[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode af35742d55 198/500: Merge pull request #39 from p
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode af35742d55 198/500: Merge pull request #39 from purcell/master |
Date: |
Sat, 29 Jan 2022 08:27:06 -0500 (EST) |
branch: elpa/nix-mode
commit af35742d5574b0d5486e0753038bdddf2a0c9d14
Merge: 14322f186f 0fde15d938
Author: Matthew Justin Bauer <mjbauer95@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #39 from purcell/master
Misc fixes
---
nix-company.el | 9 +++++----
nix-mode.el | 4 ++--
nix-prettify-mode.el | 4 ++--
nix-repl.el | 47 ++++++++++++++++++++++++-----------------------
nix-shell.el | 3 ++-
5 files changed, 35 insertions(+), 32 deletions(-)
diff --git a/nix-company.el b/nix-company.el
index 19ca5cb617..9cc0648cf1 100644
--- a/nix-company.el
+++ b/nix-company.el
@@ -10,6 +10,7 @@
(require 'cl-lib)
(require 'company)
+;;;###autoload
(defun company-nix (command &optional arg &rest _)
"Company backend for Nix.
@@ -18,7 +19,7 @@ ARG company argument"
(interactive '(interactive))
(cl-case command
(interactive (company-begin-backend 'company-nix))
- (prefix (and (member major-mode '(nix-mode nix-repl-mode))
+ (prefix (and (derived-mode-p 'nix-mode 'nix-repl-mode)
(nix-grab-attr-path)))
(candidates
(nix-get-completions (get-buffer-process (nix--get-company-buffer)) arg))
@@ -29,9 +30,9 @@ ARG company argument"
(if (looking-at "[^a-zA-Z0-9'\\-_\\.]")
(buffer-substring (point) (save-excursion (skip-chars-backward
"a-zA-Z0-9'\\-_\\.")
(point)))
- (unless (and (char-after)
- (string-match "[a-zA-Z0-9'\\-_]" (char-to-string
(char-after)))
- ""))))
+ (and (char-after)
+ (string-match "[a-zA-Z0-9'\\-_]" (char-to-string (char-after)))
+ "")))
(defun nix--get-company-buffer (&optional buffer)
"Get the Nix repl buffer for company.
diff --git a/nix-mode.el b/nix-mode.el
index c3463b72b4..38a33d46c2 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -15,8 +15,8 @@
;;; Code:
-(require 'nix-format nil 'noerror)
-(require 'nix-shebang nil 'noerror)
+(require 'nix-format)
+(require 'nix-shebang)
(defgroup nix nil
"Nix-related customizations"
diff --git a/nix-prettify-mode.el b/nix-prettify-mode.el
index 0ae8f28099..5d78615b46 100644
--- a/nix-prettify-mode.el
+++ b/nix-prettify-mode.el
@@ -191,11 +191,11 @@ See `nix-prettify-special-modes' for details."
(nix-prettify-mode)))
;;;###autoload
-(define-globalized-minor-mode global-nix-prettify-mode
+(define-globalized-minor-mode nix-prettify-global-mode
nix-prettify-mode nix-prettify-turn-on)
;;;###autoload
-(defalias 'nix-prettify-global-mode 'global-nix-prettify-mode)
+(define-obsolete-function-alias 'global-nix-prettify-mode
'nix-prettify-global-mode)
(provide 'nix-prettify-mode)
diff --git a/nix-repl.el b/nix-repl.el
index 32a04101b4..ed2db6974e 100644
--- a/nix-repl.el
+++ b/nix-repl.el
@@ -15,7 +15,8 @@
:group 'nix)
(defcustom nix-repl-executable "nix-repl"
- "Location of nix-repl command.")
+ "Location of nix-repl command."
+ :type 'string)
(define-derived-mode nix-repl-mode comint-mode "Nix-REPL"
"Interactive prompt for Nix."
@@ -54,27 +55,27 @@
(nix--with-temp-process-filter proc
(goto-char (point-min))
(process-send-string proc (concat prefix
"\t\"" (nix--char-with-ctrl ?a) "\"\n"))
- (setq i 0)
- (while (and (< (setq i (1+ i)) 100)
- (not (search-forward-regexp
"\"\\([^\"]*\\)\"[\n]*nix-repl>" nil t)))
- (sleep-for 0.01))
- (let ((new-prefix (match-string 1))
- (start-compl (point)))
- (if (string-suffix-p " " new-prefix)
- (list (substring new-prefix 0 -1))
- (process-send-string proc (concat
new-prefix "\t\t" (nix--char-with-ctrl ?u) "\n"))
- (goto-char start-compl)
- (setq i 0)
- (while (and (< (setq i (1+ i)) 100)
- (not (search-forward-regexp
-
"[\n]+nix-repl>\\|Display all \\([0-9]+\\)" nil t)))
- (sleep-for 0.01))
- (if (match-string 1)
- (progn
- (process-send-string proc "n")
- '())
- (search-backward "\n" nil t)
- (split-string (buffer-substring
start-compl (1- (point))))))))))
+ (let ((i 0))
+ (while (and (< (setq i (1+ i)) 100)
+ (not (search-forward-regexp
"\"\\([^\"]*\\)\"[\n]*nix-repl>" nil t)))
+ (sleep-for 0.01))
+ (let ((new-prefix (match-string 1))
+ (start-compl (point)))
+ (if (string-suffix-p " " new-prefix)
+ (list (substring new-prefix 0 -1))
+ (process-send-string proc (concat
new-prefix "\t\t" (nix--char-with-ctrl ?u) "\n"))
+ (goto-char start-compl)
+ (setq i 0)
+ (while (and (< (setq i (1+ i)) 100)
+ (not
(search-forward-regexp
+
"[\n]+nix-repl>\\|Display all \\([0-9]+\\)" nil t)))
+ (sleep-for 0.01))
+ (if (match-string 1)
+ (progn
+ (process-send-string proc "n")
+ '())
+ (search-backward "\n" nil t)
+ (split-string (buffer-substring
start-compl (1- (point)))))))))))
(defun nix--send-repl (input &optional process mute)
"Send INPUT to PROCESS.
@@ -92,7 +93,7 @@ MUTE if true then don’t alert user."
(defun nix--process-filter (buf marker)
"Process filter for Nix-rel buffer BUF at MARKER."
- (lambda (proc string)
+ (lambda (_proc string)
(when (buffer-live-p buf)
(with-current-buffer buf
(save-excursion
diff --git a/nix-shell.el b/nix-shell.el
index 713b223fec..0177e6a07a 100644
--- a/nix-shell.el
+++ b/nix-shell.el
@@ -25,7 +25,8 @@
(defcustom nix-shell-executable "nix-shell"
"Location of nix-shell executable."
- :group 'nix-shell)
+ :group 'nix-shell
+ :type 'string)
;;;###autoload
(defun nix-shell (path attribute)
- [nongnu] elpa/nix-mode 3e6fdd8311 112/500: Add back syntax coloring of antiquotes., (continued)
- [nongnu] elpa/nix-mode 3e6fdd8311 112/500: Add back syntax coloring of antiquotes., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 66cc5478de 113/500: Merge branch 'master' into separate-files, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0fd152e118 119/500: Merge pull request #22 from ljli/various, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 04a268a6fe 126/500: Remove "let" handling of indent., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1a4c98fcf7 118/500: Cosmetics, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 23bdbdf21f 124/500: Add custom mmm-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e413069e02 130/500: Fixup some corner cases in indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2def0ccd6a 191/500: Add autoload for company-nix command, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 895f9d14e5 193/500: Flatten "unless" form with no body, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 4a5b6d5d2c 177/500: Add travis and Makefile, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode af35742d55 198/500: Merge pull request #39 from purcell/master,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 1b3424ade0 190/500: Don't ignore errors when loading nix-format / nix-shebang, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 93a59d9acb 179/500: Use cl-lib instead of cl., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7c732faf3a 183/500: Handle smartparens in nix-mode., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7716e6d1e4 208/500: fix (cond) usage, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 236318101e 217/500: Cleanup global-nix-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 857d963d1e 219/500: Add nix-system function, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 58325164ca 232/500: Update README.md, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 36070654c8 243/500: Don’t autoload nix-instantiate., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d2f4a629a8 258/500: Only show derivations in nix store, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d0eb92e97a 263/500: Package linting, ELPA Syncer, 2022/01/29