org-compat: Define org-xor as alias for xor if available

* lisp/org-macs.el (org-xor): Move to ...
* lisp/org-compat.el (org-xor): ... here, making it an alias for xor
on Emacs 27.

This is an alternative to porting Emacs's
c676444a43e4634c1f98ec286b5bd9e46b23216b, which targets the code prior
to 45a1918ef (Move `org-xor' into "org-macs.el", 2017-10-17).
This commit is contained in:
Kyle Meyer 2019-08-13 22:19:04 -04:00
parent 218e694964
commit 531f4be256
2 changed files with 7 additions and 9 deletions

View file

@ -70,6 +70,13 @@
;;; Emacs < 27.1 compatibility
(if (fboundp 'xor)
;; `xor' was added in Emacs 27.1.
(defalias 'org-xor #'xor)
(defsubst org-xor (a b)
"Exclusive `or'."
(if a (not b) b)))
(unless (fboundp 'pcomplete-uniquify-list)
;; The misspelled variant was made obsolete in Emacs 27.1
(defalias 'pcomplete-uniquify-list 'pcomplete-uniqify-list))

View file

@ -596,15 +596,6 @@ Optional argument REGEXP selects variables to clone."
(or (null regexp) (string-match-p regexp (symbol-name name))))
(ignore-errors (set (make-local-variable name) value)))))))
;;; Logic
(defsubst org-xor (a b)
"Exclusive `or'."
(if a (not b) b))
;;; Miscellaneous