[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 79b1dede34 3/3: Use equal and member instead of eq and memq
From: |
Mattias Engdegård |
Subject: |
master 79b1dede34 3/3: Use equal and member instead of eq and memq |
Date: |
Mon, 19 Dec 2022 07:19:27 -0500 (EST) |
branch: master
commit 79b1dede3444c07f943be34867bb2cdac236ab55
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>
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.
---
lisp/cedet/semantic/complete.el | 2 +-
lisp/descr-text.el | 2 +-
lisp/emulation/viper-cmd.el | 6 +++---
lisp/mh-e/mh-identity.el | 2 +-
lisp/transient.el | 4 ++--
lisp/vc/vc-git.el | 3 ++-
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 00fe081acb..1f372804dc 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.")
;; Add any tail info.
(setq msg (concat msg msg-tail))
;; Display tooltip.
- (when (not (eq msg ""))
+ (when (not (equal msg ""))
(semantic-displayer-tooltip-show msg)))))
;;; Compatibility
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index f2ffddcf70..f105f29244 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'."
;; description is added to the category name as a tooltip
(defsubst describe-char-categories (category-set)
(let ((mnemonics (category-set-mnemonics category-set)))
- (unless (eq mnemonics "")
+ (unless (equal mnemonics "")
(list (mapconcat
(lambda (x)
(let* ((c (category-docstring x))
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 26793989d0..3b3caaf3e3 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -194,9 +194,9 @@
viper-delete-backward-char
viper-join-lines
viper-delete-char))
- (memq (viper-event-key last-command-event)
- '(up down left right (meta f) (meta b)
- (control n) (control p) (control f) (control b)))))
+ (member (viper-event-key last-command-event)
+ '(up down left right (meta f) (meta b)
+ (control n) (control p) (control f) (control b)))))
(defsubst viper-insert-state-pre-command-sentinel ()
(or (viper-preserve-cursor-color)
diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el
index bcdf91299b..2507c67746 100644
--- a/lisp/mh-e/mh-identity.el
+++ b/lisp/mh-e/mh-identity.el
@@ -141,7 +141,7 @@ See `mh-identity-list'."
(cons '("None")
(mapcar #'list (mapcar #'car mh-identity-list)))
nil t default nil default))
- (if (eq identity "None")
+ (if (equal identity "None")
nil
identity)))
diff --git a/lisp/transient.el b/lisp/transient.el
index 1cab697eec..01c492c68c 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2203,7 +2203,7 @@ value. Otherwise return CHILDREN as is."
(unless abort-only
(setq post-command
(lambda () "@transient--delay-post-command"
- (let ((act (and (not (eq (this-command-keys-vector) []))
+ (let ((act (and (not (equal (this-command-keys-vector) []))
(or (eq this-command command)
;; `execute-extended-command' was
;; used to call another command
@@ -2241,7 +2241,7 @@ value. Otherwise return CHILDREN as is."
(transient--debug 'post-command)
(transient--with-emergency-exit
(cond
- ((and (eq (this-command-keys-vector) [])
+ ((and (equal (this-command-keys-vector) [])
(= (minibuffer-depth)
(1+ transient--minibuffer-depth)))
(transient--suspend-override)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 2876a983fb..9f27f759d3 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\"."
(if branchp "branch" "tag"))))
(if branchp
(vc-git-command nil 0 nil "checkout" "-b" name
- (when (and start-point (not (eq start-point "")))
+ (when (and start-point
+ (not (equal start-point "")))
start-point))
(vc-git-command nil 0 nil "tag" name)))))
diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el
b/test/lisp/emacs-lisp/cl-lib-tests.el
index 4ec24e51e0..759138569e 100644
--- a/test/lisp/emacs-lisp/cl-lib-tests.el
+++ b/test/lisp/emacs-lisp/cl-lib-tests.el
@@ -404,7 +404,7 @@
(ert-deftest cl-lib-nth-value-test-multiple-values ()
"While CL multiple values are an alias to list, these won't work."
:expected-result :failed
- (should (eq (cl-nth-value 0 '(2 3)) '(2 3)))
+ (should (equal (cl-nth-value 0 '(2 3)) '(2 3)))
(should (= (cl-nth-value 0 1) 1))
(should (null (cl-nth-value 1 1)))
(should-error (cl-nth-value -1 (cl-values 2 3)) :type 'args-out-of-range)