Emacs: Difference between revisions
mNo edit summary |
Warn about double-listing emacs-pgtk. |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{application infobox | ||
| | |name=GNU Emacs | ||
|image=EmacsIcon.svg | |image=EmacsIcon.svg | ||
| | |type=Text Editor | ||
|firstRelease=1985; 40 years ago | |||
|license=[https://www.gnu.org/licenses/gpl.html GNU General Public License] | |||
|os=Cross-platform | |||
|website=[https://www.gnu.org/software/emacs gnu.org/emacs] | |||
|github= | |||
}} | }} | ||
<strong>Emacs</strong> is a free and open-source text editor known for its exceptional extensibility and adaptability. It can be customized into anything from a simple editor to a full development environment or productivity tool. Emacs features built-in self-documentation, syntax-aware editing, and a vast ecosystem of community-developed packages.<ref>https://www.gnu.org/software/emacs/</ref> | <strong>Emacs</strong> is a free and open-source text editor known for its exceptional extensibility and adaptability. It can be customized into anything from a simple editor to a full development environment or productivity tool. Emacs features built-in self-documentation, syntax-aware editing, and a vast ecosystem of community-developed packages.<ref>https://www.gnu.org/software/emacs/</ref> | ||
Line 81: | Line 78: | ||
==== Installing Packages ==== | ==== Installing Packages ==== | ||
{{Note|Emacs, much like NixOS can rebuild and re-fetch all of its packages based on its initialization file alone, if one chooses to use an extension called "use-package". Such a configuration file can be version controlled and used in all compatible operating systems.}} | {{Note|Emacs, much like NixOS can rebuild and re-fetch all of its packages based on its initialization file alone, if one chooses to use an extension called "use-package". Such a configuration file can be version controlled and used in all compatible operating systems.}} | ||
One can mix and match whether Emacs packages are installed by Nix or Emacs. This can be particularly useful for Emacs packages that need to be built, such as vterm. One way to install Emacs packages through Nix is by the following, replacing {{ic| | One can mix and match whether Emacs packages are installed by Nix or Emacs. This can be particularly useful for Emacs packages that need to be built, such as vterm. One way to install Emacs packages through Nix is by the following, replacing {{ic|emacs-pgtk}} with the variant in use:<syntaxhighlight lang="nix"> | ||
environment.systemPackages = with pkgs; | environment.systemPackages = with pkgs; | ||
[ ... | [ ... | ||
((emacsPackagesFor | ((emacsPackagesFor emacs-pgtk).emacsWithPackages ( | ||
epkgs: [ epkgs.vterm ] | epkgs: [ epkgs.vterm ] | ||
)) | )) | ||
Line 92: | Line 89: | ||
# To make the packages available to emacsclient, one can do the following: | # To make the packages available to emacsclient, one can do the following: | ||
services.emacs.package = with pkgs; ( | services.emacs.package = with pkgs; ( | ||
(emacsPackagesFor | (emacsPackagesFor emacs-pgtk).emacsWithPackages ( | ||
epkgs: [ epkgs.vterm ] | epkgs: [ epkgs.vterm ] | ||
) | ) | ||
Line 106: | Line 103: | ||
</syntaxhighlight> | </syntaxhighlight>Note that if the expression <code>(emacsPackagesFor emacs-pgtk)</code> is present, <code>emacs-pgtk</code> need not be listed separately in the list <code>environment.systemPackages</code>. Indeed, if one does that, <code>nixos-rebuild</code> will warn about link collisions when the configuration is rebuilt. | ||
==== Tree-sitter ==== | ==== Tree-sitter ==== | ||
Line 208: | Line 205: | ||
environment.systemPackages = with pkgs; | environment.systemPackages = with pkgs; | ||
[ ... | [ ... | ||
((emacsPackagesFor | ((emacsPackagesFor emacs-pgtk).emacsWithPackages (epkgs: [ | ||
epkgs.vterm | epkgs.vterm | ||
(callPackage ./lambda-line.nix { | (callPackage ./lambda-line.nix { |