diff options
| author | Mattias EngdegÄrd | 2022-12-16 12:17:33 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2022-12-16 19:18:34 +0100 |
| commit | 6a390fd42ec4ef97d637899fc93f34ea65639e3c (patch) | |
| tree | ab337c58990d9b187a64751309b761488266bbe5 | |
| parent | 6283b9233459d74f95e9b0300f025a49f9674fb9 (diff) | |
| download | emacs-6a390fd42ec4ef97d637899fc93f34ea65639e3c.tar.gz emacs-6a390fd42ec4ef97d637899fc93f34ea65639e3c.zip | |
Use equal and member instead of eq and memq
* lisp/cedet/semantic/complete.el (semantic-displayer-show-request):
* lisp/descr-text.el (describe-char-categories):
* lisp/mh-e/mh-identity.el (mh-select-identity):
* lisp/transient.el (transient--delay-post-command)
(transient--post-command):
* lisp/vc/vc-git.el (vc-git-create-tag):
* test/lisp/emacs-lisp/cl-lib-tests.el
(cl-lib-nth-value-test-multiple-values):
* lisp/emulation/viper-cmd.el (viper-preserve-cursor-color):
Use `equal` instead of `eq` and `member` instead of `memq` where
the comparison is with literals without guaranteed identity.
In some cases this change corrects evident bugs, in others it is
mostly cosmetic.
| -rw-r--r-- | lisp/cedet/semantic/complete.el | 2 | ||||
| -rw-r--r-- | lisp/descr-text.el | 2 | ||||
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 6 | ||||
| -rw-r--r-- | lisp/mh-e/mh-identity.el | 2 | ||||
| -rw-r--r-- | lisp/transient.el | 4 | ||||
| -rw-r--r-- | lisp/vc/vc-git.el | 3 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/cl-lib-tests.el | 2 |
7 files changed, 11 insertions, 10 deletions
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index 00fe081acb5..1f372804dcc 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el | |||
| @@ -1731,7 +1731,7 @@ Display mechanism using tooltip for a list of possible completions.") | |||
| 1731 | ;; Add any tail info. | 1731 | ;; Add any tail info. |
| 1732 | (setq msg (concat msg msg-tail)) | 1732 | (setq msg (concat msg msg-tail)) |
| 1733 | ;; Display tooltip. | 1733 | ;; Display tooltip. |
| 1734 | (when (not (eq msg "")) | 1734 | (when (not (equal msg "")) |
| 1735 | (semantic-displayer-tooltip-show msg))))) | 1735 | (semantic-displayer-tooltip-show msg))))) |
| 1736 | 1736 | ||
| 1737 | ;;; Compatibility | 1737 | ;;; Compatibility |
diff --git a/lisp/descr-text.el b/lisp/descr-text.el index f2ffddcf702..f105f292448 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el | |||
| @@ -366,7 +366,7 @@ This function is semi-obsolete. Use `get-char-code-property'." | |||
| 366 | ;; description is added to the category name as a tooltip | 366 | ;; description is added to the category name as a tooltip |
| 367 | (defsubst describe-char-categories (category-set) | 367 | (defsubst describe-char-categories (category-set) |
| 368 | (let ((mnemonics (category-set-mnemonics category-set))) | 368 | (let ((mnemonics (category-set-mnemonics category-set))) |
| 369 | (unless (eq mnemonics "") | 369 | (unless (equal mnemonics "") |
| 370 | (list (mapconcat | 370 | (list (mapconcat |
| 371 | (lambda (x) | 371 | (lambda (x) |
| 372 | (let* ((c (category-docstring x)) | 372 | (let* ((c (category-docstring x)) |
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 26793989d05..3b3caaf3e3c 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -194,9 +194,9 @@ | |||
| 194 | viper-delete-backward-char | 194 | viper-delete-backward-char |
| 195 | viper-join-lines | 195 | viper-join-lines |
| 196 | viper-delete-char)) | 196 | viper-delete-char)) |
| 197 | (memq (viper-event-key last-command-event) | 197 | (member (viper-event-key last-command-event) |
| 198 | '(up down left right (meta f) (meta b) | 198 | '(up down left right (meta f) (meta b) |
| 199 | (control n) (control p) (control f) (control b))))) | 199 | (control n) (control p) (control f) (control b))))) |
| 200 | 200 | ||
| 201 | (defsubst viper-insert-state-pre-command-sentinel () | 201 | (defsubst viper-insert-state-pre-command-sentinel () |
| 202 | (or (viper-preserve-cursor-color) | 202 | (or (viper-preserve-cursor-color) |
diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el index bcdf91299be..2507c677462 100644 --- a/lisp/mh-e/mh-identity.el +++ b/lisp/mh-e/mh-identity.el | |||
| @@ -141,7 +141,7 @@ See `mh-identity-list'." | |||
| 141 | (cons '("None") | 141 | (cons '("None") |
| 142 | (mapcar #'list (mapcar #'car mh-identity-list))) | 142 | (mapcar #'list (mapcar #'car mh-identity-list))) |
| 143 | nil t default nil default)) | 143 | nil t default nil default)) |
| 144 | (if (eq identity "None") | 144 | (if (equal identity "None") |
| 145 | nil | 145 | nil |
| 146 | identity))) | 146 | identity))) |
| 147 | 147 | ||
diff --git a/lisp/transient.el b/lisp/transient.el index 1cab697eecb..01c492c68c1 100644 --- a/lisp/transient.el +++ b/lisp/transient.el | |||
| @@ -2203,7 +2203,7 @@ value. Otherwise return CHILDREN as is." | |||
| 2203 | (unless abort-only | 2203 | (unless abort-only |
| 2204 | (setq post-command | 2204 | (setq post-command |
| 2205 | (lambda () "@transient--delay-post-command" | 2205 | (lambda () "@transient--delay-post-command" |
| 2206 | (let ((act (and (not (eq (this-command-keys-vector) [])) | 2206 | (let ((act (and (not (equal (this-command-keys-vector) [])) |
| 2207 | (or (eq this-command command) | 2207 | (or (eq this-command command) |
| 2208 | ;; `execute-extended-command' was | 2208 | ;; `execute-extended-command' was |
| 2209 | ;; used to call another command | 2209 | ;; used to call another command |
| @@ -2241,7 +2241,7 @@ value. Otherwise return CHILDREN as is." | |||
| 2241 | (transient--debug 'post-command) | 2241 | (transient--debug 'post-command) |
| 2242 | (transient--with-emergency-exit | 2242 | (transient--with-emergency-exit |
| 2243 | (cond | 2243 | (cond |
| 2244 | ((and (eq (this-command-keys-vector) []) | 2244 | ((and (equal (this-command-keys-vector) []) |
| 2245 | (= (minibuffer-depth) | 2245 | (= (minibuffer-depth) |
| 2246 | (1+ transient--minibuffer-depth))) | 2246 | (1+ transient--minibuffer-depth))) |
| 2247 | (transient--suspend-override) | 2247 | (transient--suspend-override) |
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 2876a983fb0..9f27f759d35 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -1674,7 +1674,8 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." | |||
| 1674 | (if branchp "branch" "tag")))) | 1674 | (if branchp "branch" "tag")))) |
| 1675 | (if branchp | 1675 | (if branchp |
| 1676 | (vc-git-command nil 0 nil "checkout" "-b" name | 1676 | (vc-git-command nil 0 nil "checkout" "-b" name |
| 1677 | (when (and start-point (not (eq start-point ""))) | 1677 | (when (and start-point |
| 1678 | (not (equal start-point ""))) | ||
| 1678 | start-point)) | 1679 | start-point)) |
| 1679 | (vc-git-command nil 0 nil "tag" name))))) | 1680 | (vc-git-command nil 0 nil "tag" name))))) |
| 1680 | 1681 | ||
diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index b19494af746..c3c04b6305e 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el | |||
| @@ -404,7 +404,7 @@ | |||
| 404 | (ert-deftest cl-lib-nth-value-test-multiple-values () | 404 | (ert-deftest cl-lib-nth-value-test-multiple-values () |
| 405 | "While CL multiple values are an alias to list, these won't work." | 405 | "While CL multiple values are an alias to list, these won't work." |
| 406 | :expected-result :failed | 406 | :expected-result :failed |
| 407 | (should (eq (cl-nth-value 0 '(2 3)) '(2 3))) | 407 | (should (equal (cl-nth-value 0 '(2 3)) '(2 3))) |
| 408 | (should (= (cl-nth-value 0 1) 1)) | 408 | (should (= (cl-nth-value 0 1) 1)) |
| 409 | (should (null (cl-nth-value 1 1))) | 409 | (should (null (cl-nth-value 1 1))) |
| 410 | (should-error (cl-nth-value -1 (cl-values 2 3)) :type 'args-out-of-range) | 410 | (should-error (cl-nth-value -1 (cl-values 2 3)) :type 'args-out-of-range) |