aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/array.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd2019-07-31 19:45:06 +0200
committerMattias EngdegÄrd2019-08-06 13:38:47 +0200
commitc676444a43e4634c1f98ec286b5bd9e46b23216b (patch)
tree8381c0ef5720a92b845808e8e885f6b5976ee0a1 /lisp/array.el
parent1d8b5bc8dd543ada2f3c46436e43ea27faa3cd0e (diff)
downloademacs-c676444a43e4634c1f98ec286b5bd9e46b23216b.tar.gz
emacs-c676444a43e4634c1f98ec286b5bd9e46b23216b.zip
Add conditional operator xor to subr.el
Suggested by Oleh Krehel and implemented by Basil Contovounesios in the following thread: https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00547.html * lisp/array.el (xor): Move unused function from here... * lisp/subr.el: ...to here, and improve. * lisp/gnus/spam.el (spam-xor): * lisp/play/5x5.el (5x5-xor): * lisp/proced.el (proced-xor): * lisp/progmodes/idlwave.el (idlwave-xor): * lisp/vc/diff-mode.el (diff-xor): Define as obsolete aliases of, and replace all uses with, xor. * lisp/jsonrpc.el: Remove unused dependency on array.el. * lisp/org/org.el (org-xor): Move from here... * lisp/org/org-compat.el (org-xor): ...to here, as a compatibility shim for xor. * lisp/progmodes/idlw-shell.el (idlwave-shell-enable-all-bp): * lisp/simple.el (exchange-point-and-mark): * lisp/windmove.el (windmove-display-in-direction): Use xor. * lisp/strokes.el (strokes-xor): Remove commented-out xor implementation. * doc/lispref/control.texi (Control Structures): Extend menu entry for new combining condition. (Combining Conditions): * etc/NEWS (Lisp Changes): Document xor. * test/lisp/subr-tests.el (subr-test-xor): New test.
Diffstat (limited to 'lisp/array.el')
-rw-r--r--lisp/array.el5
1 files changed, 0 insertions, 5 deletions
diff --git a/lisp/array.el b/lisp/array.el
index 2fffe0197e8..965e97ff553 100644
--- a/lisp/array.el
+++ b/lisp/array.el
@@ -740,11 +740,6 @@ of `array-rows-numbered'."
740 ((> index limit) limit) 740 ((> index limit) limit)
741 (t index))) 741 (t index)))
742 742
743(defun xor (pred1 pred2)
744 "Return the logical exclusive or of predicates PRED1 and PRED2."
745 (and (or pred1 pred2)
746 (not (and pred1 pred2))))
747
748(defun current-line () 743(defun current-line ()
749 "Return the current buffer line at point. The first line is 0." 744 "Return the current buffer line at point. The first line is 0."
750 (count-lines (point-min) (line-beginning-position))) 745 (count-lines (point-min) (line-beginning-position)))