Просмотр исходного кода

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).
Kyle Meyer 5 лет назад
Родитель
Сommit
531f4be256
2 измененных файлов с 7 добавлено и 9 удалено
  1. 7 0
      lisp/org-compat.el
  2. 0 9
      lisp/org-macs.el

+ 7 - 0
lisp/org-compat.el

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

+ 0 - 9
lisp/org-macs.el

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