0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-16 15:46:27 +00:00

Fix Emacs 27 false-positive warnings

* lisp/org-element-ast.el (org-element--plist-property): Shield
annoying warning spam with `with-no-warnings'.  The warnings are not
present in newer Emacs.
* lisp/org-element.el (org-element--interpret-affiliated-keywords):
Suppress warning about two token unused `_' arguments.
* lisp/org-id.el (org-id-find-id-in-file): Suppress warning about
number of arguments.
This commit is contained in:
Ihor Radchenko 2023-08-18 11:08:56 +03:00
parent 9e40208547
commit 933d282881
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B
3 changed files with 11 additions and 5 deletions

View file

@ -393,12 +393,18 @@ Ignore standard property array."
(`plain-text
(or (get-text-property 0 ,property ,node)
(when ,dflt
(if (plist-member (text-properties-at 0 ,node) ,property)
(if
;; FIXME: Byte-compiler throws false positives in Emacs 27.
(with-no-warnings
(plist-member (text-properties-at 0 ,node) ,property))
nil ,dflt))))
(_
(or (plist-get (nth 1 ,node) ,property)
(when ,dflt
(if (plist-member (nth 1 ,node) ,property)
(if
;; FIXME: Byte-compiler throws false positives in Emacs 27.
(with-no-warnings
(plist-member (nth 1 ,node) ,property))
nil ,dflt))))))))
(define-inline org-element-property-raw (property node &optional dflt)

View file

@ -5219,7 +5219,7 @@ If there is no affiliated keyword, return the empty string."
;; cannot belong to the property list.
(let (acc)
(org-element-properties-mapc
(lambda (prop _ _)
(lambda (prop _ __)
(let ((keyword (upcase (substring (symbol-name prop) 1))))
(when (or (string-match-p "^ATTR_" keyword)
(and

View file

@ -678,8 +678,8 @@ optional argument MARKERP, return the position as a new marker."
(buffer (or visiting
(if markerp (find-file-noselect file)
(if (<= 2 (cdr (func-arity #'get-buffer-create)))
(get-buffer-create " *Org ID temp*" t)
;; Emacs 27 does not yet have second argument.
(with-no-warnings (get-buffer-create " *Org ID temp*" t))
;; FIXME: Emacs 27 does not yet have second argument.
(get-buffer-create " *Org ID temp*"))))))
(unwind-protect
(with-current-buffer buffer