emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix some emacs-30 byte-compile warnings
Date: Mon, 23 Jan 2023 14:57:50 +0100	[thread overview]
Message-ID: <87pmb51hgh.fsf@gmail.com> (raw)


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


             reply	other threads:[~2023-01-23 13:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 13:57 Robert Pluim [this message]
2023-01-23 14:04 ` [PATCH] Fix some emacs-30 byte-compile warnings 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmb51hgh.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).