From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: 7 logical-xor implementations in source tree Date: Thu, 1 Aug 2019 00:28:23 +0200 Message-ID: <674EC692-2EB2-4080-BE91-39DD804B2514@acm.org> References: <87tvbd9a8p.fsf@oremacs.com> <87pnm14u95.fsf@tcd.ie> <87sgqvoz5c.fsf@tcd.ie> <87d0hz2e11.fsf@tcd.ie> <5B633129-B795-4BFA-AE81-FE9FD0A24CE9@acm.org> <0edfffbb-6f5a-a6b2-334a-9000e8f2eb3e@gmail.com> <20190728080417.GA5072@ACM> <875znm3q19.fsf@mbork.pl> <20190730093651.GA5427@ACM> <7n36iny4yq.fsf@ecube.ecubist.org> <7nftmmkz83.fsf@ecube.ecubist.org> <87y30eymw6.fsf@tcd.ie> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_E4A73999-5076-4553-8DB1-1C20B7F76690" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="124264"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Stefan Monnier , Barry Fishman , emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 01 00:29:11 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hsx5q-000WCP-DX for ged-emacs-devel@m.gmane.org; Thu, 01 Aug 2019 00:29:10 +0200 Original-Received: from localhost ([::1]:44868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsx5p-0003TZ-FH for ged-emacs-devel@m.gmane.org; Wed, 31 Jul 2019 18:29:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38779) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsx5L-0003TA-MZ for emacs-devel@gnu.org; Wed, 31 Jul 2019 18:28:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsx5I-0007zt-9r for emacs-devel@gnu.org; Wed, 31 Jul 2019 18:28:39 -0400 Original-Received: from mail155c50.megamailservers.eu ([91.136.10.165]:53128 helo=mail51c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsx5H-0007xA-Q3 for emacs-devel@gnu.org; Wed, 31 Jul 2019 18:28:36 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1564612108; bh=arLV7pr63jvk6ZSxu54Zhb9XHjv75njQIRkErJAKYbM=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=s+NM5GBgwej8qbx2Yd/g26a+ycggz22dc3ANtwV5HgLgQUisFVv6793APvQ9MJZRf Thkx0fy1Xjk3anZavYluG4f5t9Slq/W8lKAfXFiozF0dJV7RrFTTHBgClwn93TCU68 5MRVXnqHYpEDlK86aUQKsCwQ9HzAUGaZxARRmAfs= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] ([188.150.171.71]) (authenticated bits=0) by mail51c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x6VMSODF030160; Wed, 31 Jul 2019 22:28:25 +0000 In-Reply-To: <87y30eymw6.fsf@tcd.ie> X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0214.5D42160C.003F, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=U6m889ju c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=iRZporoAAAAA:8 a=h5j2cAhtiAE0rPyMYp0A:9 a=CjuIK1q_8ugA:10 a=nE5jfom_d_qfJMMgr5oA:9 a=B2y7HmGcmWMA:10 a=NOBgFS-JBQ2l-kSd6-zu:22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.165 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239074 Archived-At: --Apple-Mail=_E4A73999-5076-4553-8DB1-1C20B7F76690 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 31 juli 2019 kl. 22.22 skrev Basil L. Contovounesios : >=20 > Stefan Monnier writes: >=20 >> I vote to define either `bool-equal` or `xor` (and this "or" is = mutually >> exclusive ;-), in either case taking exactly 2 arguments (while those >> functions can be generalized to more, it's far from clear that it's >> worth the trouble. After all `equal` still only takes 2 args). >>=20 >> Then replace the various uses of -xor with calls to this >> new function. >=20 > +1. >=20 > If I had to pick one or the other, I would go with xor purely because = it > is the one that has been copied several times. But I am also = perfectly > happy with bool-equal, especially if it is the = historically/classically > preferred function. 2 args is a reasonable simplification for both operators, and it allows = `equiv' to be passed to HOFs that expect an equivalence relation. I = haven't found much evidence for the need of an `equiv' of 3 or more = operands either. I'd favour `equiv' over `xor' but don't think we should be forced to = make a hard choice: while each can be expressed as the inverse of the = other, they are used with different intents ('exactly one' vs. 'same = truth'). Regarding naming, I'd prefer equiv to bool-equiv to bool-equal, on the = grounds that 'equivalence' is the most common way to describe the = relation, well-known far outside specialised fields of logic and = mathematics. `bool-equal' suggests either equality qua boolean or of = booleanp values -- slightly ambiguous. Attached is Basil's patch modified for a 2-arg `equiv' function, just as = a reference point (and because code walks). --Apple-Mail=_E4A73999-5076-4553-8DB1-1C20B7F76690 Content-Disposition: attachment; filename=0001-Add-conditional-operators-xor-and-equiv-to-subr.el.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Add-conditional-operators-xor-and-equiv-to-subr.el.patch" Content-Transfer-Encoding: quoted-printable =46rom=2092d5420c202b72cd993cb0bb324473eb08082596=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Wed,=2031=20Jul=202019=2019:45:06=20+0200=0A= Subject:=20[PATCH]=20Add=20conditional=20operators=20xor=20and=20equiv=20= to=20subr.el=0A=0ASuggested=20by=20Oleh=20Krehel=20and=20implemented=20= by=20Basil=20Contovounesios=20in=0Athe=20following=20thread:=0A= https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00547.html=0A=0A= *=20lisp/array.el=20(xor):=20Move=20unused=20function=20from=20here...=0A= *=20lisp/subr.el:=20...to=20here.=0A(equiv):=20New=20function.=0A*=20= lisp/gnus/spam.el=20(spam-xor):=0A*=20lisp/play/5x5.el=20(5x5-xor):=0A*=20= lisp/proced.el=20(proced-xor):=0A*=20lisp/progmodes/idlwave.el=20= (idlwave-xor):=0A*=20lisp/vc/diff-mode.el=20(diff-xor):=20Define=20as=20= obsolete=20aliases=20of,=0Aand=20replace=20all=20uses=20with,=20xor.=0A*=20= lisp/jsonrpc.el:=20Remove=20unused=20dependency=20on=20array.el.=0A*=20= lisp/org/org.el=20(org-xor):=20Move=20from=20here...=0A*=20= lisp/org/org-compat.el=20(org-xor):=20...to=20here,=20as=20a=20= compatibility=0Ashim=20for=20xor.=0A*=20lisp/progmodes/idlw-shell.el=20= (idlwave-shell-enable-all-bp):=0A*=20lisp/simple.el=20= (exchange-point-and-mark):=20Use=20equiv.=0A*=20lisp/strokes.el=20= (strokes-xor):=20Remove=20commented-out=20xor=0Aimplementation.=0A*=20= lisp/windmove.el=20(windmove-display-in-direction):=20Use=20xor.=0A=0A*=20= doc/lispref/control.texi=20(Control=20Structures):=20Extend=20menu=20= entry=0Afor=20new=20combining=20conditions.=0A(Combining=20Conditions):=0A= *=20etc/NEWS=20(Lisp=20Changes):=20Document=20xor=20and=20equiv.=0A=0A*=20= test/lisp/subr-tests.el=20(subr-test-xor,=20subr-test-equiv):=20New=0A= tests.=0A---=0A=20doc/lispref/control.texi=20=20=20=20=20|=2039=20= +++++++++++++++++++++++++++++++++---=0A=20etc/NEWS=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20|=2011=20++++++++++=0A=20= lisp/array.el=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20=205=20= -----=0A=20lisp/gnus/spam.el=20=20=20=20=20=20=20=20=20=20=20=20|=20=206=20= ++----=0A=20lisp/jsonrpc.el=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20= =203=20+--=0A=20lisp/org/org-compat.el=20=20=20=20=20=20=20|=20=208=20= ++++++++=0A=20lisp/org/org.el=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20= =204=20----=0A=20lisp/play/5x5.el=20=20=20=20=20=20=20=20=20=20=20=20=20= |=20=208=20+++-----=0A=20lisp/proced.el=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20|=2011=20++++------=0A=20lisp/progmodes/idlw-shell.el=20|=20=20= 2=20+-=0A=20lisp/progmodes/idlwave.el=20=20=20=20|=2025=20= +++++++++++------------=0A=20lisp/simple.el=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20|=20=203=20+--=0A=20lisp/strokes.el=20=20=20=20=20=20=20=20= =20=20=20=20=20=20|=20=206=20------=0A=20lisp/subr.el=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20|=2015=20++++++++++++++=0A=20= lisp/vc/diff-mode.el=20=20=20=20=20=20=20=20=20|=2012=20+++++------=0A=20= lisp/windmove.el=20=20=20=20=20=20=20=20=20=20=20=20=20|=20=202=20+-=0A=20= test/lisp/subr-tests.el=20=20=20=20=20=20|=2014=20+++++++++++++=0A=2017=20= files=20changed,=20115=20insertions(+),=2059=20deletions(-)=0A=0Adiff=20= --git=20a/doc/lispref/control.texi=20b/doc/lispref/control.texi=0Aindex=20= e98daf66e9..311178ec49=20100644=0A---=20a/doc/lispref/control.texi=0A+++=20= b/doc/lispref/control.texi=0A@@=20-38,7=20+38,7=20@@=20Control=20= Structures=0A=20@menu=0A=20*=20Sequencing::=20=20=20=20=20=20=20=20=20=20= =20=20=20Evaluation=20in=20textual=20order.=0A=20*=20Conditionals::=20=20= =20=20=20=20=20=20=20=20=20@code{if},=20@code{cond},=20@code{when},=20= @code{unless}.=0A-*=20Combining=20Conditions::=20=20=20@code{and},=20= @code{or},=20@code{not}.=0A+*=20Combining=20Conditions::=20=20=20= @code{and},=20@code{or},=20@code{not},=20and=20friends.=0A=20*=20= Pattern-Matching=20Conditional::=20=20How=20to=20use=20@code{pcase}=20= and=20friends.=0A=20*=20Iteration::=20=20=20=20=20=20=20=20=20=20=20=20=20= =20@code{while}=20loops.=0A=20*=20Generators::=20=20=20=20=20=20=20=20=20= =20=20=20=20Generic=20sequences=20and=20coroutines.=0A@@=20-298,8=20= +298,8=20@@=20Combining=20Conditions=0A=20@section=20Constructs=20for=20= Combining=20Conditions=0A=20@cindex=20combining=20conditions=0A=20=0A-=20= =20This=20section=20describes=20three=20constructs=20that=20are=20often=20= used=20together=0A-with=20@code{if}=20and=20@code{cond}=20to=20express=20= complicated=20conditions.=20=20The=0A+=20=20This=20section=20describes=20= constructs=20that=20are=20often=20used=20together=20with=0A+@code{if}=20= and=20@code{cond}=20to=20express=20complicated=20conditions.=20=20The=0A=20= constructs=20@code{and}=20and=20@code{or}=20can=20also=20be=20used=20= individually=20as=0A=20kinds=20of=20multiple=20conditional=20constructs.=0A= =20=0A@@=20-419,6=20+419,39=20@@=20Combining=20Conditions=0A=20= @var{arg3})}=20never=20evaluates=20any=20argument=20more=20than=20once.=0A= =20@end=20defspec=0A=20=0A+@defun=20equiv=20condition1=20condition2=0A= +The=20@code{equiv}=20macro=20tests=20whether=20@var{condition1}=20and=0A= +@var{condition2}=20are=20logically=20equivalent,=20i.e.,=20either=20= both=0A+@code{nil}=20or=20both=20non-@code{nil}.=0A+=0A+If=20both=20= arguments=20are=20non-@code{nil},=20then=20the=20@code{equiv}=20call=0A= +returns=20the=20value=20of=20@var{condition2}.=20=20If=20both=20= arguments=20are=0A+@code{nil},=20@code{equiv}=20returns=20@code{t}.=0A+=0A= +For=20example,=20the=20following=20expression=20tests=20whether=20= either=20some=20state=0A+is=20enabled=20(@var{enabled}=20is=20= non-@code{nil})=20and=20should=20be=20disabled=0A+(@var{disable}=20is=20= also=20non-@code{nil}),=20or=20the=20state=20is=20disabled=0A= +(@var{enabled}=20is=20@code{nil})=20and=20should=20be=20enabled=20= (@var{disable}=20is=0A+also=20@code{nil});=20if=20either=20of=20these=20= conditions=20holds,=20the=20state=0A+should=20subsequently=20be=20= toggled:=0A+=0A+@example=0A+(when=20(equiv=20enabled=20disable)=0A+=20=20= ;;=20Toggle=20state=0A+=20=20@dots{})=0A+@end=20example=0A+@end=20defun=0A= +=0A+@defun=20xor=20condition1=20condition2=0A+This=20function=20returns=20= the=20boolean=20exclusive-or=20of=20@var{condition1}=20and=0A= +@var{condition2}.=20=20That=20is,=20@code{xor}=20returns=20@code{nil}=20= if=20either=0A+both=20arguments=20are=20@code{nil},=20or=20both=20are=20= non-@code{nil}.=20=20Otherwise,=0A+it=20returns=20the=20value=20of=20= that=20argument=20which=20is=20non-@code{nil}.=0A+=0A+In=20other=20= words,=20@code{xor}=20and=20@code{equiv}=20are=20the=20logical=20= inverses=0A+of=20each=20other.=0A+@end=20defun=0A+=0A=20@node=20= Pattern-Matching=20Conditional=0A=20@section=20Pattern-Matching=20= Conditional=0A=20@cindex=20pcase=0Adiff=20--git=20a/etc/NEWS=20= b/etc/NEWS=0Aindex=207dfb08256f..20390c9bfd=20100644=0A---=20a/etc/NEWS=0A= +++=20b/etc/NEWS=0A@@=20-2480,6=20+2480,17=20@@=20parameter=20to=20= control=20descending=20into=20subdirectories,=20and=20a=0A=20= FOLLOW-SYMLINK=20parameter=20to=20say=20that=20symbolic=20links=20that=20= point=20to=0A=20other=20directories=20should=20be=20followed.=0A=20=0A= ++++=0A+**=20New=20function=20'xor'=20returns=20the=20boolean=20= exclusive-or=20if=20its=20args.=0A+The=20function=20was=20previously=20= defined=20in=20array.el,=20but=20has=20been=20moved=20to=0A+subr.el=20so=20= that=20it=20is=20available=20by=20default.=20=20Several=20duplicates=20= of=0A+'xor'=20in=20other=20packages=20are=20now=20obsolete=20aliases=20= of=20'xor'.=0A+=0A++++=0A+**=20New=20function=20'equiv'=20tests=20= whether=20its=20args=20are=20logically=20equivalent.=0A+If=20its=20= arguments=20are=20both=20non-nil,=20'equiv'=20returns=20the=20value=20of=20= the=0A+last=20one;=20if=20they=20are=20both=20nil,=20it=20returns=20t;=20= otherwise,=20it=20returns=20nil.=0A+=0A=20=0C=0A=20*=20Changes=20in=20= Emacs=2027.1=20on=20Non-Free=20Operating=20Systems=0A=20=0Adiff=20--git=20= a/lisp/array.el=20b/lisp/array.el=0Aindex=202fffe0197e..965e97ff55=20= 100644=0A---=20a/lisp/array.el=0A+++=20b/lisp/array.el=0A@@=20-740,11=20= +740,6=20@@=20limit-index=0A=20=09((>=20index=20limit)=20limit)=0A=20=09= (t=20index)))=0A=20=0A-(defun=20xor=20(pred1=20pred2)=0A-=20=20"Return=20= the=20logical=20exclusive=20or=20of=20predicates=20PRED1=20and=20PRED2."=0A= -=20=20(and=20(or=20pred1=20pred2)=0A-=20=20=20=20=20=20=20(not=20(and=20= pred1=20pred2))))=0A-=0A=20(defun=20current-line=20()=0A=20=20=20"Return=20= the=20current=20buffer=20line=20at=20point.=20=20The=20first=20line=20is=20= 0."=0A=20=20=20(count-lines=20(point-min)=20(line-beginning-position)))=0A= diff=20--git=20a/lisp/gnus/spam.el=20b/lisp/gnus/spam.el=0Aindex=20= d752bf0efe..f990e0cba1=20100644=0A---=20a/lisp/gnus/spam.el=0A+++=20= b/lisp/gnus/spam.el=0A@@=20-708,9=20+708,7=20@@=20spam-clear-cache=0A=20=20= =20"Clear=20the=20`spam-caches'=20entry=20for=20a=20check."=0A=20=20=20= (remhash=20symbol=20spam-caches))=0A=20=0A-(defun=20spam-xor=20(a=20b)=0A= -=20=20"Logical=20A=20xor=20B."=0A-=20=20(and=20(or=20a=20b)=20(not=20= (and=20a=20b))))=0A+(define-obsolete-function-alias=20'spam-xor=20'xor=20= "27.1")=0A=20=0A=20(defun=20spam-set-difference=20(list1=20list2)=0A=20=20= =20"Return=20a=20set=20difference=20of=20LIST1=20and=20LIST2.=0A@@=20= -2550,7=20+2548,7=20@@=20spam-spamoracle-learn=0A=20=20=20=20=20=20=20=20= =20(goto-char=20(point-min))=0A=20=20=20=20=20=20=20=20=20(dolist=20= (article=20articles)=0A=20=20=20=20=20=20=20=20=20=20=20(insert=20= (spam-get-article-as-string=20article)))=0A-=20=20=20=20=20=20=20=20= (let*=20((arg=20(if=20(spam-xor=20unregister=20article-is-spam-p)=0A+=20=20= =20=20=20=20=20=20(let*=20((arg=20(if=20(xor=20unregister=20= article-is-spam-p)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20"-spam"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20"-good"))=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(status=0Adiff=20--git=20a/lisp/jsonrpc.el=20= b/lisp/jsonrpc.el=0Aindex=200fffee6866..329cc5561f=20100644=0A---=20= a/lisp/jsonrpc.el=0A+++=20b/lisp/jsonrpc.el=0A@@=20-43,9=20+43,8=20@@=0A=20= (require=20'warnings)=0A=20(require=20'pcase)=0A=20(require=20'ert)=20;=20= to=20escape=20a=20`condition-case-unless-debug'=0A-(require=20'array)=20= ;=20xor=0A=20=0A-=0C=0A+=0A=20;;;=20Public=20API=0A=20;;;=0A=20=0Adiff=20= --git=20a/lisp/org/org-compat.el=20b/lisp/org/org-compat.el=0Aindex=20= 062bb4c5ca..bb927fedf9=20100644=0A---=20a/lisp/org/org-compat.el=0A+++=20= b/lisp/org/org-compat.el=0A@@=20-362,6=20+362,14=20@@=20= 'org-texinfo-def-table-markup=0A=20=0C=0A=20;;;=20Miscellaneous=20= functions=0A=20=0A+;;=20`xor'=20was=20added=20in=20Emacs=2027.1.=0A= +(defalias=20'org-xor=0A+=20=20(if=20(fboundp=20'xor)=0A+=20=20=20=20=20=20= #'xor=0A+=20=20=20=20(lambda=20(a=20b)=0A+=20=20=20=20=20=20"Exclusive=20= or."=0A+=20=20=20=20=20=20(if=20a=20(not=20b)=20b))))=0A+=0A=20(defun=20= org-version-check=20(version=20feature=20level)=0A=20=20=20(let*=20((v1=20= (mapcar=20'string-to-number=20(split-string=20version=20"[.]")))=0A=20=20= =20=20=20=20=20=20=20=20(v2=20(mapcar=20'string-to-number=20= (split-string=20emacs-version=20"[.]")))=0Adiff=20--git=20= a/lisp/org/org.el=20b/lisp/org/org.el=0Aindex=205aa49b29d6..79725ac752=20= 100644=0A---=20a/lisp/org/org.el=0A+++=20b/lisp/org/org.el=0A@@=20= -10068,10=20+10068,6=20@@=20org-link-unescape-single-byte-sequence=0A=20=09= =20=20=20=20=20=20=20(char-to-string=20(string-to-number=20byte=2016)))=0A= =20=09=20=20=20=20=20(cdr=20(split-string=20hex=20"%"))=20""))=0A=20=0A= -(defun=20org-xor=20(a=20b)=0A-=20=20"Exclusive=20or."=0A-=20=20(if=20a=20= (not=20b)=20b))=0A-=0A=20(defun=20org-fixup-message-id-for-http=20(s)=0A=20= =20=20"Replace=20special=20characters=20in=20a=20message=20id,=20so=20it=20= can=20be=20used=20in=20an=20http=20query."=0A=20=20=20(when=20= (string-match=20"%"=20s)=0Adiff=20--git=20a/lisp/play/5x5.el=20= b/lisp/play/5x5.el=0Aindex=2028748cc351..c5d4659123=20100644=0A---=20= a/lisp/play/5x5.el=0A+++=20b/lisp/play/5x5.el=0A@@=20-435,8=20+435,8=20= @@=205x5-make-xor-with-mutation=0A=20=20=20=20=20(dotimes=20(y=20= 5x5-grid-size)=0A=20=20=20=20=20=20=20(dotimes=20(x=205x5-grid-size)=0A=20= =20=20=20=20=20=20=20=20(5x5-set-cell=20xored=20y=20x=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(5x5-xor=20(5x5-cell=20= current=20y=20x)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(5x5-cell=20best=20=20=20=20y=20= x)))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(xor=20(5x5-cell=20current=20y=20x)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(5x5-cell=20best=20=20=20= =20y=20x)))))=0A=20=20=20=20=20(5x5-mutate-solution=20xored)))=0A=20=0A=20= (defun=205x5-mutate-solution=20(solution)=0A@@=20-931,9=20+931,7=20@@=20= 5x5-randomize=0A=20=0A=20;;=20Support=20functions=0A=20=0A-(defun=20= 5x5-xor=20(x=20y)=0A-=20=20"Boolean=20exclusive-or=20of=20X=20and=20Y."=0A= -=20=20(and=20(or=20x=20y)=20(not=20(and=20x=20y))))=0A= +(define-obsolete-function-alias=20'5x5-xor=20'xor=20"27.1")=0A=20=0A=20= (defun=205x5-y-or-n-p=20(prompt)=0A=20=20=20"5x5=20wrapper=20for=20= `y-or-n-p'=20which=20respects=20the=20`5x5-hassle-me'=20setting."=0Adiff=20= --git=20a/lisp/proced.el=20b/lisp/proced.el=0Aindex=20= 5f35fa34a0..fe687a4f83=20100644=0A---=20a/lisp/proced.el=0A+++=20= b/lisp/proced.el=0A@@=20-1194,10=20+1194,7=20@@=20proced-time-lessp=0A=20= =0A=20;;;=20Sorting=0A=20=0A-(defsubst=20proced-xor=20(b1=20b2)=0A-=20=20= "Return=20the=20logical=20exclusive=20or=20of=20args=20B1=20and=20B2."=0A= -=20=20(and=20(or=20b1=20b2)=0A-=20=20=20=20=20=20=20(not=20(and=20b1=20= b2))))=0A+(define-obsolete-function-alias=20'proced-xor=20'xor=20"27.1")=0A= =20=0A=20(defun=20proced-sort-p=20(p1=20p2)=0A=20=20=20"Predicate=20for=20= sorting=20processes=20P1=20and=20P2."=0A@@=20-1208,8=20+1205,8=20@@=20= proced-sort-p=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20(k2=20(cdr=20= (assq=20(car=20sorter)=20(cdr=20p2)))))=0A=20=20=20=20=20=20=20=20=20;;=20= if=20the=20attributes=20are=20undefined,=20we=20should=20really=20abort=20= sorting=0A=20=20=20=20=20=20=20=20=20(if=20(and=20k1=20k2)=0A-=20=20=20=20= =20=20=20=20=20=20=20=20(proced-xor=20(funcall=20(nth=201=20sorter)=20k1=20= k2)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(nth=202=20sorter))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20(xor=20= (funcall=20(nth=201=20sorter)=20k1=20k2)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(nth=202=20sorter))))=0A=20=20=20=20=20(let=20= ((sort-list=20proced-sort-internal)=20sorter=20predicate=20k1=20k2)=0A=20= =20=20=20=20=20=20(catch=20'done=0A=20=20=20=20=20=20=20=20=20(while=20= (setq=20sorter=20(pop=20sort-list))=0A@@=20-1219,7=20+1216,7=20@@=20= proced-sort-p=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (and=20k1=20k2)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(funcall=20(nth=201=20sorter)=20k1=20k2)))=0A=20=20=20=20=20=20=20=20= =20=20=20(if=20(not=20(eq=20predicate=20'equal))=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(throw=20'done=20(proced-xor=20predicate=20(nth=202=20= sorter)))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(throw=20'done=20= (xor=20predicate=20(nth=202=20sorter)))))=0A=20=20=20=20=20=20=20=20=20= (eq=20t=20predicate)))))=0A=20=0A=20(defun=20proced-sort=20= (process-alist=20sorter=20descend)=0Adiff=20--git=20= a/lisp/progmodes/idlw-shell.el=20b/lisp/progmodes/idlw-shell.el=0Aindex=20= 3bd99620d0..568479c822=20100644=0A---=20a/lisp/progmodes/idlw-shell.el=0A= +++=20b/lisp/progmodes/idlw-shell.el=0A@@=20-2604,7=20+2604,7=20@@=20= idlwave-shell-enable-all-bp=0A=20=20=20(let=20=20((bpl=20(or=20bpl=20= idlwave-shell-bp-alist))=20disabled=20modified)=0A=20=20=20=20=20(while=20= bpl=0A=20=20=20=20=20=20=20(setq=20disabled=20(idlwave-shell-bp-get=20= (car=20bpl)=20'disabled))=0A-=20=20=20=20=20=20(when=20(idlwave-xor=20= (not=20disabled)=20(eq=20enable=20'enable))=0A+=20=20=20=20=20=20(when=20= (equiv=20disabled=20(eq=20enable=20'enable))=0A=20=09= (idlwave-shell-toggle-enable-current-bp=0A=20=09=20(car=20bpl)=20(if=20= (eq=20enable=20'enable)=20'enable=20'disable)=20no-update)=0A=20=09(push=20= (car=20bpl)=20modified))=0Adiff=20--git=20a/lisp/progmodes/idlwave.el=20= b/lisp/progmodes/idlwave.el=0Aindex=20614d73e23b..1b4b55c94f=20100644=0A= ---=20a/lisp/progmodes/idlwave.el=0A+++=20b/lisp/progmodes/idlwave.el=0A= @@=20-8813,9=20+8813,8=20@@=20idlwave-study-twins=0A=20=0A=20;;=20FIXME:=20= Dynamically=20scoped=20vars=20need=20to=20use=20the=20`idlwave-'=20= prefix.=0A=20;;=20(defvar=20type)=0A-(defmacro=20idlwave-xor=20(a=20b)=0A= -=20=20`(and=20(or=20,a=20,b)=0A-=09(not=20(and=20,a=20,b))))=0A+=0A= +(define-obsolete-function-alias=20'idlwave-xor=20'xor=20"27.1")=0A=20=0A= =20(defun=20idlwave-routine-entry-compare=20(a=20b)=0A=20=20=20"Compare=20= two=20routine=20info=20entries=20for=20sorting.=0A@@=20-8919,17=20= +8918,17=20@@=20idlwave-routine-twin-compare=0A=20=20=20=20=20;;=20Now:=20= follow=20JD's=20ideas=20about=20sorting.=20=20Looks=20really=20simple=20= now,=0A=20=20=20=20=20;;=20doesn't=20it?=20=20The=20difficult=20stuff=20= is=20hidden=20above...=0A=20=20=20=20=20(cond=0A-=20=20=20=20=20= ((idlwave-xor=20asysp=20=20bsysp)=20=20=20=20=20=20=20asysp)=09;=20= System=20entries=20first=0A-=20=20=20=20=20((idlwave-xor=20aunresp=20= bunresp)=20=20=20=20bunresp)=20;=20Unresolved=20last=0A+=20=20=20=20=20= ((xor=20asysp=20=20=20bsysp)=20=20=20=20=20asysp)=20=20=20=20=20=20=20=20= ;=20System=20entries=20first=0A+=20=20=20=20=20((xor=20aunresp=20= bunresp)=20=20=20bunresp)=20=20=20=20=20=20;=20Unresolved=20last=0A=20=20= =20=20=20=20((and=20idlwave-sort-prefer-buffer-info=0A-=09=20=20=20= (idlwave-xor=20abufp=20bbufp))=20=20abufp)=09;=20Buffers=20before=20= non-buffers=0A-=20=20=20=20=20((idlwave-xor=20acompp=20bcompp)=20=20=20=20= =20=20acompp)=09;=20Compiled=20entries=0A-=20=20=20=20=20((idlwave-xor=20= apathp=20bpathp)=20=20=20=20=20=20apathp)=09;=20Library=20before=20= non-library=0A-=20=20=20=20=20((idlwave-xor=20anamep=20bnamep)=20=20=20=20= =20=20anamep)=09;=20Correct=20file=20names=20first=0A-=20=20=20=20=20= ((and=20idlwave-twin-class=20anamep=20bnamep=20=20=20=20=20;=20both=20= file=20names=20match=20->=0A-=09=20=20=20(idlwave-xor=20adefp=20bdefp))=20= =20bdefp)=09;=20__define=20after=20__method=0A-=20=20=20=20=20((>=20= anpath=20bnpath)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20t)=09;=20= Who=20is=20first=20on=20path?=0A-=20=20=20=20=20(t=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= nil))))=09;=20Default=0A+=20=20=20=20=20=20=20=20=20=20=20(xor=20abufp=20= bbufp))=20abufp)=20=20=20=20=20=20=20=20;=20Buffers=20before=20= non-buffers=0A+=20=20=20=20=20((xor=20acompp=20bcompp)=20=20=20=20=20= acompp)=20=20=20=20=20=20=20;=20Compiled=20entries=0A+=20=20=20=20=20= ((xor=20apathp=20bpathp)=20=20=20=20=20apathp)=20=20=20=20=20=20=20;=20= Library=20before=20non-library=0A+=20=20=20=20=20((xor=20anamep=20= bnamep)=20=20=20=20=20anamep)=20=20=20=20=20=20=20;=20Correct=20file=20= names=20first=0A+=20=20=20=20=20((and=20idlwave-twin-class=20anamep=20= bnamep=20;=20both=20file=20names=20match=20->=0A+=20=20=20=20=20=20=20=20= =20=20=20(xor=20adefp=20bdefp))=20bdefp)=20=20=20=20=20=20=20=20;=20= __define=20after=20__method=0A+=20=20=20=20=20((>=20anpath=20bnpath)=20=20= =20=20=20=20=20t)=20=20=20=20=20=20=20=20=20=20=20=20;=20Who=20is=20= first=20on=20path?=0A+=20=20=20=20=20(t=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20nil))))=20=20=20=20=20=20=20;=20Default=0A= =20=0A=20(defun=20idlwave-routine-source-file=20(source)=0A=20=20=20(if=20= (nth=202=20source)=0Adiff=20--git=20a/lisp/simple.el=20b/lisp/simple.el=0A= index=200bc39f08c0..40a0e69adb=20100644=0A---=20a/lisp/simple.el=0A+++=20= b/lisp/simple.el=0A@@=20-5855,8=20+5855,7=20@@=20exchange-point-and-mark=0A= =20=20=20=20=20(goto-char=20omark)=0A=20=20=20=20=20(cond=20= (temp-highlight=0A=20=09=20=20=20(setq-local=20transient-mark-mode=20= (cons=20'only=20transient-mark-mode)))=0A-=09=20=20((or=20(and=20arg=20= (region-active-p))=20;=20(xor=20arg=20(not=20(region-active-p)))=0A-=09=20= =20=20=20=20=20=20(not=20(or=20arg=20(region-active-p))))=0A+=20=20=20=20= =20=20=20=20=20=20((equiv=20arg=20(region-active-p))=0A=20=09=20=20=20= (deactivate-mark))=0A=20=09=20=20(t=20(activate-mark)))=0A=20=20=20=20=20= nil))=0Adiff=20--git=20a/lisp/strokes.el=20b/lisp/strokes.el=0Aindex=20= 0c671c43ac..6edf58c7b6=20100644=0A---=20a/lisp/strokes.el=0A+++=20= b/lisp/strokes.el=0A@@=20-1524,12=20+1524,6=20@@=20= strokes-xpm-char-bit-p=0A=20=20=20(or=20(eq=20char=20?\s)=0A=20=20=20=20=20= =20=20(eq=20char=20?*)))=0A=20=0A-;;(defsubst=20strokes-xor=20(a=20b)=20=20= ###=20Should=20I=20make=20this=20an=20inline=20function?=20###=0A-;;=20=20= "T=20if=20one=20and=20only=20one=20of=20A=20and=20B=20is=20non-nil;=20= otherwise,=20returns=20nil.=0A-;;NOTE:=20Don't=20use=20this=20as=20a=20= numeric=20xor=20since=20it=20treats=20all=20non-nil=0A-;;=20=20=20=20=20=20= values=20as=20t=20including=20`0'=20(zero)."=0A-;;=20=20(eq=20(null=20a)=20= (not=20(null=20b))))=0A-=0A=20(defsubst=20= strokes-xpm-encode-length-as-string=20(length)=0A=20=20=20"Given=20some=20= LENGTH=20in=20[0,62)=20do=20a=20fast=20lookup=20of=20its=20encoding."=0A=20= =20=20(aref=20strokes-base64-chars=20length))=0Adiff=20--git=20= a/lisp/subr.el=20b/lisp/subr.el=0Aindex=20eea4e045dd..336f45b093=20= 100644=0A---=20a/lisp/subr.el=0A+++=20b/lisp/subr.el=0A@@=20-209,6=20= +209,21=20@@=20unless=0A=20=20=20(declare=20(indent=201)=20(debug=20t))=0A= =20=20=20(cons=20'if=20(cons=20cond=20(cons=20nil=20body))))=0A=20=0A= +(defsubst=20xor=20(cond1=20cond2)=0A+=20=20"Return=20the=20boolean=20= exclusive-or=20of=20COND1=20and=20COND2.=0A+If=20only=20one=20of=20the=20= arguments=20is=20non-nil,=20return=20it;=20otherwise=0A+return=20nil."=0A= +=20=20(declare=20(pure=20t)=20(side-effect-free=20error-free))=0A+=20=20= (cond=20((not=20cond1)=20cond2)=0A+=20=20=20=20=20=20=20=20((not=20= cond2)=20cond1)))=0A+=0A+(defsubst=20equiv=20(cond1=20cond2)=0A+=20=20= "Return=20non-nil=20if=20COND1=20and=20COND2=20are=20logically=20= equivalent.=0A+That=20is,=20they=20are=20either=20both=20nil,=20or=20= both=20non-nil.=0A+If=20neither=20argument=20is=20nil,=20returns=20= COND2."=0A+=20=20(declare=20(pure=20t)=20(side-effect-free=20= error-free))=0A+=20=20(if=20cond1=20cond2=20(not=20cond2)))=0A+=0A=20= (defmacro=20dolist=20(spec=20&rest=20body)=0A=20=20=20"Loop=20over=20a=20= list.=0A=20Evaluate=20BODY=20with=20VAR=20bound=20to=20each=20car=20from=20= LIST,=20in=20turn.=0Adiff=20--git=20a/lisp/vc/diff-mode.el=20= b/lisp/vc/diff-mode.el=0Aindex=200d5dc0e1c0..a96c1bfd23=20100644=0A---=20= a/lisp/vc/diff-mode.el=0A+++=20b/lisp/vc/diff-mode.el=0A@@=20-1770,7=20= +1770,7=20@@=20diff-find-approx-text=0A=20=09(if=20(>=20(-=20(car=20= forw)=20orig)=20(-=20orig=20(car=20back)))=20back=20forw)=0A=20=20=20=20=20= =20=20(or=20back=20forw))))=0A=20=0A-(defsubst=20diff-xor=20(a=20b)=20= (if=20a=20(if=20(not=20b)=20a)=20b))=0A+(define-obsolete-function-alias=20= 'diff-xor=20'xor=20"27.1")=0A=20=0A=20(defun=20diff-find-source-location=20= (&optional=20other-file=20reverse=20noprompt)=0A=20=20=20"Find=20out=20= (BUF=20LINE-OFFSET=20POS=20SRC=20DST=20SWITCHED).=0A@@=20-1783,7=20= +1783,7=20@@=20diff-find-source-location=0A=20SWITCHED=20is=20non-nil=20= if=20the=20patch=20is=20already=20applied.=0A=20NOPROMPT,=20if=20= non-nil,=20means=20not=20to=20prompt=20the=20user."=0A=20=20=20= (save-excursion=0A-=20=20=20=20(let*=20((other=20(diff-xor=20other-file=20= diff-jump-to-old-file))=0A+=20=20=20=20(let*=20((other=20(xor=20= other-file=20diff-jump-to-old-file))=0A=20=09=20=20=20(char-offset=20(-=20= (point)=20(diff-beginning-of-hunk=20t)))=0A=20=20=20=20=20=20=20=20=20=20= =20=20;;=20Check=20that=20the=20hunk=20is=20well-formed.=20=20Otherwise=20= diff-mode=20and=0A=20=20=20=20=20=20=20=20=20=20=20=20;;=20the=20user=20= may=20disagree=20on=20what=20constitutes=20the=20hunk=0A@@=20-1909,7=20= +1909,7=20@@=20diff-apply-hunk=0A=20=09(insert=20(car=20new)))=0A=20=20=20= =20=20=20=20;;=20Display=20BUF=20in=20a=20window=0A=20=20=20=20=20=20=20= (set-window-point=20(display-buffer=20buf)=20(+=20(car=20pos)=20(cdr=20= new)))=0A-=20=20=20=20=20=20(diff-hunk-status-msg=20line-offset=20= (diff-xor=20switched=20reverse)=20nil)=0A+=20=20=20=20=20=20= (diff-hunk-status-msg=20line-offset=20(xor=20switched=20reverse)=20nil)=0A= =20=20=20=20=20=20=20(when=20diff-advance-after-apply-hunk=0A=20=09= (diff-hunk-next))))))=0A=20=0A@@=20-1921,7=20+1921,7=20@@=20= diff-test-hunk=0A=20=20=20(pcase-let=20((`(,buf=20,line-offset=20,pos=20= ,src=20,_dst=20,switched)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(diff-find-source-location=20nil=20reverse)))=0A=20=20=20=20=20= (set-window-point=20(display-buffer=20buf)=20(+=20(car=20pos)=20(cdr=20= src)))=0A-=20=20=20=20(diff-hunk-status-msg=20line-offset=20(diff-xor=20= reverse=20switched)=20t)))=0A+=20=20=20=20(diff-hunk-status-msg=20= line-offset=20(xor=20reverse=20switched)=20t)))=0A=20=0A=20=0A=20(defun=20= diff-kill-applied-hunks=20()=0A@@=20-1958,7=20+1958,7=20@@=20= diff-goto-source=0A=20=20=20=20=20=20=20(pop-to-buffer=20buf)=0A=20=20=20= =20=20=20=20(goto-char=20(+=20(car=20pos)=20(cdr=20src)))=0A=20=20=20=20=20= =20=20(when=20buffer=20(next-error-found=20buffer=20(current-buffer)))=0A= -=20=20=20=20=20=20(diff-hunk-status-msg=20line-offset=20(diff-xor=20= reverse=20switched)=20t))))=0A+=20=20=20=20=20=20(diff-hunk-status-msg=20= line-offset=20(xor=20reverse=20switched)=20t))))=0A=20=0A=20=0A=20(defun=20= diff-current-defun=20()=0A@@=20-2253,7=20+2253,7=20@@=20= diff-delete-trailing-whitespace=0A=20=20=20(interactive=20"P")=0A=20=20=20= (save-excursion=0A=20=20=20=20=20(goto-char=20(point-min))=0A-=20=20=20=20= (let*=20((other=20(diff-xor=20other-file=20diff-jump-to-old-file))=0A+=20= =20=20=20(let*=20((other=20(xor=20other-file=20diff-jump-to-old-file))=0A= =20=20=20=09=20=20=20(modified-buffers=20nil)=0A=20=20=20=09=20=20=20= (style=20(save-excursion=0A=20=20=20=09=20=20=20=09=20=20=20=20(when=20= (re-search-forward=20diff-hunk-header-re=20nil=20t)=0Adiff=20--git=20= a/lisp/windmove.el=20b/lisp/windmove.el=0Aindex=20ab47565dfa..f5f51480db=20= 100644=0A---=20a/lisp/windmove.el=0A+++=20b/lisp/windmove.el=0A@@=20= -592,7=20+592,7=20@@=20windmove-display-in-direction=0A=20the=20prefix=20= argument=20is=20reversed.=0A=20When=20= `switch-to-buffer-obey-display-actions'=20is=20non-nil,=0A=20= `switch-to-buffer'=20commands=20are=20also=20supported."=0A-=20=20(let*=20= ((no-select=20(not=20(eq=20(consp=20arg)=20windmove-display-no-select)))=20= ;=20xor=0A+=20=20(let*=20((no-select=20(xor=20(consp=20arg)=20= windmove-display-no-select))=0A=20=20=20=20=20=20=20=20=20=20(old-window=20= (or=20(minibuffer-selected-window)=20(selected-window)))=0A=20=20=20=20=20= =20=20=20=20=20(new-window)=0A=20=20=20=20=20=20=20=20=20=20= (minibuffer-depth=20(minibuffer-depth))=0Adiff=20--git=20= a/test/lisp/subr-tests.el=20b/test/lisp/subr-tests.el=0Aindex=20= 0023680738..4e4671e849=20100644=0A---=20a/test/lisp/subr-tests.el=0A+++=20= b/test/lisp/subr-tests.el=0A@@=20-125,6=20+125,20=20@@=20= 'subr-tests--parent-mode=0A=20=20=20(should=20(equal=20(macroexpand-all=20= '(when=20a=20b=20c=20d))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20'(if=20a=20(progn=20b=20c=20d)))))=0A=20=0A+(ert-deftest=20= subr-test-xor=20()=0A+=20=20"Test=20`xor'."=0A+=20=20(should-not=20(xor=20= nil=20nil))=0A+=20=20(should=20(eq=20(xor=20nil=20'true)=20'true))=0A+=20= =20(should=20(eq=20(xor=20'true=20nil)=20'true))=0A+=20=20(should-not=20= (xor=20t=20t)))=0A+=0A+(ert-deftest=20subr-test-equiv=20()=0A+=20=20= "Test=20`equiv'."=0A+=20=20(should=20(equal=20(equiv=20nil=20nil)=20t))=0A= +=20=20(should=20(equal=20(equiv=203=20'a)=20'a))=0A+=20=20(should-not=20= (equiv=20'b=20nil))=0A+=20=20(should-not=20(equiv=20nil=20'c)))=0A+=0A=20= (ert-deftest=20subr-test-version-parsing=20()=0A=20=20=20(should=20= (equal=20(version-to-list=20".5")=20'(0=205)))=0A=20=20=20(should=20= (equal=20(version-to-list=20"0.9=20alpha1")=20'(0=209=20-3=201)))=0A--=20= =0A2.20.1=20(Apple=20Git-117)=0A=0A= --Apple-Mail=_E4A73999-5076-4553-8DB1-1C20B7F76690--