about summary refs log tree commit diff
path: root/misc/emacs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-09-27T19·43-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-09-27T19·49-0400
commit95c74eae269b2b9e4bc514581b5caa1d80b54acc (patch)
treef8f36185fa71202a79ed320e2a413433f957ff63 /misc/emacs
parentf46612be96a70a188cd48462ac94089d3e95a36b (diff)
Allow dashes in identifiers
In Nixpkgs, the attribute in all-packages.nix corresponding to a
package is usually equal to the package name.  However, this doesn't
work if the package contains a dash, which is fairly common.  The
convention is to replace the dash with an underscore (e.g. "dbus-lib"
becomes "dbus_glib"), but that's annoying.  So now dashes are valid in
variable / attribute names, allowing you to write:

  dbus-glib = callPackage ../development/libraries/dbus-glib { };

and

  buildInputs = [ dbus-glib ];

Since we don't have a negation or subtraction operation in Nix, this
is unambiguous.
Diffstat (limited to 'misc/emacs')
-rw-r--r--misc/emacs/nix-mode.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/emacs/nix-mode.el b/misc/emacs/nix-mode.el
index 121a9172b633..986edcf6e321 100644
--- a/misc/emacs/nix-mode.el
+++ b/misc/emacs/nix-mode.el
@@ -78,7 +78,7 @@ The hook `nix-mode-hook' is run when Nix mode is started.
     ("\\<isNull\\>" . font-lock-builtin-face)
     ("[a-zA-Z][a-zA-Z0-9\\+-\\.]*:[a-zA-Z0-9%/\\?:@&=\\+\\$,_\\.!~\\*'-]+"
      . font-lock-constant-face)
-    ("\\<\\([a-zA-Z_][a-zA-Z0-9_'\.]*\\)[ \t]*="
+    ("\\<\\([a-zA-Z_][a-zA-Z0-9_'\-\.]*\\)[ \t]*="
      (1 font-lock-variable-name-face nil nil))
     ("<[a-zA-Z0-9._\\+-]+\\(/[a-zA-Z0-9._\\+-]+\\)*>"
      . font-lock-constant-face)