branch: elpa/nix-mode commit 8fe2ccf0b01f694a77d2528e06c10f06057784f6 Merge: 66206cab27 b5e5f431db Author: Matthew Bauer <mjbaue...@gmail.com> Commit: GitHub <nore...@github.com>
Merge pull request #155 from nagy/style Style updates --- nix-build.el | 1 + nix-company.el | 6 ++++-- nix-edit.el | 4 +++- nix-format.el | 2 ++ nix-instantiate.el | 4 +++- nix-log.el | 5 ++++- nix-mode-mmm.el | 3 ++- nix-mode.el | 9 ++++----- nix-prettify-mode.el | 4 +++- nix-repl.el | 9 +++++++-- nix-search.el | 3 ++- nix-shell.el | 11 +++++------ nix-store.el | 8 +++++--- nix.el | 4 ++-- 14 files changed, 47 insertions(+), 26 deletions(-) diff --git a/nix-build.el b/nix-build.el index df85a676d6..9a0c6d5e4a 100644 --- a/nix-build.el +++ b/nix-build.el @@ -13,6 +13,7 @@ (require 'nix) (require 'nix-search) +;;;###autoload (defun nix-build (&optional file attr) "Run nix-build in a compilation buffer. FILE the file to parse. diff --git a/nix-company.el b/nix-company.el index d4c2ae1d57..6280ad352d 100644 --- a/nix-company.el +++ b/nix-company.el @@ -1,8 +1,10 @@ ;;; nix-company.el --- Company support for Nix -*- lexical-binding: t -*- -;; This file is NOT part of GNU Emacs. - +;; Homepage: https://github.com/NixOS/nix-mode ;; Version: 1.4.0 +;; Package-Requires: ((emacs "24.3")) + +;; This file is NOT part of GNU Emacs. ;;; Commentary: diff --git a/nix-edit.el b/nix-edit.el index 547006deb4..f2b03ab128 100644 --- a/nix-edit.el +++ b/nix-edit.el @@ -1,8 +1,9 @@ -;;; nix-edit.el -- run nix commands in Emacs -*- lexical-binding: t -*- +;;; nix-edit.el --- Run nix commands -*- lexical-binding: t -*- ;; Author: Matthew Bauer <mjbaue...@gmail.com> ;; Homepage: https://github.com/NixOS/nix-mode ;; Keywords: nix +;; Package-Requires: ((emacs "24.3")) ;; Version: 1.4.0 ;; This file is NOT part of GNU Emacs. @@ -14,6 +15,7 @@ (require 'nix) (require 'nix-search) +;;;###autoload (defun nix-edit (&optional file attr) "Open the nix log. FILE the nix file to load from. diff --git a/nix-format.el b/nix-format.el index a31f577cbb..e661b560a4 100644 --- a/nix-format.el +++ b/nix-format.el @@ -2,6 +2,8 @@ ;; This file is NOT part of GNU Emacs. +;; Homepage: https://github.com/NixOS/nix-mode +;; Package-Requires: ((emacs "24.1")) ;; Version: 1.4.0 ;;; Commentary: diff --git a/nix-instantiate.el b/nix-instantiate.el index e7230ed0f1..b7d5b45859 100644 --- a/nix-instantiate.el +++ b/nix-instantiate.el @@ -1,10 +1,12 @@ -;;; nix-instantiate.el -- run nix commands in Emacs -*- lexical-binding: t -*- +;;; nix-instantiate.el --- Run nix commands -*- lexical-binding: t -*- ;; Author: Matthew Bauer <mjbaue...@gmail.com> ;; Homepage: https://github.com/NixOS/nix-mode +;; Package-Requires: ((emacs "25.1")) ;; Keywords: nix ;; Version: 1.4.0 + ;; This file is NOT part of GNU Emacs. ;;; Commentary: diff --git a/nix-log.el b/nix-log.el index 1df0e1d010..730cd6de3a 100644 --- a/nix-log.el +++ b/nix-log.el @@ -1,8 +1,10 @@ -;;; nix-log.el -- run nix commands in Emacs -*- lexical-binding: t -*- +;;; nix-log.el --- Run nix commands -*- lexical-binding: t -*- ;; Author: Matthew Bauer <mjbaue...@gmail.com> ;; Homepage: https://github.com/NixOS/nix-mode +;; Package-Requires: ((emacs "24.1")) ;; Keywords: nix + ;; Version: 1.4.0 ;; This file is NOT part of GNU Emacs. @@ -15,6 +17,7 @@ (require 'nix-search) (require 'nix-instantiate) +;;;###autoload (defun nix-log (file attr) "Open the nix log. FILE nix file to parse. diff --git a/nix-mode-mmm.el b/nix-mode-mmm.el index 2774b4dbbe..cdc21e2ac4 100644 --- a/nix-mode-mmm.el +++ b/nix-mode-mmm.el @@ -1,9 +1,10 @@ -;;; nix-shell.el -- support for MMM in nix-mode -*- lexical-binding: t -*- +;;; nix-mode-mmm.el --- Support for MMM in nix-mode -*- lexical-binding: t -*- ;; Author: Matthew Bauer <mjbaue...@gmail.com> ;; Homepage: https://github.com/NixOS/nix-mode ;; Keywords: nix ;; Version: 1.4.0 +;; Package-Requires: ((emacs "24.3") (mmm-mode "0.5.8")) ;; This file is NOT part of GNU Emacs. diff --git a/nix-mode.el b/nix-mode.el index 113bc6296c..73bd4af794 100644 --- a/nix-mode.el +++ b/nix-mode.el @@ -25,7 +25,7 @@ (eval-when-compile (require 'subr-x)) (defgroup nix-mode nil - "Nix mode customizations" + "Nix mode customizations." :group 'nix) (defcustom nix-indent-function 'smie-indent-line @@ -531,7 +531,7 @@ STRING-TYPE type of string based off of Emacs syntax table types" (defconst nix-smie--path-chars "a-zA-Z0-9-+_.:/~") (defun nix-smie--skip-angle-path-forward () - "Skip forward a path enclosed in angle brackets, e.g <nixpkgs>" + "Skip forward a path enclosed in angle brackets, e.g <nixpkgs>." (let ((start (point))) (when (eq (char-after) ?<) (forward-char) @@ -543,7 +543,7 @@ STRING-TYPE type of string based off of Emacs syntax table types" (ignore (goto-char start)))))) (defun nix-smie--skip-angle-path-backward () - "Skip backward a path enclosed in angle brackets, e.g <nixpkgs>" + "Skip backward a path enclosed in angle brackets, e.g <nixpkgs>." (let ((start (point))) (when (eq (char-before) ?>) (backward-char) @@ -958,8 +958,7 @@ The following commands may be useful: The hook `nix-mode-hook' is run when Nix mode is started. -\\{nix-mode-map} -" +\\{nix-mode-map}" :group 'nix-mode :syntax-table nix-mode-syntax-table :abbrev-table nix-mode-abbrev-table diff --git a/nix-prettify-mode.el b/nix-prettify-mode.el index 57ff556341..5aa50af2df 100644 --- a/nix-prettify-mode.el +++ b/nix-prettify-mode.el @@ -1,4 +1,4 @@ -;;; nix-prettify.el -- Prettify Nix store file names -*- lexical-binding: t -*- +;;; nix-prettify-mode.el --- Prettify Nix store file names -*- lexical-binding: t -*- ;; Copyright © 2014, 2015 Alex Kost <alez...@gmail.com> ;; Modified by Matthew Bauer for use in nix-mode @@ -8,6 +8,8 @@ ;; Homepage: https://github.com/NixOS/nix-mode ;; Version: 1.1 ;; Keywords: nix +;; Package-Requires: ((emacs "24.3")) + ;; This file is NOT part of GNU Emacs. diff --git a/nix-repl.el b/nix-repl.el index d1fb5026d0..b4fea6da48 100644 --- a/nix-repl.el +++ b/nix-repl.el @@ -2,7 +2,11 @@ ;; This file is NOT part of GNU Emacs. +;; Homepage: https://github.com/NixOS/nix-mode ;; Version: 1.4.5 +;; Package-Requires: ((emacs "24.4")) + +;; This file is NOT part of GNU Emacs. ;;; Commentary: @@ -14,12 +18,12 @@ (require 'nix) (defgroup nix-repl nil - "nix-repl customizations" + "Nix-repl customizations." :group 'nix) (defcustom nix-repl-executable-args '("repl") "Arguments to provide to nix-repl." - :type 'list) + :type '(repeat string)) (defvar nix-repl-completion-redirect-buffer " *nix-repl completions redirect*" @@ -43,6 +47,7 @@ (define-derived-mode nix-repl-mode comint-mode "Nix-REPL" "Interactive prompt for Nix." + :interactive nil (setq-local comint-prompt-regexp nix-prompt-regexp) (setq-local comint-prompt-read-only t) (let* ((is-remote (file-remote-p default-directory)) diff --git a/nix-search.el b/nix-search.el index 3b95e4ff9a..a14c164131 100644 --- a/nix-search.el +++ b/nix-search.el @@ -1,9 +1,10 @@ -;;; nix-search.el -- run nix commands in Emacs -*- lexical-binding: t -*- +;;; nix-search.el --- Run nix commands -*- lexical-binding: t -*- ;; Author: Matthew Bauer <mjbaue...@gmail.com> ;; Homepage: https://github.com/NixOS/nix-mode ;; Keywords: nix ;; Version: 1.4.0 +;; Package-Requires: ((emacs "25.1")) ;; This file is NOT part of GNU Emacs. diff --git a/nix-shell.el b/nix-shell.el index dcab7e5df4..006a9cdd37 100644 --- a/nix-shell.el +++ b/nix-shell.el @@ -1,9 +1,10 @@ -;;; nix-shell.el -- run nix commands in Emacs -*- lexical-binding: t -*- +;;; nix-shell.el --- Run nix commands -*- lexical-binding: t -*- ;; Author: Matthew Bauer <mjbaue...@gmail.com> ;; Homepage: https://github.com/NixOS/nix-mode -;; Keywords: nix +;; Keywords: nix, processes ;; Version: 1.4.0 +;; Package-Requires: ((emacs "25.1")) ;; This file is NOT part of GNU Emacs. @@ -201,8 +202,7 @@ The DRV file to use." (format "-I%s" include))))) (when (bound-and-true-p flycheck-mode) - (flycheck-buffer)) - ))) + (flycheck-buffer))))) (defun nix-shell-with-packages (packages &optional pkgs-file) "Create a nix shell environment from the listed package. @@ -210,8 +210,7 @@ PACKAGES a list of packages to use. PKGS-FILE the Nix file to get the packages from." (nix-instantiate-async (apply-partially 'nix-shell--callback (current-buffer)) - (nix-shell--with-packages-file packages pkgs-file) - )) + (nix-shell--with-packages-file packages pkgs-file))) (defun nix-shell--with-packages-file (packages &optional pkgs-file) "Get a .nix file from the packages list. diff --git a/nix-store.el b/nix-store.el index 3e772d799e..a05f1d34ec 100644 --- a/nix-store.el +++ b/nix-store.el @@ -1,8 +1,9 @@ -;;; nix-store.el -- run nix commands in Emacs -*- lexical-binding: t -*- +;;; nix-store.el --- Run nix commands -*- lexical-binding: t -*- ;; Author: Matthew Bauer <mjbaue...@gmail.com> ;; Homepage: https://github.com/NixOS/nix-mode ;; Keywords: nix +;; Package-Requires: ((emacs "25.1") (magit-section "3.3.0")) ;; Version: 1.4.0 ;; This file is NOT part of GNU Emacs. @@ -14,7 +15,8 @@ (require 'eieio) (require 'nix) (require 'magit-section) -(require 'cl-lib) +(eval-when-compile + (require 'cl-lib)) (defgroup nix-store nil "Nix-store customizations." @@ -45,7 +47,7 @@ PATH the path within /nix/store to realise" is displayed") (cl-defmethod nix-store-fill-data ((object nix-store-path)) - "Query the nix store store via `nix-store-executable' and save that data into OBJECT." + "Query the nix store via `nix-store-executable' and save that data into OBJECT." (oset object :size (nix-store--query 'size (nix-store-path-path object))) (oset object :hash (nix-store--query 'hash (nix-store-path-path object))) (oset object :derivers (nix-store--query 'deriver (nix-store-path-path object))) diff --git a/nix.el b/nix.el index 73733d3f3f..90c0b45faa 100644 --- a/nix.el +++ b/nix.el @@ -22,7 +22,7 @@ (require 'let-alist)) (defgroup nix nil - "Nix-related customizations" + "Nix-related customizations." :group 'languages) (defcustom nix-executable "nix" @@ -70,7 +70,7 @@ (defvar nix-version nil) (defun nix-version () - "Get the version of Nix" + "Get the version of Nix." (or nix-version (nix--process-string "--version"))) (defun nix-show-config ()