[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix some emacs-30 byte-compile warnings
From: |
Robert Pluim |
Subject: |
[PATCH] Fix some emacs-30 byte-compile warnings |
Date: |
Mon, 23 Jan 2023 14:57:50 +0100 |
The emacs 30 byte-compiler warns about uses of `eq'
and similar with constant strings which might have unintended
semantics. Patch is against emacs master.
-- >8 --
* lisp/org/ob-octave.el (org-babel-octave-evaluate-session): Use
`delete' instead of `delq' when deleting a constant string.
* lisp/org/org-agenda.el (org-agenda-format-item): Use `string=' when
comparing to a constant string.
* lisp/org/org-element.el (org-element-cache-map): Use `equal' when
comparing to a constant list.
* lisp/org/org-table.el (org-table-make-reference): Use `string=' when
comparing to a constant string.
---
diff --git c/lisp/org/ob-octave.el i/lisp/org/ob-octave.el
index 9bf16b9849..e411961e92 100644
--- c/lisp/org/ob-octave.el
+++ i/lisp/org/ob-octave.el
@@ -243,7 +243,7 @@ org-babel-octave-evaluate-session
(`output
(setq results
(if matlabp
- (cdr (reverse (delq "" (mapcar #'org-strip-quotes
+ (cdr (reverse (delete "" (mapcar #'org-strip-quotes
(mapcar #'org-trim raw)))))
(cdr (member org-babel-octave-eoe-output
(reverse (mapcar #'org-strip-quotes
diff --git c/lisp/org/org-agenda.el i/lisp/org/org-agenda.el
index 2d194ad341..b0587d5d92 100644
--- c/lisp/org/org-agenda.el
+++ i/lisp/org/org-agenda.el
@@ -7326,7 +7326,7 @@ org-agenda-format-item
(let ((s (org-format-outline-path
(org-get-outline-path)
(1-
(frame-width))
nil
org-agenda-breadcrumbs-separator)))
- (if (eq "" s) "" (concat s
org-agenda-breadcrumbs-separator))))))
+ (if (string= "" s) "" (concat s
org-agenda-breadcrumbs-separator))))))
(setq time (cond (s2 (concat
(org-agenda-time-of-day-to-ampm-maybe s1)
"-" (org-agenda-time-of-day-to-ampm-maybe s2)
diff --git c/lisp/org/org-element.el i/lisp/org/org-element.el
index 389acf8250..e427966f57 100644
--- c/lisp/org/org-element.el
+++ i/lisp/org/org-element.el
@@ -7558,7 +7558,7 @@ org-element-cache-map
;; beginning.
(next-element-re (pcase granularity
((or `headline
- (guard (eq '(headline)
+ (guard (equal '(headline)
restrict-elements)))
(cons
(org-with-limited-levels
@@ -7566,7 +7566,7 @@ org-element-cache-map
'match-beg))
(`headline+inlinetask
(cons
- (if (eq '(inlinetask) restrict-elements)
+ (if (equal '(inlinetask)
restrict-elements)
(org-inlinetask-outline-regexp)
org-element-headline-re)
'match-beg))
diff --git c/lisp/org/org-table.el i/lisp/org/org-table.el
index 5116b1127f..fbfdc253f9 100644
--- c/lisp/org/org-table.el
+++ i/lisp/org/org-table.el
@@ -2861,7 +2861,7 @@ org-table-make-reference
(if lispp
(if (eq lispp 'literal)
elements
- (if (and (eq elements "") (not keep-empty))
+ (if (and (string= elements "") (not keep-empty))
""
(prin1-to-string
(if numbers (string-to-number elements) elements))))
Robert
--
- [PATCH] Fix some emacs-30 byte-compile warnings,
Robert Pluim <=