emacs: Remove notmuch-setq-local

Just use setq-local, which existed since Emacs 24.3.
This commit is contained in:
Jonas Bernoulli 2020-08-08 13:50:04 +02:00 committed by David Bremner
parent 9946380e47
commit 2156517d90
3 changed files with 3 additions and 11 deletions

View file

@ -172,11 +172,11 @@ toggles the setting in this buffer."
(interactive) (interactive)
(if (local-variable-p 'notmuch-address-command) (if (local-variable-p 'notmuch-address-command)
(kill-local-variable 'notmuch-address-command) (kill-local-variable 'notmuch-address-command)
(notmuch-setq-local notmuch-address-command 'internal)) (setq-local notmuch-address-command 'internal))
(when (boundp 'company-idle-delay) (when (boundp 'company-idle-delay)
(if (local-variable-p 'company-idle-delay) (if (local-variable-p 'company-idle-delay)
(kill-local-variable 'company-idle-delay) (kill-local-variable 'company-idle-delay)
(notmuch-setq-local company-idle-delay nil)))) (setq-local company-idle-delay nil))))
(defun notmuch-address-matching (substring) (defun notmuch-address-matching (substring)
"Returns a list of completion candidates matching SUBSTRING. "Returns a list of completion candidates matching SUBSTRING.

View file

@ -62,7 +62,7 @@
;; internal completion) can still be accessed via standard company ;; internal completion) can still be accessed via standard company
;; functions, e.g., company-complete. ;; functions, e.g., company-complete.
(unless (eq notmuch-address-command 'internal) (unless (eq notmuch-address-command 'internal)
(notmuch-setq-local company-idle-delay nil))) (setq-local company-idle-delay nil)))
;;;###autoload ;;;###autoload
(defun notmuch-company (command &optional arg &rest _ignore) (defun notmuch-company (command &optional arg &rest _ignore)

View file

@ -40,14 +40,6 @@
(unless (fboundp 'message--fold-long-headers) (unless (fboundp 'message--fold-long-headers)
(add-hook 'message-header-hook 'notmuch-message--fold-long-headers)) (add-hook 'message-header-hook 'notmuch-message--fold-long-headers))
(if (fboundp 'setq-local)
(defalias 'notmuch-setq-local 'setq-local)
(defmacro notmuch-setq-local (var val)
"Set variable VAR to value VAL in current buffer.
Backport of setq-local for emacs without setq-local (pre 24.3)."
`(set (make-local-variable ',var) ,val)))
(if (fboundp 'read-char-choice) (if (fboundp 'read-char-choice)
(defalias 'notmuch-read-char-choice 'read-char-choice) (defalias 'notmuch-read-char-choice 'read-char-choice)
(defun notmuch-read-char-choice (prompt chars &optional inhibit-keyboard-quit) (defun notmuch-read-char-choice (prompt chars &optional inhibit-keyboard-quit)