all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Fix some emacs-30 byte-compile warnings
@ 2023-01-23 13:57 Robert Pluim
  2023-01-23 14:04 ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Pluim @ 2023-01-23 13:57 UTC (permalink / raw)
  To: emacs-orgmode


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
-- 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-12 17:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-23 13:57 [PATCH] Fix some emacs-30 byte-compile warnings Robert Pluim
2023-01-23 14:04 ` Ihor Radchenko
2023-01-23 17:28   ` Robert Pluim
2023-02-17 14:08     ` Ihor Radchenko
2023-02-17 15:33       ` Robert Pluim
2024-05-12 17:42       ` Ihor Radchenko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.