From MAILER-DAEMON Thu Nov 01 12:24:19 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gIFla-0001Ky-Ur for mharc-emacs-elpa-diffs@gnu.org; Thu, 01 Nov 2018 12:24:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIFlG-0001IN-7Y for emacs-elpa-diffs@gnu.org; Thu, 01 Nov 2018 12:24:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIFkr-0004OJ-DV for emacs-elpa-diffs@gnu.org; Thu, 01 Nov 2018 12:23:54 -0400 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:41318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIFkl-0004My-6t for emacs-elpa-diffs@gnu.org; Thu, 01 Nov 2018 12:23:30 -0400 Received: by vcs0.savannah.gnu.org (Postfix, from userid 131183) id D009A204F2; Thu, 1 Nov 2018 12:23:26 -0400 (EDT) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 86e0136: [gnus-mock] Conditionally add nnimap server, bump to 0.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Eric Abrahamsen In-Reply-To: <20181101162325.29232.43229@vcs0.savannah.gnu.org> References: <20181101162325.29232.43229@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 86e01365089891b2b65628b4ed9b21e570451de8 Auto-Submitted: auto-generated Message-Id: <20181101162326.D009A204F2@vcs0.savannah.gnu.org> Date: Thu, 1 Nov 2018 12:23:25 -0400 (EDT) From: eric@ericabrahamsen.net (Eric Abrahamsen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 16:24:16 -0000 branch: master commit 86e01365089891b2b65628b4ed9b21e570451de8 Author: Eric Abrahamsen Commit: Eric Abrahamsen [gnus-mock] Conditionally add nnimap server, bump to 0.2.0 =20 * packages/gnus-mock/gnus-mock.el (gnus-mock-dovecot-imap-program): New option, set to the path of the dovecot imap program to get an nnimap server. Bump version. * packages/gnus-mock/gnus-mock.el (gnus-mock-start): Check for useabl= e value of above option and add nnimap server and groups. * packages/gnus-mock/data/imapmail: New directory holding all the mai= l data for the nnimap server. --- .../1541087501.M709276P19819.slip,S=3D2997,W=3D3064:2, | 67 ++++++ .../1541087501.M716539P19819.slip,S=3D3538,W=3D3624:2, | 86 ++++++++ .../1541087501.M722048P19819.slip,S=3D4327,W=3D4419:2, | 92 ++++++++ .../1541087501.M724043P19819.slip,S=3D3659,W=3D3738:2, | 79 +++++++ .../1541087501.M725903P19819.slip,S=3D4886,W=3D4994:2, | 108 ++++++++++ .../1541087501.M727585P19819.slip,S=3D2858,W=3D2916:2, | 58 ++++++ .../1541087501.M729440P19819.slip,S=3D5108,W=3D5217:2, | 109 ++++++++++ .../1541087501.M731257P19819.slip,S=3D4305,W=3D4392:2, | 87 ++++++++ .../1541087501.M732982P19819.slip,S=3D4269,W=3D4353:2, | 84 ++++++++ .../1541087501.M734712P19819.slip,S=3D3014,W=3D3083:2, | 69 ++++++ .../1541087501.M736331P19819.slip,S=3D5431,W=3D5548:2, | 117 +++++++++++ .../1541087501.M738191P19819.slip,S=3D5797,W=3D5919:2, | 122 +++++++++++ .../1541087501.M739848P19819.slip,S=3D3808,W=3D3894:2, | 86 ++++++++ .../1541087501.M741650P19819.slip,S=3D4877,W=3D4981:2, | 104 +++++++++ .../1541087501.M743334P19819.slip,S=3D2695,W=3D2756:2, | 61 ++++++ .../1541087501.M745024P19819.slip,S=3D3988,W=3D4070:2, | 82 ++++++++ .../1541087501.M746564P19819.slip,S=3D2440,W=3D2493:2, | 53 +++++ .../1541087501.M748729P19819.slip,S=3D4636,W=3D4730:2, | 94 +++++++++ .../1541087501.M750954P19819.slip,S=3D6224,W=3D6379:2, | 155 +++++++++++= +++ .../1541087501.M752804P19819.slip,S=3D5700,W=3D5822:2, | 122 +++++++++++ .../imapmail/mail/.emacs-devel/dovecot-uidlist | 21 ++ .../imapmail/mail/.emacs-devel/dovecot.index.cache | Bin 0 -> 16392 byte= s .../data/imapmail/mail/.emacs-devel/maildirfolder | 0 .../1541087335.M224506P19819.slip,S=3D4578,W=3D4684:2, | 106 ++++++++++ .../1541087335.M232569P19819.slip,S=3D3789,W=3D3886:2, | 97 +++++++++ .../1541087335.M239374P19819.slip,S=3D3350,W=3D3432:2, | 82 ++++++++ .../1541087335.M245904P19819.slip,S=3D3275,W=3D3354:2, | 79 +++++++ .../1541087335.M252543P19819.slip,S=3D2246,W=3D2301:2, | 55 +++++ .../1541087335.M257361P19819.slip,S=3D2745,W=3D2810:2, | 65 ++++++ .../1541087335.M263297P19819.slip,S=3D5828,W=3D5969:2, | 141 +++++++++++= ++ .../1541087335.M267088P19819.slip,S=3D4259,W=3D4369:2, | 110 ++++++++++ .../1541087335.M270804P19819.slip,S=3D5031,W=3D5145:2, | 114 ++++++++++ .../1541087335.M273777P19819.slip,S=3D4162,W=3D4268:2, | 106 ++++++++++ .../1541087335.M276430P19819.slip,S=3D4417,W=3D4518:2, | 101 +++++++++ .../1541087335.M278921P19819.slip,S=3D9511,W=3D9743:2, | 232 +++++++++++= ++++++++++ .../1541087335.M281396P19819.slip,S=3D5658,W=3D5785:2, | 127 +++++++++++ .../1541087335.M283480P19819.slip,S=3D4006,W=3D4107:2, | 101 +++++++++ .../1541087335.M285367P19819.slip,S=3D3927,W=3D4027:2, | 100 +++++++++ .../1541087335.M287297P19819.slip,S=3D2226,W=3D2275:2, | 49 +++++ .../1541087335.M289193P19819.slip,S=3D4827,W=3D4912:2, | 85 ++++++++ .../1541087335.M291195P19819.slip,S=3D3629,W=3D3720:2, | 91 ++++++++ .../1541087335.M292770P19819.slip,S=3D1849,W=3D1894:2, | 45 ++++ .../1541087335.M294457P19819.slip,S=3D3562,W=3D3651:2, | 89 ++++++++ .../1541087335.M296156P19819.slip,S=3D3287,W=3D3369:2, | 82 ++++++++ .../1541087335.M297893P19819.slip,S=3D3226,W=3D3297:2, | 71 +++++++ .../1541087335.M299625P19819.slip,S=3D3977,W=3D4068:2, | 91 ++++++++ .../1541087335.M301512P19819.slip,S=3D3623,W=3D3709:2, | 86 ++++++++ .../1541087335.M303229P19819.slip,S=3D2525,W=3D2587:2, | 62 ++++++ .../1541087335.M305256P19819.slip,S=3D2232,W=3D2283:2, | 51 +++++ .../1541087335.M307038P19819.slip,S=3D3980,W=3D4062:2, | 82 ++++++++ .../1541087335.M308821P19819.slip,S=3D5152,W=3D5264:2, | 112 ++++++++++ .../1541087335.M310887P19819.slip,S=3D2337,W=3D2393:2, | 56 +++++ .../1541087335.M312715P19819.slip,S=3D3811,W=3D3900:2, | 89 ++++++++ .../1541087335.M314502P19819.slip,S=3D1894,W=3D1937:2, | 43 ++++ .../1541087335.M316209P19819.slip,S=3D2364,W=3D2419:2, | 55 +++++ .../gnus-mock/data/imapmail/mail/dovecot-uidlist | 33 +++ .../data/imapmail/mail/dovecot-uidvalidity | 1 + .../imapmail/mail/dovecot-uidvalidity.5bdb1f80 | 0 .../data/imapmail/mail/dovecot.index.cache | Bin 0 -> 18408 byte= s .../gnus-mock/data/imapmail/mail/subscriptions | 3 + packages/gnus-mock/gnus-mock.el | 56 ++++- 61 files changed, 4801 insertions(+), 3 deletions(-) diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M709276P19819.slip,S=3D2997,W=3D3064:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M709276P19819.slip,S=3D2997,W=3D= 3064:2, new file mode 100644 index 0000000..48d3268 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 709276P19819.slip,S=3D2997,W=3D3064:2, @@ -0,0 +1,67 @@ +From MAILER-DAEMON Thu Jun 29 16:53:15 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQgR9-000168-Bo + for mharc-emacs-devel@gnu.org; Thu, 29 Jun 2017 16:53:15 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:49168) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQgR7-00015z-IL + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:53:14 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQgR2-0002go-N9 + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:53:13 -0400 +Received: from [195.159.176.226] (port=3D41967 helo=3Dblaine.gmane.org) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dQgR2-0002fs-GR + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:53:08 -0400 +Received: from list by blaine.gmane.org with local (Exim 4.84_2) + (envelope-from ) id 1dQgQt-0005Rx-MC + for emacs-devel@gnu.org; Thu, 29 Jun 2017 22:52:59 +0200 +X-Injected-Via-Gmane: http://gmane.org/ +To: emacs-devel@gnu.org +From: Stefan Monnier +Subject: Re: [Emacs-diffs] master c75eb10: Don't change + byte-compile-delete-errors at runtime (Bug#27340) +Date: Thu, 29 Jun 2017 16:52:59 -0400 +Lines: 11 +Message-ID: +References: <20170624141528.514.4459@vcs0.savannah.gnu.org> + <20170624141530.443C5210EB@vcs0.savannah.gnu.org> + + + <87r2y28ule.fsf@gnu.org> +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@blaine.gmane.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) +Cancel-Lock: sha1:0ovUZbNlyU/S9RpSdcgnYnh9N94=3D +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [gener= ic] + [fuzzy] +X-Received-From: 195.159.176.226 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Jun 2017 20:53:14 -0000 + +> This is wrong. declaim has run-time effects, just like defvar etc. + +If you put (defvar foo) in foo.el, then compile it, then load foo.elc, +you'll see that this defvar has no runtime effect. + +I think cl-declaim should basically behave the same: it holds +compilation directives which should basically only influence the +compilation of the current file. + + + Stefan + + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M716539P19819.slip,S=3D3538,W=3D3624:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M716539P19819.slip,S=3D3538,W=3D= 3624:2, new file mode 100644 index 0000000..58b7ba1 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 716539P19819.slip,S=3D3538,W=3D3624:2, @@ -0,0 +1,86 @@ +From MAILER-DAEMON Fri Jun 30 02:06:51 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQp4t-0004eN-1F + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 02:06:51 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:42250) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQp4r-0004eH-BF + for emacs-devel@gnu.org; Fri, 30 Jun 2017 02:06:50 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQp4o-0007ps-6u + for emacs-devel@gnu.org; Fri, 30 Jun 2017 02:06:49 -0400 +Received: from [195.159.176.226] (port=3D57208 helo=3Dblaine.gmane.org) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dQp4o-0007nj-0g + for emacs-devel@gnu.org; Fri, 30 Jun 2017 02:06:46 -0400 +Received: from list by blaine.gmane.org with local (Exim 4.84_2) + (envelope-from ) id 1dQp4e-0002yX-O7 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 08:06:36 +0200 +X-Injected-Via-Gmane: http://gmane.org/ +To: emacs-devel@gnu.org +From: Stefan Monnier +Subject: Re: [Emacs-diffs] master c75eb10: Don't change + byte-compile-delete-errors at runtime (Bug#27340) +Date: Fri, 30 Jun 2017 02:06:33 -0400 +Lines: 27 +Message-ID: +References: <20170624141528.514.4459@vcs0.savannah.gnu.org> + <20170624141530.443C5210EB@vcs0.savannah.gnu.org> + + + <87r2y28ule.fsf@gnu.org> + + <871sq28sk0.fsf@gnu.org> + <87h8yy78bh.fsf@gnu.org> +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@blaine.gmane.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) +Cancel-Lock: sha1:bOxsaXqcjbFmAz54/kHcU7pSocA=3D +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [gener= ic] + [fuzzy] +X-Received-From: 195.159.176.226 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 06:06:50 -0000 + +> In CL declaim can be used to make variables special. (In fact, `specia= l' +> is the only declaration that must have an effect in all conforming CL +> implementations.) + +Right, AFAIK it's largely equivalent to Elisp's (defvar foo). + +not sure how it works in CL, but in Elisp, if a file foo.el has + + (defvar foo) + ... + +then `foo` will be treated as dynamically bound in foo.el when the +compiler generate the code for foo.elc. +But loading foo.elc, won't mark `foo` as dynamically bound, so in + + (require 'foo) + (defun bar (x) + (let ((foo x)) + (lambda (y) (+ foo y)))) + +the function `bar` should treat its `foo` binding lexically. + + + Stefan + + +PS: Note I'm really talking about (defvar foo) and not (defvar foo blabl= a) + + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M722048P19819.slip,S=3D4327,W=3D4419:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M722048P19819.slip,S=3D4327,W=3D= 4419:2, new file mode 100644 index 0000000..091ac48 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 722048P19819.slip,S=3D4327,W=3D4419:2, @@ -0,0 +1,92 @@ +From MAILER-DAEMON Thu Jun 29 18:12:02 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQhfO-0004v0-54 + for mharc-emacs-devel@gnu.org; Thu, 29 Jun 2017 18:12:02 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:40434) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQhfM-0004up-0C + for emacs-devel@gnu.org; Thu, 29 Jun 2017 18:12:00 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQhfH-0007z2-Vq + for emacs-devel@gnu.org; Thu, 29 Jun 2017 18:11:59 -0400 +Received: from manu26.manufrog.com ([98.142.98.2]:44390) + by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) + (Exim 4.71) (envelope-from ) id 1dQhfH-0007yJ-RI + for emacs-devel@gnu.org; Thu, 29 Jun 2017 18:11:55 -0400 +Received: from c-5306e555.04-211-6c6b701.cust.bredbandsbolaget.se + ([85.229.6.83]:54900 helo=3Dmuon.localdomain) + by manu26.manufrog.com with esmtpa (Exim 4.89) + (envelope-from ) + id 1dQhfA-0047HD-BM; Fri, 30 Jun 2017 00:11:48 +0200 +Received: by muon.localdomain (Postfix, from userid 1000) + id F3EA748420E; Fri, 30 Jun 2017 00:11:46 +0200 (CEST) +From: =3D?utf-8?Q?Johan_Bockg=3DC3=3DA5rd?=3D +To: Stefan Monnier +Cc: Noam Postavsky , Emacs developers +Subject: Re: [Emacs-diffs] master c75eb10: Don't change + byte-compile-delete-errors at runtime (Bug#27340) +References: <20170624141528.514.4459@vcs0.savannah.gnu.org> + <20170624141530.443C5210EB@vcs0.savannah.gnu.org> + + + <87r2y28ule.fsf@gnu.org> + + <871sq28sk0.fsf@gnu.org> +Date: Fri, 30 Jun 2017 00:11:46 +0200 +In-Reply-To: (Stefan Monnie= r's + message of "Thu, 29 Jun 2017 16:49:44 -0400") +Message-ID: <87h8yy78bh.fsf@gnu.org> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) +MIME-Version: 1.0 +Content-Type: text/plain +X-AntiAbuse: This header was added to track abuse, + please include it with any abuse report +X-AntiAbuse: Primary Hostname - manu26.manufrog.com +X-AntiAbuse: Original Domain - gnu.org +X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] +X-AntiAbuse: Sender Address Domain - gnu.org +X-Get-Message-Sender-Via: manu26.manufrog.com: authenticated_id: + noreply@tryserumgardar.se +X-Authenticated-Sender: manu26.manufrog.com: noreply@tryserumgardar.se +X-Source:=20 +X-Source-Args:=20 +X-Source-Dir:=20 +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [gener= ic] + [fuzzy] +X-Received-From: 98.142.98.2 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Jun 2017 22:12:01 -0000 + +Stefan Monnier writes: + +>> The Hyperspec says that: +>> +>> 1. [declaim should] make definitions available both in the compilatio= n +>> and run-time environments. +> +> Hmm... the uses of declaim that I'm familiar with are optimization +> settings for the compiler. These don't "make definitions available" +> AFAICT. If foo.el contains a declaim to set the optimization level, +> I don't see why it would make sense for this setting to affect all fil= es +> compiled after foo.elc was loaded (I can understand that the spec may +> allow such a suboptimal behavior, but not that it would require it). + +In CL declaim can be used to make variables special. (In fact, `special' +is the only declaration that must have an effect in all conforming CL +implementations.) + +Also see + +https://groups.google.com/forum/#!original/comp.lang.lisp/rO1Vru1fbvI/-3= FkSBvlE0gJ + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M724043P19819.slip,S=3D3659,W=3D3738:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M724043P19819.slip,S=3D3659,W=3D= 3738:2, new file mode 100644 index 0000000..38a0d86 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 724043P19819.slip,S=3D3659,W=3D3738:2, @@ -0,0 +1,79 @@ +From MAILER-DAEMON Thu Jun 29 16:49:56 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQgNw-0008Ub-PW + for mharc-emacs-devel@gnu.org; Thu, 29 Jun 2017 16:49:56 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:48061) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQgNu-0008Tu-2x + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:49:54 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQgNo-0000uz-HT + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:49:54 -0400 +Received: from pruche.dit.umontreal.ca ([132.204.246.22]:56128) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1dQgNo-0000uj-C4; Thu, 29 Jun 2017 16:49:48 -0400 +Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) + by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v5TKniJd000637= ; + Thu, 29 Jun 2017 16:49:45 -0400 +Received: by ceviche.home (Postfix, from userid 20848) + id BD3906627F; Thu, 29 Jun 2017 16:49:44 -0400 (EDT) +From: Stefan Monnier +To: Johan =3D?windows-1252?Q?Bockg=3DE5rd?=3D +Cc: Noam Postavsky , Emacs developers +Subject: Re: [Emacs-diffs] master c75eb10: Don't change + byte-compile-delete-errors at runtime (Bug#27340) +Message-ID: +References: <20170624141528.514.4459@vcs0.savannah.gnu.org> + <20170624141530.443C5210EB@vcs0.savannah.gnu.org> + + + <87r2y28ule.fsf@gnu.org> + + <871sq28sk0.fsf@gnu.org> +Date: Thu, 29 Jun 2017 16:49:44 -0400 +In-Reply-To: <871sq28sk0.fsf@gnu.org> ("Johan =3D?windows-1252?Q?Bockg=3D= E5rd?=3D + =3D?windows-1252?Q?=3D22's?=3D message of "Thu, 29 + Jun 2017 22:09:19 +0200") +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) +MIME-Version: 1.0 +Content-Type: text/plain +X-NAI-Spam-Flag: NO +X-NAI-Spam-Threshold: 5 +X-NAI-Spam-Score: 0 +X-NAI-Spam-Rules: 2 Rules triggered + EDT_SA_DN_PASS=3D0, RV6059=3D0 +X-NAI-Spam-Version: 2.3.0.9418 : core <6059> : inlines <5957> : streams + <1752065> : uri <2453206> +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 132.204.246.22 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Jun 2017 20:49:55 -0000 + +> The Hyperspec says that: +> +> 1. [declaim should] make definitions available both in the compilation +> and run-time environments. + +Hmm... the uses of declaim that I'm familiar with are optimization +settings for the compiler. These don't "make definitions available" +AFAICT. If foo.el contains a declaim to set the optimization level, +I don't see why it would make sense for this setting to affect all files +compiled after foo.elc was loaded (I can understand that the spec may +allow such a suboptimal behavior, but not that it would require it). + + + Stefan + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M725903P19819.slip,S=3D4886,W=3D4994:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M725903P19819.slip,S=3D4886,W=3D= 4994:2, new file mode 100644 index 0000000..cd42832 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 725903P19819.slip,S=3D4886,W=3D4994:2, @@ -0,0 +1,108 @@ +From MAILER-DAEMON Thu Jun 29 16:09:30 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQfko-0007hm-T3 + for mharc-emacs-devel@gnu.org; Thu, 29 Jun 2017 16:09:30 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:37966) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQfkn-0007hf-8Q + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:09:30 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQfkk-0000tX-Io + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:09:29 -0400 +Received: from manu26.manufrog.com ([98.142.98.2]:60910) + by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) + (Exim 4.71) (envelope-from ) id 1dQfkk-0000tF-D4 + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:09:26 -0400 +Received: from c-5306e555.04-211-6c6b701.cust.bredbandsbolaget.se + ([85.229.6.83]:53846 helo=3Dmuon.localdomain) + by manu26.manufrog.com with esmtpa (Exim 4.89) + (envelope-from ) + id 1dQfkf-003hqK-C6; Thu, 29 Jun 2017 22:09:21 +0200 +Received: by muon.localdomain (Postfix, from userid 1000) + id 8A93548420E; Thu, 29 Jun 2017 22:09:19 +0200 (CEST) +From: =3D?utf-8?Q?Johan_Bockg=3DC3=3DA5rd?=3D +To: Noam Postavsky +Cc: Stefan Monnier , + Emacs developers +Subject: Re: [Emacs-diffs] master c75eb10: Don't change + byte-compile-delete-errors at runtime (Bug#27340) +References: <20170624141528.514.4459@vcs0.savannah.gnu.org> + <20170624141530.443C5210EB@vcs0.savannah.gnu.org> + + + <87r2y28ule.fsf@gnu.org> + +Date: Thu, 29 Jun 2017 22:09:19 +0200 +In-Reply-To: + (Noam Postavsky's message of "Thu, 29 Jun 2017 15:46:46 -0400") +Message-ID: <871sq28sk0.fsf@gnu.org> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) +MIME-Version: 1.0 +Content-Type: text/plain; charset=3Dutf-8 +Content-Transfer-Encoding: quoted-printable +X-AntiAbuse: This header was added to track abuse, + please include it with any abuse report +X-AntiAbuse: Primary Hostname - manu26.manufrog.com +X-AntiAbuse: Original Domain - gnu.org +X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] +X-AntiAbuse: Sender Address Domain - gnu.org +X-Get-Message-Sender-Via: manu26.manufrog.com: authenticated_id: + noreply@tryserumgardar.se +X-Authenticated-Sender: manu26.manufrog.com: noreply@tryserumgardar.se +X-Source:=20 +X-Source-Args:=20 +X-Source-Dir:=20 +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [gener= ic] + [fuzzy] +X-Received-From: 98.142.98.2 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Jun 2017 20:09:30 -0000 + +Noam Postavsky writes: + +> On Thu, Jun 29, 2017 at 3:25 PM, Johan Bockg=3DC3=3DA5rd wr=3D +ote: +> +>> This is wrong. declaim has run-time effects, just like defvar etc. Th= e +>> compile-time side effect is that it ALSO affects the compilation of t= he +>> remainder of the current file. +>> +>> http://www.lispworks.com/documentation/HyperSpec/Body/03_bcaa.htm +> +> So you don't think this statement allows to omit run-time effects? +> +> It is not specified whether definitions made available in the +> compilation environment are available in the evaluation +> environment, nor is it specified whether they are available in +> subsequent compilation units or subsequent invocations of the +> compiler. + +No, evaluation environment !=3D3D run-time environment.(*) + +The Hyperspec says that: + +1. [declaim should] make definitions available both in the compilation + and run-time environments. +2. It is not specified whether definitions [...] + a) are available in the evaluation environment, + b) in subsequent compilation units or subsequent invocations of the + compiler. +3. compile-time side effects happen only [..] at top level. + + +(*) evaluation environment n. a [kind of] run-time environment in which + macro expanders and code specified by eval-when to be evaluated are + evaluated. All evaluations initiated by the compiler take place in + the evaluation environment. + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M727585P19819.slip,S=3D2858,W=3D2916:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M727585P19819.slip,S=3D2858,W=3D= 2916:2, new file mode 100644 index 0000000..ee5f7a6 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 727585P19819.slip,S=3D2858,W=3D2916:2, @@ -0,0 +1,58 @@ +From MAILER-DAEMON Fri Jun 30 02:00:40 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQoyu-000342-Ps + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 02:00:40 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:39484) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQoyr-00033t-My + for emacs-devel@gnu.org; Fri, 30 Jun 2017 02:00:38 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQoyl-0001rL-6U + for emacs-devel@gnu.org; Fri, 30 Jun 2017 02:00:34 -0400 +Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53271) + by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) + id 1dQoyl-0001rC-3R; Fri, 30 Jun 2017 02:00:31 -0400 +Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3971 + helo=3Dhome-c4e4a596f7) + by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) + (Exim 4.82) (envelope-from ) + id 1dQoyk-0002fs-5v; Fri, 30 Jun 2017 02:00:30 -0400 +Date: Fri, 30 Jun 2017 09:00:17 +0300 +Message-Id: <838tkaqaku.fsf@gnu.org> +From: Eli Zaretskii +To: Kaushal Modi +CC: emacs-devel@gnu.org +In-reply-to: + (message from Kaushal Modi on Thu, 29 Jun 2017 20:25:54 +0000) +Subject: Re: Native line numbers column disappears at times +Reply-to: Eli Zaretskii +References: <83tw35thxw.fsf@gnu.org> <87efu7lsj0.fsf@lylat> + <83r2y7sc9q.fsf@gnu.org> <87a84vl8gm.fsf@lylat> <8760fjl85k.fsf@lylat> + <83o9tassmh.fsf@gnu.org> <87wp7y4jvk.fsf@lylat> + <83bmp9se23.fsf@gnu.org> + +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [gener= ic] +X-Received-From: 2001:4830:134:3::e +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 06:00:38 -0000 + +> From: Kaushal Modi +> Date: Thu, 29 Jun 2017 20:25:54 +0000 +>=20 +> The line numbers column disappears at times. I have seen that to happe= n only when the emacs *frame* is +> not in focus. As soon as I click on that window, the line numbers re-a= ppear. I don't yet have a recipe to +> consistently recreate this. + +Thanks for letting me know. I do need a recipe to debug and fix this. + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M729440P19819.slip,S=3D5108,W=3D5217:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M729440P19819.slip,S=3D5108,W=3D= 5217:2, new file mode 100644 index 0000000..6195f92 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 729440P19819.slip,S=3D5108,W=3D5217:2, @@ -0,0 +1,109 @@ +From MAILER-DAEMON Thu Jun 29 16:26:13 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQg0z-0005m6-Ge + for mharc-emacs-devel@gnu.org; Thu, 29 Jun 2017 16:26:13 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:41991) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQg0x-0005lx-Cx + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:26:12 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQg0w-0007N9-Hw + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:26:11 -0400 +Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:36322= ) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dQg0v-0007Ig-1B; Thu, 29 Jun 2017 16:26:09 -0400 +Received: by mail-lf0-x230.google.com with SMTP id h22so59291728lfk.3; + Thu, 29 Jun 2017 13:26:07 -0700 (PDT) +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3Dgmail.co= m; s=3D20161025; + h=3Dmime-version:references:in-reply-to:from:date:message-id:subject:to= ;=20 + bh=3DyHyut9o5E9L2ecBMn2EZMioy/LmZ6uI34QpgScmeMLQ=3D; + b=3DnvOHWOiPfpnMML3MWrR7JnW29Rc4nrhS5R5yUWLWFAIk8GIJvNxuxhxGIwEMpf6hVM + VTwQaCLA+JMdK43B6B+YmwZh2gKegmEhuSfYdAs3QSnQXLuCAg2ds6cnh4oFSD/4sfTm + 9K4Vylb7Xvt9/WwLqL9c4TyMH/VaovARy9GixftGYafBceZ6f06ye0tcvPB6bVXg0CIs + w+1coJBkj9pJuSD44ghFzz8qKryqnlcDAAF+0g/u2H7dXvVZZ6Pd+nUTfh6Pv0oyCj0A + e4l1oXQ+fLYGHsUO3TRsXItVTTqIFtI1fIsGOLEW0zwVoKSKhW+wQohO5IkT4/keR7bA + 2fwA=3D=3D +X-Google-DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; + d=3D1e100.net; s=3D20161025; + h=3Dx-gm-message-state:mime-version:references:in-reply-to:from:date + :message-id:subject:to; + bh=3DyHyut9o5E9L2ecBMn2EZMioy/LmZ6uI34QpgScmeMLQ=3D; + b=3Dcn7wR196vlxjndEjuxLygRZ7y+9DqDmUDTmoGilVeyxzkR2hDE6DcIM487PfS5uNB6 + 416cVK8kI+khl4R4IepZR2kLu9xCvzs406FjZUt1VpuyQt9ZZBaXiLpgkxRcjN1htwXq + xI6uy4MCgNKo/JFo6cIUj/HfDvFj2V/NZG5jWBgwv3AFV8jaakyGNm2OLUmx9CYRmbAB + d45rZE2CpAE8kkNoHk9SHK6KKzYX2M7B7+C+5Ok/PEgaQ0RbrqTQV0UAE7BQJI2WUizX + vpNQs5ylvcJ/URi7VfH40psGy35ZGMaCPK5fgHlWeEnbZOKrdJa0HSvSb7zhJF+JWXXI + GIKQ=3D=3D +X-Gm-Message-State: AKS2vOxDmdO4ZFnQAfF7DMZcyxsSg17LS+RzFQcV3OpJR2V1lkcx= o0Vd + M5HWdinnBG0LU+3LMef9UugsHdlCpA=3D=3D +X-Received: by 10.46.75.9 with SMTP id y9mr5376298lja.60.1498767965938; = Thu, + 29 Jun 2017 13:26:05 -0700 (PDT) +MIME-Version: 1.0 +References: <83tw35thxw.fsf@gnu.org> <87efu7lsj0.fsf@lylat> + <83r2y7sc9q.fsf@gnu.org> <87a84vl8gm.fsf@lylat> <8760fjl85k.fsf@lylat> + <83o9tassmh.fsf@gnu.org> <87wp7y4jvk.fsf@lylat> + <83bmp9se23.fsf@gnu.org> +In-Reply-To: <83bmp9se23.fsf@gnu.org> +From: Kaushal Modi +Date: Thu, 29 Jun 2017 20:25:54 +0000 +Message-ID: +Subject: Native line numbers column disappears at times +To: Eli Zaretskii , emacs-devel@gnu.org +Content-Type: multipart/alternative; boundary=3D"f403045e9d1c35ed8505531= f1cc0" +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 2a00:1450:4010:c07::230 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Jun 2017 20:26:12 -0000 + +--f403045e9d1c35ed8505531f1cc0 +Content-Type: text/plain; charset=3D"UTF-8" + +Hi Eli, + +I have been testing out the line numbers branch for past few days. I see= a +tremendous improvement over the first cut (and thank you for adding the +current line number highlight feature). + +I have just 1 remark: + +The line numbers column disappears at times. I have seen that to happen +only when the emacs *frame* is not in focus. As soon as I click on that +window, the line numbers re-appear. I don't yet have a recipe to +consistently recreate this. + +Thanks. +--=20 + +Kaushal Modi + +--f403045e9d1c35ed8505531f1cc0 +Content-Type: text/html; charset=3D"UTF-8" +Content-Transfer-Encoding: quoted-printable + +
Hi Eli,

I have been testing out th= e lin=3D +e numbers branch for past few days. I see a tremendous improvement over = the=3D + first cut (and thank you for adding the current line number highlight f= eat=3D +ure).

I have just 1 remark:

The line numbers column disappears at times. I have seen that to happ= en =3D +only when the emacs *frame* is not in focus. As soon as I click on that = win=3D +dow, the line numbers re-appear. I don't yet have a recipe to consis= ten=3D +tly recreate this.

Thanks.
--

Ka=3D +ushal Modi

+
+ +--f403045e9d1c35ed8505531f1cc0-- + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M731257P19819.slip,S=3D4305,W=3D4392:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M731257P19819.slip,S=3D4305,W=3D= 4392:2, new file mode 100644 index 0000000..7c6aa31 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 731257P19819.slip,S=3D4305,W=3D4392:2, @@ -0,0 +1,87 @@ +From MAILER-DAEMON Thu Jun 29 22:10:31 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQlOA-0007W9-UC + for mharc-emacs-devel@gnu.org; Thu, 29 Jun 2017 22:10:30 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:49844) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQlO8-0007Vz-FZ + for emacs-devel@gnu.org; Thu, 29 Jun 2017 22:10:29 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQlO4-00024y-Fz + for emacs-devel@gnu.org; Thu, 29 Jun 2017 22:10:28 -0400 +Received: from mail-qt0-x232.google.com ([2607:f8b0:400d:c0d::232]:33943= ) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) id 1dQlO4-00023l-8f + for emacs-devel@gnu.org; Thu, 29 Jun 2017 22:10:24 -0400 +Received: by mail-qt0-x232.google.com with SMTP id 32so88960776qtv.1 + for ; Thu, 29 Jun 2017 19:10:22 -0700 (PDT) +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; + d=3Dudel-edu.20150623.gappssmtp.com; s=3D20150623; + h=3Ddate:from:to:cc:subject:message-id:mime-version:content-disposition + :user-agent; bh=3Dl7QWNktVtxMHBwTXGGbaWXc2STPluebFC/lgHZd/R1k=3D; + b=3Dib6k8bkJ2itn0n8aAQNH05vOhWQtbtclFMRPfyCBLT/hX47vhr7becwpw+xUnOSnfb + lGDJzUKOewW3KgolLQb7snAZCB8glipRo/9nKCWqUg8y8/f0nejNgwm5aB+/6uoyBGZL + xZsxfO+Xi7zzKuhl4LYJgRlqFpUwnXq08FirYFErb/9iuO2vyrqpxlaXU39f2l6Q5cq3 + g74kwfczCKdPHoL5fV5JQ16PPC5R5dVvp8KRD9zPzP59KMoTy1Xw8rYxiGDQxbKBQtMK + iELJcZevE17hLZjzk4a1V7prod9jUnlc4Og5Ric0KTnYqIb9X7HZCWlS4vEKkvUyGmoq + 8wDg=3D=3D +X-Google-DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; + d=3D1e100.net; s=3D20161025; + h=3Dx-gm-message-state:date:from:to:cc:subject:message-id:mime-version + :content-disposition:user-agent; + bh=3Dl7QWNktVtxMHBwTXGGbaWXc2STPluebFC/lgHZd/R1k=3D; + b=3DjLZ0G0aUEytwpNm8+qt3pGtEhK2EmGUpsNbGeOZ0YrbZDC/TKOYTLSydQQZF7O6gDT + Jy5bBTG4I5bljBiPRxqoevkgyxfeIpS/9bFISQyGp/Qr6Zgel2W4tQafyq0po0sLnUHu + l+5psSZFeXPsqBME36lQPhHhKCrw8I8M1WeSf13CyDjTGYYVqYY4Gnv/+M+0z14LVZfL + lsETeKADlCHkv/hWUnIom2zxIlWLoVnseIvuwrTNcicQIS8f3Dg4ynVbEc64HqqLpiVi + 2J/pGA2iApD1h6Tpf3SI9g9e+rWgJatwPLUJ336SMclE9w6KZco4bKC9y2hrb5OmelXh + w5UQ=3D=3D +X-Gm-Message-State: AKS2vOzYQBy4Ci9fjcAjOC+rUYrWjPdC1iR8f3/uZjF4TCeFRC/J= D2+c + A7fymfZfBmRdDAzY9haG6Q=3D=3D +X-Received: by 10.237.51.34 with SMTP id u31mr6755959qtd.188.14987886217= 55; + Thu, 29 Jun 2017 19:10:21 -0700 (PDT) +Received: from holos.localdomain (pool-173-64-125-158.bltmmd.fios.verizo= n.net. + [173.64.125.158]) by smtp.gmail.com with ESMTPSA id + m49sm5828311qtf.32.2017.06.29.19.10.20 + (version=3DTLS1_2 cipher=3DECDHE-RSA-CHACHA20-POLY1305 bits=3D256/256); + Thu, 29 Jun 2017 19:10:21 -0700 (PDT) +Received: by holos.localdomain (Postfix, from userid 1000) + id 3C2E168E78; Thu, 29 Jun 2017 22:10:20 -0400 (EDT) +Date: Thu, 29 Jun 2017 22:10:20 -0400 +From: Mark Oteiza +To: emacs-devel@gnu.org +Cc: Stefan Monnier +Subject: On cl-print and help-fns +Message-ID: <20170630021020.GA27460@holos.localdomain> +MIME-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +Content-Disposition: inline +User-Agent: Mutt/1.8.3 (2017-05-23) +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 2607:f8b0:400d:c0d::232 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 02:10:29 -0000 + +Hi, + +While cl-print is a nice feature, I am puzzled why its use in the help +buffer is neither documented nor configurable. + +https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3D2c18969c8 + +I think that "Its value is #f(compiled-function () #)", while +less messy, is less useful than just seeing the bytecode, as the bytecod= e +would at least give me a clue. The cl-prin1-to-string output is opaque. + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M732982P19819.slip,S=3D4269,W=3D4353:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M732982P19819.slip,S=3D4269,W=3D= 4353:2, new file mode 100644 index 0000000..993dc00 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 732982P19819.slip,S=3D4269,W=3D4353:2, @@ -0,0 +1,84 @@ +From MAILER-DAEMON Fri Jun 30 23:29:21 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dR961-0006kc-KM + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 23:29:21 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:53848) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dR95z-0006kG-T0 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 23:29:20 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dR95z-0004fX-0C + for emacs-devel@gnu.org; Fri, 30 Jun 2017 23:29:19 -0400 +Received: from mail-oi0-x236.google.com ([2607:f8b0:4003:c06::236]:35387= ) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) id 1dR95y-0004cm-Q3 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 23:29:18 -0400 +Received: by mail-oi0-x236.google.com with SMTP id 191so24266970oii.2 + for ; Fri, 30 Jun 2017 20:29:17 -0700 (PDT) +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3Dgmail.co= m; s=3D20161025; + h=3Dmime-version:sender:in-reply-to:references:from:date:message-id + :subject:to:cc; + bh=3DikBio9oaMuuwp+/AD7QME3AK5sANbMv7Wo/pssAZr5M=3D; + b=3DFRlD/iKqUW9tJTzInLGirW6rJh/rD6x8r7+NsMg6LrecE188sXyq21m6K5ExSOP3tJ + +ZZOBS+4KadFhEQl56IV9HL6qTlfpLZ925b8Qz4zHWkqG8R5zzle3kGTV5940x14Z4xy + 7awEw7UAD3EQ+PENfu27rjfSluNei2BtDoTWPcO8Fqkw90UOvQ/TWFTfvcH15pj+Uj2Y + /DfesfjNcJc8W5urFAuhjF+h56bYPBbwnKqlxmiRdb17nlxyhqFNX3FiL7SCvtXhKs1o + /BplHQgOECN+5Z/3/IN+OILQ6PJ39rYTyZNcBqf2kf2YLtISUuxTc1MzxCsmIdZlVA3Z + rS3Q=3D=3D +X-Google-DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; + d=3D1e100.net; s=3D20161025; + h=3Dx-gm-message-state:mime-version:sender:in-reply-to:references:from + :date:message-id:subject:to:cc; + bh=3DikBio9oaMuuwp+/AD7QME3AK5sANbMv7Wo/pssAZr5M=3D; + b=3DigW3FX+0Q8Mv6QVMuGi1QVXmgqM9VVHAtt8h+6B0s9YfWK7CApBxVhKpR0sLFfz1VD + KRbvfXfyC/sGPdu6+ZiAtYsXLB8DsstK2N5yJ+mbPhnRYv+wJqJAmvRqiM90zVpzslB9 + bTCBlBUm2NGD8n5iLgNyEDkq3MYCpJfCPOLRyM3gmG6BN3pSG39qbC1sfcWEbPnyo/F4 + GvWHeu1oaNFYsLGeFWtTkh9ecr+ciUu8xZPdffDdmnT4bmt0qgKjaTBCiUvSFDC1ITVs + 8JPNi/Z9u0uZis3kNViLy/kdtbdMwTTO7qrnGKTgZe8vLaTt+HLWPkiI5mU1HtdNzQwQ + mYyg=3D=3D +X-Gm-Message-State: AKS2vOz0PWwAZTFA4nRC8RT5Pp0RYWAMDjQdNKbu0x0gYYOLkoA5= 2W7P + WlH8Vso9VlGPADcjsKv/yBGI3VfJtA=3D=3D +X-Received: by 10.202.80.66 with SMTP id e63mr15834272oib.152.1498879756= 463; + Fri, 30 Jun 2017 20:29:16 -0700 (PDT) +MIME-Version: 1.0 +Sender: npostavs@gmail.com +Received: by 10.74.113.91 with HTTP; Fri, 30 Jun 2017 20:29:15 -0700 (PD= T) +In-Reply-To: +References: <20170630021020.GA27460@holos.localdomain> + +From: Noam Postavsky +Date: Fri, 30 Jun 2017 23:29:15 -0400 +X-Google-Sender-Auth: la9ZlhZlQxgTWU1jP8H-IreiuS0 +Message-ID: +Subject: Re: On cl-print and help-fns +To: Stefan Monnier +Cc: Emacs developers +Content-Type: text/plain; charset=3D"UTF-8" +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 2607:f8b0:4003:c06::236 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 01 Jul 2017 03:29:20 -0000 + +On Fri, Jun 30, 2017 at 2:11 AM, Stefan Monnier + wrote: +> PS: Oh, and IIUC in the latest version of the code, you might be +> able to click on the # to see a disassembly of the code. + +You can now. + +[1: 23ff664fd2]: 2017-06-30 23:30:07 -0400 + * lisp/help-fns.el (describe-variable): Let-bind cl-print-compiled-but= ton. + http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3D23ff664fd24dbd= d8cc5b9d1fb68423fe6592b0a0 + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M734712P19819.slip,S=3D3014,W=3D3083:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M734712P19819.slip,S=3D3014,W=3D= 3083:2, new file mode 100644 index 0000000..beece5a --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 734712P19819.slip,S=3D3014,W=3D3083:2, @@ -0,0 +1,69 @@ +From MAILER-DAEMON Fri Jun 30 02:12:13 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQpA5-0007Sj-P9 + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 02:12:13 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:44035) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQpA3-0007RT-HU + for emacs-devel@gnu.org; Fri, 30 Jun 2017 02:12:12 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQpA0-0002xQ-C7 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 02:12:11 -0400 +Received: from [195.159.176.226] (port=3D38916 helo=3Dblaine.gmane.org) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dQpA0-0002wT-5R + for emacs-devel@gnu.org; Fri, 30 Jun 2017 02:12:08 -0400 +Received: from list by blaine.gmane.org with local (Exim 4.84_2) + (envelope-from ) id 1dQp9o-0001fX-WE + for emacs-devel@gnu.org; Fri, 30 Jun 2017 08:11:56 +0200 +X-Injected-Via-Gmane: http://gmane.org/ +To: emacs-devel@gnu.org +From: Stefan Monnier +Subject: Re: On cl-print and help-fns +Date: Fri, 30 Jun 2017 02:11:55 -0400 +Lines: 18 +Message-ID: +References: <20170630021020.GA27460@holos.localdomain> +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@blaine.gmane.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) +Cancel-Lock: sha1:P4Nr8O4NQ6m+4vcm/KnFCn3hJmI=3D +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [gener= ic] + [fuzzy] +X-Received-From: 195.159.176.226 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 06:12:12 -0000 + +> While cl-print is a nice feature, I am puzzled why its use in the help +> buffer is neither documented nor configurable. + +> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3D2c18969c8 + +> I think that "Its value is #f(compiled-function () #)", whil= e +> less messy, is less useful than just seeing the bytecode, as the bytec= ode +> would at least give me a clue. The cl-prin1-to-string output is opaqu= e. + +Maybe we should default cl-print-compiled to `static`, so as to hide the +byte-code, but still show the constants used in the code? + + + Stefan + + +PS: Oh, and IIUC in the latest version of the code, you might be +able to click on the # to see a disassembly of the code. + + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M736331P19819.slip,S=3D5431,W=3D5548:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M736331P19819.slip,S=3D5431,W=3D= 5548:2, new file mode 100644 index 0000000..be92827 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 736331P19819.slip,S=3D5431,W=3D5548:2, @@ -0,0 +1,117 @@ +From MAILER-DAEMON Fri Jun 30 22:00:00 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dR7hY-0006P2-Ij + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 22:00:00 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:42572) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dR7hV-0006OW-Sr + for emacs-devel@gnu.org; Fri, 30 Jun 2017 21:59:58 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dR7hV-00033M-5b + for emacs-devel@gnu.org; Fri, 30 Jun 2017 21:59:57 -0400 +Received: from mail-oi0-x22e.google.com ([2607:f8b0:4003:c06::22e]:36387= ) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dR7hT-00031N-N1; Fri, 30 Jun 2017 21:59:55 -0400 +Received: by mail-oi0-x22e.google.com with SMTP id p187so105029000oif.3; + Fri, 30 Jun 2017 18:59:54 -0700 (PDT) +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3Dgmail.co= m; s=3D20161025; + h=3Dmime-version:in-reply-to:references:from:date:message-id:subject:to + :cc; bh=3DXXWcGLYcxybY6br5Ell0WiPd6Odvr59+4xgQoEVfcbg=3D; + b=3Dok9IIXi+YcBX0J2XtCdPFMT8f7N4Fa3XfUGARwTvoP0aCLIAfdAJTZyOhjdD33VVeC + zSXiRYjYJMvu+P3siRX9CIq9YB5+6CUFpHbNJ4f9QKlIBhyHjoqCaIfooUcltZ+lLKTW + wbmHkzYTYm4BA//dmNr56GmRJrsXJCM5s91nTjGwwX5ehWYZj/BLzIMyS8oIKMb+1s3E + WPy/A45fHeh8/0lrQzww6PWtlos/DT7YJFEnKpG5NaRgI8Wn8SaPDak+4OPAdlGxPuvN + YvonLs8siGD+mja4SMuvymTAOln0xrVrALZXm3WLr11IJzuPf/9FM1aV5wB6p8mLtkTB + R1vg=3D=3D +X-Google-DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; + d=3D1e100.net; s=3D20161025; + h=3Dx-gm-message-state:mime-version:in-reply-to:references:from:date + :message-id:subject:to:cc; + bh=3DXXWcGLYcxybY6br5Ell0WiPd6Odvr59+4xgQoEVfcbg=3D; + b=3DA7yU3v1Jxc7YcLcpWZKd0cYE3ZCJsC99/OrX237MXjzYERjrjDsQnBE0aYXVWgQ89V + seF7XDRQfFuRo/rV49Nz4267akVyhnmea9UIfKhc594q0r60wWY65sQFdUZXTHnomugL + oVWt9MSqTRzpU9HzUPiioQRwP1ZTXlLSUuMkyAn6n1+HXGMQXYwP5prIfypiRXq8kvCA + RTCn4nniIriTa5QNPxX+krSzVaQM7jQf/VfKK39bP93WZb6F242VLeTNTuIkGRBEwA/m + 3g2817jjqkMPt8AePCoEAkw268sdmDBr+0BQ53vYg10mdJW6Acfw373ctJR0NP2RjV/3 + hzog=3D=3D +X-Gm-Message-State: AKS2vOzySCPhSUhL420rZQWHI2dUccRKsPLwuZTrNx9+UfazaGiR= xkiF + ZllCUciG2wT61+aZizUDGeHkPoED5g=3D=3D +X-Received: by 10.202.224.70 with SMTP id x67mr12914085oig.75.1498874392= 922; + Fri, 30 Jun 2017 18:59:52 -0700 (PDT) +MIME-Version: 1.0 +Received: by 10.182.2.73 with HTTP; Fri, 30 Jun 2017 18:59:52 -0700 (PDT= ) +In-Reply-To: <83y3s9pm2a.fsf@gnu.org> +References: <83y3s9pm2a.fsf@gnu.org> +From: Filipe Silva +Date: Fri, 30 Jun 2017 22:59:52 -0300 +Message-ID: +Subject: Re: Native line numbers, final testing +To: Eli Zaretskii +Cc: Emacs developers +Content-Type: multipart/alternative; boundary=3D"001a113d38a0c0d05c05533= 7e354" +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 2607:f8b0:4003:c06::22e +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 01 Jul 2017 01:59:58 -0000 + +--001a113d38a0c0d05c055337e354 +Content-Type: text/plain; charset=3D"UTF-8" + +Awesome Eli! I should be able to perform testing tomorrow + +On Fri, Jun 30, 2017 at 11:49 AM, Eli Zaretskii wrote: + +> I've finished development of this feature and pushed the changes to +> the scratch/line-numbers branch. "Visual" line numbers are +> implemented, and all the known bugs should be fixed. I also added +> documentation. +> +> Please test and report any problems you find. If no grave bugs show +> up, I will probably land this on master in a few days. +> +> Thanks to everybody who sent feedback and reported problems and +> feature requests. +> +> + +--001a113d38a0c0d05c055337e354 +Content-Type: text/html; charset=3D"UTF-8" +Content-Transfer-Encoding: quoted-printable + +
Awesome Eli! I should be able to perform testing tomorrow=

O= n Fri, =3D +Jun 30, 2017 at 11:49 AM, Eli Zaretskii <eliz@gnu.org> wrote= :
=3D +
I've finished development of this fea= tur=3D +e and pushed the changes to
+the scratch/line-numbers branch.=3DC2=3DA0 "Visual" line numbe= rs are<=3D +br> +implemented, and all the known bugs should be fixed.=3DC2=3DA0 I also ad= ded
+documentation.
+
+Please test and report any problems you find.=3DC2=3DA0 If no grave bugs= show +up, I will probably land this on master in a few days.
+
+Thanks to everybody who sent feedback and reported problems and
+feature requests.
+
+

+ +--001a113d38a0c0d05c055337e354-- + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M738191P19819.slip,S=3D5797,W=3D5919:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M738191P19819.slip,S=3D5797,W=3D= 5919:2, new file mode 100644 index 0000000..3deb762 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 738191P19819.slip,S=3D5797,W=3D5919:2, @@ -0,0 +1,122 @@ +From MAILER-DAEMON Fri Jun 30 17:15:11 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dR3Fv-0003mj-AS + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 17:15:11 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:45403) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dR3Ft-0003jJ-AI + for emacs-devel@gnu.org; Fri, 30 Jun 2017 17:15:10 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dR3Fp-0006ei-9F + for emacs-devel@gnu.org; Fri, 30 Jun 2017 17:15:09 -0400 +Received: from mail-it0-x22b.google.com ([2607:f8b0:4001:c0b::22b]:37977= ) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dR3Fp-0006eF-4b; Fri, 30 Jun 2017 17:15:05 -0400 +Received: by mail-it0-x22b.google.com with SMTP id k192so31170720ith.1; + Fri, 30 Jun 2017 14:15:05 -0700 (PDT) +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3Dgmail.co= m; s=3D20161025; + h=3Dfrom:to:cc:subject:references:date:in-reply-to:message-id + :user-agent:mime-version:content-transfer-encoding; + bh=3DbBRmn2SJ2JRgrOfe+XSWhS2CvnOvM94JJoRyj/N78Bs=3D; + b=3DaQAkPtpZUteyrT0fZDEweFU3e9xhERltNc2qjQK0dOiVKVmxQ/ETTt5VFZ3IAZ19Lv + sbiwrao0wQfUpnERrUHe2UEeF6XHsZX9jZDXwMPdnGfEGSxAwH9wjyjQNlOpt0WotVoc + L3Iu6x7+qtKZ6P/YSEH1XMVM87IX1ZqYQIiNT9n24EnO0xBiaCdzmN4P3Paej5cg/LPM + TS/qPg30v36jfQmCGlt5uoEOuMuOa3l7yfJIJuhxOrGMCNUJgSAc7TB5bYws/1sZo6fn + qhGHTxPfDWf94SmCD1coZ0Yvq2G7uVRHdm4wxrJL1HV0CBfBSLa3WXFqw0HadiEAjZFm + sBLw=3D=3D +X-Google-DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; + d=3D1e100.net; s=3D20161025; + h=3Dx-gm-message-state:from:to:cc:subject:references:date:in-reply-to + :message-id:user-agent:mime-version:content-transfer-encoding; + bh=3DbBRmn2SJ2JRgrOfe+XSWhS2CvnOvM94JJoRyj/N78Bs=3D; + b=3DWuaU2JQptxFXf98eDtZf+gkxHqrg7ezEXBoqKH4iGFYaUiksRc2l03Ww0x/Y28l+mX + dXOkK6kjch4qQ2OGn5WwA4TQJNre54cUr6wATRPWz+MgSOld6A8gF6uVptUDeSoP0fXN + m4tJD7ilt6NpnmRTy7DOUuyAMQ6LsKnXMV3kf88g6zFGqTrwXoWMVBehlrPdW2XKdhMo + acaco2egkbeoIDZ6aWDZeqnrFEDeYOHtsNk6/EsZfy7JvBIsr6LuPhYaPY3qa3IT0zUX + kTk5GUx3bKcmw8lHexpWqpJ/FDaoTaDYDOglcoGvqTxMYz1lBPydkXmRqrq81QfmJYem + UMaw=3D=3D +X-Gm-Message-State: AKS2vOzpguHERylqQz6qSMCYtUCq9/jCtiPN5H16YQE2MKxE7d6C= MUFD + XZYPTLLh7fIRicSn +X-Received: by 10.36.204.215 with SMTP id x206mr9678915itf.81.1498857303= 384; + Fri, 30 Jun 2017 14:15:03 -0700 (PDT) +Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) + by smtp.gmail.com with ESMTPSA id 66sm2559890itj.1.2017.06.30.14.15.01 + (version=3DTLS1_2 cipher=3DECDHE-RSA-CHACHA20-POLY1305 bits=3D256/256); + Fri, 30 Jun 2017 14:15:02 -0700 (PDT) +From: Alex +To: Eli Zaretskii +Cc: emacs-devel@gnu.org +Subject: Re: Native line numbers, final testing +References: <83y3s9pm2a.fsf@gnu.org> <87vandz7lw.fsf@lylat> + <83wp7tpcav.fsf@gnu.org> <87r2y1z45o.fsf@lylat> + <83vandp7wz.fsf@gnu.org> +Date: Fri, 30 Jun 2017 15:15:00 -0600 +In-Reply-To: <83vandp7wz.fsf@gnu.org> (Eli Zaretskii's message of "Fri, = 30 Jun + 2017 22:55:24 +0300") +Message-ID: <87mv8pyy7f.fsf@lylat> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) +MIME-Version: 1.0 +Content-Type: text/plain; charset=3Dutf-8 +Content-Transfer-Encoding: quoted-printable +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 2607:f8b0:4001:c0b::22b +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 21:15:10 -0000 + +Eli Zaretskii writes: + +>> From: Alex +>> Cc: emacs-devel@gnu.org +>> Date: Fri, 30 Jun 2017 13:06:27 -0600 +>> +>> I forgot that just before testing relative line numbers, I set +>> `display-line-number-width' to a non-nil value. For immediate results= , +>> try setting it to 0 and hit C-n/C-p a few times. +> +> Ah, okay. Thanks, should be fixed now. + +Thanks, it appears to be fixed. + +I noticed another bug. With `display-line-numbers' set to t or 'relative +in xdisp.c: + +M-g c 2970 RET +C-n + +Notice that C-n moved back one column. This does not happen with +'visual, nor does it happen when the window is sufficiently small. This +is in emacs -Q, and only happens with non-nil line-move-visual. + +>> P.S. I noticed that with display-line-numbers set to 'visual, goto-li= ne +>> is much slower compared to 'relative. Is this expected? +> +> Yes. The initial na=3DC3=3DAFve implementation was unbearably slow, b= ut I was +> lucky to find a shortcut. It is still sometimes slow, and a few +> redisplay optimizations are disabled with this mode, because moving +> point vertically needs to redisplay the entire window, since the line +> numbers change. If someone has ideas for speeding it up, I'm all +> ears. + +I'm not planning to use 'visual, and I of course don't claim to know +anything about this, but I'm curious as to why it works like this. +goto-line in either style always goes to the same absolute line number, +right? Does the line number display calculation occur after the point is +already moved to this line? If so, then doesn't the display engine just +need to calculate the visual line numbers around this point? If so, then +why does a large jump like M-g g 25000 take so much longer comparatively +than M-g g 1000? If these assumptions are wrong (they likely are), why +are they wrong? + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M739848P19819.slip,S=3D3808,W=3D3894:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M739848P19819.slip,S=3D3808,W=3D= 3894:2, new file mode 100644 index 0000000..00841b5 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 739848P19819.slip,S=3D3808,W=3D3894:2, @@ -0,0 +1,86 @@ +From MAILER-DAEMON Fri Jun 30 15:55:42 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dR210-0004Tt-KF + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 15:55:42 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:39706) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dR20y-0004TS-NI + for emacs-devel@gnu.org; Fri, 30 Jun 2017 15:55:41 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dR20v-0003NA-Ij + for emacs-devel@gnu.org; Fri, 30 Jun 2017 15:55:40 -0400 +Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46026) + by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) + id 1dR20v-0003N5-FC; Fri, 30 Jun 2017 15:55:37 -0400 +Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1706 + helo=3Dhome-c4e4a596f7) + by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) + (Exim 4.82) (envelope-from ) + id 1dR20u-00059G-Oz; Fri, 30 Jun 2017 15:55:37 -0400 +Date: Fri, 30 Jun 2017 22:55:24 +0300 +Message-Id: <83vandp7wz.fsf@gnu.org> +From: Eli Zaretskii +To: Alex +CC: emacs-devel@gnu.org +In-reply-to: <87r2y1z45o.fsf@lylat> (message from Alex on Fri, 30 Jun 20= 17 + 13:06:27 -0600) +Subject: Re: Native line numbers, final testing +Reply-to: Eli Zaretskii +References: <83y3s9pm2a.fsf@gnu.org> <87vandz7lw.fsf@lylat> + <83wp7tpcav.fsf@gnu.org> <87r2y1z45o.fsf@lylat> +MIME-version: 1.0 +Content-type: text/plain; charset=3Diso-8859-1 +Content-Transfer-Encoding: 8bit +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [gener= ic] +X-Received-From: 2001:4830:134:3::e +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 19:55:41 -0000 + +> From: Alex +> Cc: emacs-devel@gnu.org +> Date: Fri, 30 Jun 2017 13:06:27 -0600 +>=20 +> >> If the current line number is at least 4 digits long, then the text= in +> >> the current line is shifted over. +> > +> > Thanks, but I don't understand what you mean, and I tried one file +> > with 5-digit line number and didn't see what I think you described. +> > +> > Can you show a screenshot? Are you using some special font where th= is +> > happens? +>=20 +> I forgot that just before testing relative line numbers, I set +> `display-line-number-width' to a non-nil value. For immediate results, +> try setting it to 0 and hit C-n/C-p a few times. + +Ah, okay. Thanks, should be fixed now. + +(Btw zero is not valid as the value of display-line-number-width, +although the code before the last changes mistakenly tried using it. +Starting from now, zero and any other non-positive value are +interpreted as nil.) + +> P.S. I noticed that with display-line-numbers set to 'visual, goto-lin= e +> is much slower compared to 'relative. Is this expected? + +Yes. The initial na=EF=BF=BDve implementation was unbearably slow, but = I was +lucky to find a shortcut. It is still sometimes slow, and a few +redisplay optimizations are disabled with this mode, because moving +point vertically needs to redisplay the entire window, since the line +numbers change. If someone has ideas for speeding it up, I'm all +ears. + +At least it is significantly faster than the only add-on package which +implemented something similar to visual mode. + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M741650P19819.slip,S=3D4877,W=3D4981:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M741650P19819.slip,S=3D4877,W=3D= 4981:2, new file mode 100644 index 0000000..6774ced --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 741650P19819.slip,S=3D4877,W=3D4981:2, @@ -0,0 +1,104 @@ +From MAILER-DAEMON Fri Jun 30 15:06:38 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dR1FV-0005Dx-Sx + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 15:06:37 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:46931) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dR1FT-0005CY-94 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 15:06:36 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dR1FQ-0000cD-4U + for emacs-devel@gnu.org; Fri, 30 Jun 2017 15:06:35 -0400 +Received: from mail-io0-x244.google.com ([2607:f8b0:4001:c06::244]:34311= ) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dR1FQ-0000bs-0L; Fri, 30 Jun 2017 15:06:32 -0400 +Received: by mail-io0-x244.google.com with SMTP id m19so4138819ioe.1; + Fri, 30 Jun 2017 12:06:31 -0700 (PDT) +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3Dgmail.co= m; s=3D20161025; + h=3Dfrom:to:cc:subject:references:date:in-reply-to:message-id + :user-agent:mime-version; + bh=3DkyVlno9OszrHX8dVOfWlttPDuG6SCkOxC5+4PooKJfs=3D; + b=3DDYWOEQEeX1BgOiX6SvhlhzVED3uxTS4jkjbnlTDrlqozxNW5OCirI7AgmemDLpmpNP + i0rjyJdKZOjRuq0ri7mXBFZx1L0Kgc38OUJppCM5qhSvV9TXYyA1LFqgUUWJmjt20xwa + Jpx/QxjCka8JqmyfO3xQoglwkqzFh4X1Oa6mdxQdBRGM8AYK88s0p/fXOg0zXO9vY9Bg + cSCxyfOhWtFiDnX3zPMXye82nHlU2IWgID+Kdi/09FpyyhDCkXzSNXhaN+Sn3lsbByVI + Kwaofwjt6Mirs1l1LeGPE45Z0rk0d9laC/7QF+RmLeTT2LOKscI3GjzEYCh0s+J6AiKx + 3rZQ=3D=3D +X-Google-DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; + d=3D1e100.net; s=3D20161025; + h=3Dx-gm-message-state:from:to:cc:subject:references:date:in-reply-to + :message-id:user-agent:mime-version; + bh=3DkyVlno9OszrHX8dVOfWlttPDuG6SCkOxC5+4PooKJfs=3D; + b=3DjEv4DAjCOTf0+Zz/lUMISDhfywPmRNT5roP535+sUhZxGOcdywsmQ0PzVoewjO6f5n + l/QoUolsLkOZTOSomCCTKjwkVg23mIxbHE3YKRQiIQ2VkTuvDBSseBJV1aFEQZ3zqmvp + UiJFMfvq4Vawr0C1uRd4c85Af5Dp9CnxbnzxYyhDPbNYJpQRWWRHGt759B9jmpu5lEav + AWIpYJQPBPz2cCwu7dCIR+SP5XRCFALifp8nJxVrGXyZtK0qzxLvN7yQjgVl5vwNh+E5 + boXbnk1963yPFWb+R51Vo7JLAsuX3k7OKnpEX+Cia5bJyuuvbSRXPkuXoiHU/hIoYML8 + cqtg=3D=3D +X-Gm-Message-State: AKS2vOw0QeIJAznytDIRgRqPwDZIG85sfV7wyr3M70VL/Pug6edL= lHlI + VLYj6UduyfMTV8LL +X-Received: by 10.107.141.214 with SMTP id p205mr23536464iod.43.14988495= 90949;=20 + Fri, 30 Jun 2017 12:06:30 -0700 (PDT) +Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) + by smtp.gmail.com with ESMTPSA id + g198sm2214629itb.3.2017.06.30.12.06.29 + (version=3DTLS1_2 cipher=3DECDHE-RSA-CHACHA20-POLY1305 bits=3D256/256); + Fri, 30 Jun 2017 12:06:29 -0700 (PDT) +From: Alex +To: Eli Zaretskii +Cc: emacs-devel@gnu.org +Subject: Re: Native line numbers, final testing +References: <83y3s9pm2a.fsf@gnu.org> <87vandz7lw.fsf@lylat> + <83wp7tpcav.fsf@gnu.org> +Date: Fri, 30 Jun 2017 13:06:27 -0600 +In-Reply-To: <83wp7tpcav.fsf@gnu.org> (Eli Zaretskii's message of "Fri, = 30 Jun + 2017 21:20:40 +0300") +Message-ID: <87r2y1z45o.fsf@lylat> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) +MIME-Version: 1.0 +Content-Type: text/plain +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 2607:f8b0:4001:c06::244 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 19:06:36 -0000 + +Eli Zaretskii writes: + +>> From: Alex +>> Cc: emacs-devel@gnu.org +>> Date: Fri, 30 Jun 2017 11:51:55 -0600 +>>=20 +>> There's an issue with relative line numbers with a non-nil +>> `display-line-numbers-current-absolute'. +>>=20 +>> If the current line number is at least 4 digits long, then the text i= n +>> the current line is shifted over. +> +> Thanks, but I don't understand what you mean, and I tried one file +> with 5-digit line number and didn't see what I think you described. +> +> Can you show a screenshot? Are you using some special font where this +> happens? + +I forgot that just before testing relative line numbers, I set +`display-line-number-width' to a non-nil value. For immediate results, +try setting it to 0 and hit C-n/C-p a few times. + +P.S. I noticed that with display-line-numbers set to 'visual, goto-line +is much slower compared to 'relative. Is this expected? M-g 25000 in +xdisp.c with 'relative is almost insant for me, but quite a few seconds +(the first time) with 'visual. This is in emacs -Q. + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M743334P19819.slip,S=3D2695,W=3D2756:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M743334P19819.slip,S=3D2695,W=3D= 2756:2, new file mode 100644 index 0000000..f653ffc --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 743334P19819.slip,S=3D2695,W=3D2756:2, @@ -0,0 +1,61 @@ +From MAILER-DAEMON Fri Jun 30 14:20:59 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dR0XL-0007Ww-Sl + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 14:20:59 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:33447) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dR0XJ-0007Wq-W1 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 14:20:58 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dR0XF-0003E6-Va + for emacs-devel@gnu.org; Fri, 30 Jun 2017 14:20:57 -0400 +Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45114) + by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) + id 1dR0XF-0003DO-KV; Fri, 30 Jun 2017 14:20:53 -0400 +Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1679 + helo=3Dhome-c4e4a596f7) + by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) + (Exim 4.82) (envelope-from ) + id 1dR0XE-0008Aa-Kg; Fri, 30 Jun 2017 14:20:53 -0400 +Date: Fri, 30 Jun 2017 21:20:40 +0300 +Message-Id: <83wp7tpcav.fsf@gnu.org> +From: Eli Zaretskii +To: Alex +CC: emacs-devel@gnu.org +In-reply-to: <87vandz7lw.fsf@lylat> (message from Alex on Fri, 30 Jun 20= 17 + 11:51:55 -0600) +Subject: Re: Native line numbers, final testing +Reply-to: Eli Zaretskii +References: <83y3s9pm2a.fsf@gnu.org> <87vandz7lw.fsf@lylat> +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [gener= ic] +X-Received-From: 2001:4830:134:3::e +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 18:20:58 -0000 + +> From: Alex +> Cc: emacs-devel@gnu.org +> Date: Fri, 30 Jun 2017 11:51:55 -0600 +>=20 +> There's an issue with relative line numbers with a non-nil +> `display-line-numbers-current-absolute'. +>=20 +> If the current line number is at least 4 digits long, then the text in +> the current line is shifted over. + +Thanks, but I don't understand what you mean, and I tried one file +with 5-digit line number and didn't see what I think you described. + +Can you show a screenshot? Are you using some special font where this +happens? + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M745024P19819.slip,S=3D3988,W=3D4070:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M745024P19819.slip,S=3D3988,W=3D= 4070:2, new file mode 100644 index 0000000..5e06835 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 745024P19819.slip,S=3D3988,W=3D4070:2, @@ -0,0 +1,82 @@ +From MAILER-DAEMON Fri Jun 30 13:53:11 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dR06R-0006VX-FT + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 13:53:11 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:53927) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dR06P-0006Ue-3G + for emacs-devel@gnu.org; Fri, 30 Jun 2017 13:53:09 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dR06M-0001nN-3c + for emacs-devel@gnu.org; Fri, 30 Jun 2017 13:53:09 -0400 +Received: from mail-io0-x241.google.com ([2607:f8b0:4001:c06::241]:34371= ) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dR06L-0001mk-VS; Fri, 30 Jun 2017 13:53:06 -0400 +Received: by mail-io0-x241.google.com with SMTP id m19so3995142ioe.1; + Fri, 30 Jun 2017 10:53:04 -0700 (PDT) +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3Dgmail.co= m; s=3D20161025; + h=3Dfrom:to:cc:subject:references:date:in-reply-to:message-id + :user-agent:mime-version; + bh=3DWziIk3O0vDW/bArlDNc4M93QFRSd8AA01KJBarqyico=3D; + b=3DTA2MlD7fP178dXnafOn6xTBbw+UCKjeLHDlabPx0iJ0J+G3q6aqFDjEsrvMFzIHGPl + z4S+HDhWMnY1VXN0TRqsUSLWTWocyPExRxeZlsrkjA5Fayb2P8Zpst6lBh8ZhNVSK5j9 + hLKEDYKFy6xAqOrPpfwrfqXQerKhqk0hMVxqH+kjCONB+4giJYSkrKONoKSwQCr21ZZ+ + b4THr7UX3c6fvV/aozsEpzyvqhVbbfOl6CyB4LHt759YkVWMAMIDZX8xnWkDsVkUuAnA + KxQC5Qjj+Ay40WxQDWloz8ioM5eXATfVoPb0OIQ/nFo0hRhZQEymNvgJQ9wuAGX2i+a+ + q2bQ=3D=3D +X-Google-DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; + d=3D1e100.net; s=3D20161025; + h=3Dx-gm-message-state:from:to:cc:subject:references:date:in-reply-to + :message-id:user-agent:mime-version; + bh=3DWziIk3O0vDW/bArlDNc4M93QFRSd8AA01KJBarqyico=3D; + b=3DlHeHTnmG+lP+PXFGju5pVm4CGyLFnmMItJKLsQf+GtDXzvboyhrAaUa2Sh81QrT5jk + l0jDqV/P51nraTzCWA0rVvSTmIPaPjFLZELbx8bzUG+3dJoQG/85pCOaN+7gvl/aI1qU + vILaG/nhXBKH+KV0erjPiX3CnYi6ezZdwIzvvdbEltvL8sSgQpVqGjQmAKjgDUhGOqe7 + wY3gs2NBZXYiz8alAgblqHsmFB9FbFAYs85/Kiq5WCDqYPbMUkxUVFhrW/xtbtAgV0/f + HjLoQxCfZFiBAXm2VF9/hscmYNK0xMmte5wAVaKWn/cjsNQ5LZ0pEsG/xam1Fgcd6kUX + Tssg=3D=3D +X-Gm-Message-State: AKS2vOyJLkvDpnGFl2kg/Sjlmq0YpvdMPvuGj7ZcbrIP46zABt6d= IDQQ + MMa2jSSeROeJzwdE +X-Received: by 10.107.16.29 with SMTP id y29mr15665129ioi.190.1498845183= 220; + Fri, 30 Jun 2017 10:53:03 -0700 (PDT) +Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) + by smtp.gmail.com with ESMTPSA id + b14sm2449124itb.18.2017.06.30.10.53.01 + (version=3DTLS1_2 cipher=3DECDHE-RSA-CHACHA20-POLY1305 bits=3D256/256); + Fri, 30 Jun 2017 10:53:02 -0700 (PDT) +From: Alex +To: Eli Zaretskii +Cc: emacs-devel@gnu.org +Subject: Re: Native line numbers, final testing +References: <83y3s9pm2a.fsf@gnu.org> +Date: Fri, 30 Jun 2017 11:51:55 -0600 +In-Reply-To: <83y3s9pm2a.fsf@gnu.org> (Eli Zaretskii's message of "Fri, = 30 Jun + 2017 17:49:49 +0300") +Message-ID: <87vandz7lw.fsf@lylat> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) +MIME-Version: 1.0 +Content-Type: text/plain +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 2607:f8b0:4001:c06::241 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 17:53:10 -0000 + +There's an issue with relative line numbers with a non-nil +`display-line-numbers-current-absolute'. + +If the current line number is at least 4 digits long, then the text in +the current line is shifted over. + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M746564P19819.slip,S=3D2440,W=3D2493:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M746564P19819.slip,S=3D2440,W=3D= 2493:2, new file mode 100644 index 0000000..cbe3ef5 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 746564P19819.slip,S=3D2440,W=3D2493:2, @@ -0,0 +1,53 @@ +From MAILER-DAEMON Fri Jun 30 10:50:11 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQxFL-0005pq-Ry + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 10:50:11 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:37635) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQxFJ-0005nx-Pe + for emacs-devel@gnu.org; Fri, 30 Jun 2017 10:50:10 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQxFG-0008CL-OQ + for emacs-devel@gnu.org; Fri, 30 Jun 2017 10:50:09 -0400 +Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41606) + by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) + id 1dQxFG-0008By-L6 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 10:50:06 -0400 +Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1379 + helo=3Dhome-c4e4a596f7) + by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) + (Exim 4.82) (envelope-from ) id 1dQxFF-0006EU-GL + for emacs-devel@gnu.org; Fri, 30 Jun 2017 10:50:06 -0400 +Date: Fri, 30 Jun 2017 17:49:49 +0300 +Message-Id: <83y3s9pm2a.fsf@gnu.org> +From: Eli Zaretskii +To: emacs-devel@gnu.org +Subject: Native line numbers, final testing +Reply-to: Eli Zaretskii +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [gener= ic] +X-Received-From: 2001:4830:134:3::e +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 14:50:10 -0000 + +I've finished development of this feature and pushed the changes to +the scratch/line-numbers branch. "Visual" line numbers are +implemented, and all the known bugs should be fixed. I also added +documentation. + +Please test and report any problems you find. If no grave bugs show +up, I will probably land this on master in a few days. + +Thanks to everybody who sent feedback and reported problems and +feature requests. + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M748729P19819.slip,S=3D4636,W=3D4730:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M748729P19819.slip,S=3D4636,W=3D= 4730:2, new file mode 100644 index 0000000..a3bcf6c --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 748729P19819.slip,S=3D4636,W=3D4730:2, @@ -0,0 +1,94 @@ +From MAILER-DAEMON Fri Jun 30 21:31:54 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dR7GM-000669-9b + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 21:31:54 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:58189) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dR2kT-0001OX-G0 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 16:42:42 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dR2kS-0003Ja-O1 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 16:42:41 -0400 +Received: from mail-oi0-x22b.google.com ([2607:f8b0:4003:c06::22b]:32786= ) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dR2kS-0003Ab-J1 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 16:42:40 -0400 +Received: by mail-oi0-x22b.google.com with SMTP id p188so45248313oia.0 + for ; Fri, 30 Jun 2017 13:42:38 -0700 (PDT) +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3Dgmail.co= m; s=3D20161025; + h=3Dmime-version:sender:from:date:message-id:subject:to; + bh=3DthwpxHUeeu3CrKuHSKMBkZIt6P3gdyJWVFnfiPzNkfg=3D; + b=3DBtg3ai+KWsGQ46Ma2QxraquPB8ZROekkOXBmBhErWRyZ/6fJGKfGEAhgD+U6iEGc4H + BneBnskuhHkl287yBFG389vMXrgPPacC5PiNdpH/jyDAgil7Fb37SKUJscQU9zDlqP7G + 54UAgxfojDmoHUWZIfJPF32bPosjw41GwwC7FYU/Mx8K7PsQ4+S5Yu/Xn/IcbrXRDo09 + tcXkl7fclNlyHeN6G3k2NjQzEj/S0NQuWwqVnm+5LwViesziwn675V5HW7G2aSTdooQr + iCiWUfg8NM4tlRCmTrHfQFWukPDOLRgI2crkSvQaktI5gTZ/TzG0IuqapRzMx2a8jz3x + O+Ew=3D=3D +X-Google-DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; + d=3D1e100.net; s=3D20161025; + h=3Dx-gm-message-state:mime-version:sender:from:date:message-id:subject + :to; bh=3DthwpxHUeeu3CrKuHSKMBkZIt6P3gdyJWVFnfiPzNkfg=3D; + b=3Dr/krzb/PW4G3PmsweWKZfXzv2tkw355mpiE4pOzU0NkCHkCAbEeZEQGiCh2S1fZ2l4 + 9lWLfjwbRSj+TNvrwc/QwDHUsuoDVP+ubT4Y6g6W7AQFfPNcPfCu0BPRqffEQy04yVo3 + 0abIhOZnxi3rX1WnjU7qV5ym6C8nzc7MU3z46QkQX/UO6E7hr+mh2odVHm4v4DNtjdwJ + YgrtPIC9apiAA7vwx42A7lXALeNfwslDoIodU2PiLiNi6iIAy6IH3QEZ4ma6pm7iHnVL + Tr2Ti8qJ02ZcuvAv0e4BlqAqIicjCPcL001KxPkoz7pXif9hoTk3BV+XYECV2xUTPl9/ + II2g=3D=3D +X-Gm-Message-State: AKS2vOzKi4IyzBjm9kTwZkThH6IjAXBRlLx/jN43k9nLK7heC5lt= Qm3X + hkhUNCtzc84g/uzsCNEn3jVJbpRFPj3a +X-Received: by 10.202.198.4 with SMTP id w4mr13606041oif.147.14988553577= 51; + Fri, 30 Jun 2017 13:42:37 -0700 (PDT) +MIME-Version: 1.0 +Sender: rocky.bernstein@gmail.com +Received: by 10.74.77.86 with HTTP; Fri, 30 Jun 2017 13:42:37 -0700 (PDT= ) +From: Rocky Bernstein +Date: Fri, 30 Jun 2017 16:42:37 -0400 +X-Google-Sender-Auth: c3MxvLdGpJF9_kxIwUC9RS_Wp0g +Message-ID: +Subject: Adding a few realgud colors to /etc/themes +To: emacs-devel@gnu.org +Content-Type: multipart/alternative; boundary=3D"001a1134f0a82b29ab05533= 3754c" +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 2607:f8b0:4003:c06::22b +X-Mailman-Approved-At: Fri, 30 Jun 2017 21:31:53 -0400 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Jun 2017 20:42:42 -0000 + +--001a1134f0a82b29ab055333754c +Content-Type: text/plain; charset=3D"UTF-8" + +I would like to add three realgud color face definitions per theme into +etc/themes. (realgud is an elpa package) + +What's the preferred way to do this? + +The easiest for me is to create a branch of of the savannah git, make +changes, and then do something that allows people to look at and merge i= n +when okay. + +--001a1134f0a82b29ab055333754c +Content-Type: text/html; charset=3D"UTF-8" +Content-Transfer-Encoding: quoted-printable + +
I would like to add three realgud color face definiti= ons p=3D +er theme into etc/themes. (realgud is an elpa package)

W=3D +hat's the preferred way to do this?=3DC2=3DA0

The =3D +easiest for me is to create a branch of of the savannah git, make change= s, =3D +and then do something that allows people to look at and merge in when ok= ay.=3D +




+ +--001a1134f0a82b29ab055333754c-- + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M750954P19819.slip,S=3D6224,W=3D6379:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M750954P19819.slip,S=3D6224,W=3D= 6379:2, new file mode 100644 index 0000000..64d58de --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 750954P19819.slip,S=3D6224,W=3D6379:2, @@ -0,0 +1,155 @@ +From MAILER-DAEMON Fri Jun 30 22:32:42 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dR8DC-0004RH-5x + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 22:32:42 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:47380) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dR8DA-0004RB-1B + for emacs-devel@gnu.org; Fri, 30 Jun 2017 22:32:41 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dR8D6-0007JU-RA + for emacs-devel@gnu.org; Fri, 30 Jun 2017 22:32:39 -0400 +Received: from aserp1040.oracle.com ([141.146.126.69]:28321) + by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) + (Exim 4.71) (envelope-from ) + id 1dR8D6-0007JA-Gf + for emacs-devel@gnu.org; Fri, 30 Jun 2017 22:32:36 -0400 +Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74= ]) + by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with + ESMTP id v612WVAJ022749 + (version=3DTLSv1.2 cipher=3DECDHE-RSA-AES256-GCM-SHA384 bits=3D256 veri= fy=3DOK); + Sat, 1 Jul 2017 02:32:32 GMT +Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75= ]) + by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v612WVM3006110 + (version=3DTLSv1/SSLv3 cipher=3DDHE-RSA-AES256-GCM-SHA384 bits=3D256 + verify=3DOK); Sat, 1 Jul 2017 02:32:31 GMT +Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9= ]) + by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v612WV5C010913; + Sat, 1 Jul 2017 02:32:31 GMT +MIME-Version: 1.0 +Message-ID: +Date: Fri, 30 Jun 2017 19:32:29 -0700 (PDT) +From: Drew Adams +Sender: Drew Adams +To: Jean-Christophe Helary , Emacs + development discussions +Subject: RE: format use inquiry +References: + <7e7f068e4e.fsf@fencepost.gnu.org> + + <2FDCF579-44BC-49AD-985F-14AE5C654645@gmail.com> +In-Reply-To: <2FDCF579-44BC-49AD-985F-14AE5C654645@gmail.com> +X-Priority: 3 +X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL + 12.0.6770.5000 (x86)] +Content-Type: text/plain; charset=3Dutf-8 +Content-Transfer-Encoding: quoted-printable +X-Source-IP: userv0022.oracle.com [156.151.31.74] +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [gen= eric] + [fuzzy] +X-Received-From: 141.146.126.69 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 01 Jul 2017 02:32:41 -0000 + +> Paul suggested that it would be a maintenance hassle to keep 2 almost +> identical urls if we spelled them out as Yuri suggested but I checked = oth=3D +er +> source packages and for ex auth-source-pass-tests.el explicitly spells= ou=3D +t +> all the urls without resorting to smart formatting to save a few chara= cte=3D +rs. +>=3D20 +> Also, considering the way %s is abused in other places package.el, for= ex +> in: +>=3D20 +> (message "%d package%s marked for upgrading." +> (length upgrades) +> (if (=3D3D (length upgrades) 1) "" "s"))))) +>=3D20 +> I don't think it is good to keep the above code because it gives bad +> incentives to authors especially if work on i18n/l10n proceeds (even t= hou=3D +gh +> http/https is not related to l10n). +>=3D20 +> So, I'm going to spell out the urls as I proceed with untangling code = and +> translatable strings in package.el. I'll send a diff here when I'm don= e f=3D +or +> evaluation. + +FWIW, I think this is a bit misguided. It seems to +be putting translation/localization interests before +code-readability - IOW, making things simpler for some +tools or secondary uses of code, rather than keeping +them simple for someone to read. + +I'm not arguing maintenance burden but readability +(which also affects maintenance burden). + +Maybe some sacrifice of code simplicity is needed in +the interest of translation-help. But I think another +approach should be sought than what you've proposed. + +Code, especially Lisp code, is partly about expressing +something symbolically, to yourself and others who read +the code. + +If you factor out the part of two things that is common, +that makes it easy to _see_ what is common and what is +different. + +If you instead use two URLs that are almost identical +then you make a human reader scan each of them looking +for differences: + +(if (gnutls-available-p) + "https://elpa.gnu.org/packeges/"; + "http://elpa.gnu.org/packages/";) + +(Did you spot the typo?) + +Here the URLs are pretty short, so you might not +get a headache immediately, scanning and comparing. +But imagine the mental load if they were a lot longer. +Or if you had to scan and compare lots of them. +Spend an evening doing that and you might change your +mind about how great it is to duplicate all of that +common text. + +You could bind a variable to name each one: + +(let ((https "https://elpa.gnu.org/packages/") + (http "http://elpa.gnu.org/packages/")) + (if (gnutls-available-p) https http)) + +(You can come up with better var names.) + +That still makes someone scan and compare, but +it at least points out (names) what the expected +difference is. I don't claim it doesn't suffer +from what I complain about above, but it seems a +bit less burdensome to me. + +There might be other approaches. None of this +matters much if we're talking only about someone's +preferred style here or there. But if we're +talking about a wholesale change then maybe some +better approach can be found. + +Just one opinion. + +As for the question of messages that use singular +vs plural forms, I'd again point to Common Lisp's +`format', which addresses that kind of thing (at +least for English). + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/15410= 87501.M752804P19819.slip,S=3D5700,W=3D5822:2, b/packages/gnus-mock/data/i= mapmail/mail/.emacs-devel/cur/1541087501.M752804P19819.slip,S=3D5700,W=3D= 5822:2, new file mode 100644 index 0000000..aec30a8 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/cur/1541087501.M= 752804P19819.slip,S=3D5700,W=3D5822:2, @@ -0,0 +1,122 @@ +From MAILER-DAEMON Fri Jun 30 21:57:46 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dR7fO-0005GF-OX + for mharc-emacs-devel@gnu.org; Fri, 30 Jun 2017 21:57:46 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:42061) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1dR7fM-0005G6-VS + for emacs-devel@gnu.org; Fri, 30 Jun 2017 21:57:45 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1dR7fJ-0000nn-U0 + for emacs-devel@gnu.org; Fri, 30 Jun 2017 21:57:45 -0400 +Received: from mail-pg0-x234.google.com ([2607:f8b0:400e:c05::234]:34986= ) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dR7fJ-0000n2-LD + for emacs-devel@gnu.org; Fri, 30 Jun 2017 21:57:41 -0400 +Received: by mail-pg0-x234.google.com with SMTP id j186so70921624pge.2 + for ; Fri, 30 Jun 2017 18:57:41 -0700 (PDT) +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3Dgmail.co= m; s=3D20161025; + h=3Dfrom:content-transfer-encoding:mime-version:subject:date:references + :to:in-reply-to:message-id; + bh=3D0WG55+LqIeHr6q+fTLiAGrks9UjP9d3t9HWsVhglgKg=3D; + b=3DPT4jvOGw2nIzbuutgTFvwQwa+CemjgrKEhcCR5ca5F7opzM8ziTKb8blUOOkBVF1Dk + WQhqFoUK4b09LYsv7y7KUSz36lH9RwozqYpq6ybl0bR5wBofQg2sFfv6oDhfby45s9c/ + 26E6mIqB+dHnl+Dwu2rpYdfUP3ZyHoOPVRt4Y/9f0rAxKb+szqWbJr5BD4s5Y08LXfZM + z1PRnfpfTTjw4CO9mJJPcRUDO+yCX7lBTYXXqtvIP+FhnzNENMdyaXY0g7Mq+GUUhBAX + JPlup7mxx9zOL4QOk5ZgsT9p19ELWk0GKR3uefqTQi6fdMbqJDK4kn5wjczdpZPGlXrs + m1HQ=3D=3D +X-Google-DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; + d=3D1e100.net; s=3D20161025; + h=3Dx-gm-message-state:from:content-transfer-encoding:mime-version + :subject:date:references:to:in-reply-to:message-id; + bh=3D0WG55+LqIeHr6q+fTLiAGrks9UjP9d3t9HWsVhglgKg=3D; + b=3DF21ZQgw7v/zaVxzSQiQkmmIZoldkBlPEtBXk74OcIspYoeaB5zb/RObkHkdZz6npDS + f2FbN5kn5ZeBu0hYGKslrvg+AbjVdxrh3F/uwJGzUqO5bvFqALW1tOMNIXnPnsxJkBo7 + 7yhRiQxdgQ99RL3cram8WvoahQ7u+66n5xuxc21NS3tGIYsKhHLtnsRWHBkYexmh7wkp + NTup4oIxz1tK/b9c3e3gnIQYEH0KYThG9C8PlCiib/M8poanf28roxJwo8fnhtNY4fxX + KZb509Zymsonio0YZWbVCCKdIZCndOTg6b2RFIgbZNVbPI2fc1vZJtezuX39qX0MXhgd + Al+g=3D=3D +X-Gm-Message-State: AKS2vOzgf7sEzUGhS2R8zP26h9N6QuZY5hi22AVPsqNh9+DxywFa= m2zK + jVCkX9BduTBqQt6UEpI=3D +X-Received: by 10.84.128.1 with SMTP id 1mr27746843pla.244.1498874260364= ; + Fri, 30 Jun 2017 18:57:40 -0700 (PDT) +Received: from [10.251.103.141] ([210.160.37.44]) + by smtp.gmail.com with ESMTPSA id + s62sm22113253pfi.36.2017.06.30.18.57.38 for + (version=3DTLS1_2 cipher=3DECDHE-RSA-AES128-GCM-SHA256 bits=3D128/128); + Fri, 30 Jun 2017 18:57:39 -0700 (PDT) +From: Jean-Christophe Helary +Content-Type: text/plain; charset=3Dus-ascii +Content-Transfer-Encoding: quoted-printable +Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) +Subject: Re: format use inquiry +Date: Sat, 1 Jul 2017 10:56:49 +0900 +References: + <7e7f068e4e.fsf@fencepost.gnu.org> + +To: Emacs development discussions +In-Reply-To: +Message-Id: <2FDCF579-44BC-49AD-985F-14AE5C654645@gmail.com> +X-Mailer: Apple Mail (2.3273) +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 2607:f8b0:400e:c05::234 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 01 Jul 2017 01:57:45 -0000 + + +> On Jun 22, 2017, at 10:57, Richard Stallman wrote: +>=3D20 +>>> (format "http%s://elpa.gnu.org/packages/" +>>> (if (gnutls-available-p) "s" = =3D +"")) +>=3D20 +>> Yes, it is. But obviously I think that, since I wrote it. +>=3D20 +> I agree it is acceptable, but this looks like something that might be +> needed in a number of places, so perhaps we should make a nicer +> interface to do it. + +There is only one instance of such a query in package.el and no other =3D +package in the emacs distribution seems to use gnutls-available-p to add= =3D +an "s" to http. + +Paul suggested that it would be a maintenance hassle to keep 2 almost =3D +identical urls if we spelled them out as Yuri suggested but I checked =3D +other source packages and for ex auth-source-pass-tests.el explicitly =3D +spells out all the urls without resorting to smart formatting to save a = =3D +few characters. + +Also, considering the way %s is abused in other places package.el, for =3D +ex in: + + (message "%d package%s marked for upgrading." = =3D + =3D20 + (length upgrades) = =3D + =3D20 + (if (=3D3D (length upgrades) 1) "" "s")))))=3D20 + +I don't think it is good to keep the above code because it gives bad =3D +incentives to authors especially if work on i18n/l10n proceeds (even =3D +though http/https is not related to l10n). + +So, I'm going to spell out the urls as I proceed with untangling code =3D +and translatable strings in package.el. I'll send a diff here when I'm =3D +done for evaluation. + +Jean-Christophe=3D20=3D + + diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/dovecot-u= idlist b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/dovecot-uidli= st new file mode 100644 index 0000000..1fe7a48 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/dovecot-uidlist @@ -0,0 +1,21 @@ +3 V1541087104 N1 G108aaf290d21db5b6b4d000040cf8723 +1 :1541087501.M709276P19819.slip,S=3D2997,W=3D3064 +2 :1541087501.M716539P19819.slip,S=3D3538,W=3D3624 +3 :1541087501.M722048P19819.slip,S=3D4327,W=3D4419 +4 :1541087501.M724043P19819.slip,S=3D3659,W=3D3738 +5 :1541087501.M725903P19819.slip,S=3D4886,W=3D4994 +6 :1541087501.M727585P19819.slip,S=3D2858,W=3D2916 +7 :1541087501.M729440P19819.slip,S=3D5108,W=3D5217 +8 :1541087501.M731257P19819.slip,S=3D4305,W=3D4392 +9 :1541087501.M732982P19819.slip,S=3D4269,W=3D4353 +10 :1541087501.M734712P19819.slip,S=3D3014,W=3D3083 +11 :1541087501.M736331P19819.slip,S=3D5431,W=3D5548 +12 :1541087501.M738191P19819.slip,S=3D5797,W=3D5919 +13 :1541087501.M739848P19819.slip,S=3D3808,W=3D3894 +14 :1541087501.M741650P19819.slip,S=3D4877,W=3D4981 +15 :1541087501.M743334P19819.slip,S=3D2695,W=3D2756 +16 :1541087501.M745024P19819.slip,S=3D3988,W=3D4070 +17 :1541087501.M746564P19819.slip,S=3D2440,W=3D2493 +18 :1541087501.M748729P19819.slip,S=3D4636,W=3D4730 +19 :1541087501.M750954P19819.slip,S=3D6224,W=3D6379 +20 :1541087501.M752804P19819.slip,S=3D5700,W=3D5822 diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/dovecot.i= ndex.cache b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/dovecot.i= ndex.cache new file mode 100644 index 0000000..5bcc3b0 Binary files /dev/null and b/packages/gnus-mock/data/imapmail/mail/.emacs= -devel/dovecot.index.cache differ diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/maildirfo= lder b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/maildirfolder new file mode 100644 index 0000000..e69de29 diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M224506= P19819.slip,S=3D4578,W=3D4684:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M224506P19819.slip,S=3D4578,W=3D4684:2, new file mode 100644 index 0000000..24a17d9 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M224506P19819.= slip,S=3D4578,W=3D4684:2, @@ -0,0 +1,106 @@ +From MAILER-DAEMON Thu Nov 01 15:40:25 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TU0cr-0004nw-OT + for mharc-info-gnus-english@gnu.org; Thu, 01 Nov 2012 15:40:25 -0400 +Received: from eggs.gnu.org ([208.118.235.92]:33026) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TU0cp-0004mq-BO + for info-gnus-english@gnu.org; Thu, 01 Nov 2012 15:40:24 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1TU0cm-0000XJ-Pz + for info-gnus-english@gnu.org; Thu, 01 Nov 2012 15:40:22 -0400 +Received: from mout.web.de ([212.227.15.3]:51276) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TU0cm-0000X5-GO + for info-gnus-english@gnu.org; Thu, 01 Nov 2012 15:40:20 -0400 +Received: from drachen.dragon ([89.204.130.4]) by smtp.web.de (mrweb001)= with + ESMTPSA (Nemesis) id 0LfzgJ-1T11nG2TQB-00pTDm; + Thu, 01 Nov 2012 20:40:18 +0100 +From: Michael Heerdegen +To: info-gnus-english@gnu.org +Subject: Re: Changes in emacs.el +References: <87wqy6sxy0.fsf@Compaq.site.inet> + + <87wqy6y32n.fsf@Compaq.site.inet> +Mail-Followup-To: info-gnus-english@gnu.org, Cecil@decebal.nl +Date: Thu, 01 Nov 2012 20:40:42 +0100 +In-Reply-To: <87wqy6y32n.fsf@Compaq.site.inet> (Cecil Westerhof's messag= e of + "Wed, 31 Oct 2012 18:16:32 +0100") +Message-ID: <87txt9t8lh.fsf@web.de> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) +MIME-Version: 1.0 +Content-Type: text/plain +X-Provags-ID: V02:K0:T/BBsqi86c+433tvzHjerevn47TSY59o7vUE3Y1STwK + PQB49yCbEFUL0YO0GFjRkT68iC40u+//44L7yYrMK/1N+0IaAN + DDSAgR9vsCGLT5OhXnaUK6gpAuiILpE9J8cGyHe282txZF+0B0 + UMvvyzTJAk+GWmvhV5a1Rk/upFSpyvPR/K/vFR7chk543DBTDl + zbFo8dbhYjhJnblEKcIvVGX2a3KYmigzUS6RsmyLgs=3D +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [gen= eric] +X-Received-From: 212.227.15.3 +Cc: Cecil@decebal.nl +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 01 Nov 2012 19:40:24 -0000 + +Cecil Westerhof writes: + +> I now added: +> (setq custom-file "~/.emacs.d/.emacs-custom.el") +> (load custom-file t nil t t) +> +> There is only one problem: +> ;; Your init file should contain only one such instance. +> +> Now there will be two. I will see if this is going to give problems. + +If you have a separate custom file, your init file can contain as much +`custom-set-variables' or `custom-set-faces' as you want, AFAIK. The +limitation only exists so that Emacs can automatically edit it and can +be sure it doesn't miss anything. If you have a separate custom file, +you can do what you want in your init file, because it's then not +subject to automatic editing. + +Of course, it would be better style to avoid `custom-set-variables' in +your init file and use standard Elisp instead (I mean `setq', +`setq-default' etc.). + +> Also: why does Emacs do this? I never do anything with custom. + +I know that some code in vanilla Emacs or third party packages use the +customization file for storing settings. You need not use the +customization interface for this to happen. It is arguable if this is +always necessary, but I can live with it. + +In your case, this was the apparently the cause: + + Gnus supports Cancel Locks in News. +=20 + This means a header `Cancel-Lock' is inserted in news + posting. It is used to determine if you wrote an article or + not (for canceling and superseding). Gnus generates a random + password string the first time you post a message, and saves + it in your `~/.emacs' using the Custom system. While the + variable is called `canlock-password', it is not security + sensitive data. Publishing your canlock string on the web + will not allow anyone to be able to anything she could not + already do. The behavior can be changed by customizing + `message-insert-canlock'. + + + +Regards, + +Michael. + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M232569= P19819.slip,S=3D3789,W=3D3886:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M232569P19819.slip,S=3D3789,W=3D3886:2, new file mode 100644 index 0000000..6d90997 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M232569P19819.= slip,S=3D3789,W=3D3886:2, @@ -0,0 +1,97 @@ +From MAILER-DAEMON Tue Nov 06 15:19:02 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TVpby-0008FG-MR + for mharc-info-gnus-english@gnu.org; Tue, 06 Nov 2012 15:19:02 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:58809) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TVpbv-0008F1-CB + for info-gnus-english@gnu.org; Tue, 06 Nov 2012 15:19:01 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1TVpbt-0008DV-WC + for info-gnus-english@gnu.org; Tue, 06 Nov 2012 15:18:59 -0500 +Received: from plane.gmane.org ([80.91.229.3]:36433) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TVpbt-0008BZ-PI + for info-gnus-english@gnu.org; Tue, 06 Nov 2012 15:18:57 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1TVpbz-0002Pb-2a + for info-gnus-english@gnu.org; Tue, 06 Nov 2012 21:19:03 +0100 +Received: from s0106000acd1d509c.du.shawcable.net ([70.67.174.161]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Tue, 06 Nov 2012 21:19:03 +0100 +Received: from prad by s0106000acd1d509c.du.shawcable.net with local (Gm= exim + 0.1 (Debian)) id 1AlnuQ-0007hv-00 + for ; Tue, 06 Nov 2012 21:19:03 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: prad +Subject: Re: delete temporary html files +Date: Tue, 06 Nov 2012 12:18:45 -0800 +Lines: 32 +Message-ID: <87pq3qscwq.fsf@psinom.home> +References: <87mwyzeuxe.fsf@psinom.home> + <87objbw3pa.fsf@marauder.physik.uni-ulm.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: s0106000acd1d509c.du.shawcable.net +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) +Cancel-Lock: sha1:r0WTr/s/DSGbKBhkMMdps7iUdxg=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 06 Nov 2012 20:19:01 -0000 + +Reiner Steib writes: + +> On Fri, Nov 02 2012, prad wrote: +> +>> sometimes i read emails in my browser because they don't show up +>> properly in gnus (S-K S-H).=20 +> +> You mean `K H'. +> +yes sorry! + +> ,----[ v gnus-article-browse-delete-temp RET ] +> | gnus-article-browse-delete-temp is a variable defined in `gnus-art.e= l'. +> | Its value is ask +> |=20 +> | Documentation: +> | What to do with temporary files from `gnus-article-browse-html-parts= '. +> | If nil, don't delete temporary files. If it is t, delete them on +> | exit from the summary buffer. If it is the symbol `file', query +> | on each file, if it is `ask' ask once when exiting from the +> | summary buffer. +> `---- +> +thx for this! +i've used emacs for years, but i still have trouble figuring out how to +find what i need in the documentation. + +it works perfectly now just the way i want. + +--=20 +in friendship, +prad + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M239374= P19819.slip,S=3D3350,W=3D3432:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M239374P19819.slip,S=3D3350,W=3D3432:2, new file mode 100644 index 0000000..4278174 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M239374P19819.= slip,S=3D3350,W=3D3432:2, @@ -0,0 +1,82 @@ +From MAILER-DAEMON Tue Nov 06 03:15:07 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TVeJP-0001RD-Rc + for mharc-info-gnus-english@gnu.org; Tue, 06 Nov 2012 03:15:07 -0500 +From: Reiner Steib +Newsgroups: gnu.emacs.gnus +Subject: Re: delete temporary html files +References: <87mwyzeuxe.fsf@psinom.home> +X-Face: #vK]N[`vqjuod*|)'[iD7/"3AB-ApT%fmN"LWAg@oS7OesGv~)n[OBTLM#I=3D= "J'Y^-7I + I/ps7o_'IK@#-Rs{::DZ@O8yS|fexe,XslY[:dNWOb~>?mC-&i_c)say:"\IpA.5U.b]'NY= ; + Pks{lb h.+#6%DpZuaK3dcHB`Av3zc:r!C%~s0&m, tWj]&}, + qg.+0ww2gK%f!:GK|wMl.I!(voY*1"^li8"~B BNG)9LvPi?^DMR-GVDnZqhu*3Hi, + +g=3DwFhI)BL6&u{EOVEHjVEVq~d?_}lMntWAc3(6?kftjc>_f>! + g0wM(qPM$d5]^TT_Qyi&L?LGVG)SHN;Gk/,pkY9,~ +Mail-Copies-To: nobody +Date: Tue, 06 Nov 2012 09:11:45 +0100 +Message-ID: <87objbw3pa.fsf@marauder.physik.uni-ulm.de> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) +Cancel-Lock: sha1:o5J+YurFZQgmEI8bNNDs7kkTmq8=3D +MIME-Version: 1.0 +Content-Type: text/plain +NNTP-Posting-Host: bridgekeeper.physik.uni-ulm.de +X-Trace: news.uni-ulm.de 1352189512 134.60.10.175 (6 Nov 2012 09:11:52 += 0100) +Lines: 38 +Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!news2.arglkargh.de!= feeder.erje.net!eu.feeder.erje.net!news-2.dfn.de!news.dfn.de!news.uni-stu= ttgart.de!rz.uni-karlsruhe.de!news.uni-ulm.de!hydrangea.reiner-steib.de!n= ot-for-mail +Xref: usenet.stanford.edu gnu.emacs.gnus:87041 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +Reply-To: Reiner Steib +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 06 Nov 2012 08:15:05 -0000 + +On Fri, Nov 02 2012, prad wrote: + +> sometimes i read emails in my browser because they don't show up +> properly in gnus (S-K S-H).=20 + +You mean `K H'. + +> when i quit the summary, i get a message asking me if i want to +> delete tmp html files. +> +> is there a way to set things so tmp html files are deleted +> automatically? + +,----[ v gnus-article-browse-delete-temp RET ] +| gnus-article-browse-delete-temp is a variable defined in `gnus-art.el'= . +| Its value is ask +|=20 +| Documentation: +| What to do with temporary files from `gnus-article-browse-html-parts'. +| If nil, don't delete temporary files. If it is t, delete them on +| exit from the summary buffer. If it is the symbol `file', query +| on each file, if it is `ask' ask once when exiting from the +| summary buffer. +`---- + +> i'm also puzzled as to why the question is asked. why would anyone wan= t +> to keep tmp html files around when it's=20 +> +> a) already visible in one's browser +> b) you can get it back anytime with S-K S-H + +Maybe t ("Don't ask") should be the default. + +Bye, Reiner. +--=20 + ,,, + (o o) +---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M245904= P19819.slip,S=3D3275,W=3D3354:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M245904P19819.slip,S=3D3275,W=3D3354:2, new file mode 100644 index 0000000..24398b3 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M245904P19819.= slip,S=3D3275,W=3D3354:2, @@ -0,0 +1,79 @@ +From MAILER-DAEMON Fri Nov 02 14:12:17 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TULj7-0002aK-V6 + for mharc-info-gnus-english@gnu.org; Fri, 02 Nov 2012 14:12:17 -0400 +Received: from eggs.gnu.org ([208.118.235.92]:43916) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TULj5-0002Yn-Md + for info-gnus-english@gnu.org; Fri, 02 Nov 2012 14:12:16 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1TULj4-0003dJ-KO + for info-gnus-english@gnu.org; Fri, 02 Nov 2012 14:12:15 -0400 +Received: from plane.gmane.org ([80.91.229.3]:35834) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TULj4-0003d6-DX + for info-gnus-english@gnu.org; Fri, 02 Nov 2012 14:12:14 -0400 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1TULj9-0003Tk-4Y + for info-gnus-english@gnu.org; Fri, 02 Nov 2012 19:12:19 +0100 +Received: from s0106000acd1d509c.du.shawcable.net ([70.67.174.161]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Fri, 02 Nov 2012 19:12:19 +0100 +Received: from prad by s0106000acd1d509c.du.shawcable.net with local (Gm= exim + 0.1 (Debian)) id 1AlnuQ-0007hv-00 + for ; Fri, 02 Nov 2012 19:12:19 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: prad +Subject: delete temporary html files +Date: Fri, 02 Nov 2012 11:11:57 -0700 +Lines: 16 +Message-ID: <87mwyzeuxe.fsf@psinom.home> +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: s0106000acd1d509c.du.shawcable.net +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) +Cancel-Lock: sha1:xe7+TuSMczZDa3kzsYmiqrAJ2c0=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 02 Nov 2012 18:12:16 -0000 + +sometimes i read emails in my browser because they don't show up +properly in gnus (S-K S-H). when i quit the summary, i get a message +asking me if i want to delete tmp html files. + +is there a way to set things so tmp html files are deleted +automatically? + +i'm also puzzled as to why the question is asked. why would anyone want +to keep tmp html files around when it's=20 + +a) already visible in one's browser +b) you can get it back anytime with S-K S-H + +--=20 +in friendship, +prad + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M252543= P19819.slip,S=3D2246,W=3D2301:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M252543P19819.slip,S=3D2246,W=3D2301:2, new file mode 100644 index 0000000..2080752 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M252543P19819.= slip,S=3D2246,W=3D2301:2, @@ -0,0 +1,55 @@ +From MAILER-DAEMON Sun Nov 04 14:30:06 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TV5tW-00045w-6t + for mharc-info-gnus-english@gnu.org; Sun, 04 Nov 2012 14:30:06 -0500 +Path: usenet.stanford.edu!newsfeed.news.ucla.edu!news.snarked.org!feeder= .erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!= .POSTED!not-for-mail +From: Winston +Newsgroups: gnu.emacs.gnus +Subject: Re: Sometimes problem when posting to aioe +Date: Sun, 04 Nov 2012 14:28:17 -0500 +Organization: Panther Software and Research Company +Lines: 16 +Message-ID: +References: <87bofqkdw7.fsf@Compaq.site> +NNTP-Posting-Host: HiP9CM4zZKmgWNAsVK99/w.user.speranza.aioe.org +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +X-Complaints-To: abuse@aioe.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) +X-Notice: Filtered by postfilter v. 0.8.2 +Cancel-Lock: sha1:kO5PzssBFUebZblFrHCzEkgpXyg=3D +Mail-Copies-To: never +Xref: usenet.stanford.edu gnu.emacs.gnus:87040 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 04 Nov 2012 19:30:05 -0000 + +Cecil Westerhof wrote: +>> This works with one very important hitch: I lose all my marks. + +to which I incompletely replied: +> Another, and rather simple, solution to this problem is: + +> cd ~/News/marks +> ln -s news.aioe.org nntp.aioe.org [or vice versa] + +Oops. Similarly, you also need to do: + +cd ~/News/agent/nntp +ln -s news.aioe.org nntp.aioe.org [or vice versa] + +HTH, + -WBE + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M257361= P19819.slip,S=3D2745,W=3D2810:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M257361P19819.slip,S=3D2745,W=3D2810:2, new file mode 100644 index 0000000..52122ac --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M257361P19819.= slip,S=3D2745,W=3D2810:2, @@ -0,0 +1,65 @@ +From MAILER-DAEMON Sat Nov 03 16:15:07 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TUk7W-00087R-Vx + for mharc-info-gnus-english@gnu.org; Sat, 03 Nov 2012 16:15:06 -0400 +Path: usenet.stanford.edu!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsf= eed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!ne= ws.stack.nl!aioe.org!.POSTED!not-for-mail +From: Winston +Newsgroups: gnu.emacs.gnus +Subject: Re: Sometimes problem when posting to aioe +Date: Sat, 03 Nov 2012 16:14:35 -0400 +Organization: Panther Software and Research Company +Lines: 26 +Message-ID: +References: <87bofqkdw7.fsf@Compaq.site> +NNTP-Posting-Host: HiP9CM4zZKmgWNAsVK99/w.user.speranza.aioe.org +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +X-Complaints-To: abuse@aioe.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) +X-Notice: Filtered by postfilter v. 0.8.2 +Cancel-Lock: sha1:F2pNsehh+vVxM7O4yTq5L1Jc9Pg=3D +Mail-Copies-To: never +Xref: usenet.stanford.edu gnu.emacs.gnus:87039 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 03 Nov 2012 20:15:05 -0000 + +Cecil Westerhof asked: +> I use the aioe newsserver. Sometimes I get: +> nntp (news.aioe.org) open error: ''. Continue? (y or n) + +> The only way to keep reading and sending news is to change: +> (setq gnus-select-method '(nntp "news.aioe.org")) +> to: +> (setq gnus-select-method '(nntp "nntp.aioe.org")) + +> Does anybody know why this happens and what to do about it? + +My impression from actual use is that one or the other server is +actually down for a few hours or sometimes days at a time. As long as +at least one of them is up, the service itself is logically available. +The "solution" is just what you're already doing, or something such as +what others have already suggested. + +> This works with one very important hitch: I lose all my marks. + +Another, and rather simple, solution to this problem is: + +cd ~/News/marks +ln -s news.aioe.org nntp.aioe.org [or vice versa] + +HTH, + -WBE + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M263297= P19819.slip,S=3D5828,W=3D5969:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M263297P19819.slip,S=3D5828,W=3D5969:2, new file mode 100644 index 0000000..5e9f310 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M263297P19819.= slip,S=3D5828,W=3D5969:2, @@ -0,0 +1,141 @@ +From MAILER-DAEMON Fri Nov 09 06:02:09 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TWmLh-0004QG-K4 + for mharc-info-gnus-english@gnu.org; Fri, 09 Nov 2012 06:02:09 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:52206) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TWmLY-0004Py-Ax + for info-gnus-english@gnu.org; Fri, 09 Nov 2012 06:02:07 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1TWmLU-0002Kn-BV + for info-gnus-english@gnu.org; Fri, 09 Nov 2012 06:02:00 -0500 +Received: from m50-112.126.com ([123.125.50.112]:43240) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TWmLT-0002Ka-40 + for info-gnus-english@gnu.org; Fri, 09 Nov 2012 06:01:56 -0500 +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3D126.com; + s=3Ds110527; h=3DReceived:From:To:Cc:Subject:References:Face:Date: + In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type: + Content-Transfer-Encoding; bh=3D0dYBCHQYZFCK1e7FN4UsOXej5lDmVOO5lQ + kw04viKF4=3D; b=3DUwzozl5wjOtP+NgfZ8eqlGlEO4ygJu+MvmzWaW8j5b+5dBvzEp + H7f/L0T+ysK5RdfulTvBwttNbvj2jLUprAnkarxA//8lhU3E6wVxy/xV4SAe5cO8 + 5suUskZ7Tb1TXdtsZBkXySTMDAzCgdN77Sd3mG43oattwvJVqjDkNykTE=3D +Received: from Aphrodite.local (unknown [27.115.42.254]) + by smtp6 (Coremail) with SMTP id j9KowECJeVWd4pxQJzdCAQ--.9S2; + Fri, 09 Nov 2012 19:01:51 +0800 (CST) +From: Easior +To: asjo@koldfront.dk (Adam Sj=EF=BF=BDgren) +Subject: Re: how to work with nnfolder? +References: <87k3tv9zdf.fsf@Noah.localdomain> + <87390jb681.fsf@topper.koldfront.dk> +Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAAK/INwWK6Q= AAABl0 + RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAMUExURe/v7y8pJ5UdEpuRfs3= NYikA + AAE9SURBVHjaxJRbbsUgDEQ9nv3vuWAI2ASoo34URcrVzRz8GIPI/y3q+MUUgAGopgIAE2A= O4JNb + FoCiSIs+BZQabNkr16S5kAGUNfeGMeeCGZHVF7NoRqRL1tIlFUA/APoF6O1sKxWgEPgC0AW= gfPIN + lDyArMvNL8DKyDW1ZPKMHn/PxQ4Psz2ipdLTyWREIBC3abPNEAHc93X6u2suj0iUm6AGbof= J3U84 + AbUDVQl7ZAEYIw056uHAJoLwFYqme1aIIBbzBZT/aMMbgS62bN8hetPDnTyjRr1d3dw3tgM= hhG2+ + BxrhR2kA5DGEhCKaa2d9/zzkzS7iQDxFcvazwQc9F6+Ve8OO00fgJp96LjbvATrJIublNNA= 1aVUv + 6fn6pn7Y7yWvUx0babPXR7C/dm7Mfdpw3Rp8LPMP60eAAQAtmgbkuFBEMwAAAABJRU5ErkJ= gggo=3D +Date: Fri, 09 Nov 2012 19:01:56 +0800 +In-Reply-To: <87390jb681.fsf@topper.koldfront.dk> (Adam Sj's message of = "Fri,=20 + 09 Nov 2012 08:11:58 +0100") +Message-ID: +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) +MIME-Version: 1.0 +Content-Type: text/plain; charset=3Dutf-8 +Content-Transfer-Encoding: quoted-printable +X-CM-TRANSID: j9KowECJeVWd4pxQJzdCAQ--.9S2 +X-Coremail-Antispam: 1Uf129KBjvJXoW7tw15KFy8Xr18Jw48JryUtrb_yoW8Aw13pF + 4aqrsIvr48Zr48CFs5uw1jyryfJFy5KFW5ZasYqr4rA3W5uFy8Jr1xCr4FvFyUArySkr1j + yFs7tryDAr1qva7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 + 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UB7K3UUUUU=3D +X-CM-SenderInfo: 5hdvx0bu6rjloofrz/1tbi1wRiaUgYzYKzKQAAsd +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x +X-Received-From: 123.125.50.112 +Cc: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 09 Nov 2012 11:02:07 -0000 + +>>>>> "AS" =3D3D=3D3D Adam Sjgren writes: + + AS> On Fri, 09 Nov 2012 12:25:16 +0800, Easior wrote: + >> ;; Tell gnus which method to use for archives (nnfolder) + + AS> [...] + + >> However, there is something weird happened. When I send a messag= e by + AS> gnus, + >> I'll find that a file named 'mail' will be created in the direct= ory + >> "~/.emacs.d/gnus/Mail/archive/sent/". In fact, it is not correct= . + AS> Gnus + >> should create a file, e.g. named '1', in the directory + >> "~/.emacs.d/gnus/Mail/archive/sent/mail". + + AS> What gave you that impression? + +The mechanism of nnml made me such impression. + + AS> nnfolder stores each _group_ in a file, not each mail. + + AS> See: + + AS> * http://gnus.org/manual/gnus_201.html + + AS> As you have observed, nnml stores each _mail_ in a separate file= ; as + AS> described in: + + AS> * http://gnus.org/manual/gnus_194.html + + >> everything is ok. What's happened? + + AS> Looks like it works as advertised to me? + + AS> :-), + + AS> Adam + + AS> --=3D20 + AS> "Everybody will be quick to agree that EMACS has a Adam Sjgren + AS> simple to learn user interface, at least to gain asjo@koldfront.= dk + AS> 'novice' status." + +Thank you very much. + +There is another problem. If I use=3D20 + +;; Tell gnus which method to use for archives (nnfolder)=3D20 +(setq gnus-message-archive-method=3D20 + '(nnfolder "archive"=3D20 + (nnfolder-directory "~/.emacs.d/gnus/Mail/archive")=3D2= 0 + (nnfolder-active-file "~/.emacs.d/gnus/Mail/archive/act= ive=3D +")=3D20 + ;; (nnfolder-get-new-mail nil)=3D20 + (nnfolder-inhibit-expiry t)))=3D20 + +all buffers related to gnus will be read only. Why does it happen? + +--=3D20 +Best Regards, + +Easior +----- +Ich bin von heute und ehedam, aber etwas ist in mir, das ist vor +morgen und =3DC3=3DBCbermorgen und einstmal.=3DEF=3DBB=3DBF + + Friedrich Wilhelm Nietzsche +---------------------------------------------------------------- + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M267088= P19819.slip,S=3D4259,W=3D4369:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M267088P19819.slip,S=3D4259,W=3D4369:2, new file mode 100644 index 0000000..b68b654 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M267088P19819.= slip,S=3D4259,W=3D4369:2, @@ -0,0 +1,110 @@ +From MAILER-DAEMON Fri Nov 09 02:12:26 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TWilO-0004f8-LL + for mharc-info-gnus-english@gnu.org; Fri, 09 Nov 2012 02:12:26 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:47009) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TWilJ-0004dn-8d + for info-gnus-english@gnu.org; Fri, 09 Nov 2012 02:12:24 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1TWilE-0001tu-IQ + for info-gnus-english@gnu.org; Fri, 09 Nov 2012 02:12:21 -0500 +Received: from plane.gmane.org ([80.91.229.3]:41005) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TWilE-0001ti-Br + for info-gnus-english@gnu.org; Fri, 09 Nov 2012 02:12:16 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1TWilJ-00057U-DD + for info-gnus-english@gnu.org; Fri, 09 Nov 2012 08:12:21 +0100 +Received: from 2505ds5-by.0.fullrate.dk ([89.150.142.116]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Fri, 09 Nov 2012 08:12:21 +0100 +Received: from asjo by 2505ds5-by.0.fullrate.dk with local (Gmexim 0.1 + (Debian)) id 1AlnuQ-0007hv-00 + for ; Fri, 09 Nov 2012 08:12:21 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: asjo@koldfront.dk (Adam =3D?iso-8859-1?Q?Sj=3DF8gren?=3D) +Subject: Re: how to work with nnfolder? +Date: Fri, 09 Nov 2012 08:11:58 +0100 +Organization: koldfront - analysis & revolution, Copenhagen, Denmark +Lines: 38 +Message-ID: <87390jb681.fsf@topper.koldfront.dk> +References: <87k3tv9zdf.fsf@Noah.localdomain> +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Diso-8859-1 +Content-Transfer-Encoding: 8bit +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: 2505ds5-by.0.fullrate.dk +OpenPGP: id=3D21BDE416; url=3Dhttp://asjo.koldfront.dk/gpg.asc +X-Face: )qY&CseJ?.:=3D8F#^~GcSA?F=3D9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97, + Q(^@xk}n4Ou + rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S= /IS9lMJ + ^St'=3DVZBR +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 09 Nov 2012 07:12:25 -0000 + +On Fri, 09 Nov 2012 12:25:16 +0800, Easior wrote: + +> ;; Tell gnus which method to use for archives (nnfolder) + +[...] + +> However, there is something weird happened. When I send a message by g= nus, +> I'll find that a file named 'mail' will be created in the directory +> "~/.emacs.d/gnus/Mail/archive/sent/". In fact, it is not correct. Gnus +> should create a file, e.g. named '1', in the directory +> "~/.emacs.d/gnus/Mail/archive/sent/mail". + +What gave you that impression? + +nnfolder stores each _group_ in a file, not each mail. + +See: + + * http://gnus.org/manual/gnus_201.html + +As you have observed, nnml stores each _mail_ in a separate file; as +described in: + + * http://gnus.org/manual/gnus_194.html + +> everything is ok. What's happened? + +Looks like it works as advertised to me? + + + :-), + + Adam + +--=20 + "Everybody will be quick to agree that EMACS has a Adam Sj=EF= =BF=BDgren + simple to learn user interface, at least to gain asjo@koldfront.= dk + 'novice' status." + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M270804= P19819.slip,S=3D5031,W=3D5145:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M270804P19819.slip,S=3D5031,W=3D5145:2, new file mode 100644 index 0000000..36a9a6a --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M270804P19819.= slip,S=3D5031,W=3D5145:2, @@ -0,0 +1,114 @@ +From MAILER-DAEMON Fri Nov 09 00:02:39 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TWgjn-0005AS-Gp + for mharc-info-gnus-english@gnu.org; Fri, 09 Nov 2012 00:02:39 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:51271) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TWg9y-0000ln-HW + for info-gnus-english@gnu.org; Thu, 08 Nov 2012 23:25:39 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1TWg9x-0000y4-GO + for info-gnus-english@gnu.org; Thu, 08 Nov 2012 23:25:38 -0500 +Received: from m50-111.126.com ([123.125.50.111]:58160) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TWg9u-0000wx-Ar + for info-gnus-english@gnu.org; Thu, 08 Nov 2012 23:25:37 -0500 +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3D126.com; + s=3Ds110527; h=3DReceived:From:To:Subject:Face:Date:Message-ID: + User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding; + bh=3D9DURyIcON0nAcMFj3mXHMNQ71bFLorYe0NrkPDx2Pb4=3D; b=3DDqCnsKSehxYeQ + FFjE2d64box8idKQGkWR8vCMgX53JhH/Ed7eMNETNDMXpc6XixEs5Jza2RWfBZhD + Vcb+Z3MgC1CVmk4gSjVWBMN82mNrXvPX9TiyNAWtraftBweVw37+ZC4a3hXawMs0 + Lb61kDIF1CDWsBfX5MnW4ayaMurRRk=3D +Received: from Noah.localdomain (unknown [27.115.42.253]) + by smtp5 (Coremail) with SMTP id jtKowEDJrE+thZxQccYtAQ--.55S3; + Fri, 09 Nov 2012 12:25:19 +0800 (CST) +From: Easior +To: info-gnus-english@gnu.org +Subject: how to work with nnfolder? +Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAAK/INwWK6Q= AAABl0 + RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAMUExURe/v7y8pJ5UdEpuRfs3= NYikA + AAE9SURBVHjaxJRbbsUgDEQ9nv3vuWAI2ASoo34URcrVzRz8GIPI/y3q+MUUgAGopgIAE2A= O4JNb + FoCiSIs+BZQabNkr16S5kAGUNfeGMeeCGZHVF7NoRqRL1tIlFUA/APoF6O1sKxWgEPgC0AW= gfPIN + lDyArMvNL8DKyDW1ZPKMHn/PxQ4Psz2ipdLTyWREIBC3abPNEAHc93X6u2suj0iUm6AGbof= J3U84 + AbUDVQl7ZAEYIw056uHAJoLwFYqme1aIIBbzBZT/aMMbgS62bN8hetPDnTyjRr1d3dw3tgM= hhG2+ + BxrhR2kA5DGEhCKaa2d9/zzkzS7iQDxFcvazwQc9F6+Ve8OO00fgJp96LjbvATrJIublNNA= 1aVUv + 6fn6pn7Y7yWvUx0babPXR7C/dm7Mfdpw3Rp8LPMP60eAAQAtmgbkuFBEMwAAAABJRU5ErkJ= gggo=3D +Date: Fri, 09 Nov 2012 12:25:16 +0800 +Message-ID: <87k3tv9zdf.fsf@Noah.localdomain> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) +MIME-Version: 1.0 +Content-Type: text/plain; charset=3Dgb2312 +Content-Transfer-Encoding: quoted-printable +X-CM-TRANSID: jtKowEDJrE+thZxQccYtAQ--.55S3 +X-Coremail-Antispam: 1Uf129KBjvJXoW7JFW3Gw1fAw1rGr45uFyUWrg_yoW8JrWUpw + 4YgF4Svw1UXw1rAa9Y934F9ry3ZF1rtFWjqwnavr15Aa43WF95Ar1Fkr4jqFW5Krn3G348 + Zan5KrWDJFn09rDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 + 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jxeOJUUUUU=3D +X-CM-SenderInfo: 5hdvx0bu6rjloofrz/1tbiJg1iaU4f76TEJQAAsb +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x +X-Received-From: 123.125.50.111 +X-Mailman-Approved-At: Fri, 09 Nov 2012 00:02:38 -0500 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 09 Nov 2012 04:25:39 -0000 + + +hi, all. + +To archive the messages sent, I use + +;; Tell gnus which method to use for archives (nnfolder) +(setq gnus-message-archive-method + '(nnfolder "archive" + (nnfolder-directory "~/.emacs.d/gnus/Mail/archive/") + (nnfolder-active-file +"~/.emacs.d/gnus/Mail/archive/active") + (nnfolder-get-new-mail nil) + (nnfolder-inhibit-expiry t))) +;; Tell gnus into which group to store messages +(setq gnus-message-archive-group + '((if (message-news-p) + "nnfolder+archive:sent.news" + "nnfolder+archive:sent.mail"))) + +However, there is something weird happened. When I send a message by gnu= s, +I'll find that a file named 'mail' will be created in the directory +"~/.emacs.d/gnus/Mail/archive/sent/". In fact, it is not correct. Gnus +should create a file, e.g. named '1', in the directory +"~/.emacs.d/gnus/Mail/archive/sent/mail". If I +only use the following configuration + +;; Tell gnus into which group to store messages +(setq gnus-message-archive-group + '((if (message-news-p) + "nnml+POP:sent.news" + "nnml+POP:sent.mail"))) + +everything is ok. What's happened? + +Thanks in advance. + +Cheers, + +Easior + +--=3D20 +=3DD7=3DD4=3DB4=3DD3=3DC4=3DE3=3DC0=3DEB=3DBF=3DAA=3DC1=3DCB=3DD2=3DD4=3D= BA=3DF3=3DA3=3DAC=3DCE=3DD2=3DD2=3DBB=3DD6=3DB1=3DB5=3D +=3DC8=3DB4=3DFD=3DD7=3DC5=3DC4=3DE3=3DBB=3DD8=3DC0=3DB4 +=3DD0=3DC4=3DCD=3DB4=3DB5=3DC4=3DCA=3DB1=3DBA=3DF2=3DA3=3DAC=3DD5=3DE6=3D= CA=3DC7=3DBA=3DC3=3DD0=3DC1=3DBF=3DE0 +My homepage:[http://xxxxxxxx] + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M273777= P19819.slip,S=3D4162,W=3D4268:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M273777P19819.slip,S=3D4162,W=3D4268:2, new file mode 100644 index 0000000..7987fb8 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M273777P19819.= slip,S=3D4162,W=3D4268:2, @@ -0,0 +1,106 @@ +From MAILER-DAEMON Sun Nov 11 12:52:23 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TXbhn-0008Oq-Uq + for mharc-info-gnus-english@gnu.org; Sun, 11 Nov 2012 12:52:23 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:57993) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TXbhj-0008OI-Vp + for info-gnus-english@gnu.org; Sun, 11 Nov 2012 12:52:23 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1TXbhg-0005Ht-Tn + for info-gnus-english@gnu.org; Sun, 11 Nov 2012 12:52:19 -0500 +Received: from plane.gmane.org ([80.91.229.3]:44334) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TXbhg-0005Hg-N6 + for info-gnus-english@gnu.org; Sun, 11 Nov 2012 12:52:16 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1TXbhn-0001xR-0y + for info-gnus-english@gnu.org; Sun, 11 Nov 2012 18:52:23 +0100 +Received: from c-24-131-17-1.hsd1.pa.comcast.net ([24.131.17.1]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Sun, 11 Nov 2012 18:52:23 +0100 +Received: from gardellawg by c-24-131-17-1.hsd1.pa.comcast.net with loca= l + (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 + for ; Sun, 11 Nov 2012 18:52:23 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: William Gardella +Subject: Re: which variable determines the behavior of news' drafts? +Date: Sun, 11 Nov 2012 12:52:03 -0500 +Lines: 41 +Message-ID: <87bof4gh8c.fsf@gmail.com> +References: +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: c-24-131-17-1.hsd1.pa.comcast.net +X-Archive: encrypt +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) +Cancel-Lock: sha1:T2bRvh0nmXXPNW+HxN0pGrI8qkI=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 11 Nov 2012 17:52:23 -0000 + +Hi there. + +Easior writes: + +> Hi, all. +> +> I have made some modifications of default places of gnus directories, +> e.g. +> +> (setq gnus-default-directory "~/.emacs.d/gnus/") (setq +> gnus-home-directory "~/.emacs.d/gnus/") (setq gnus-directory +> "~/.emacs.d/gnus/News/") (setq message-auto-save-directory +> "~/.emacs.d/gnus/Mail/drafts/") +> +> it always works well. However, there exists a seemingly strange +> directory +> +> $ cd ~/.emacs.d/gnus/News $ ls agent drafts trash $ ls drafts drafts +> queue +> +> it means that there are two directories with the same name "drafts" +> exiting in the gnus hirarchical directories. How can I do? +> +> Thank in advance. + +Those two directories exist because Gnus makes two "nndraft" groups +within `gnus-directory' automatically. nndraft:drafts is for saved +unsent messages, while nndraft:queue is where "sent" messages are +diverted to whenever Gnus is in "unplugged" (offline) mode, or if you +set the variable `gnus-agent-queue-mail' to t. + +FYI, according to the docstring of `message-auto-save-directory', it is +only used when Gnus isn't running. You might be better off setting it +to what Gnus is trying to use. + +Your directory setup is cool for portability. I think I'll steal it. :) + +Best, WGG + +--=20 +I use grml (http://grml.org/) + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M276430= P19819.slip,S=3D4417,W=3D4518:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M276430P19819.slip,S=3D4417,W=3D4518:2, new file mode 100644 index 0000000..0a8b3fa --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M276430P19819.= slip,S=3D4417,W=3D4518:2, @@ -0,0 +1,101 @@ +From MAILER-DAEMON Fri Nov 09 06:41:37 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TWmxt-0001c6-8k + for mharc-info-gnus-english@gnu.org; Fri, 09 Nov 2012 06:41:37 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:56470) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TWmxo-0001bq-D2 + for info-gnus-english@gnu.org; Fri, 09 Nov 2012 06:41:36 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1TWmxn-00053L-AB + for info-gnus-english@gnu.org; Fri, 09 Nov 2012 06:41:32 -0500 +Received: from m50-110.126.com ([123.125.50.110]:49004) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TWmxj-00052i-Lg + for info-gnus-english@gnu.org; Fri, 09 Nov 2012 06:41:31 -0500 +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3D126.com; + s=3Ds110527; h=3DReceived:From:To:Subject:Face:Date:Message-ID: + User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding; + bh=3DEhD+HiWgWYV+wLyybECfAeTN2NqdL3E03MULN7BuNt0=3D; b=3DXB8aH00lsmmeS + y+ZBzbeR1ic01SONoPmI/r3SGu3j/uEXnV/ihuf/J+yyEBo+wn9FH6SgV/30Wxra + hjAQplNs1KPgWVhaXIWBR6/j9tFFigkK5rs92TWCBCWshOJUSu+xijmQ6HpWpLtg + U7hJzBvt3LAlhCT3LK/L69fOkoM4+8=3D +Received: from Aphrodite.local (unknown [27.115.42.254]) + by smtp4 (Coremail) with SMTP id jdKowEBJE0zc65xQRShPAQ--.117S2; + Fri, 09 Nov 2012 19:41:17 +0800 (CST) +From: Easior +To: info-gnus-english@gnu.org +Subject: which variable determines the behavior of news' drafts? +Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAAK/INwWK6Q= AAABl0 + RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAMUExURe/v7y8pJ5UdEpuRfs3= NYikA + AAE9SURBVHjaxJRbbsUgDEQ9nv3vuWAI2ASoo34URcrVzRz8GIPI/y3q+MUUgAGopgIAE2A= O4JNb + FoCiSIs+BZQabNkr16S5kAGUNfeGMeeCGZHVF7NoRqRL1tIlFUA/APoF6O1sKxWgEPgC0AW= gfPIN + lDyArMvNL8DKyDW1ZPKMHn/PxQ4Psz2ipdLTyWREIBC3abPNEAHc93X6u2suj0iUm6AGbof= J3U84 + AbUDVQl7ZAEYIw056uHAJoLwFYqme1aIIBbzBZT/aMMbgS62bN8hetPDnTyjRr1d3dw3tgM= hhG2+ + BxrhR2kA5DGEhCKaa2d9/zzkzS7iQDxFcvazwQc9F6+Ve8OO00fgJp96LjbvATrJIublNNA= 1aVUv + 6fn6pn7Y7yWvUx0babPXR7C/dm7Mfdpw3Rp8LPMP60eAAQAtmgbkuFBEMwAAAABJRU5ErkJ= gggo=3D +Date: Fri, 09 Nov 2012 19:41:26 +0800 +Message-ID: +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) +MIME-Version: 1.0 +Content-Type: text/plain; charset=3Dutf-8 +Content-Transfer-Encoding: 8bit +X-CM-TRANSID: jdKowEBJE0zc65xQRShPAQ--.117S2 +X-Coremail-Antispam: 1Uf129KBjvdXoW7Gw1rXry7CrWDGF4fKry3Arb_yoWfJFXEka + 4kGF9rAFWakF47Ja13tr4UX3W8KrZ5G3srArW5Kr42krWxJ398JrsrJrs8ZF17XayIqr1a + krZ5Jr4jywnrGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT + 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8SfO7UUUUU=3D=3D +X-CM-SenderInfo: 5hdvx0bu6rjloofrz/1tbi8xxiaU0vMrLrhQAAso +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x +X-Received-From: 123.125.50.110 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 09 Nov 2012 11:41:36 -0000 + + +Hi, all. + +I have made some modifications of default places of gnus directories, e.= g. + +(setq gnus-default-directory "~/.emacs.d/gnus/") +(setq gnus-home-directory "~/.emacs.d/gnus/") +(setq gnus-directory "~/.emacs.d/gnus/News/") +(setq message-auto-save-directory "~/.emacs.d/gnus/Mail/drafts/") + +it always works well. However, there exists a seemingly strange director= y + +$ cd ~/.emacs.d/gnus/News +$ ls=20 +agent drafts trash +$ ls drafts +drafts queue + +it means that there are two directories with the same name "drafts" exit= ing in the gnus +hirarchical directories. How can I do? + +Thank in advance. + +--=20 +Best Regards, + +Easior +----- +Ich bin von heute und ehedam, aber etwas ist in mir, das ist vor +morgen und =C3=BCbermorgen und einstmal.=EF=BB=BF + + Friedrich Wilhelm Nietzsche +---------------------------------------------------------------- + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M278921= P19819.slip,S=3D9511,W=3D9743:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M278921P19819.slip,S=3D9511,W=3D9743:2, new file mode 100644 index 0000000..ab1999a --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M278921P19819.= slip,S=3D9511,W=3D9743:2, @@ -0,0 +1,232 @@ +From MAILER-DAEMON Thu Nov 15 23:13:57 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TZDJV-00038e-Ao + for mharc-info-gnus-english@gnu.org; Thu, 15 Nov 2012 23:13:57 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:53628) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TZDJQ-00036J-F1 + for info-gnus-english@gnu.org; Thu, 15 Nov 2012 23:13:55 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1TZDJN-0006X1-9k + for info-gnus-english@gnu.org; Thu, 15 Nov 2012 23:13:52 -0500 +Received: from m50-111.126.com ([123.125.50.111]:36231) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TZDJM-0006WY-0w + for info-gnus-english@gnu.org; Thu, 15 Nov 2012 23:13:49 -0500 +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3D126.com; + s=3Ds110527; h=3DReceived:From:To:Cc:Subject:In-Reply-To:Date: + Message-ID:References:User-Agent:Face:MIME-Version:Content-Type: + Content-Transfer-Encoding; bh=3DiBfV7+Rjp/yKl5P2qYWh0+fB6ourOsc9M+ + B8ngttOb0=3D; b=3DYbkcuBiPX7rROIccxVkslEp1xZ6+uKj7UsYql+83TWMbrqha92 + t7sYdBnJMeteIpc+vYKs6nG5d4KEizUqGnyEZU4JHkDF2pv0M9VQzMFAl43wKNtM + OWc1hI3w5BMEKLuMgrE8pra1zDgIJF/nWV7/NBzfRFJd3ovsYwjZA9zrQ=3D +Received: from Noah.localdomain (unknown [27.115.42.252]) + by smtp5 (Coremail) with SMTP id jtKowEAZkEd0vaVQrW9oAg--.650S3; + Fri, 16 Nov 2012 12:13:40 +0800 (CST) +From: Easior +To: Thorsten Jolitz +Subject: Re: Strange indentation in message-mode +In-Reply-To: <87pqalfh3j.fsf@googlemail.com> (Thorsten Jolitz's message = of + "Thu, 03 May 2012 16:56:48 +0200") +Date: Wed, 14 Nov 2012 19:55:02 +0800 +Message-ID: <87obj0s8kp.fsf@Noah.localdomain> +References: <87txzxh7u0.fsf@googlemail.com> <87sjfhh22e.fsf@gnu.org> + <87pqalfh3j.fsf@googlemail.com> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) +Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAAK/INwWK6Q= AAABl0 + RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAMUExURe/v7y8pJ5UdEpuRfs3= NYikA + AAE9SURBVHjaxJRbbsUgDEQ9nv3vuWAI2ASoo34URcrVzRz8GIPI/y3q+MUUgAGopgIAE2A= O4JNb + FoCiSIs+BZQabNkr16S5kAGUNfeGMeeCGZHVF7NoRqRL1tIlFUA/APoF6O1sKxWgEPgC0AW= gfPIN + lDyArMvNL8DKyDW1ZPKMHn/PxQ4Psz2ipdLTyWREIBC3abPNEAHc93X6u2suj0iUm6AGbof= J3U84 + AbUDVQl7ZAEYIw056uHAJoLwFYqme1aIIBbzBZT/aMMbgS62bN8hetPDnTyjRr1d3dw3tgM= hhG2+ + BxrhR2kA5DGEhCKaa2d9/zzkzS7iQDxFcvazwQc9F6+Ve8OO00fgJp96LjbvATrJIublNNA= 1aVUv + 6fn6pn7Y7yWvUx0babPXR7C/dm7Mfdpw3Rp8LPMP60eAAQAtmgbkuFBEMwAAAABJRU5ErkJ= gggo=3D +MIME-Version: 1.0 +Content-Type: text/plain; charset=3Dutf-8 +Content-Transfer-Encoding: quoted-printable +X-CM-TRANSID: jtKowEAZkEd0vaVQrW9oAg--.650S3 +X-Coremail-Antispam: 1Uf129KBjvJXoWxtrW7Wry8uF17Gw4fJryxXwb_yoW7WF4Upr + 13Jr17Gr4UJr1UJw1UJr1UGr1Yvr1UJr1UJr15Jr18Jr1Yyr1UJr1UJr1rJryUJry5Jw1U + Ar1UWr1UJr1UJrUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 + 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jf_-PUUUUU=3D +X-CM-SenderInfo: 5hdvx0bu6rjloofrz/1tbinx9paU3ktCFn5gAAs9 +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x +X-Received-From: 123.125.50.111 +Cc: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 16 Nov 2012 04:13:55 -0000 + +>>>>> "TJ" =3D3D=3D3D Thorsten Jolitz writes: + + TJ> Bastien writes: + TJ> Hi Bastien, + + >> Thorsten Jolitz writes: + >>=3D20 + >>> The mode line says: + >>>=3D20 + >>> ,------------------------------------------------ + >>> | Message MML AC OrgTbl OrgStruct yas Abbrev Fill + >>> `------------------------------------------------ + >>>=3D20 + >>> and I deactivated OrgTbl and then OrgStruct, but the problem di= d + TJ> not go + >>> away. When I deactivate auto-fill-mode, the lines get very long= , + TJ> and + >>> when I press M-q the paragraphs get filled correctly. But w= ith + >>> auto-fill-mode activated, M-q does not undo the strange + TJ> indentation. + >>>=3D20 + >>> Any idea what could be the problem? + >>=3D20 + >> OrgStruct in the mode-line doesn't tell whether this is + TJ> orgstruct-mode + >> or orgstruct++-mode (I need to fix this.) + >>=3D20 + >> But my guess is that you use orgstruct++-mode, right? + + TJ> C-h m gives: + + TJ> ,---------------------------------------------------------------= ---=3D +---- + TJ> | Enabled minor modes: Abbrev Auto-Complete Auto-Composition + TJ> | Auto-Compression Auto-Encryption Auto-Fill Delete-Selection + TJ> | Diff-Auto-Refine Display-Time File-Name-Shadow Flyspell Font-L= ock + TJ> | Global-Font-Lock Gnus-Message-Citation Ido-Everywhere Line-Num= ber + TJ> Mml + TJ> | Mouse-Wheel Openwith Orgstruct Orgtbl Rcirc-Track Recentf + TJ> | Shell-Dirtrack Show-Paren Tooltip Transient-Mark Yas/Global + TJ> Yas/Minor + TJ> `---------------------------------------------------------------= ---=3D +---- + + TJ> and further down: + + TJ> ,-------------------------------------------- + TJ> | Orgstruct minor mode (indicator OrgStruct): + TJ> | Toggle the minor mode `orgstruct-mode'. + TJ> `-------------------------------------------- + + TJ> pressing the link: + + TJ> ,-------------------------------------------------------------- + TJ> | ... + TJ> | orgstruct-mode is also a variable. + TJ> |=3D20 + TJ> | orgstruct-mode is a variable defined in `org.el'. + TJ> | Its value is nil + TJ> |=3D20 + TJ> | Automatically becomes buffer-local when set in any fashion. + TJ> |=3D20 + TJ> | Documentation: + TJ> | Non-nil if OrgStruct mode is enabled. + TJ> | Use the command `orgstruct-mode' to change this variable. + TJ> `-------------------------------------------------------------- + + TJ> not quite right, since mode-line says it is enabled.=3D20 + + TJ> checking the functionality, e.g.: + + TJ> ,------------------------------------------------------ + TJ> | M-q Fill paragraph and items like in Org-mode + TJ> | M-RET Insert new heading/item + TJ> `------------------------------------------------------ + + TJ> =3D3D> (Promote, demote works) + TJ> ,---------------------------------------------------------------= ---=3D +--- + TJ> | runs the command orgtbl-hijacker-command-106, which= is=3D + an + TJ> | interactive Lisp function. + TJ> |=3D20 + TJ> | It is bound to . + TJ> |=3D20 + TJ> | (orgtbl-hijacker-command-106 ARG) + TJ> `---------------------------------------------------------------= ---=3D +--- + + TJ> ,---------------------------------------------------------------= - + TJ> | M-q runs the command orgstruct-hijacker-command-22, which is a= n + TJ> | interactive Lisp function. + TJ> |=3D20 + TJ> | It is bound to M-q. + TJ> `---------------------------------------------------------------= - + + >> orgstruct++-mode used to *replace* some indent/filling functions= of + >> major-mode (in this case message-mode) by Org's ones. Deactivat= ing + >> orgstruct++-mode was _not_ restoring the values for those replac= ed + >> variables... which caused confusion. + >>=3D20 + >> I recently reworked Org's code to fix this.=3D20=3D20 + >>=3D20 + >> Please double-check you have this commit in your git log: + >>=3D20 + >> http://orgmode.org/w/?p=3D3Dorg-mode.git;a=3D3Dcommit;h=3D3Da8= c312 + + TJ> apparently not: + + TJ> ,------------------------------------------------------------ + TJ> | ~/gitclone/org-mode $ git show a8c312 | + TJ> | fatal: ambiguous argument | + TJ> | 'a8c312': unknown revision or path not in the working tree. | + TJ> `------------------------------------------------------------ + + TJ> after sending this post, I will update and refresh Org-mode and = rep=3D +ort + TJ> what happened.=3D20 + + TJ> my system data: + TJ> ,---------------------------------------------------------------= ---=3D +---- + TJ> | "GNU Emacs 24.0.93.1 (x86_64-unknown-linux-gnu, GTK+ Version + TJ> 2.24.10) + TJ> | of 2012-02-07 on arch + TJ> | 7.8.09 + TJ> | Ma Gnus v0.2" + TJ> `---------------------------------------------------------------= ---=3D +---- + + TJ> --=3D20 + TJ> cheers, + TJ> Thorsten + + TJ> _______________________________________________ + TJ> info-gnus-english mailing list + TJ> info-gnus-english@gnu.org + TJ> https://lists.gnu.org/mailman/listinfo/info-gnus-english + +Hi, Thorsten. + +I'm very interesting in your styles of citing codes. It's so cool. I won= der=3D + whether it is +automatically made when you composed your messages. If it does, can you = sha=3D +re your elisp +codes with me? + +Thanks in advance. + +--=3D20 +Best regards, + +Easior +----- +Ich bin von heute und ehedam, aber etwas ist in mir, das ist vor +morgen und =3DC3=3DBCbermorgen und einstmal.=3DEF=3DBB=3DBF + + Friedrich Wilhelm Nietzsche +---------------------------------------------------------------- + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M281396= P19819.slip,S=3D5658,W=3D5785:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M281396P19819.slip,S=3D5658,W=3D5785:2, new file mode 100644 index 0000000..6f65733 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M281396P19819.= slip,S=3D5658,W=3D5785:2, @@ -0,0 +1,127 @@ +From MAILER-DAEMON Thu Nov 15 23:13:57 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TZDJV-000394-ET + for mharc-info-gnus-english@gnu.org; Thu, 15 Nov 2012 23:13:57 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:53630) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TZDJQ-00036K-Fv + for info-gnus-english@gnu.org; Thu, 15 Nov 2012 23:13:55 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1TZDJN-0006X7-ED + for info-gnus-english@gnu.org; Thu, 15 Nov 2012 23:13:52 -0500 +Received: from m50-110.126.com ([123.125.50.110]:40831) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TZDJL-0006Mx-MJ + for info-gnus-english@gnu.org; Thu, 15 Nov 2012 23:13:49 -0500 +DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3D126.com; + s=3Ds110527; h=3DReceived:From:To:Subject:In-Reply-To:Date: + Message-ID:References:User-Agent:Face:MIME-Version:Content-Type: + Content-Transfer-Encoding; bh=3DHaxaAp9/Lr5mBCdu/jpo4qC8fso56Xx2kj + 4qTGTLZcM=3D; b=3DV21tI5tUnkOXQCyk07F1xS/RzxqVMzOekFq8g/+06UrzjtAJMC + fzuPkQ+l/kxRDiZ3WMXGxTHzJ/hogsHlzzMIFzVSl6oje+7HdroNtl7bDn7etTjQ + Hl0nUHgkGrlrjRKkk2nruy6+O1GI1c3/S0vnZS16a8A/rTOlzJE/ALbgM=3D +Received: from Noah.localdomain (unknown [27.115.42.252]) + by smtp4 (Coremail) with SMTP id jdKowECZgWhwvaVQxTuFAg--.382S3; + Fri, 16 Nov 2012 12:13:37 +0800 (CST) +From: Easior +To: info-gnus-english@gnu.org +Subject: Re: multiple gmail accounts: smtp and expiry +In-Reply-To: <63bompavp2.fsf@news.eternal-september.org> (Richard Riley'= s + message of "Wed, 18 Apr 2012 17:47:21 +0200") +Date: Wed, 14 Nov 2012 20:06:14 +0800 +Message-ID: <87ip98s821.fsf@Noah.localdomain> +References: <87sjg6dxlr.fsf@gmail.com> <82ipgyv890.fsf@gmail.com> + <82d375oxl5.fsf@gmail.com> + <63bompavp2.fsf@news.eternal-september.org> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) +Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAAK/INwWK6Q= AAABl0 + RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAMUExURe/v7y8pJ5UdEpuRfs3= NYikA + AAE9SURBVHjaxJRbbsUgDEQ9nv3vuWAI2ASoo34URcrVzRz8GIPI/y3q+MUUgAGopgIAE2A= O4JNb + FoCiSIs+BZQabNkr16S5kAGUNfeGMeeCGZHVF7NoRqRL1tIlFUA/APoF6O1sKxWgEPgC0AW= gfPIN + lDyArMvNL8DKyDW1ZPKMHn/PxQ4Psz2ipdLTyWREIBC3abPNEAHc93X6u2suj0iUm6AGbof= J3U84 + AbUDVQl7ZAEYIw056uHAJoLwFYqme1aIIBbzBZT/aMMbgS62bN8hetPDnTyjRr1d3dw3tgM= hhG2+ + BxrhR2kA5DGEhCKaa2d9/zzkzS7iQDxFcvazwQc9F6+Ve8OO00fgJp96LjbvATrJIublNNA= 1aVUv + 6fn6pn7Y7yWvUx0babPXR7C/dm7Mfdpw3Rp8LPMP60eAAQAtmgbkuFBEMwAAAABJRU5ErkJ= gggo=3D +MIME-Version: 1.0 +Content-Type: text/plain; charset=3Dutf-8 +Content-Transfer-Encoding: quoted-printable +X-CM-TRANSID: jdKowECZgWhwvaVQxTuFAg--.382S3 +X-Coremail-Antispam: 1Uf129KBjvJXoW7Cw4kXF15XFWUuFyxtFWfuFg_yoW8Wr4fpw + 43JF17Gr1DJr4UAw1vqw1UXw1Iyr1UArnxJrn8Jry8Xryqyr4xJ3yUtr4rC34DJ34fJr1j + vr1UGr1DGw1UJrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 + 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jxcTQUUUUU=3D +X-CM-SenderInfo: 5hdvx0bu6rjloofrz/1tbi1xFpaUgYzcm8NwAAsZ +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x +X-Received-From: 123.125.50.110 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 16 Nov 2012 04:13:55 -0000 + +>>>>> "RR" =3D3D=3D3D Richard Riley writes: + + RR> Sivaram Neelakantan writes: + >> On Tue, Apr 17 2012,Richard Riley wrote: + >>=3D20 + >> [snipped 19 lines] + >>=3D20 + >>>> And if people have better ideas, they'd correct it on the wiki= . + >>>>=3D20 + >>>=3D20 + >>> Except in reality they don't. Mutiple smtp accounts has numerou= s + >>> solutions - some which do and some which dont work with multipl= e + RR> gmail + >>> accounts and the latest Gnus and for someone not familiar with + RR> elisp to + >>=3D20 + >> True. You at least know what didn't work. :-) + + RR> In addition the msmtp solution is not nice since (a) its externa= l to + RR> emacs/gnus and (b) passwords are kept in clear text as opposed t= o t=3D +he + RR> much more preferablie .authinfo.gpg. Possibly there is some clea= ver + RR> way + RR> around that but I dont know. + +If you want to let gnus work with .authinfo.gpg, you can use=3D20 + +,------------------------------------------------- +|(setq auth-sources '((:source "~/.authinfo.gpg"))) +`------------------------------------------------- +It also works with nnimap back end for gmail account. You could try it. + + + >>=3D20 + >> [snipped 6 lines] + >>=3D20 + >> sivaram + >> --=3D20 + + RR> _______________________________________________ + RR> info-gnus-english mailing list + RR> info-gnus-english@gnu.org + RR> https://lists.gnu.org/mailman/listinfo/info-gnus-english + +--=3D20 +Best regards, + +Easior +----- +Ich bin von heute und ehedam, aber etwas ist in mir, das ist vor +morgen und =3DC3=3DBCbermorgen und einstmal.=3DEF=3DBB=3DBF + + Friedrich Wilhelm Nietzsche +---------------------------------------------------------------- + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M283480= P19819.slip,S=3D4006,W=3D4107:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M283480P19819.slip,S=3D4006,W=3D4107:2, new file mode 100644 index 0000000..70dfeda --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M283480P19819.= slip,S=3D4006,W=3D4107:2, @@ -0,0 +1,101 @@ +From MAILER-DAEMON Fri Nov 16 18:31:19 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TZVNX-0007TY-3d + for mharc-info-gnus-english@gnu.org; Fri, 16 Nov 2012 18:31:19 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:49347) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TZVNT-0007SQ-22 + for info-gnus-english@gnu.org; Fri, 16 Nov 2012 18:31:18 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1TZVNP-0000cR-V6 + for info-gnus-english@gnu.org; Fri, 16 Nov 2012 18:31:14 -0500 +Received: from plane.gmane.org ([80.91.229.3]:38620) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TZVNP-0000cE-Ox + for info-gnus-english@gnu.org; Fri, 16 Nov 2012 18:31:11 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1TZVNX-00043S-MB + for info-gnus-english@gnu.org; Sat, 17 Nov 2012 00:31:19 +0100 +Received: from samograd.ca ([69.90.114.176]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Sat, 17 Nov 2012 00:31:19 +0100 +Received: from burton by samograd.ca with local (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Sat, 17 Nov 2012 00:31:19 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: Burton Samograd +Subject: Re: Error in nnimap-open-connection-1 when using nnimap-stream = plain +Date: Fri, 16 Nov 2012 16:27:36 -0700 +Lines: 37 +Message-ID: +References: +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: samograd.ca +User-Agent: Gnus/5.1299999999999999 (Gnus v5.13) Emacs/24.3.50 (cygwin) +Cancel-Lock: sha1:HlquWWaL9oJW6ePEfLejrOmtLlo=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 16 Nov 2012 23:31:18 -0000 + +Burton Samograd writes: + +> Hello, +> +> When I use the following select method: +> +> (setq gnus-select-method '(nnimap "localhost" +> (nnimap-address "localhost") +> (nnimap-server-port 1143) +> (nnimap-stream plain))) +> +> I get a "wrong type argument: string nil" message when running gnus. +> Tracking this down lead me into nnimap-open-connection-1, where it +> doesn't look like capabilities are set when using nnimap-stream plain +> (or maybe some other reason). +> +> I fixed it by wrapping the mapcar #'upcase with an if statement +> (starting at line 433 of my gnus sources in nnimap.el): +> +> (setf (nnimap-capabilities nnimap-object) +> (if capabilities +> (mapcar #'upcase +> (split-string capabilities)) +> "")) + +I realized after sending that this probably should have been: + + (setf (nnimap-capabilities nnimap-object) + (if capabilities + (mapcar #'upcase + (split-string capabilities)))) + +since if returns nil, which I should have been returning rather than the +empty string. + +-- +Burton Samograd + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M285367= P19819.slip,S=3D3927,W=3D4027:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M285367P19819.slip,S=3D3927,W=3D4027:2, new file mode 100644 index 0000000..8c4ac91 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M285367P19819.= slip,S=3D3927,W=3D4027:2, @@ -0,0 +1,100 @@ +From MAILER-DAEMON Fri Nov 16 18:10:06 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TZV30-0002DH-8B + for mharc-info-gnus-english@gnu.org; Fri, 16 Nov 2012 18:10:06 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:57273) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TZV2v-0002AB-3a + for info-gnus-english@gnu.org; Fri, 16 Nov 2012 18:10:04 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1TZV2s-00033z-0b + for info-gnus-english@gnu.org; Fri, 16 Nov 2012 18:10:01 -0500 +Received: from plane.gmane.org ([80.91.229.3]:41500) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TZV2r-00033t-Qr + for info-gnus-english@gnu.org; Fri, 16 Nov 2012 18:09:57 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1TZV2y-0000zM-37 + for info-gnus-english@gnu.org; Sat, 17 Nov 2012 00:10:04 +0100 +Received: from samograd.ca ([69.90.114.176]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Sat, 17 Nov 2012 00:10:04 +0100 +Received: from burton by samograd.ca with local (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Sat, 17 Nov 2012 00:10:04 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: Burton Samograd +Subject: Error in nnimap-open-connection-1 when using nnimap-stream plai= n +Date: Fri, 16 Nov 2012 15:57:09 -0700 +Lines: 37 +Message-ID: +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: samograd.ca +User-Agent: Gnus/5.1299999999999999 (Gnus v5.13) Emacs/24.3.50 (cygwin) +Cancel-Lock: sha1:WVM5Oh06Sv8pm0B/ouZJi9ptyzQ=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 16 Nov 2012 23:10:04 -0000 + +Hello, + +When I use the following select method: + +(setq gnus-select-method '(nnimap "localhost" + (nnimap-address "localhost") + (nnimap-server-port 1143) + (nnimap-stream plain))) + +I get a "wrong type argument: string nil" message when running gnus. +Tracking this down lead me into nnimap-open-connection-1, where it +doesn't look like capabilities are set when using nnimap-stream plain +(or maybe some other reason). + +I fixed it by wrapping the mapcar #'upcase with an if statement +(starting at line 433 of my gnus sources in nnimap.el): + + (setf (nnimap-capabilities nnimap-object) + (if capabilities + (mapcar #'upcase + (split-string capabilities)) + "")) + +The original code was: + + (setf (nnimap-capabilities nnimap-object) + (mapcar #'upcase + (split-string capabilities))) + +which error'd out when capabilities was nil. + +I'm not sure if this is a proper fix, but it got me a bit further into +what I was trying to do, which as attempt to use Davmail to connect to +an exchange server. =20 + +-- +Burton Samograd + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M287297= P19819.slip,S=3D2226,W=3D2275:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M287297P19819.slip,S=3D2226,W=3D2275:2, new file mode 100644 index 0000000..edb49c8 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M287297P19819.= slip,S=3D2226,W=3D2275:2, @@ -0,0 +1,49 @@ +From MAILER-DAEMON Sun Nov 18 19:20:06 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TaF5q-0003Tp-1k + for mharc-info-gnus-english@gnu.org; Sun, 18 Nov 2012 19:20:06 -0500 +Path: usenet.stanford.edu!news.glorb.com!feeder.erje.net!eu.feeder.erje.= net!feed.xsnews.nl!border-1.ams.xsnews.nl!feeder.xennanews.com!feeder.xen= nanews.com!nf37.xennanews.com!not-for-mail +From: Cecil Westerhof +Newsgroups: gnu.emacs.gnus +Subject: Deleted group still found by tab expansion +Organization: Decebal Computing +X-Homepage: http://www.decebal.nl/ +Date: Sun, 18 Nov 2012 23:47:34 +0100 +Message-ID: <87boeur0jd.fsf@Compaq.site.inet> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) +Cancel-Lock: sha1:ii43G3C46BojGT1npOe/u+uzmR4=3D +MIME-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +X-Complaints-To: abuse@xennanews.com +Lines: 11 +NNTP-Posting-Host: 84.53.123.169 (84.53.123.169) +NNTP-Posting-Date: Sun, 18 Nov 2012 23:59:22 +0100 +Xref: usenet.stanford.edu gnu.emacs.gnus:87054 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 19 Nov 2012 00:20:05 -0000 + +In the past I had two groups. One ended with SpamNotFound and the othe +with SpamNLLGG. I deleted the last group. But still when I want to +move a message and type SpamN and give a TAB, instead of expanding to +SpamNotFound I get the two possibilities. Why does Gnus remember a +group that is deleted a long time ago? And how can I make Gnus forget +the group? + +--=20 +Cecil Westerhof +Senior Software Engineer +LinkedIn: http://www.linkedin.com/in/cecilwesterhof + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M289193= P19819.slip,S=3D4827,W=3D4912:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M289193P19819.slip,S=3D4827,W=3D4912:2, new file mode 100644 index 0000000..f7c993c --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M289193P19819.= slip,S=3D4827,W=3D4912:2, @@ -0,0 +1,85 @@ +From MAILER-DAEMON Tue Nov 20 05:45:07 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TalKF-0001Zz-D8 + for mharc-info-gnus-english@gnu.org; Tue, 20 Nov 2012 05:45:07 -0500 +Path: usenet.stanford.edu!news.glorb.com!news.netfront.net!not-for-mail +From: Liming Yang +Newsgroups: gnu.emacs.gnus +Subject: Re: gnus-notify.el is not work on Emacs24.2 +Date: Tue, 20 Nov 2012 18:43:22 +0800 +Organization: Netfront http://www.netfront.net/ +Lines: 43 +Message-ID: <87mwycimgl.fsf@w-oasis.com> +References: <123791454375028291.719217yanglm.ace-163.com@freenews.netfro= nt.net> + +NNTP-Posting-Host: 114.255.88.2 +Mime-Version: 1.0 +Content-Type: text/plain +Content-Transfer-Encoding: quoted-printable +X-Trace: adenine.netfront.net 1353408151 89220 114.255.88.2 (20 Nov 2012 + 10:42:31 GMT) +X-Complaints-To: news@netfront.net +NNTP-Posting-Date: Tue, 20 Nov 2012 10:42:31 +0000 (UTC) +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) +Cancel-Lock: sha1:g0eYmcFj8SNxxhpWANXEgYQaVK0=3D +Xref: usenet.stanford.edu gnu.emacs.gnus:87059 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 20 Nov 2012 10:45:05 -0000 + +Debugger entered--Lisp error: (invalid-function gnus-group-unread) + gnus-group-unread("dummy.group") + #[(g) "=08@\303 !\304\305\306 !\"A\205=3D1F\n\247\205=3D1F\n\307V\205=3D= 1F\310 !*=3D +\207" [g group unread gnus-group-unread assoc modeline-notify gnus-group= -fi=3D +nd-parameter 0 gnus-mst-notify-group] 4](("dummy.group" 0 nil)) + mapc(#[(g) "=08@\303 !\304\305\306 !\"A\205=3D1F\n\247\205=3D1F\n\307V= \205=3D1F\3=3D +10 !*\207" [g group unread gnus-group-unread assoc modeline-notify gnus-= gro=3D +up-find-parameter 0 gnus-mst-notify-group] 4] (("dummy.group" 0 nil) ("\= 277=3D +\306\321\247\274\274\312\365.\327\324\310\273\277\306\321\247.\322\275\3= 21\=3D +247" 3 ((1 . 42509) (57556 . 57577) 57580 (57596 . 57597)) ((seen (57556= . =3D +57611)))) ("nntp+freenews.netfront.net:gnu.emacs.bug" 3 nil nil "nntp:fr= een=3D +ews.netfront.net") ("nntp+freenews.netfront.net:gnu.emacs.gnus" 3 ((1 . = 147=3D +0) 1472 1475 1477 1481 1486 (1488 . 1489) (1502 . 1503) 1505 (1507 . 150= 8) =3D +1513 1517 1520 1525 1528 1530 (1532 . 1533) 1538 1542 1544 1549 (1554 . = 155=3D +5) 1560 (1562 . 1563) (1565 . 1566) 1574 (1581 . 1582) (1585 . 1586) 158= 8 1=3D +592 1594 1598 1600 1603 1615 1618 (1623 . 1625) 1628 1630 1633 (1638 . 1= 639=3D +) 1643 1646 1649 1653 1698 1746 1778 1789 1800 ...) ((seen (1470 . 1471)= (1=3D +473 . 1474) 1476 (1478 . 1480) (1482 . 1485) 1487 (1490 . 1501) 1504 150= 6 (=3D +1509 . 1512) (1514 . 1516) (1518 . 1519) (1521 . 1524) (1526 . 1527) 152= 9 1=3D +531 (1534 . 1537) (1539 . 1541) 1543 (1545 . 1548) (1550 . 1553) (1556 .= 15=3D +59) 1561 1564 (1567 . 1573) (1575 . 1580) (1583 . 1584) 1587 (1589 . 159= 1) =3D +1593 (1595 . 1597) 1599 (1601 . 1602) (1604 . 1614) (1616 . 1617) (1619 = . 1=3D +622) (1626 . 1627) 1629 (1631 . 1632) (1634 . 1637) (1640 . 1642) (1644 = . 1=3D +645) (1647 . 1648) (1650 . 1652) (1654 . 1697) (1699 . 1745) (1747 . 177= 7) =3D +(1779 . 1788) (1790 . 1799) ...)) "nntp:freenews.netfront.net") ("nntp+f= ree=3D +news.netfront.net:gnu.emacs.help" 3 nil nil "nntp:freenews.netfront.net"= ) (=3D +"nntp+freenews.netfront.net:linux.debian.user" 3 nil nil "nntp:freenews.= net=3D +front.net") ("nntp+freenews.netfront.net:linux.kernel" 3 ((1 . 217364) 3= 174=3D +85 317493) ((seen (317485 . 317984))) "nntp:freenews.netfront.net") ("nn= tp+=3D +freenews.netfront.net:linux.debian.doc" 3 nil nil "nntp:freenews.netfron= t.n=3D +et") ("nntp+freenews.netfront.net:linux.debian.kernel" 3 nil nil "nntp:f= ree=3D +news.netfront.net") ("nnml:mail.system" 3 ((1 . 6)) ((seen (1 . 6))) "nn= ml:=3D +") ("nnml:mail.send.mail" 3 nil nil "nnml:") ("nnml:mail.send.news" 3 ni= l n=3D +il "nnml:") ("nnml:mail.misc" 3 nil nil "nnml:") ("nndraft:drafts" 1 nil= ni=3D +l (nndraft "") ((gnus-dummy (gnus-draft-mode)))))) + gnus-mst-show-groups-with-new-messages() + run-hooks(gnus-after-getting-new-news-hook) + apply(run-hooks gnus-after-getting-new-news-hook) + gnus-run-hooks(gnus-after-getting-new-news-hook) + gnus-group-get-new-news(nil) + call-interactively(gnus-group-get-new-news nil nil) + +--- news://freenews.netfront.net/ - complaints: news@netfront.net --- + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M291195= P19819.slip,S=3D3629,W=3D3720:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M291195P19819.slip,S=3D3629,W=3D3720:2, new file mode 100644 index 0000000..cf3f63c --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M291195P19819.= slip,S=3D3629,W=3D3720:2, @@ -0,0 +1,91 @@ +From MAILER-DAEMON Mon Nov 19 11:18:40 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TaU3U-0006y6-Lr + for mharc-info-gnus-english@gnu.org; Mon, 19 Nov 2012 11:18:40 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:45956) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TaU3P-0006y0-6j + for info-gnus-english@gnu.org; Mon, 19 Nov 2012 11:18:39 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1TaU3J-0003bV-3f + for info-gnus-english@gnu.org; Mon, 19 Nov 2012 11:18:35 -0500 +Received: from plane.gmane.org ([80.91.229.3]:54792) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TaU3I-0003ae-TE + for info-gnus-english@gnu.org; Mon, 19 Nov 2012 11:18:29 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1TaU3Q-0005iQ-14 + for info-gnus-english@gnu.org; Mon, 19 Nov 2012 17:18:36 +0100 +Received: from tsdh.uni-koblenz.de ([141.26.67.142]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Mon, 19 Nov 2012 17:18:36 +0100 +Received: from tsdh by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debia= n)) + id 1AlnuQ-0007hv-00 + for ; Mon, 19 Nov 2012 17:18:36 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: Tassilo Horn +Subject: Re: gnus-notify.el is not work on Emacs24.2 +Date: Mon, 19 Nov 2012 17:18:12 +0100 +Lines: 27 +Message-ID: <87wqxho9bv.fsf@thinkpad.tsdh.de> +References: <123791454375028291.719217yanglm.ace-163.com@freenews.netfro= nt.net> +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de +User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) +Cancel-Lock: sha1:Ya75UbA/qbDBSQAxO92/2UtGAEA=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 19 Nov 2012 16:18:39 -0000 + +yanglm writes: + +> Error message is below +> invalid function : gnus-group-unread=20 + +The error message indicates that `gnus-group-unread' (which is a macro) +is called like a function. Glancing at the gnus-notify.el code at + + http://www.emacswiki.org/emacs/gnus-notify.el + +I can't see where this happens. + +Could you do M-x toggle-debug-on-error RET and then trigger the problem +again? You'll get a *backtrace* buffer that will help to spot the +problem. + +> who can fix it! + +Probably the gnus-notify.el author. His name and email address are +listed in the file. + +Bye, +Tassilo + +BTW: Very new, not yet released Gnus/Emacs versions have a +gnus-notifications.el that provides about the same features. You might +want to switch to that once emacs 24.3 has been released. + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M292770= P19819.slip,S=3D1849,W=3D1894:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M292770P19819.slip,S=3D1849,W=3D1894:2, new file mode 100644 index 0000000..ac8db7f --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M292770P19819.= slip,S=3D1849,W=3D1894:2, @@ -0,0 +1,45 @@ +From MAILER-DAEMON Mon Nov 19 09:50:07 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TaSfn-0007E3-Ld + for mharc-info-gnus-english@gnu.org; Mon, 19 Nov 2012 09:50:07 -0500 +Path: usenet.stanford.edu!news.glorb.com!news.netfront.net!not-for-mail +From: yanglm +Newsgroups: gnu.emacs.gnus +Subject: gnus-notify.el is not work on Emacs24.2 +Date: Mon, 19 Nov 2012 14:45:34 +0000 (UTC) +Organization: Netfront http://www.netfront.net/ +Lines: 6 +Message-ID: <123791454375028291.719217yanglm.ace-163.com@freenews.netfro= nt.net> +NNTP-Posting-Host: 123.151.32.70 +Mime-Version: 1.0 +Content-Type: text/plain; charset=3DUTF-8 +Content-Transfer-Encoding: 8bit +X-Trace: adenine.netfront.net 1353336334 35980 123.151.32.70 (19 Nov 201= 2 + 14:45:34 GMT) +X-Complaints-To: news@netfront.net +NNTP-Posting-Date: Mon, 19 Nov 2012 14:45:34 +0000 (UTC) +User-Agent: NewsTap/3.5.5 (iPad) +Xref: usenet.stanford.edu gnu.emacs.gnus:87055 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 19 Nov 2012 14:50:06 -0000 + +Error message is below +invalid function : gnus-group-unread=20 + +who can fix it! + +--- news://freenews.netfront.net/ - complaints: news@netfront.net --- + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M294457= P19819.slip,S=3D3562,W=3D3651:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M294457P19819.slip,S=3D3562,W=3D3651:2, new file mode 100644 index 0000000..5ab7a91 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M294457P19819.= slip,S=3D3562,W=3D3651:2, @@ -0,0 +1,89 @@ +From MAILER-DAEMON Mon Nov 19 14:22:43 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TaWvb-00021R-Tp + for mharc-info-gnus-english@gnu.org; Mon, 19 Nov 2012 14:22:43 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:49391) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TaWvX-000201-1Y + for info-gnus-english@gnu.org; Mon, 19 Nov 2012 14:22:42 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1TaWvS-00038p-0p + for info-gnus-english@gnu.org; Mon, 19 Nov 2012 14:22:38 -0500 +Received: from plane.gmane.org ([80.91.229.3]:47122) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TaWvR-00038h-QA + for info-gnus-english@gnu.org; Mon, 19 Nov 2012 14:22:33 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1TaWva-0007UR-58 + for info-gnus-english@gnu.org; Mon, 19 Nov 2012 20:22:42 +0100 +Received: from fw54.torolab.ibm.com ([199.246.40.54]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Mon, 19 Nov 2012 20:22:42 +0100 +Received: from harizvi by fw54.torolab.ibm.com with local (Gmexim 0.1 (D= ebian)) + id 1AlnuQ-0007hv-00 + for ; Mon, 19 Nov 2012 20:22:42 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: Haider Rizvi +Subject: Gnus in stuck state with gnus-demon +Date: Mon, 19 Nov 2012 14:22:14 -0500 +Lines: 26 +Message-ID: +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: fw54.torolab.ibm.com +User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (darwin) +Cancel-Lock: sha1:FXdPZbl83QklMHnVLYsl870x5pc=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 19 Nov 2012 19:22:42 -0000 + +For my gnus setup, I have various nntp servers, nnimap, and nnrss server= s.=20 + +I have set the following for fetching mail and news automatically:=20 +(gnus-demon-add-handler 'gnus-demon-scan-news 30 1) +(gnus-demon-init) + +Quite often, I see gnus stuck, the last message being about nndraft. I +can break out of it by pressing ctrl-g. It doesn't seem to be just gnus +getting msgs, I have been patient and waited for a while with no +movement. + +After breaking, in *Messages* I see the following: + +...... +nnimap read 82k from imap.gmail.com (initial sync of 3 groups; please wa= it) [2 times] +Reading active file from archive via nnfolder...done +Reading active file via nndraft...done + + +Ma Gnus v0.6 +GNU Emacs 24.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) + of 2012-08-27 on bob.porkrind.org + +Regards,=20 +--=20 +Haider + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M296156= P19819.slip,S=3D3287,W=3D3369:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M296156P19819.slip,S=3D3287,W=3D3369:2, new file mode 100644 index 0000000..d038821 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M296156P19819.= slip,S=3D3287,W=3D3369:2, @@ -0,0 +1,82 @@ +From MAILER-DAEMON Wed Nov 21 10:22:16 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TbC80-00038V-Pm + for mharc-info-gnus-english@gnu.org; Wed, 21 Nov 2012 10:22:16 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:33443) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TbC7t-00037T-L4 + for info-gnus-english@gnu.org; Wed, 21 Nov 2012 10:22:15 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1TbC7n-0005Nm-AM + for info-gnus-english@gnu.org; Wed, 21 Nov 2012 10:22:09 -0500 +Received: from plane.gmane.org ([80.91.229.3]:33389) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TbC7n-0005Ni-3N + for info-gnus-english@gnu.org; Wed, 21 Nov 2012 10:22:03 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1TbC7v-0005dX-IE + for info-gnus-english@gnu.org; Wed, 21 Nov 2012 16:22:11 +0100 +Received: from 37.160.11.167 ([37.160.11.167]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Wed, 21 Nov 2012 16:22:11 +0100 +Received: from j.cubizolles by 37.160.11.167 with local (Gmexim 0.1 (Deb= ian)) + id 1AlnuQ-0007hv-00 + for ; Wed, 21 Nov 2012 16:22:11 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: Julien Cubizolles +Subject: Select message by header +Date: Wed, 21 Nov 2012 16:21:34 +0100 +Lines: 18 +Message-ID: <871ufnm16p.fsf@free.fr> +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dutf-8 +Content-Transfer-Encoding: 8bit +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: 37.160.11.167 +User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) +Cancel-Lock: sha1:MH24feLS/vuW7HmtBXyNVHmPj+E=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 21 Nov 2012 15:22:15 -0000 + +What's the best way to mark all messages according to the value of a +header=C2=A0? + +Let's say I want to move all messages from a given author, I can do from +a Summary buffer=C2=A0: + +/ a name-of-the-author, then M P b, then B m name-of-group-where-to +move, then / w to recover the summary + +The filtering/unfiltering feels unnecessary here + +Or I can do=20 +& From name-of-the-author, then B m but then gnus asks for the +name-of-group-where-to-move for each message + +How to get the best of both methods=C2=A0? + +Julien. + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M297893= P19819.slip,S=3D3226,W=3D3297:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M297893P19819.slip,S=3D3226,W=3D3297:2, new file mode 100644 index 0000000..ff3e282 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M297893P19819.= slip,S=3D3226,W=3D3297:2, @@ -0,0 +1,71 @@ +From MAILER-DAEMON Thu Nov 22 16:49:59 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1Tbeel-0002Zn-4z + for mharc-info-gnus-english@gnu.org; Thu, 22 Nov 2012 16:49:59 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:60487) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1Tbeej-0002YQ-5t + for info-gnus-english@gnu.org; Thu, 22 Nov 2012 16:49:57 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1Tbeei-0003rr-A6 + for info-gnus-english@gnu.org; Thu, 22 Nov 2012 16:49:57 -0500 +Received: from plane.gmane.org ([80.91.229.3]:37981) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1Tbeei-0003ph-3G + for info-gnus-english@gnu.org; Thu, 22 Nov 2012 16:49:56 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1Tbeej-000882-M4 + for info-gnus-english@gnu.org; Thu, 22 Nov 2012 22:49:57 +0100 +Received: from gas45-3-82-244-252-119.fbx.proxad.net ([82.244.252.119]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Thu, 22 Nov 2012 22:49:57 +0100 +Received: from j.cubizolles by gas45-3-82-244-252-119.fbx.proxad.net wit= h + local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 + for ; Thu, 22 Nov 2012 22:49:57 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: Julien Cubizolles +Subject: Agent, Imap and duplicate messages +Date: Thu, 22 Nov 2012 18:27:10 +0100 +Lines: 7 +Message-ID: <87mwy9r1jl.fsf@free.fr> +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dutf-8 +Content-Transfer-Encoding: 8bit +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: gas45-3-82-244-252-119.fbx.proxad.net +User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) +Cancel-Lock: sha1:sZFwAP9JFS79VD0E6Qp8Ci0zBKs=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 22 Nov 2012 21:49:58 -0000 + +I'm using an agentised nnimap group and noticed a strange +behaviour. Just after starting gnus, many unread messages are shown seve= ral +times (twice or sometimes 3 or 4 times), the copy being marked as old (O +mark). However hitting M-g clears the summary of these duplicates. It's +not too bad but kind of annoying. Have your seen something similar=C2=A0= ? + +Julien. + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M299625= P19819.slip,S=3D3977,W=3D4068:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M299625P19819.slip,S=3D3977,W=3D4068:2, new file mode 100644 index 0000000..5c83b25 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M299625P19819.= slip,S=3D3977,W=3D4068:2, @@ -0,0 +1,91 @@ +From MAILER-DAEMON Sun Nov 25 14:36:21 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1Tci05-00088O-1A + for mharc-info-gnus-english@gnu.org; Sun, 25 Nov 2012 14:36:21 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:44334) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1Tci02-00088C-Ag + for info-gnus-english@gnu.org; Sun, 25 Nov 2012 14:36:19 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1Tci01-0002Ss-08 + for info-gnus-english@gnu.org; Sun, 25 Nov 2012 14:36:18 -0500 +Received: from plane.gmane.org ([80.91.229.3]:53699) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1Tci00-0002So-Q1 + for info-gnus-english@gnu.org; Sun, 25 Nov 2012 14:36:16 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1Tci09-0006wo-Ez + for info-gnus-english@gnu.org; Sun, 25 Nov 2012 20:36:25 +0100 +Received: from c-67-172-26-251.hsd1.pa.comcast.net ([67.172.26.251]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Sun, 25 Nov 2012 20:36:25 +0100 +Received: from gardellawg by c-67-172-26-251.hsd1.pa.comcast.net with lo= cal + (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 + for ; Sun, 25 Nov 2012 20:36:25 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: William Gardella +Subject: Re: nnimap, tick mark not synced when reading from 2 computers +Date: Sun, 25 Nov 2012 14:36:01 -0500 +Lines: 26 +Message-ID: <87pq31h3vi.fsf@gmail.com> +References: +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: c-67-172-26-251.hsd1.pa.comcast.net +X-Archive: encrypt +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) +Cancel-Lock: sha1:DvxwJjmu1jviM5ptFdFoWH64GtE=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 25 Nov 2012 19:36:19 -0000 + +Hi Par, + +Par Kurlberg writes: + +> Work mail is kept on an exchange server, and I access it from two +> computers (one laptop, the other my work desktop) using gnus+nnimap. +> Recently (I think it is after I upgraded to emacs 24) I have had troub= le +> with tick marks not being synced properly. E.g., when I untick a +> message on my laptop, it is remains ticked in the summary buffer on my +> desktop. As far as I can tell, the %Flagged flag on the imap server i= s +> being set/reset correctly from either client, but it seems like gnus +> uses the information in ~/.newsrc.eld, and this overrides the flags on +> the server. (This suspicion could be wrong.) + +May we see the nnimap portion of your Gnus configuration? Also, which +way are you using nnimap (as a mail source, or as primary/secondry +select method)? I use 2 nnimap servers as secondary select method on +three Debian boxen in Emacs 24.2.1, and the marks in each system's Gnus +nnimap groups seem to match up with each other and their respective IMAP +servers. + +Best, +WGG + +--=20 +I use grml (http://grml.org/) + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M301512= P19819.slip,S=3D3623,W=3D3709:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M301512P19819.slip,S=3D3623,W=3D3709:2, new file mode 100644 index 0000000..1a169ea --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M301512P19819.= slip,S=3D3623,W=3D3709:2, @@ -0,0 +1,86 @@ +From MAILER-DAEMON Sun Nov 25 09:48:11 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TcdVD-00067T-3u + for mharc-info-gnus-english@gnu.org; Sun, 25 Nov 2012 09:48:11 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:46521) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TcZW2-0005f4-KQ + for info-gnus-english@gnu.org; Sun, 25 Nov 2012 05:32:47 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1TcZW1-0005Qt-Gu + for info-gnus-english@gnu.org; Sun, 25 Nov 2012 05:32:46 -0500 +Received: from smtp-2.sys.kth.se ([130.237.32.160]:47783) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1TcZW1-0005PG-9v + for info-gnus-english@gnu.org; Sun, 25 Nov 2012 05:32:45 -0500 +Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.= 91]) + by smtp-2.sys.kth.se (Postfix) with ESMTP id 2866914DC48 + for ; Sun, 25 Nov 2012 11:32:07 +0100 (CET) +X-Virus-Scanned: by amavisd-new at kth.se +Received: from smtp-2.sys.kth.se ([130.237.32.160]) + by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) + (amavisd-new, port 10024) + with LMTP id tA+BqjK-n1UP; Sun, 25 Nov 2012 11:32:02 +0100 (CET) +X-KTH-Auth: kurlberg [89.160.0.43] +X-KTH-mail-from: kurlberg@math.kth.se +Received: from odin.local (c-89-160-0-43.cust.bredband2.com [89.160.0.43= ]) + by smtp-2.sys.kth.se (Postfix) with ESMTP id 16B6A14D7CC; + Sun, 25 Nov 2012 11:32:00 +0100 (CET) +From: Par Kurlberg +To: info-gnus-english@gnu.org +Subject: nnimap, tick mark not synced when reading from 2 computers +Date: Sun, 25 Nov 2012 11:32:00 +0100 +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x +X-Received-From: 130.237.32.160 +X-Mailman-Approved-At: Sun, 25 Nov 2012 09:48:08 -0500 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 25 Nov 2012 10:32:47 -0000 + + +Work mail is kept on an exchange server, and I access it from two +computers (one laptop, the other my work desktop) using gnus+nnimap. +Recently (I think it is after I upgraded to emacs 24) I have had trouble +with tick marks not being synced properly. E.g., when I untick a +message on my laptop, it is remains ticked in the summary buffer on my +desktop. As far as I can tell, the %Flagged flag on the imap server is +being set/reset correctly from either client, but it seems like gnus +uses the information in ~/.newsrc.eld, and this overrides the flags on +the server. (This suspicion could be wrong.) + +Any hints on how to fix this? (Or hints on how to debug it?) + +Best, +Par=20 + +PS: Some system info + +Computer 1 (macos) + +GNU Emacs 24.1.1 (x86_64-apple-darwin11.4.0, GTK+ Version 2.18.9) of +2012-06-20 on odin.local + +Gnus v5.13 + + +Computer 2 (ubuntu) + +GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 201= 2-06-21\ +=20 +Gnus v5.13 + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M303229= P19819.slip,S=3D2525,W=3D2587:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M303229P19819.slip,S=3D2525,W=3D2587:2, new file mode 100644 index 0000000..6dd7fb9 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M303229P19819.= slip,S=3D2525,W=3D2587:2, @@ -0,0 +1,62 @@ +From MAILER-DAEMON Thu Nov 29 11:45:06 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1Te7EY-0007Qw-7J + for mharc-info-gnus-english@gnu.org; Thu, 29 Nov 2012 11:45:06 -0500 +Path: usenet.stanford.edu!news.glorb.com!feeder.erje.net!eu.feeder.erje.= net!news.mixmin.net!aioe.org!.POSTED!not-for-mail +From: Emanuel Berg +Newsgroups: gnu.emacs.gnus +Subject: 2 x summary buffer line color +Date: Thu, 29 Nov 2012 17:41:08 +0100 +Organization: Aioe.org NNTP Server +Lines: 25 +Message-ID: <87obig5pln.fsf@VLAN-3434.student.uu.se> +NNTP-Posting-Host: SWN/nubmpQxYKwY7hPy4YA.user.speranza.aioe.org +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +X-Complaints-To: abuse@aioe.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) +X-Notice: Filtered by postfilter v. 0.8.2 +Cancel-Lock: sha1:VIVVMwUZQ4fwNdlwev6BIogbhdQ=3D +Xref: usenet.stanford.edu gnu.emacs.gnus:87065 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Nov 2012 16:45:05 -0000 + +1) I'd like a line in the summary buffer only to tell author and +subject, but I'd like those elements to be in different colors. + +This is how far I got (in .gnus): + +(setq gnus-summary-line-format "%U%R%I%a: %s\n") + +Is there a markup for colors? + +2) How do you define your own highlighting as for read and unread +articles? Again, I added this to .gnus, but it fell short because I +don't know how to define those last elements of the association list +element (they are not Emacs variables, and not Emacs functions, and +those are the only things I know how to track (with C-h v and C-h f, +respectively)). + +(setq gnus-summary-highlight + '(((eq mark gnus-unread-mark) . gnus-summary-normal-unread) + (t . gnus-summary-normal-read) )) + +Thank you :) +--=20 +Emanuel Berg - programmer (hire me!) +CV + code + screenshots: http://user.it.uu.se/~embe8573 + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M305256= P19819.slip,S=3D2232,W=3D2283:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M305256P19819.slip,S=3D2232,W=3D2283:2, new file mode 100644 index 0000000..fbb9afd --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M305256P19819.= slip,S=3D2232,W=3D2283:2, @@ -0,0 +1,51 @@ +From MAILER-DAEMON Thu Nov 29 18:20:06 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TeDOo-0003cY-Pt + for mharc-info-gnus-english@gnu.org; Thu, 29 Nov 2012 18:20:06 -0500 +Path: usenet.stanford.edu!news.kjsl.com!us.feeder.erje.net!feeder.erje.n= et!eu.feeder.erje.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail +From: Emanuel Berg +Newsgroups: gnu.emacs.gnus +Subject: Re: 2 x summary buffer line color +Date: Fri, 30 Nov 2012 00:16:32 +0100 +Organization: Aioe.org NNTP Server +Lines: 11 +Message-ID: <87boegngof.fsf@VLAN-3434.student.uu.se> +References: <87obig5pln.fsf@VLAN-3434.student.uu.se> + + <87ip8ongz4.fsf@VLAN-3434.student.uu.se> +NNTP-Posting-Host: SWN/nubmpQxYKwY7hPy4YA.user.speranza.aioe.org +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +X-Complaints-To: abuse@aioe.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) +X-Notice: Filtered by postfilter v. 0.8.2 +Cancel-Lock: sha1:+NNqDOa2nK5mdFvdsYvs67Ek7RU=3D +Xref: usenet.stanford.edu gnu.emacs.gnus:87069 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Nov 2012 23:20:06 -0000 + +Emanuel Berg writes: + +> I wonder though, you say, my articles, replies to me, etc., but, for +> example in the first case, will that not simply highlight all articles +> that you've not read? + +Or, is this determined by the score? Then it makes sense, my mistake. + +--=20 +Emanuel Berg - programmer (hire me!) +CV + code + screenshots: http://user.it.uu.se/~embe8573 + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M307038= P19819.slip,S=3D3980,W=3D4062:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M307038P19819.slip,S=3D3980,W=3D4062:2, new file mode 100644 index 0000000..2b9e378 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M307038P19819.= slip,S=3D3980,W=3D4062:2, @@ -0,0 +1,82 @@ +From MAILER-DAEMON Thu Nov 29 18:15:06 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TeDJy-00039p-Oh + for mharc-info-gnus-english@gnu.org; Thu, 29 Nov 2012 18:15:06 -0500 +Path: usenet.stanford.edu!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!.P= OSTED!not-for-mail +From: Emanuel Berg +Newsgroups: gnu.emacs.gnus +Subject: Re: 2 x summary buffer line color +Date: Fri, 30 Nov 2012 00:10:07 +0100 +Organization: Aioe.org NNTP Server +Lines: 43 +Message-ID: <87ip8ongz4.fsf@VLAN-3434.student.uu.se> +References: <87obig5pln.fsf@VLAN-3434.student.uu.se> + +NNTP-Posting-Host: SWN/nubmpQxYKwY7hPy4YA.user.speranza.aioe.org +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +X-Complaints-To: abuse@aioe.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) +X-Notice: Filtered by postfilter v. 0.8.2 +Cancel-Lock: sha1:d8Z/wfo4xFb6a5o9N0XbCH22giY=3D +Xref: usenet.stanford.edu gnu.emacs.gnus:87068 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Nov 2012 23:15:05 -0000 + +Oleksandr Gavenko writes: + +> ;; Especially highlight my message and replays to me. +> (eval-after-load 'gnus-sum +> '(progn +> (defface my-gnus-own-unread-face nil +> "Use this face to display own postings in Summary Buffer") +> (copy-face 'gnus-summary-high-unread-face 'my-gnus-own-unread-fac= e) +> (set-face-background 'my-gnus-own-unread-face "linen") +> (add-to-list 'gnus-summary-highlight +> '((and (> score 190) (eq mark gnus-unread-mark)) . m= y-gnus-own-unread-face)) +> (defface my-gnus-own-ancient-face nil +> "Use this face to display own postings in Summary Buffer") +> (copy-face 'gnus-summary-high-ancient-face 'my-gnus-own-ancient-f= ace) +> (set-face-background 'my-gnus-own-ancient-face "linen") +> (add-to-list 'gnus-summary-highlight +> '((and (> score 190) (eq mark gnus-ancient-mark)) . = my-gnus-own-ancient-face)) +> (defface my-gnus-own-ticked-face nil +> "Use this face to display own postings in Summary Buffer") +> (copy-face 'gnus-summary-high-ticked-face 'my-gnus-own-ticked-fac= e) +> (set-face-background 'my-gnus-own-ticked-face "linen") +> (add-to-list 'gnus-summary-highlight +> '((and (> score 190) (or (eq mark gnus-dormant-mark)= (eq mark gnus-ticked-mark))) . my-gnus-own-ticked-face)) +> (defface my-gnus-fup-face nil +> "Use this face to display direct fups to my postings.") +> (copy-face 'gnus-summary-high-unread-face 'my-gnus-fup-face) +> (set-face-background 'my-gnus-fup-face "honeydew") +> (add-to-list 'gnus-summary-highlight +> '((and (<=3D 90 score) (<=3D score 110) (eq mark gnu= s-unread-mark)) . my-gnus-fup-face)) +> )) + +OK, that worked, but it would probably look better if you either +changed the attributes of those standard faces, or, defined you own +faces. All that copying is a bit "hackish" :) (But like I said, it +worked, so thanks.) + +I wonder though, you say, my articles, replies to me, etc., but, for +example in the first case, will that not simply highlight all articles +that you've not read? + +--=20 +Emanuel Berg - programmer (hire me!) +CV + code + screenshots: http://user.it.uu.se/~embe8573 + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M308821= P19819.slip,S=3D5152,W=3D5264:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M308821P19819.slip,S=3D5152,W=3D5264:2, new file mode 100644 index 0000000..37be557 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M308821P19819.= slip,S=3D5152,W=3D5264:2, @@ -0,0 +1,112 @@ +From MAILER-DAEMON Thu Nov 29 14:20:34 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1Te9f0-00083E-Ml + for mharc-info-gnus-english@gnu.org; Thu, 29 Nov 2012 14:20:34 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:40571) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1Te9et-00080M-Kb + for info-gnus-english@gnu.org; Thu, 29 Nov 2012 14:20:33 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1Te9es-0004UI-9t + for info-gnus-english@gnu.org; Thu, 29 Nov 2012 14:20:27 -0500 +Received: from plane.gmane.org ([80.91.229.3]:42819) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1Te9es-0004Tv-3T + for info-gnus-english@gnu.org; Thu, 29 Nov 2012 14:20:26 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1Te9ey-0008R4-9H + for info-gnus-english@gnu.org; Thu, 29 Nov 2012 20:20:32 +0100 +Received: from 37.229.16.202 ([37.229.16.202]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Thu, 29 Nov 2012 20:20:32 +0100 +Received: from gavenkoa by 37.229.16.202 with local (Gmexim 0.1 (Debian)= ) + id 1AlnuQ-0007hv-00 + for ; Thu, 29 Nov 2012 20:20:32 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: Oleksandr Gavenko +Subject: Re: 2 x summary buffer line color +Date: Thu, 29 Nov 2012 21:20:09 +0200 +Organization: Oleksandr Gavenko , + http://gavenkoa.users.sf.net +Lines: 46 +Message-ID: <87624ojjx2.fsf@gavenkoa.example.com> +References: <87obig5pln.fsf@VLAN-3434.student.uu.se> +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: 37.229.16.202 +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) +Cancel-Lock: sha1:ZeFPYLFSmEcEXpdecOJB4xJiEwY=3D +X-detected-operating-system: by eggs.gnu.org: Genre and OS details not + recognized. +X-Received-From: 80.91.229.3 +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Nov 2012 19:20:33 -0000 + +On 2012-11-29, Emanuel Berg wrote: + +> 2) How do you define your own highlighting as for read and unread +> articles? Again, I added this to .gnus, but it fell short because I +> don't know how to define those last elements of the association list +> element (they are not Emacs variables, and not Emacs functions, and +> those are the only things I know how to track (with C-h v and C-h f, +> respectively)). +> +> (setq gnus-summary-highlight +> '(((eq mark gnus-unread-mark) . gnus-summary-normal-unread) +> (t . gnus-summary-normal-read) )) + +I just copy piece in some way relevant code from my '.emacs': + +;; Especially highlight my message and replays to me. +(eval-after-load 'gnus-sum + '(progn + (defface my-gnus-own-unread-face nil + "Use this face to display own postings in Summary Buffer") + (copy-face 'gnus-summary-high-unread-face 'my-gnus-own-unread-face) + (set-face-background 'my-gnus-own-unread-face "linen") + (add-to-list 'gnus-summary-highlight + '((and (> score 190) (eq mark gnus-unread-mark)) . my-= gnus-own-unread-face)) + (defface my-gnus-own-ancient-face nil + "Use this face to display own postings in Summary Buffer") + (copy-face 'gnus-summary-high-ancient-face 'my-gnus-own-ancient-fac= e) + (set-face-background 'my-gnus-own-ancient-face "linen") + (add-to-list 'gnus-summary-highlight + '((and (> score 190) (eq mark gnus-ancient-mark)) . my= -gnus-own-ancient-face)) + (defface my-gnus-own-ticked-face nil + "Use this face to display own postings in Summary Buffer") + (copy-face 'gnus-summary-high-ticked-face 'my-gnus-own-ticked-face) + (set-face-background 'my-gnus-own-ticked-face "linen") + (add-to-list 'gnus-summary-highlight + '((and (> score 190) (or (eq mark gnus-dormant-mark) (= eq mark gnus-ticked-mark))) . my-gnus-own-ticked-face)) + (defface my-gnus-fup-face nil + "Use this face to display direct fups to my postings.") + (copy-face 'gnus-summary-high-unread-face 'my-gnus-fup-face) + (set-face-background 'my-gnus-fup-face "honeydew") + (add-to-list 'gnus-summary-highlight + '((and (<=3D 90 score) (<=3D score 110) (eq mark gnus-= unread-mark)) . my-gnus-fup-face)) + )) + +--=20 +Best regards! + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M310887= P19819.slip,S=3D2337,W=3D2393:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M310887P19819.slip,S=3D2337,W=3D2393:2, new file mode 100644 index 0000000..2c0cf74 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M310887P19819.= slip,S=3D2337,W=3D2393:2, @@ -0,0 +1,56 @@ +From MAILER-DAEMON Thu Nov 29 14:00:08 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1Te9LE-0007nX-P9 + for mharc-info-gnus-english@gnu.org; Thu, 29 Nov 2012 14:00:08 -0500 +Path: usenet.stanford.edu!news.glorb.com!feeder.erje.net!eu.feeder.erje.= net!proxad.net!feeder1-2.proxad.net!193.252.117.184.MISMATCH!feeder.news.= orange.fr!not-for-mail +From: Daimrod +Newsgroups: gnu.emacs.gnus +Subject: Send signed message to newsgroup +Date: Thu, 29 Nov 2012 20:00:39 +0100 +Message-ID: <87sj7skze0.fsf@casa.home> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) +Cancel-Lock: sha1:eSRHMgnb+Dy0bezBK+w9/bQGYTs=3D +MIME-Version: 1.0 +Content-Type: text/plain +Lines: 18 +Organization: les newsgroups par Orange +NNTP-Posting-Date: 29 Nov 2012 19:59:24 CET +NNTP-Posting-Host: 90.54.229.31 +X-Trace: 1354215564 reader.news.orange.fr 9017 90.54.229.31:15616 +X-Complaints-To: abuse@orange.fr +Xref: usenet.stanford.edu gnu.emacs.gnus:87066 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Nov 2012 19:00:07 -0000 + +Hi, + +I use Gnus v5.13 with Emacs compiled from the git repository. + +Remote: master @ origin (git://git.savannah.gnu.org/emacs.git) +Head: 858ed42 Fix wording of commentary to 'struct face' in dispexte= rn.h. + +Though I can send mail to a newsgroup, I can't sign it without being rej= ected: + +441 437 Rejected 1672 001b00 IncomingFilter=20 +Couldn't send message via news: 441 437 Rejected 1672 001b00 IncomingFil= ter=20 + +I didn't try (yet) to find when this problem was introduced but I've +been able to send signed mail to a newsgroup with an ancient version of +Emacs (probably one or two month old). + +--=20 +Daimrod/Greg + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M312715= P19819.slip,S=3D3811,W=3D3900:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M312715P19819.slip,S=3D3811,W=3D3900:2, new file mode 100644 index 0000000..13f3716 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M312715P19819.= slip,S=3D3811,W=3D3900:2, @@ -0,0 +1,89 @@ +From MAILER-DAEMON Fri Nov 30 07:57:59 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TeQAJ-0001pc-Ko + for mharc-info-gnus-english@gnu.org; Fri, 30 Nov 2012 07:57:59 -0500 +Received: from eggs.gnu.org ([208.118.235.92]:58204) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TeQAG-0001o3-JT + for info-gnus-english@gnu.org; Fri, 30 Nov 2012 07:57:57 -0500 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) + id 1TeQAF-000225-Bz + for info-gnus-english@gnu.org; Fri, 30 Nov 2012 07:57:56 -0500 +Received: from plane.gmane.org ([80.91.229.3]:54170) + by eggs.gnu.org with esmtp (Exim 4.71) + (envelope-from ) + id 1TeQAF-00021w-5C + for info-gnus-english@gnu.org; Fri, 30 Nov 2012 07:57:55 -0500 +Received: from list by plane.gmane.org with local (Exim 4.69) + (envelope-from ) + id 1TeQAN-0004Ji-5c + for info-gnus-english@gnu.org; Fri, 30 Nov 2012 13:58:03 +0100 +Received: from 2505ds5-by.0.fullrate.dk ([89.150.142.116]) + by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) + id 1AlnuQ-0007hv-00 + for ; Fri, 30 Nov 2012 13:58:03 +0100 +Received: from asjo by 2505ds5-by.0.fullrate.dk with local (Gmexim 0.1 + (Debian)) id 1AlnuQ-0007hv-00 + for ; Fri, 30 Nov 2012 13:58:03 +0100 +X-Injected-Via-Gmane: http://gmane.org/ +To: info-gnus-english@gnu.org +From: asjo@koldfront.dk (Adam =3D?iso-8859-1?Q?Sj=3DF8gren?=3D) +Subject: Re: Gnus header in Rmail +Date: Fri, 30 Nov 2012 13:57:41 +0100 +Organization: koldfront - analysis & revolution, Copenhagen, Denmark +Lines: 17 +Message-ID: <877gp345a2.fsf@topper.koldfront.dk> +References: <874nk7bvfn.fsf@VLAN-3434.student.uu.se> +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Diso-8859-1 +Content-Transfer-Encoding: 8bit +X-Complaints-To: usenet@ger.gmane.org +X-Gmane-NNTP-Posting-Host: 2505ds5-by.0.fullrate.dk +OpenPGP: id=3D21BDE416; url=3Dhttp://asjo.koldfront.dk/gpg.asc +X-Face: )qY&CseJ?.:=3D8F#^~GcSA?F=3D9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97, + Q(^@xk}n4Ou + rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S= /IS9lMJ + ^St'=3DVZBR +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Nov 2012 12:57:57 -0000 + +On Fri, 30 Nov 2012 04:50:52 +0100, Emanuel wrote: + +> Help would be appreciated, as it is a bit weird (although I don't know +> if people are paying attention to all strange headers in e-mails, it +> just shouldn't be there). + +I would think it would only be used internally and removed before +sending - did you check if it actually gets sent? + + + Best regards, + + Adam + +--=20 + "we push onward. to you, it is 2005, to us, it is Adam Sj=EF= =BF=BDgren + 2011. we are always far ahead." asjo@koldfront.= dk + + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M314502= P19819.slip,S=3D1894,W=3D1937:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M314502P19819.slip,S=3D1894,W=3D1937:2, new file mode 100644 index 0000000..ff030e8 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M314502P19819.= slip,S=3D1894,W=3D1937:2, @@ -0,0 +1,43 @@ +From MAILER-DAEMON Thu Nov 29 23:00:06 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TeHlm-00026y-Ip + for mharc-info-gnus-english@gnu.org; Thu, 29 Nov 2012 23:00:06 -0500 +Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!us.feeder.erje.n= et!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail +From: Emanuel Berg +Newsgroups: gnu.emacs.gnus +Subject: Re: Gnus header in Rmail +Date: Fri, 30 Nov 2012 04:54:14 +0100 +Organization: Aioe.org NNTP Server +Lines: 5 +Message-ID: <87vccnagpl.fsf@VLAN-3434.student.uu.se> +References: <874nk7bvfn.fsf@VLAN-3434.student.uu.se> +NNTP-Posting-Host: SWN/nubmpQxYKwY7hPy4YA.user.speranza.aioe.org +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +X-Complaints-To: abuse@aioe.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) +X-Notice: Filtered by postfilter v. 0.8.2 +Cancel-Lock: sha1:qXMrAB8ZUr+Lc7qZe3fTRZBBzro=3D +Xref: usenet.stanford.edu gnu.emacs.gnus:87071 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Nov 2012 04:00:05 -0000 + +That should be: Gnus header in *Message mode*, not Rmail. +--=20 +Emanuel Berg - programmer (hire me!) +CV + code + screenshots: http://user.it.uu.se/~embe8573 + + diff --git a/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M316209= P19819.slip,S=3D2364,W=3D2419:2, b/packages/gnus-mock/data/imapmail/mail/= cur/1541087335.M316209P19819.slip,S=3D2364,W=3D2419:2, new file mode 100644 index 0000000..b30947f --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/cur/1541087335.M316209P19819.= slip,S=3D2364,W=3D2419:2, @@ -0,0 +1,55 @@ +From MAILER-DAEMON Thu Nov 29 22:55:06 2012 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1TeHgv-0000cc-Vr + for mharc-info-gnus-english@gnu.org; Thu, 29 Nov 2012 22:55:05 -0500 +Path: usenet.stanford.edu!news.kjsl.com!us.feeder.erje.net!feeder.erje.n= et!eu.feeder.erje.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail +From: Emanuel Berg +Newsgroups: gnu.emacs.gnus +Subject: Gnus header in Rmail +Date: Fri, 30 Nov 2012 04:50:52 +0100 +Organization: Aioe.org NNTP Server +Lines: 18 +Message-ID: <874nk7bvfn.fsf@VLAN-3434.student.uu.se> +NNTP-Posting-Host: SWN/nubmpQxYKwY7hPy4YA.user.speranza.aioe.org +Mime-Version: 1.0 +Content-Type: text/plain; charset=3Dus-ascii +X-Complaints-To: abuse@aioe.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) +X-Notice: Filtered by postfilter v. 0.8.2 +Cancel-Lock: sha1:GkXie55mAw1PrYmyY9FKIt6n79w=3D +Xref: usenet.stanford.edu gnu.emacs.gnus:87070 +To: info-gnus-english@gnu.org +X-BeenThere: info-gnus-english@gnu.org +X-Mailman-Version: 2.1.14 +Precedence: list +List-Id: "Announcements and discussions for GNUS, + the GNU Emacs Usenet newsreader \(in English\)" + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 30 Nov 2012 03:55:05 -0000 + +I use Emacs' Rmail (M-x rmail) as my e-mail client. Since I started to +use Gnus, when I hit `C-x m` to get a blank e-mail to write (in +Message mode), this header is nowadays visible: + + X-Draft-From: ("rec.sport.boxing" 11442) + +I suppose it has something to do with Message mode being used both to +send e-mails (and to respond to received ones, i.e., invocation from +Rmail) and to send articles to the newsgroups. + +Help would be appreciated, as it is a bit weird (although I don't know +if people are paying attention to all strange headers in e-mails, it +just shouldn't be there). + +--=20 +Emanuel Berg - programmer (hire me!) +CV + code + screenshots: http://user.it.uu.se/~embe8573 + + diff --git a/packages/gnus-mock/data/imapmail/mail/dovecot-uidlist b/pack= ages/gnus-mock/data/imapmail/mail/dovecot-uidlist new file mode 100644 index 0000000..c486ca2 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/dovecot-uidlist @@ -0,0 +1,33 @@ +3 V1541087103 N33 G889f75357f1fdb5b6b4d000040cf8723 +1 :1541087335.M224506P19819.slip,S=3D4578,W=3D4684 +2 :1541087335.M232569P19819.slip,S=3D3789,W=3D3886 +3 :1541087335.M239374P19819.slip,S=3D3350,W=3D3432 +4 :1541087335.M245904P19819.slip,S=3D3275,W=3D3354 +5 :1541087335.M252543P19819.slip,S=3D2246,W=3D2301 +6 :1541087335.M257361P19819.slip,S=3D2745,W=3D2810 +7 :1541087335.M263297P19819.slip,S=3D5828,W=3D5969 +8 :1541087335.M267088P19819.slip,S=3D4259,W=3D4369 +9 :1541087335.M270804P19819.slip,S=3D5031,W=3D5145 +10 :1541087335.M273777P19819.slip,S=3D4162,W=3D4268 +11 :1541087335.M276430P19819.slip,S=3D4417,W=3D4518 +12 :1541087335.M278921P19819.slip,S=3D9511,W=3D9743 +13 :1541087335.M281396P19819.slip,S=3D5658,W=3D5785 +14 :1541087335.M283480P19819.slip,S=3D4006,W=3D4107 +15 :1541087335.M285367P19819.slip,S=3D3927,W=3D4027 +16 :1541087335.M287297P19819.slip,S=3D2226,W=3D2275 +17 :1541087335.M289193P19819.slip,S=3D4827,W=3D4912 +18 :1541087335.M291195P19819.slip,S=3D3629,W=3D3720 +19 :1541087335.M292770P19819.slip,S=3D1849,W=3D1894 +20 :1541087335.M294457P19819.slip,S=3D3562,W=3D3651 +21 :1541087335.M296156P19819.slip,S=3D3287,W=3D3369 +22 :1541087335.M297893P19819.slip,S=3D3226,W=3D3297 +23 :1541087335.M299625P19819.slip,S=3D3977,W=3D4068 +24 :1541087335.M301512P19819.slip,S=3D3623,W=3D3709 +25 :1541087335.M303229P19819.slip,S=3D2525,W=3D2587 +26 :1541087335.M305256P19819.slip,S=3D2232,W=3D2283 +27 :1541087335.M307038P19819.slip,S=3D3980,W=3D4062 +28 :1541087335.M308821P19819.slip,S=3D5152,W=3D5264 +29 :1541087335.M310887P19819.slip,S=3D2337,W=3D2393 +30 :1541087335.M312715P19819.slip,S=3D3811,W=3D3900 +31 :1541087335.M314502P19819.slip,S=3D1894,W=3D1937 +32 :1541087335.M316209P19819.slip,S=3D2364,W=3D2419 diff --git a/packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity b/= packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity new file mode 100644 index 0000000..5543413 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity @@ -0,0 +1 @@ +5bdb1f80 \ No newline at end of file diff --git a/packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity.5b= db1f80 b/packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity.5bdb1f= 80 new file mode 100644 index 0000000..e69de29 diff --git a/packages/gnus-mock/data/imapmail/mail/dovecot.index.cache b/= packages/gnus-mock/data/imapmail/mail/dovecot.index.cache new file mode 100644 index 0000000..23dd25b Binary files /dev/null and b/packages/gnus-mock/data/imapmail/mail/doveco= t.index.cache differ diff --git a/packages/gnus-mock/data/imapmail/mail/subscriptions b/packag= es/gnus-mock/data/imapmail/mail/subscriptions new file mode 100644 index 0000000..6e1e1ce --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/subscriptions @@ -0,0 +1,3 @@ +V 2 + +INBOX diff --git a/packages/gnus-mock/gnus-mock.el b/packages/gnus-mock/gnus-mo= ck.el index ff3f54b..2e7813a 100644 --- a/packages/gnus-mock/gnus-mock.el +++ b/packages/gnus-mock/gnus-mock.el @@ -5,7 +5,7 @@ ;; Author: Eric Abrahamsen ;; Maintainer: Eric Abrahamsen ;; Package-Type: multi -;; Version: 0.1.2 +;; Version: 0.2.0 =20 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -48,11 +48,11 @@ ;; Users have two options for adding custom configuration to the mock ;; session: =20 -;; - `gnus-mock-gnus-settings' can be set to a filename, the contents +;; - `gnus-mock-gnus-file' can be set to a filename, the contents ;; of which will be appended to the .gnus.el startup file in the ;; mock session. This code will be executed at Gnus startup. =20 -;; - `gnus-mock-init-setting' should also be a filename, the contents +;; - `gnus-mock-init-file' should also be a filename, the contents ;; of which will be appended to the init.el file that is loaded when ;; the child Emacs process starts. =20 @@ -113,6 +113,18 @@ so multiple sessions will not conflict if this optio= n is nil." :group 'gnus-mock :type 'string) =20 +(defcustom gnus-mock-dovecot-imap-program nil + "Dovecot imap executable used to set up an nnimap server. +This option should not be set to the \"dovecot\" executable +itself, but rather to the \"imap\" executable that ships with +dovecot. This executable isn't on the PATH, but often lives at +/usr/lib/dovecot/imap. + +If nil, no nnimap server will be added to the Gnus mock +installation." + :group 'gnus-mock + :type 'string) + (defconst gnus-mock-data-dir (file-name-as-directory (expand-file-name "data" @@ -192,12 +204,50 @@ will start a mock Gnus session." (append-to-file (point-min) (point-max) (expand-file-name ".gnus.el" mock-tmp-dir)))) + ;; Possibly add an nnimap server. + (when gnus-mock-dovecot-imap-program + (with-temp-buffer + (insert "\n\n") + (prin1 + `(add-to-list + 'gnus-secondary-select-methods + (quote (nnimap + "Mocky" + (nnimap-stream shell) + (nnimap-shell-program + ,(concat + gnus-mock-dovecot-imap-program + (format " -o mail_location=3Dmaildir:%s/imapmail/mail" + mock-tmp-dir)))))) + (current-buffer)) + (append-to-file + (point-min) (point-max) + (expand-file-name ".gnus.el" mock-tmp-dir)))) ;; There are absolute paths in the .newsrc.eld file, so doctor ;; that file. (with-current-buffer (find-file-noselect (expand-file-name ".newsrc.eld" mock-tmp-dir)) (while (re-search-forward "REPLACE_ME" (point-max) t) (replace-match mock-tmp-dir t)) + (when gnus-mock-dovecot-imap-program + (goto-char (point-max)) + (insert "\n\n") + (prin1 + '(setq + gnus-newsrc-alist + (append + gnus-newsrc-alist + '(("nnimap+Mocky:INBOX" 3 nil ((unexist) (seen (1 . 32))) + "nnimap:Mocky" ((modseq . "33") (uidvalidity . "1541087103") + (active 1 . 32) + (permanent-flags %Answered %Flagged %Deleted + %Seen %Draft %*))) + ("nnimap+Mocky:emacs-devel" 3 nil ((unexist 0)) + "nnimap:Mocky" ((modseq . "21") (uidvalidity . "1541087104") + (active 0 . 20) + (permanent-flags %Answered %Flagged %Deleted + %Seen %Draft %*)))))) + (current-buffer))) (basic-save-buffer)) (make-process :name "gnus-mock" :buffer nil :command (list gnus-mock-emacs-program From MAILER-DAEMON Thu Nov 01 14:32:22 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gIHlW-00074p-ES for mharc-emacs-elpa-diffs@gnu.org; Thu, 01 Nov 2018 14:32:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIHlT-00072H-Kq for emacs-elpa-diffs@gnu.org; Thu, 01 Nov 2018 14:32:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIHlS-0002Jq-7u for emacs-elpa-diffs@gnu.org; Thu, 01 Nov 2018 14:32:19 -0400 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:42822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIHlP-0002Ib-Jb for emacs-elpa-diffs@gnu.org; Thu, 01 Nov 2018 14:32:16 -0400 Received: by vcs0.savannah.gnu.org (Postfix, from userid 134376) id 4FA72204F2; Thu, 1 Nov 2018 14:32:15 -0400 (EDT) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 6119093: [el-search] Fix nested match issues in *El Occur* MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Heerdegen In-Reply-To: <20181101183213.22529.12538@vcs0.savannah.gnu.org> References: <20181101183213.22529.12538@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 6119093fb93aa3ccb6606cd63ade45ef7af8a210 Auto-Submitted: auto-generated Message-Id: <20181101183215.4FA72204F2@vcs0.savannah.gnu.org> Date: Thu, 1 Nov 2018 14:32:15 -0400 (EDT) From: michael_heerdegen@web.de (Michael Heerdegen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 18:32:21 -0000 branch: master commit 6119093fb93aa3ccb6606cd63ade45ef7af8a210 Author: Michael Heerdegen Commit: Michael Heerdegen [el-search] Fix nested match issues in *El Occur* =20 Fix flawed match count display and by-match moving in *El Occur* buffers for nested or adjacent matches. Bump version to 1.7.10. =20 * packages/el-search/el-search.el (el-search--occur): Cover each match with an individual overlay storing the match number and other data in an overlay property. (el-search-occur--next-match): Use these new overlays for navigation. Call 'el-search--scroll-sexp-in-view'. (el-search-occur--show-match-count): Rewrite to use the new match-spanning overlays. --- packages/el-search/el-search.el | 145 ++++++++++++++++++++++------------= ------ 1 file changed, 79 insertions(+), 66 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-sear= ch.el index ff222b2..3939b97 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -7,7 +7,7 @@ ;; Created: 29 Jul 2015 ;; Keywords: lisp ;; Compatibility: GNU Emacs 25 -;; Version: 1.7.9 +;; Version: 1.7.10 ;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0")) =20 =20 @@ -405,14 +405,11 @@ ;; syntax "##" (a syntax for an interned symbol whose name is the ;; empty string) can lead to errors while searching. ;; -;; - In *El Occur* buffers, when there are adjacent or nested matches, -;; the movement commands (el-search-occur-previous-match, -;; el-search-occur-next-match aka n and p) may skip matches, and the -;; shown match count can be inaccurate. -;; ;; ;; TODO: ;; +;; - Get rid of the redundant el-search-match overlays in occur buffers +;; ;; - There should be a way to go back to the starting position, like ;; in Isearch, which does this with (push-mark isearch-opoint t) in ;; `isearch-done'. @@ -2999,43 +2996,42 @@ Prompt for a new pattern and revert." (add-hook 'post-command-hook #'el-search-hl-post-command-fun t t) (when do-fun (funcall do-fun))))) =20 +(defvar el-search-occur-match-ov-prop 'el-occur-match-data) + (defun el-search-occur--next-match (&optional backward) - (let ((done nil) (pos (point))) - (when-let ((this-ov (cl-some (lambda (ov) (and (overlay-get ov 'el-s= earch-match) ov)) - (overlays-at pos)))) - (setq pos (funcall (if backward #'overlay-start #'overlay-end) thi= s-ov))) - (while (and (not done) (setq pos (funcall (if backward #'previous-si= ngle-char-property-change - #'next-single-char-prope= rty-change) - pos 'el-search-match))) - (setq done (or (memq pos (list (point-min) (point-max))) - (cl-some (lambda (ov) (overlay-get ov 'el-search-ma= tch)) - (overlays-at pos))))) - (if (memq pos (list (point-min) (point-max))) + (let ((pos (point)) new-pos) + (cl-flet ((at-a-match-beg-p + (lambda (pos) + (when-let ((match-data (get-char-property pos el-search= -occur-match-ov-prop))) + (and (not (=3D (point) (if backward (point-min) (poin= t-max)))) + (not (eq match-data + (get-char-property (1- pos) el-search-o= ccur-match-ov-prop)))))))) + (while (and (setq new-pos (funcall (if backward #'previous-single-= char-property-change + #'next-single-char-property-c= hange) + pos el-search-occur-match-ov-pr= op)) + (not (eq pos new-pos)) + (setq pos new-pos) + (not (at-a-match-beg-p pos))))) + (if (memq pos (list (point-min) (point-max) nil)) (progn (el-search--message-no-log "No match %s this position" (if bac= kward "before" "after")) (sit-for 1.5)) (goto-char pos) - (save-excursion (hs-show-block)))) - (el-search-occur--show-match-count)) + (save-excursion (hs-show-block)) + (redisplay) + (el-search--scroll-sexp-in-view (list (point) (el-search--end-of-s= exp))) + (el-search-occur--show-match-count)))) =20 (defvar el-search-occur--total-matches nil) =20 (defun el-search-occur--show-match-count () - (while-no-input - (let ((nbr-match 0) - (pos (point)) - (match-here-p (lambda () (get-char-property (point) 'el-search= -match)))) - (when (funcall match-here-p) - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (while (< (point) pos) - (goto-char (next-single-char-property-change (point) 'el-s= earch-match)) - (when (funcall match-here-p) - (cl-incf nbr-match))) - (el-search--message-no-log - "Match %d/%d" nbr-match el-search-occur--total-matches)))))= )) + (pcase-let ((`(,_buffer ,_mb ,_file ,nbr) + (get-char-property (point) el-search-occur-match-ov-prop)= )) + (el-search--message-no-log + "%d/%s" nbr + (if el-search-occur--total-matches + (format "%d" el-search-occur--total-matches) + "???")))) =20 (defun el-search-occur-next-match () "Move point to the next match." @@ -3168,6 +3164,7 @@ Prompt for a new pattern and revert." (el-search--get-search-description-string se= arch))) (condition-case-unless-debug err (let ((insert-summary-position (point)) + (match-nbr 0) (stream-of-matches (stream-partition (funcall (el-search-object-get-matches search)) @@ -3187,18 +3184,20 @@ Prompt for a new pattern and revert." (insert (format " (%d match%s)\n" buffer-matches (if (> buffer-matches 1) "es" ""))= ) - (let ((buffer-matches+contexts + (let ((buffer-matches+counts+contexts (seq-map (pcase-lambda ((and match `(,_ ,ma= tch-beg ,_))) (with-current-buffer buffer - (cons match - (let ((open-paren-in-col= umn-0-is-defun-start nil)) - (save-excursion - (funcall el-search-g= et-occur-context-function - match-beg))= )))) + (list + match + (cl-incf match-nbr) + (let ((open-paren-in-column-0= -is-defun-start nil)) + (save-excursion + (funcall el-search-get-oc= cur-context-function + match-beg)))))) stream-of-buffer-matches))) - (while (not (stream-empty-p buffer-matches+conte= xts)) - (pcase-let ((`((,_ ,match-beg ,_) . (,context-= beg . ,context-end)) - (stream-first buffer-matches+cont= exts))) + (while (not (stream-empty-p buffer-matches+count= s+contexts)) + (pcase-let ((`((,_ ,match-beg ,_) ,_ (,context= -beg . ,context-end)) + (stream-first buffer-matches+coun= ts+contexts))) (let ((insertion-point (point)) matches (end-of-defun (with-current-buffer buf= fer (goto-char match-beg) @@ -3206,53 +3205,67 @@ Prompt for a new pattern and revert." (if (< 0 paren-depth= ) (scan-lists matc= h-beg 1 paren-depth) (el-search--end-of= -sexp)))))) - (let ((rest buffer-matches+contexts) - (remaining-buffer-matches-+contexts = buffer-matches+contexts)) + (let ((rest buffer-matches+counts+contexts= ) + (remaining-buffer-matches+counts+con= texts + buffer-matches+counts+contexts)) (with-current-buffer buffer (while (pcase (stream-first rest) - (`(,_ . (,(and cbeg (pred (> = end-of-defun))) . ,_)) + (`(,_ ,_ (,(and cbeg (pred (>= end-of-defun))) . ,_)) (prog1 t (stream-pop rest) (when (< cbeg context-end) - (setq remaining-buffer-m= atches-+contexts rest) + (setq remaining-buffer-m= atches+counts+contexts rest) (when (< cbeg context-be= g) (setq context-beg cbeg= ) (setq context-end (or (el-search--= end-of-sexp cbeg) context-end))))))))) (setq matches (car (stream-divide-with-get-rest-= fun - buffer-matches+contexts - (lambda (_) remaining-buffer= -matches-+contexts)))) - (setq buffer-matches+contexts remaining-= buffer-matches-+contexts)) + buffer-matches+counts+contex= ts + (lambda (_) remaining-buffer= -matches+counts+contexts)))) + (setq buffer-matches+counts+contexts + remaining-buffer-matches+counts+co= ntexts)) (cl-flet ((insert-match-and-advance - (match-beg) + (match-beg nbr) (let ((insertion-point (point))= ) - (insert (propertize - (with-current-buffer= buffer - (buffer-substring-= no-properties - (goto-char match-= beg) - (goto-char (el-se= arch--end-of-sexp)))) - 'match-data `(,buffe= r ,match-beg ,file))) + (insert (with-current-buffer = buffer + (buffer-substring-n= o-properties + (goto-char match-b= eg) + (goto-char (el-sea= rch--end-of-sexp))))) (let ((ov (make-overlay inser= tion-point (point) nil t))) (overlay-put ov 'face 'el-s= earch-occur-match) (overlay-put - ov 'el-search-match (list = (or file buffer) match-beg))) + ov 'el-search-match (list = (or file buffer) match-beg)) + (overlay-put + ov el-search-occur-match-o= v-prop + `(,buffer ,match-beg ,file= ,nbr))) (with-current-buffer buffer (= point))))) (insert (format "\n;;;; Line %d\n" (with-current-buffer buf= fer (line-number-at-pos co= ntext-beg)))) (setq insertion-point (point)) - (let ((working-position context-beg)) + (let ((working-position context-beg) mai= n-match-beg) (while (not (stream-empty-p matches)) - (pcase-let ((`((,_ ,match-beg ,_) . = ,_) (stream-pop matches))) + (pcase-let ((`((,_ ,match-beg ,_) ,n= br ,_) (stream-pop matches))) (insert-buffer-substring buffer wo= rking-position match-beg) - (setq working-position (insert-mat= ch-and-advance match-beg)) + (setq + main-match-beg (point) + working-position (insert-match-an= d-advance match-beg nbr)) ;; Drop any matches inside the pri= nted area. - ;; FIXME: Should we highlight matc= hes inside matches specially? - ;; Should we display the number of= matches included in a context? - (while (pcase (stream-first matche= s) - (`((,_ ,(pred (> working-= position)) ,_) . ,_) t)) - (stream-pop matches)))) + (while + (pcase (stream-first matches) + (`((,_ ,(and (pred (> workin= g-position)) mb) ,_) ,nbr ,_) + (let ((ov-start (+ main-mat= ch-beg (- mb match-beg)))) + (overlay-put + (make-overlay + ov-start + (+ ov-start + (with-current-buffer= buffer + (el-search--end-of= -sexp mb)))) + el-search-occur-match-ov= -prop + `(,buffer ,mb ,file ,nbr= ))) + (stream-pop matches) + t))))) (insert (with-current-buffer buffer (buffer-substring-no-properties From MAILER-DAEMON Fri Nov 02 07:19:39 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gIXUJ-0007kn-9J for mharc-emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 07:19:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIXUE-0007iP-L0 for emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 07:19:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIXU9-0002re-DE for emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 07:19:34 -0400 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:55529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIXU9-0002r2-4Q for emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 07:19:29 -0400 Received: by vcs0.savannah.gnu.org (Postfix, from userid 67418) id E930D20443; Fri, 2 Nov 2018 07:19:28 -0400 (EDT) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master b11eef7: Add mail command index in debbugs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Albinus In-Reply-To: <20181102111928.9909.5992@vcs0.savannah.gnu.org> References: <20181102111928.9909.5992@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: b11eef7c968e4dd66be228a7d9ad3a76544b4e0b Auto-Submitted: auto-generated Message-Id: <20181102111928.E930D20443@vcs0.savannah.gnu.org> Date: Fri, 2 Nov 2018 07:19:28 -0400 (EDT) From: Michael.Albinus@gmx.de (Michael Albinus) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 11:19:38 -0000 branch: master commit b11eef7c968e4dd66be228a7d9ad3a76544b4e0b Author: Michael Albinus Commit: Michael Albinus Add mail command index in debbugs =20 * packages/debbugs/debbugs-ug.texi (Top): Add Mail Command Index. =20 * packages/debbugs/debbugs.texi (Requesting bug numbers) (Searching bugs): Use @uref{}. =20 * packages/debbugs/instructions.texi: New file. --- packages/debbugs/debbugs-ug.info | 332 +++++++++++++++++++++++++++++++= ++++-- packages/debbugs/debbugs-ug.texi | 6 + packages/debbugs/debbugs.texi | 4 +- packages/debbugs/instructions.texi | 302 +++++++++++++++++++++++++++++++= ++ 4 files changed, 628 insertions(+), 16 deletions(-) diff --git a/packages/debbugs/debbugs-ug.info b/packages/debbugs/debbugs-= ug.info index 7e3901d..19d7040 100644 --- a/packages/debbugs/debbugs-ug.info +++ b/packages/debbugs/debbugs-ug.info @@ -57,6 +57,7 @@ Org Mode: (org)Top.). As backend they use the 'debbugs= ' Emacs library * Command Index:: Debbugs commands. * Variable Index:: User options and variables. * Key Index:: Keyboard strokes on bug report buffers. +* Mail Command Index:: Debbugs control mailserver commands. =20 =1F File: debbugs-ug.info, Node: Retrieving Bugs, Next: Searching Bugs, P= rev: Top, Up: Top @@ -641,7 +642,7 @@ Variable Index * debbugs-org-severity-priority: TODO Items. (line 10) =20 =1F -File: debbugs-ug.info, Node: Key Index, Prev: Variable Index, Up: Top +File: debbugs-ug.info, Node: Key Index, Next: Mail Command Index, Pre= v: Variable Index, Up: Top =20 Key Index ********* @@ -670,22 +671,325 @@ Key Index * w: Tabulated Lists. (line 49) * x: Tabulated Lists. (line 68) =20 +=1F +File: debbugs-ug.info, Node: Mail Command Index, Prev: Key Index, Up:= Top + +Debbugs control mailserver commands +*********************************** + +'reassign bugnumber package [ version ]' + Records that bug #bugnumber is a bug in package. This can be + used to set the package if the user forgot the pseudo-header, or + to change an earlier assignment. No notifications are sent to + anyone (other than the usual information in the processing + transcript). + + If you supply a version, the bug tracking system will note that + the bug affects that version of the newly-assigned package. + +'reopen bugnumber [ originator-address | =3D | ! ]' + Reopens #bugnumber if it is closed. + + By default, or if you specify =3D, the original submitter is still + as the originator of the report, so that they will get the ack + when it is closed again. + + If you supply an originator-address the originator will be set to + the address you supply. If you wish to become the new originator + of the reopened report you can use the ! shorthand or specify + your own email address. + + It is usually a good idea to tell the person who is about to be + recorded as the originator that you're reopening the report, so + that they will know to expect the ack which they'll get when it + is closed again. + + If the bug is not closed then reopen won't do anything, not even + change the originator. To change the originator of an open bug + report, use the submitter command; note that this will inform the + original submitter of the change. + + If the bug was recorded as being closed in a particular version + of a package but recurred in a later version, it is better to use + the found command instead. + +'found bugnumber [ version ]' + Record that #bugnumber has been encountered in the given version + of the package to which it is assigned. + + The bug tracking system uses this information, in conjunction + with fixed versions recorded when closing bugs, to display lists + of bugs open in various versions of each package. It considers a + bug to be open when it has no fixed version, or when it has been + found more recently than it has been fixed. + + If no version is given, then the list of fixed versions for the + bug is cleared. This is identical to the behaviour of reopen. + + This command will only cause a bug to be marked as not done if no + version is specified, or if the version being marked found is + equal to the version which was last marked fixed. (If you are + certain that you want the bug marked as not done, use reopen in + conjunction with found. + + This command was introduced in preference to reopen because it + was difficult to add a version to that command's syntax without + suffering ambiguity. + +'notfound bugnumber version' + Remove the record that #bugnumber was encountered in the given + version of the package to which it is assigned. + + This differs from closing the bug at that version in that the bug + is not listed as fixed in that version either; no information + about that version will be known. It is intended for fixing + mistakes in the record of when a bug was found. + +'submitter bugnumber originator-address | !' + Changes the originator of #bugnumber to originator-address. + + If you wish to become the new originator of the report you can + use the ! shorthand or specify your own email address. + + While the reopen command changes the originator of other bugs + merged with the one being reopened, submitter does not affect + merged bugs. + +'forwarded bugnumber address' + Notes that bugnumber has been forwarded to the upstream + maintainer at address. This does not actually forward the + report. This can be used to change an existing incorrect + forwarded-to address, or to record a new one for a bug that + wasn't previously noted as having been forwarded. + +'notforwarded bugnumber' + Forgets any idea that bugnumber has been forwarded to any + upstream maintainer. If the bug was not recorded as having been + forwarded then this will do nothing. + +'retitle bugnumber new-title' + Changes the title of a bug report to that specified (the default + is the Subject mail header from the original report). + + Unlike most of the other bug-manipulation commands when used on + one of a set of merged reports this will change the title of only + the individual bug requested, and not all those with which it is + merged. + +'severity bugnumber severity' + Set the severity level for bug report #bugnumber to severity. No + notification is sent to the user who reported the bug. + + For their meanings please consult the general developers' + documentation for the bug system. + +'clone bugnumber NewID [ new IDs ... ]' + The clone control command allows you to duplicate a bug report. + It is useful in the case where a single report actually indicates + that multiple distinct bugs have occurred. "New IDs" are + negative numbers, separated by spaces, which may be used in + subsequent control commands to refer to the newly duplicated + bugs. A new report is generated for each new ID. + + Example usage: + + clone 12345 -1 -2 + reassign -1 foo + retitle -1 foo: foo sucks + reassign -2 bar + retitle -2 bar: bar sucks when used with foo + severity -2 wishlist + clone 123456 -3 + reassign -3 foo + retitle -3 foo: foo sucks + merge -1 -3 + +'merge bugnumber bugnumber ...' + Merges two or more bug reports. When reports are merged opening, + closing, marking or unmarking as forwarded and reassigning any of + the bugs to a new package will have an identical effect on all of + the merged reports. + + Before bugs can be merged they must be in exactly the same state: + either all open or all closed, with the same forwarded-to + upstream author address or all not marked as forwarded, all + assigned to the same package or package(s) (an exact string + comparison is done on the package to which the bug is assigned), + and all of the same severity. If they don't start out in the + same state you should use reassign, reopen and so forth to make + sure that they are before using merge. Titles are not required + to match, and will not be affected by the merge. + + If any of the bugs listed in a merge command is already merged + with another bug then all the reports merged with any of the ones + listed will all be merged together. Merger is like equality: it + is reflexive, transitive and symmetric. + + Merging reports causes a note to appear on each report's logs; on + the WWW pages this includes links to the other bugs. + + Merged reports are all expired simultaneously, and only when all + of the reports each separately meet the criteria for expiry. + +'forcemerge bugnumber bugnumber ...' + Forcibly merges two or more bug reports. The first bug is chosen + as the master bug, and its seetings are assigned to the bugs + listed next in the command. See the text above for a description + of what merging means. + +'unmerge bugnumber' + Disconnects a bug report from any other reports with which it may + have been merged. If the report listed is merged with several + others then they are all left merged with each other; only their + associations with the bug explicitly named are removed. + + If many bug reports are merged and you wish to split them into + two separate groups of merged reports you must unmerge each + report in one of the new groups separately and then merge them + into the required new group. + + You can only unmerge one report with each unmerge command; if you + want to disconnect more than one bug simply include several + unmerge commands in your message. + +'tags bugnumber [ + | - | =3D ] tag [ tag ... ]' + Sets tags for the bug report #bugnumber. No notification is sent + to the user who reported the bug. Setting the action to + means + to add each given tag, - means to remove each given tag, and =3D + means to ignore the current tags and set them afresh to the list + provided. The default action is adding. + + Example usage: + + # same as 'tags 123456 + patch' + tags 123456 patch + + # same as 'tags 123456 + help security' + tags 123456 help security + + # add 'fixed' and 'pending' tags + tags 123456 + fixed pending + + # remove 'unreproducible' tag + tags 123456 - unreproducible + + # set tags to exactly 'moreinfo' and 'unreproducible' + tags 123456 =3D moreinfo unreproducible + + Available tags currently include patch, wontfix, moreinfo, + unreproducible, help, pending, fixed, security, upstream, potato, + woody, sarge, sid and experimental. + + For their meanings please consult the general developers' + documentation for the bug system. + +'block bugnumber by|with bug [ bug ... ]' +'unblock bugnumber by|with bug [ bug ... ]' + Use to note that one bug blocks another bug from being fixed. + The first listed bug is the one being blocked, and it is followed + by the bug or bugs that are blocking it. Use unblock to unblock + a bug. + + Example usage: + + # indicates that 7890 cannot be fixed until 123456 is fixed + block 7890 by 123456 + # indicates that 7890 can be fixed before 123456 after all + unblock 7890 by 123456 + +'close bugnumber [ fixed-version ] (deprecated)' + Close bug report #bugnumber. + + A notification is sent to the user who reported the bug, but (in + contrast to mailing bugnumber-done) the text of the mail which + caused the bug to be closed is not included in that notification. + The maintainer who closes a report should ensure, probably by + sending a separate message, that the user who reported the bug + knows why it is being closed. The use of this command is + therefore deprecated. + + If you supply a fixed-version, the bug tracking system will note + that the bug was fixed in that version of the package. + +'package [ packagename ... ]' + Limits the following commands so that they will only apply to + bugs filed against the listed packages. You can list one or more + packages. If you don't list any packages, the following commands + will apply to all bugs. You're encouraged to use this as a + safety feature in case you accidentally use the wrong bug + numbers. + + Example usage: + + package foo + reassign 123456 bar 1.0-1 + + package bar + retitle 123456 bar: bar sucks + severity 123456 normal + + package + severity 234567 wishlist + +'owner bugnumber address | !' + Sets address to be the "owner" of #bugnumber. The owner of a bug + claims responsibility for fixing it. This is useful to share out + work in cases where a package has a team of maintainers. + + If you wish to become the owner of the bug yourself, you can use + the ! shorthand or specify your own email address. + +'noowner bugnumber' + Forgets any idea that the bug has an owner other than the usual + maintainer. If the bug had no owner recorded then this will do + nothing. + +'archive bugnumber' + Archives a bug that was previously archived if the bug fulfills + the requirements for archival, ignoring time. + +'unarchive bugnumber' + Unarchives a bug that was previously archived. Unarchival should + generally be coupled with reopen and found/fixed as approprite. + Bugs that have been unarchived can be archived using archive + assuming the non-time based archival requirements are met. + +'#...' + One-line comment. The # must be at the start of the line. The + text of comments will be included in the acknowledgement sent to + the sender and to affected maintainers, so you can use this to + document the reasons for your commands. + +'quit' +'stop' +'thank' +'thanks' +'thankyou' +'thank you' +'--' + On a line by itself, in any case, possibly followed by + whitespace, tells the control server to stop processing the + message; the remainder of the message can include explanations, + signatures or anything else, none of it will be detected by the + control server. + =20 =1F Tag Table: Node: Top=7F1097 -Node: Retrieving Bugs=7F2635 -Node: Searching Bugs=7F6868 -Ref: Searching Bugs-Footnote-1=7F11181 -Ref: Searching Bugs-Footnote-2=7F11269 -Node: Presenting Bugs=7F11360 -Node: Tabulated Lists=7F11936 -Node: TODO Items=7F15611 -Node: Control Messages=7F16667 -Node: Applying Patches=7F19851 -Node: Minor Mode=7F21217 -Node: Command Index=7F22273 -Node: Variable Index=7F23062 -Node: Key Index=7F24136 +Node: Retrieving Bugs=7F2704 +Node: Searching Bugs=7F6937 +Ref: Searching Bugs-Footnote-1=7F11250 +Ref: Searching Bugs-Footnote-2=7F11338 +Node: Presenting Bugs=7F11429 +Node: Tabulated Lists=7F12005 +Node: TODO Items=7F15680 +Node: Control Messages=7F16736 +Node: Applying Patches=7F19920 +Node: Minor Mode=7F21286 +Node: Command Index=7F22342 +Node: Variable Index=7F23131 +Node: Key Index=7F24205 +Node: Mail Command Index=7F25771 =1F End Tag Table diff --git a/packages/debbugs/debbugs-ug.texi b/packages/debbugs/debbugs-= ug.texi index b4d8885..f3623dd 100644 --- a/packages/debbugs/debbugs-ug.texi +++ b/packages/debbugs/debbugs-ug.texi @@ -68,6 +68,7 @@ Programmer's Manual, debbugs}). * Command Index:: Debbugs commands. * Variable Index:: User options and variables. * Key Index:: Keyboard strokes on bug report buffers. +* Mail Command Index:: Debbugs control mailserver commands. @end menu =20 =20 @@ -684,6 +685,11 @@ buffer, when @code{debbugs-browse-mode} is enabled. = See user option @unnumbered Key Index @printindex ky =20 + +@node Mail Command Index +@unnumbered Debbugs control mailserver commands +@include instructions.texi + @bye =20 @c Local Variables: diff --git a/packages/debbugs/debbugs.texi b/packages/debbugs/debbugs.tex= i index 9b01512..898fdb6 100644 --- a/packages/debbugs/debbugs.texi +++ b/packages/debbugs/debbugs.texi @@ -236,7 +236,7 @@ GNU port: @code{"fixed"}, @code{"notabug"}, @code{"wo= ntfix"}, @code{"unreproducible"}, @code{"moreinfo"}, @code{"patch"}, @code{"pending"}, @code{"help"}, @code{"security"}, @code{"confirmed"}, @code{"easy"}. See -@url{https://debbugs.gnu.org/Developer.html#tags} for the actual list +@uref{https://debbugs.gnu.org/Developer.html#tags} for the actual list of tags. =20 @item :owner @@ -466,7 +466,7 @@ values are strings or numbers, i.e.@: @var{:keyword} = @var{value} Every sublist of the @var{query} forms a hyperestraier condition. A detailed description of hyperestraier conditions can be found at @c https does not work. -@url{http://fallabs.com/hyperestraier/uguide-en.html#searchcond}. +@uref{http://fallabs.com/hyperestraier/uguide-en.html#searchcond}. =20 The following conditions are possible: =20 diff --git a/packages/debbugs/instructions.texi b/packages/debbugs/instru= ctions.texi new file mode 100644 index 0000000..e3c5f29 --- /dev/null +++ b/packages/debbugs/instructions.texi @@ -0,0 +1,302 @@ +@table @samp +@item reassign bugnumber package [ version ] +Records that bug #bugnumber is a bug in package. This can be used +to set the package if the user forgot the pseudo-header, or to +change an earlier assignment. No notifications are sent to anyone +(other than the usual information in the processing transcript). + +If you supply a version, the bug tracking system will note that +the bug affects that version of the newly-assigned package. + +@item reopen bugnumber [ originator-address | =3D | ! ] +Reopens #bugnumber if it is closed. + +By default, or if you specify =3D, the original submitter is still +as the originator of the report, so that they will get the ack +when it is closed again. + +If you supply an originator-address the originator will be set to +the address you supply. If you wish to become the new originator +of the reopened report you can use the ! shorthand or specify your +own email address. + +It is usually a good idea to tell the person who is about to be +recorded as the originator that you're reopening the report, so +that they will know to expect the ack which they'll get when it is +closed again. + +If the bug is not closed then reopen won't do anything, not even +change the originator. To change the originator of an open bug +report, use the submitter command; note that this will inform the +original submitter of the change. + +If the bug was recorded as being closed in a particular version of +a package but recurred in a later version, it is better to use the +found command instead. + +@item found bugnumber [ version ] +Record that #bugnumber has been encountered in the given version +of the package to which it is assigned. + +The bug tracking system uses this information, in conjunction with +fixed versions recorded when closing bugs, to display lists of +bugs open in various versions of each package. It considers a bug +to be open when it has no fixed version, or when it has been found +more recently than it has been fixed. + +If no version is given, then the list of fixed versions for the +bug is cleared. This is identical to the behaviour of reopen. + +This command will only cause a bug to be marked as not done if no +version is specified, or if the version being marked found is +equal to the version which was last marked fixed. (If you are +certain that you want the bug marked as not done, use reopen in +conjunction with found. + +This command was introduced in preference to reopen because it was +difficult to add a version to that command's syntax without +suffering ambiguity. + +@item notfound bugnumber version +Remove the record that #bugnumber was encountered in the given +version of the package to which it is assigned. + +This differs from closing the bug at that version in that the bug +is not listed as fixed in that version either; no information +about that version will be known. It is intended for fixing +mistakes in the record of when a bug was found. + +@item submitter bugnumber originator-address | ! +Changes the originator of #bugnumber to originator-address. + +If you wish to become the new originator of the report you can use +the ! shorthand or specify your own email address. + +While the reopen command changes the originator of other bugs +merged with the one being reopened, submitter does not affect +merged bugs. + +@item forwarded bugnumber address +Notes that bugnumber has been forwarded to the upstream maintainer +at address. This does not actually forward the report. This can be +used to change an existing incorrect forwarded-to address, or to +record a new one for a bug that wasn't previously noted as having +been forwarded. + +@item notforwarded bugnumber +Forgets any idea that bugnumber has been forwarded to any upstream +maintainer. If the bug was not recorded as having been forwarded +then this will do nothing. + +@item retitle bugnumber new-title +Changes the title of a bug report to that specified (the default +is the Subject mail header from the original report). + +Unlike most of the other bug-manipulation commands when used on +one of a set of merged reports this will change the title of only +the individual bug requested, and not all those with which it is +merged. + +@item severity bugnumber severity +Set the severity level for bug report #bugnumber to severity. No +notification is sent to the user who reported the bug. + +For their meanings please consult the general developers' +documentation for the bug system. + +@item clone bugnumber NewID [ new IDs @dots{} ] +The clone control command allows you to duplicate a bug report. It +is useful in the case where a single report actually indicates +that multiple distinct bugs have occurred. "New IDs" are negative +numbers, separated by spaces, which may be used in subsequent +control commands to refer to the newly duplicated bugs. A new +report is generated for each new ID. + +Example usage: + +@example +clone 12345 -1 -2 +reassign -1 foo +retitle -1 foo: foo sucks +reassign -2 bar +retitle -2 bar: bar sucks when used with foo +severity -2 wishlist +clone 123456 -3 +reassign -3 foo +retitle -3 foo: foo sucks +merge -1 -3 +@end example + +@item merge bugnumber bugnumber @dots{} + Merges two or more bug reports. When reports are merged openi= ng, + closing, marking or unmarking as forwarded and reassigning an= y of + the bugs to a new package will have an identical effect on al= l of + the merged reports. + + Before bugs can be merged they must be in exactly the same st= ate: +either all open or all closed, with the same forwarded-to upstream +author address or all not marked as forwarded, all assigned to the +same package or package(s) (an exact string comparison is done on +the package to which the bug is assigned), and all of the same +severity. If they don't start out in the same state you should use +reassign, reopen and so forth to make sure that they are before +using merge. Titles are not required to match, and will not be +affected by the merge. + +If any of the bugs listed in a merge command is already merged +with another bug then all the reports merged with any of the ones +listed will all be merged together. Merger is like equality: it is +reflexive, transitive and symmetric. + +Merging reports causes a note to appear on each report's logs; on +the WWW pages this includes links to the other bugs. + +Merged reports are all expired simultaneously, and only when all +of the reports each separately meet the criteria for expiry. + +@item forcemerge bugnumber bugnumber @dots{} +Forcibly merges two or more bug reports. The first bug is chosen +as the master bug, and its seetings are assigned to the bugs +listed next in the command. See the text above for a description +of what merging means. + +@item unmerge bugnumber +Disconnects a bug report from any other reports with which it may +have been merged. If the report listed is merged with several +others then they are all left merged with each other; only their +associations with the bug explicitly named are removed. + +If many bug reports are merged and you wish to split them into two +separate groups of merged reports you must unmerge each report in +one of the new groups separately and then merge them into the +required new group. + +You can only unmerge one report with each unmerge command; if you +want to disconnect more than one bug simply include several +unmerge commands in your message. + +@item tags bugnumber [ + | - | =3D ] tag [ tag @dots{} ] +Sets tags for the bug report #bugnumber. No notification is sent +to the user who reported the bug. Setting the action to + means to +add each given tag, - means to remove each given tag, and =3D means +to ignore the current tags and set them afresh to the list +provided. The default action is adding. + +Example usage: + +@example +# same as 'tags 123456 + patch' +tags 123456 patch + +# same as 'tags 123456 + help security' +tags 123456 help security + +# add 'fixed' and 'pending' tags +tags 123456 + fixed pending + +# remove 'unreproducible' tag +tags 123456 - unreproducible + +# set tags to exactly 'moreinfo' and 'unreproducible' +tags 123456 =3D moreinfo unreproducible +@end example + +Available tags currently include patch, wontfix, moreinfo, +unreproducible, help, pending, fixed, security, upstream, potato, +woody, sarge, sid and experimental. + +For their meanings please consult the general developers' +documentation for the bug system. + +@item block bugnumber by|with bug [ bug @dots{} ] +@itemx unblock bugnumber by|with bug [ bug @dots{} ] +Use to note that one bug blocks another bug from being fixed. The +first listed bug is the one being blocked, and it is followed by +the bug or bugs that are blocking it. Use unblock to unblock a +bug. + +Example usage: + +@example +# indicates that 7890 cannot be fixed until 123456 is fixed +block 7890 by 123456 +# indicates that 7890 can be fixed before 123456 after all +unblock 7890 by 123456 +@end example + +@item close bugnumber [ fixed-version ] (deprecated) +Close bug report #bugnumber. + +A notification is sent to the user who reported the bug, but (in +contrast to mailing bugnumber-done) the text of the mail which +caused the bug to be closed is not included in that notification. +The maintainer who closes a report should ensure, probably by +sending a separate message, that the user who reported the bug +knows why it is being closed. The use of this command is therefore +deprecated. + +If you supply a fixed-version, the bug tracking system will note +that the bug was fixed in that version of the package. + +@item package [ packagename @dots{} ] +Limits the following commands so that they will only apply to bugs +filed against the listed packages. You can list one or more +packages. If you don't list any packages, the following commands +will apply to all bugs. You're encouraged to use this as a safety +feature in case you accidentally use the wrong bug numbers. + +Example usage: + +@example +package foo +reassign 123456 bar 1.0-1 + +package bar +retitle 123456 bar: bar sucks +severity 123456 normal + +package +severity 234567 wishlist +@end example + +@item owner bugnumber address | ! +Sets address to be the "owner" of #bugnumber. The owner of a bug +claims responsibility for fixing it. This is useful to share out +work in cases where a package has a team of maintainers. + +If you wish to become the owner of the bug yourself, you can use +the ! shorthand or specify your own email address. + +@item noowner bugnumber +Forgets any idea that the bug has an owner other than the usual +maintainer. If the bug had no owner recorded then this will do +nothing. + +@item archive bugnumber + Archives a bug that was previously archived if the bug fulfil= ls + the requirements for archival, ignoring time. + +@item unarchive bugnumber +Unarchives a bug that was previously archived. Unarchival should +generally be coupled with reopen and found/fixed as approprite. +Bugs that have been unarchived can be archived using archive +assuming the non-time based archival requirements are met. + +@item #@dots{} +One-line comment. The # must be at the start of the line. The text +of comments will be included in the acknowledgement sent to the +sender and to affected maintainers, so you can use this to +document the reasons for your commands. + +@item quit +@itemx stop +@itemx thank +@itemx thanks +@itemx thankyou +@itemx thank you +@itemx -- +On a line by itself, in any case, possibly followed by whitespace, +tells the control server to stop processing the message; the +remainder of the message can include explanations, signatures or +anything else, none of it will be detected by the control server. +@end table From MAILER-DAEMON Fri Nov 02 08:12:17 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gIYJF-0002Gc-TM for mharc-emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 08:12:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIYJD-0002GM-70 for emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 08:12:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIYJB-0000F0-SI for emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 08:12:15 -0400 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:56175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIYJB-0000Du-Mf for emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 08:12:13 -0400 Received: by vcs0.savannah.gnu.org (Postfix, from userid 67418) id 7E65D20443; Fri, 2 Nov 2018 08:12:13 -0400 (EDT) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 6941464: * packages/debbugs/instructions.texi: Add @anchor{}. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Albinus In-Reply-To: <20181102121212.6263.85440@vcs0.savannah.gnu.org> References: <20181102121212.6263.85440@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 6941464ab7401a54e96d36f165f8cfe48ce78c3b Auto-Submitted: auto-generated Message-Id: <20181102121213.7E65D20443@vcs0.savannah.gnu.org> Date: Fri, 2 Nov 2018 08:12:13 -0400 (EDT) From: Michael.Albinus@gmx.de (Michael Albinus) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 12:12:16 -0000 branch: master commit 6941464ab7401a54e96d36f165f8cfe48ce78c3b Author: Michael Albinus Commit: Michael Albinus * packages/debbugs/instructions.texi: Add @anchor{}. --- packages/debbugs/debbugs-ug.info | 30 ++++++++++++++++++++++++++ packages/debbugs/instructions.texi | 44 ++++++++++++++++++++++++++++++++= ------ 2 files changed, 67 insertions(+), 7 deletions(-) diff --git a/packages/debbugs/debbugs-ug.info b/packages/debbugs/debbugs-= ug.info index 19d7040..6e45558 100644 --- a/packages/debbugs/debbugs-ug.info +++ b/packages/debbugs/debbugs-ug.info @@ -991,5 +991,35 @@ Node: Command Index=7F22342 Node: Variable Index=7F23131 Node: Key Index=7F24205 Node: Mail Command Index=7F25771 +Ref: Mail Command Index: reassign=7F25924 +Ref: Mail Command Index: reopen=7F26388 +Ref: Mail Command Index: found=7F27542 +Ref: Mail Command Index: notfound=7F28623 +Ref: Mail Command Index: submitter=7F29032 +Ref: Mail Command Index: forwarded=7F29426 +Ref: Mail Command Index: notforwarded=7F29765 +Ref: Mail Command Index: retitle=7F29966 +Ref: Mail Command Index: severity=7F30350 +Ref: Mail Command Index: clone=7F30615 +Ref: Mail Command Index: merge=7F31379 +Ref: Mail Command Index: forcemerge=7F32766 +Ref: Mail Command Index: unmerge=7F33040 +Ref: Mail Command Index: tags=7F33743 +Ref: Mail Command Index: block=7F34850 +Ref: Mail Command Index: unblock=7F34892 +Ref: Mail Command Index: close=7F35382 +Ref: Mail Command Index: package=7F36032 +Ref: Mail Command Index: owner=7F36644 +Ref: Mail Command Index: noowner=7F37007 +Ref: Mail Command Index: archive=7F37180 +Ref: Mail Command Index: unarchive=7F37321 +Ref: Mail Command Index: #=7F37614 +Ref: Mail Command Index: quit=7F37874 +Ref: Mail Command Index: stop=7F37881 +Ref: Mail Command Index: thank=7F37888 +Ref: Mail Command Index: thanks=7F37896 +Ref: Mail Command Index: thankyou=7F37905 +Ref: Mail Command Index: thank you=7F37916 +Ref: Mail Command Index: --=7F37928 =1F End Tag Table diff --git a/packages/debbugs/instructions.texi b/packages/debbugs/instru= ctions.texi index e3c5f29..ba51807 100644 --- a/packages/debbugs/instructions.texi +++ b/packages/debbugs/instructions.texi @@ -1,4 +1,5 @@ @table @samp +@anchor{Mail Command Index: reassign} @item reassign bugnumber package [ version ] Records that bug #bugnumber is a bug in package. This can be used to set the package if the user forgot the pseudo-header, or to @@ -8,6 +9,7 @@ change an earlier assignment. No notifications are sent t= o anyone If you supply a version, the bug tracking system will note that the bug affects that version of the newly-assigned package. =20 +@anchor{Mail Command Index: reopen} @item reopen bugnumber [ originator-address | =3D | ! ] Reopens #bugnumber if it is closed. =20 @@ -34,6 +36,7 @@ If the bug was recorded as being closed in a particular= version of a package but recurred in a later version, it is better to use the found command instead. =20 +@anchor{Mail Command Index: found} @item found bugnumber [ version ] Record that #bugnumber has been encountered in the given version of the package to which it is assigned. @@ -57,6 +60,7 @@ This command was introduced in preference to reopen bec= ause it was difficult to add a version to that command's syntax without suffering ambiguity. =20 +@anchor{Mail Command Index: notfound} @item notfound bugnumber version Remove the record that #bugnumber was encountered in the given version of the package to which it is assigned. @@ -66,6 +70,7 @@ is not listed as fixed in that version either; no infor= mation about that version will be known. It is intended for fixing mistakes in the record of when a bug was found. =20 +@anchor{Mail Command Index: submitter} @item submitter bugnumber originator-address | ! Changes the originator of #bugnumber to originator-address. =20 @@ -76,6 +81,7 @@ While the reopen command changes the originator of othe= r bugs merged with the one being reopened, submitter does not affect merged bugs. =20 +@anchor{Mail Command Index: forwarded} @item forwarded bugnumber address Notes that bugnumber has been forwarded to the upstream maintainer at address. This does not actually forward the report. This can be @@ -83,11 +89,13 @@ used to change an existing incorrect forwarded-to add= ress, or to record a new one for a bug that wasn't previously noted as having been forwarded. =20 +@anchor{Mail Command Index: notforwarded} @item notforwarded bugnumber Forgets any idea that bugnumber has been forwarded to any upstream maintainer. If the bug was not recorded as having been forwarded then this will do nothing. =20 +@anchor{Mail Command Index: retitle} @item retitle bugnumber new-title Changes the title of a bug report to that specified (the default is the Subject mail header from the original report). @@ -97,6 +105,7 @@ one of a set of merged reports this will change the ti= tle of only the individual bug requested, and not all those with which it is merged. =20 +@anchor{Mail Command Index: severity} @item severity bugnumber severity Set the severity level for bug report #bugnumber to severity. No notification is sent to the user who reported the bug. @@ -104,6 +113,7 @@ notification is sent to the user who reported the bug= . For their meanings please consult the general developers' documentation for the bug system. =20 +@anchor{Mail Command Index: clone} @item clone bugnumber NewID [ new IDs @dots{} ] The clone control command allows you to duplicate a bug report. It is useful in the case where a single report actually indicates @@ -127,13 +137,14 @@ retitle -3 foo: foo sucks merge -1 -3 @end example =20 +@anchor{Mail Command Index: merge} @item merge bugnumber bugnumber @dots{} - Merges two or more bug reports. When reports are merged openi= ng, - closing, marking or unmarking as forwarded and reassigning an= y of - the bugs to a new package will have an identical effect on al= l of - the merged reports. +Merges two or more bug reports. When reports are merged opening, +closing, marking or unmarking as forwarded and reassigning any of +the bugs to a new package will have an identical effect on all of +the merged reports. =20 - Before bugs can be merged they must be in exactly the same st= ate: +Before bugs can be merged they must be in exactly the same state: either all open or all closed, with the same forwarded-to upstream author address or all not marked as forwarded, all assigned to the same package or package(s) (an exact string comparison is done on @@ -154,12 +165,14 @@ the WWW pages this includes links to the other bugs= . Merged reports are all expired simultaneously, and only when all of the reports each separately meet the criteria for expiry. =20 +@anchor{Mail Command Index: forcemerge} @item forcemerge bugnumber bugnumber @dots{} Forcibly merges two or more bug reports. The first bug is chosen as the master bug, and its seetings are assigned to the bugs listed next in the command. See the text above for a description of what merging means. =20 +@anchor{Mail Command Index: unmerge} @item unmerge bugnumber Disconnects a bug report from any other reports with which it may have been merged. If the report listed is merged with several @@ -175,6 +188,7 @@ You can only unmerge one report with each unmerge com= mand; if you want to disconnect more than one bug simply include several unmerge commands in your message. =20 +@anchor{Mail Command Index: tags} @item tags bugnumber [ + | - | =3D ] tag [ tag @dots{} ] Sets tags for the bug report #bugnumber. No notification is sent to the user who reported the bug. Setting the action to + means to @@ -208,7 +222,9 @@ woody, sarge, sid and experimental. For their meanings please consult the general developers' documentation for the bug system. =20 +@anchor{Mail Command Index: block} @item block bugnumber by|with bug [ bug @dots{} ] +@anchor{Mail Command Index: unblock} @itemx unblock bugnumber by|with bug [ bug @dots{} ] Use to note that one bug blocks another bug from being fixed. The first listed bug is the one being blocked, and it is followed by @@ -224,6 +240,7 @@ block 7890 by 123456 unblock 7890 by 123456 @end example =20 +@anchor{Mail Command Index: close} @item close bugnumber [ fixed-version ] (deprecated) Close bug report #bugnumber. =20 @@ -238,6 +255,7 @@ deprecated. If you supply a fixed-version, the bug tracking system will note that the bug was fixed in that version of the package. =20 +@anchor{Mail Command Index: package} @item package [ packagename @dots{} ] Limits the following commands so that they will only apply to bugs filed against the listed packages. You can list one or more @@ -259,6 +277,7 @@ package severity 234567 wishlist @end example =20 +@anchor{Mail Command Index: owner} @item owner bugnumber address | ! Sets address to be the "owner" of #bugnumber. The owner of a bug claims responsibility for fixing it. This is useful to share out @@ -267,33 +286,44 @@ work in cases where a package has a team of maintai= ners. If you wish to become the owner of the bug yourself, you can use the ! shorthand or specify your own email address. =20 +@anchor{Mail Command Index: noowner} @item noowner bugnumber Forgets any idea that the bug has an owner other than the usual maintainer. If the bug had no owner recorded then this will do nothing. =20 +@anchor{Mail Command Index: archive} @item archive bugnumber - Archives a bug that was previously archived if the bug fulfil= ls - the requirements for archival, ignoring time. +Archives a bug that was previously archived if the bug fulfills +the requirements for archival, ignoring time. =20 +@anchor{Mail Command Index: unarchive} @item unarchive bugnumber Unarchives a bug that was previously archived. Unarchival should generally be coupled with reopen and found/fixed as approprite. Bugs that have been unarchived can be archived using archive assuming the non-time based archival requirements are met. =20 +@anchor{Mail Command Index: #} @item #@dots{} One-line comment. The # must be at the start of the line. The text of comments will be included in the acknowledgement sent to the sender and to affected maintainers, so you can use this to document the reasons for your commands. =20 +@anchor{Mail Command Index: quit} @item quit +@anchor{Mail Command Index: stop} @itemx stop +@anchor{Mail Command Index: thank} @itemx thank +@anchor{Mail Command Index: thanks} @itemx thanks +@anchor{Mail Command Index: thankyou} @itemx thankyou +@anchor{Mail Command Index: thank you} @itemx thank you +@anchor{Mail Command Index: --} @itemx -- On a line by itself, in any case, possibly followed by whitespace, tells the control server to stop processing the message; the From MAILER-DAEMON Fri Nov 02 12:20:20 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gIcBI-0007UW-3J for mharc-emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 12:20:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIcBE-0007UL-AX for emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 12:20:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIcBC-0000AK-Ax for emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 12:20:16 -0400 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:59061) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIcBC-0000A8-29 for emacs-elpa-diffs@gnu.org; Fri, 02 Nov 2018 12:20:14 -0400 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id AC7FE20443; Fri, 2 Nov 2018 12:20:13 -0400 (EDT) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/zones 16ea023: * zones.el: Improve the doc. Mention it's on GNU ELPA MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Drew Adams In-Reply-To: <20181102162012.26978.37700@vcs0.savannah.gnu.org> References: <20181102162012.26978.37700@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/zones X-Git-Reftype: branch X-Git-Rev: 16ea0232f24b326dc6fb975db9d628bf39ecc968 Auto-Submitted: auto-generated Message-Id: <20181102162013.AC7FE20443@vcs0.savannah.gnu.org> Date: Fri, 2 Nov 2018 12:20:13 -0400 (EDT) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 16:20:18 -0000 branch: externals/zones commit 16ea0232f24b326dc6fb975db9d628bf39ecc968 Author: Drew Adams Commit: Stefan Monnier * zones.el: Improve the doc. Mention it's on GNU ELPA =20 (narrow-map): Don't override pre-existing bindings. --- zones.el | 204 +++++++++++++++++++++++++++++++++++++++++++--------------= ------ 1 file changed, 140 insertions(+), 64 deletions(-) diff --git a/zones.el b/zones.el index 1140d81..8569488 100644 --- a/zones.el +++ b/zones.el @@ -7,11 +7,12 @@ ;; Author: Drew Adams ;; Maintainer: Drew Adams ;; Created: Sun Apr 18 12:58:07 2010 (-0700) -;; Version: 2018.10.28 +;; Version: 2018.11.01 ;; Package-Requires: () -;; Last-Updated: Tue Oct 30 13:07:40 2018 (-0700) +;; Last-Updated: Thu Nov 1 09:46:25 2018 (-0700) ;; By: dradams -;; Update #: 2152 +;; Update #: 2236 +;; URL: https://elpa.gnu.org/packages/zones.html ;; URL: https://www.emacswiki.org/emacs/download/zones.el ;; Doc URL: https://www.emacswiki.org/emacs/Zones ;; Doc URL: https://www.emacswiki.org/emacs/MultipleNarrowings @@ -20,7 +21,8 @@ ;; ;; Features that might be required by this library: ;; -;; `backquote', `bytecomp', `cconv', `cl-lib', `macroexp'. +;; `backquote', `bytecomp', `cconv', `cl', `cl-lib', `gv', +;; `macroexp'. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -28,10 +30,17 @@ ;; ;; Zones of text - like multiple regions. ;; -;; More description below. -;; ;; Bug reports etc.: (concat "drew" ".adams" "@" "oracle" ".com") ;; +;; You can get `zones.el' from Emacs Wiki or GNU ELPA: +;; +;; * Emacs Wiki: https://www.emacswiki.org/emacs/download/zones.el +;; * GNU ELPA: https://elpa.gnu.org/packages/zones.html +;; +;; The instance on Emacs Wiki might sometimes be more recent, but +;; major changes (named ''versions'') are posted to GNU ELPA. +;; +;; More description below. =0C ;;(@> "Index") ;; @@ -48,7 +57,9 @@ ;; (@> "Things Defined Here") ;; (@> "Documentation") ;; (@> "Compatibility") +;; (@> "Zones") ;; (@> "Coalesced (United) Zones") +;; (@> "Noncontiguous Region and Set of Zones") ;; (@> "Zones and Overlays") ;; (@> "Izone Commands") ;; (@> "Izone List Variables") @@ -170,6 +181,7 @@ ;; BUFFER is a buffer name (string) and where POSITION is a buffer ;; position (number only). ;; +;; The content of a zone is any contiguous stretch of buffer text. ;; The positions of a zone can be in either numeric order. The ;; positions are also called the zone "limits". The lower limit is ;; called the zone "beginning"; the upper limit is called its "end". @@ -183,10 +195,10 @@ ;; ;; Basic-zone union and intersection operations (`zz-zone-union', ;; `zz-zone-intersection') each act on a list of zones, returning -;; another such list, but which has POS1 <=3D POS2 in each of its -;; zones, and which lists its zones in ascending order of their cars. -;; For basic-zone union, the resulting zones are said to be -;; "coalesced", or "united". +;; another such list, but with the recorded positions for each zone +;; in (ascending) buffer order, and with the zones in ascending order +;; of their cars. For basic-zone union, the resulting zones are said +;; to be "coalesced", or "united". ;; ;; The extra info in the zones that result from zone union or ;; intersection is just the set union or set intersection of the @@ -201,24 +213,62 @@ ;; * The zones in the result list have been sorted in ascending order ;; by their first elements. ;; -;; * The zones in the result list are not adjacent and do not -;; overlap: there is some other buffer text (i.e., not in any zone) -;; between any two zones in the result. +;; * The zones in the result list are disjoint: they are not adjacent +;; and do not overlap: there is some other buffer text (i.e., not +;; in any zone) between any two zones in the result. +;; +;; +;;(@* "Noncontiguous Region and Set of Zones") +;; ** Noncontiguous Region and Set of Zones ** +;; +;; Starting with Emacs 25, Emacs can sometimes use a region that is +;; made up of noncontiguous pieces of buffer content: a +;; "noncontiguous region". This is similar to a set of zones, but +;; there are some differences. +;; +;; The zones in a set (or list) of zones can be adjacent or overlap, +;; and their order in the set is typically not important. +;; +;; A noncontiguous region corresponds instead to what results from +;; coalescing (uniting) a set of zones: a sequence of disjoint zones, +;; in buffer order, that is, ordered by their cars. +;; +;; The Lisp representation of a zone also differs from that of a +;; segment of a noncontiguous region. Each records two buffer +;; positions, but a zone can also include a list of additional +;; information (whatever you like). +;; +;; A noncontiguous-region segment is a cons (BEGIN . END), with BEGIN +;; <=3D END. A zone is a list (LIMIT1 LIMIT2 . EXTRA) of two positions +;; optionally followed by a list of extra stuff (any Lisp objects). +;; And as stated above, the zone limits need not be in ascending +;; order. +;; +;; The last difference is that each buffer position of a zone can be +;; a marker, which means that a list of zones can specify zones in +;; different buffers. A zone position can also be a readable marker, +;; which is a Lisp sexp that can be written to disk (e.g., as part of +;; a bookmark or saved variable), and restored in a later Emacs +;; session by reading the file where it is saved. ;; ;; ;;(@* "Zones and Overlays") ;; ** Zones and Overlays ** ;; -;; Emacs overlays have a lot in common with zones: overlays have an -;; associated buffer, two limits (positions), and a list of -;; properties. +;; Zones have even more in common with Emacs overlays than they do +;; with segments of a noncontiguous region. An overlay has an +;; associated buffer, two limits (start and end), and an optional +;; list of properties. ;; -;; Zones are different, in that: +;; Zones differ from overlays in these ways: ;; -;; * They can have identifiers (izones). -;; * They can have a readable Lisp form, by using numbers or readable -;; markers. -;; * They can be persistent, by bookmarking them. +;; * A zone can have an identifier (izone). +;; * A zone can have a readable Lisp form, by using numbers or +;; readable markers. +;; * A zone need not be specific to a particular buffer. If a zone's +;; positions are numbers instead of markers then you can use it in +;; any buffer. +;; * A set of zones can be persistent, by bookmarking it. ;; ;; You can create zones from overlays, and vice versa, using ;; functions `zz-overlay-to-zone', `zz-zone-to-overlay', @@ -227,8 +277,8 @@ ;; When creating zones from overlays you can specify how to represent ;; the zone limits: using markers, readable markers, or positive ;; integers. And you can specify whether to create basic zones or -;; izones. The overlay property list becomes the EXTRA information -;; of the resulting zone: (LIMIT1 LIMIT2 . EXTRA). +;; izones. The overlay property list becomes the list of EXTRA +;; information of the resulting zone: (LIMIT1 LIMIT2 . EXTRA). ;; ;; When creating overlays from zones, any list of EXTRA zone ;; information is used as the property list of the resulting overlay. @@ -351,7 +401,11 @@ ;; Many of the commands that manipulate izones are bound on keymap ;; `narrow-map'. They are available on prefix key `C-x n', along ;; with the narrowing/widening keys `C-x n d', `C-x n n', `C-x n p', -;; and `C-x n w': +;; and `C-x n w'. (If you use Emacs 22 then there is no +;; `narrow-map', so the same keys are bound on keymap `ctl-x-map'.) +;; +;; If you have already bound one of these keys then `zones.el' does +;; not rebind that key; your bindings are respected. ;; ;; C-x n a `zz-add-zone' - Add to current izones variable ;; C-x n A `zz-add-zone-and-unite' - Add izone, then unite izones @@ -473,6 +527,9 @@ ;; ;;(@* "Change log") ;; +;; 2018/10/31 dadams +;; Do not overwrite any user key bindings on narrow-map or ctl-x-map= . +;; Simplified defadvice. ;; 2018/10/30 dadams ;; Forked Emacs 20-21 stuff off as zones20.el. ;; Require cl-lib.el for Emacs 23+, cl.el for Emacs 22. @@ -730,7 +787,7 @@ ;; ;;; Code: =20 -(eval-when-compile (require 'cl)) ;; case +(eval-when-compile (require 'cl)) ;; case (No `cl-case' for Emacs 22) =20 ;; Quiet the byte-compiler. (defvar hlt-last-face) ; In `highlight.el' @@ -835,7 +892,7 @@ The cddr of ZONE remains as it was." (if (<=3D beg end) zone `(,end ,beg ,@extra)))) =20 (defun zz-zones-overlap-p (zone1 zone2) - "Return non-nil if ZONE1 and ZONE2 overlap. + "Return non-nil if ZONE1 and ZONE2 overlap. Assumes that each zone is ordered (its car <=3D its cadr). The cddrs are ignored. =20 @@ -896,8 +953,7 @@ This is a non-destructive operation: The result is a = new list." "Return the union (coalescence) of the zones in list ZONES. Each element of ZONES is a list of two zone limits, possibly followed by extra info: (LIMIT1 LIMIT2 . EXTRA), where EXTRA is a list. - -The limits do not need to be in numerical order. +The limits need not be in numerical order. =20 Each limit can be a number or a marker, but zones with markers for buffers other than BUFFER (default: current buffer) are ignored. @@ -956,8 +1012,8 @@ Each car can be a number or a marker. \(The result is nil if they do not overlap.) Assumes that each zone is ordered (its car <=3D its cadr). =20 -The cddr of a non-nil result (its EXTRA information) is -the intersection of the EXTRA information of each zone: +The cddr of a non-nil result (its list of EXTRA information) is the +intersection of the EXTRA information of each zone: =20 (zz-set-intersection (cddr zone1) (cddr zone2)) =20 @@ -1860,41 +1916,65 @@ current zones instead of adding to them." =20 ;;--------------------- =20 -;; FIXME: Just loading this file shouldn't overwrite bindings a user may -;; have put into narrow-map. (cond ((boundp 'narrow-map) ; Emacs 23+ - (define-key narrow-map "a" 'zz-add-zone) - (define-key narrow-map "A" 'zz-add-zone-and-unite) - (define-key narrow-map "c" 'zz-clone-zones) - (define-key narrow-map "C" 'zz-clone-and-unite-zones) - (define-key narrow-map "\C-d" 'zz-delete-zone) - (define-key narrow-map "r" (if (> emacs-major-version 21) 'zz-= select-region-repeat 'zz-select-region)) - (define-key narrow-map "u" 'zz-unite-zones) - (define-key narrow-map "v" 'zz-set-izones-var) - (define-key narrow-map "x" 'zz-narrow-repeat)) + (unless (lookup-key narrow-map "a") + (define-key narrow-map "a" 'zz-add-zone)) + (unless (lookup-key narrow-map "A") + (define-key narrow-map "A" 'zz-add-zone-and-unite)) + (unless (lookup-key narrow-map "c") + (define-key narrow-map "c" 'zz-clone-zones)) + (unless (lookup-key narrow-map "C") + (define-key narrow-map "C" 'zz-clone-and-unite-zones)) + (unless (lookup-key narrow-map "\C-d") + (define-key narrow-map "\C-d" 'zz-delete-zone)) + (unless (lookup-key narrow-map "r") + (define-key narrow-map "r" (if (> emacs-major-version 21) 'z= z-select-region-repeat 'zz-select-region))) + (unless (lookup-key narrow-map "u") + (define-key narrow-map "u" 'zz-unite-zones)) + (unless (lookup-key narrow-map "v") + (define-key narrow-map "v" 'zz-set-izones-var)) + (unless (lookup-key narrow-map "x") + (define-key narrow-map "x" 'zz-narrow-repeat))) (t - (define-key ctl-x-map "na" 'zz-add-zone) - (define-key ctl-x-map "nA" 'zz-add-zone-and-unite) - (define-key ctl-x-map "nc" 'zz-clone-zones) - (define-key ctl-x-map "nC" 'zz-clone-and-unite-zones) - (define-key ctl-x-map "n\C-d" 'zz-delete-zone) - (define-key ctl-x-map "nr" (if (> emacs-major-version 21) 'zz-= select-region-repeat 'zz-select-region)) - (define-key ctl-x-map "nu" 'zz-unite-zones) - (define-key ctl-x-map "nv" 'zz-set-izones-var) - (define-key ctl-x-map "nx" (if (> emacs-major-version 21) 'zz-= narrow-repeat 'zz-narrow)))) + (unless (lookup-key ctl-x-map "na") + (define-key ctl-x-map "na" 'zz-add-zone)) + (unless (lookup-key ctl-x-map "nA") + (define-key ctl-x-map "nA" 'zz-add-zone-and-unite)) + (unless (lookup-key ctl-x-map "nc") + (define-key ctl-x-map "nc" 'zz-clone-zones)) + (unless (lookup-key ctl-x-map "nC") + (define-key ctl-x-map "nC" 'zz-clone-and-unite-zones)) + (unless (lookup-key ctl-x-map "n\C-d") + (define-key ctl-x-map "n\C-d" 'zz-delete-zone)) + (unless (lookup-key ctl-x-map "nr") + (define-key ctl-x-map "nr" (if (> emacs-major-version 21) 'z= z-select-region-repeat 'zz-select-region))) + (unless (lookup-key ctl-x-map "nu") + (define-key ctl-x-map "nu" 'zz-unite-zones)) + (unless (lookup-key ctl-x-map "nv") + (define-key ctl-x-map "nv" 'zz-set-izones-var)) + (unless (lookup-key ctl-x-map "nx") + (define-key ctl-x-map "nx" (if (> emacs-major-version 21) 'z= z-narrow-repeat 'zz-narrow))))) =20 (eval-after-load "highlight" '(cond ((boundp 'narrow-map) ; Emacs 23+ - (define-key narrow-map "h" 'hlt-highlight-regions) - (define-key narrow-map "H" 'hlt-highlight-regions-in-buffers) - (define-key narrow-map "l" 'zz-add-zones-from-highlighting) - (define-key narrow-map "L" 'zz-set-zones-from-highlighting)) + (unless (lookup-key narrow-map "h") + (define-key narrow-map "h" 'hlt-highlight-regions)) + (unless (lookup-key narrow-map "H") + (define-key narrow-map "H" 'hlt-highlight-regions-in-buffers)) + (unless (lookup-key narrow-map "l") + (define-key narrow-map "l" 'zz-add-zones-from-highlighting)) + (unless (lookup-key narrow-map "L") + (define-key narrow-map "L" 'zz-set-zones-from-highlighting))) (t - (define-key ctl-x-map "nh" 'hlt-highlight-regions) - (define-key ctl-x-map "nH" 'hlt-highlight-regions-in-buffers) - (define-key ctl-x-map "nl" 'zz-add-zones-from-highlighting) - (define-key ctl-x-map "nL" 'zz-set-zones-from-highlighting)))) + (unless (lookup-key ctl-x-map "nh") + (define-key ctl-x-map "nh" 'hlt-highlight-regions)) + (unless (lookup-key ctl-x-map "nH") + (define-key ctl-x-map "nH" 'hlt-highlight-regions-in-buffers)) + (unless (lookup-key ctl-x-map "nl") + (define-key ctl-x-map "nl" 'zz-add-zones-from-highlighting)) + (unless (lookup-key ctl-x-map "nL") + (define-key ctl-x-map "nL" 'zz-set-zones-from-highlighting))))) =20 =20 ;; Call `zz-add-zone' if interactive or if `zz-add-zone-anyway-p'. @@ -1912,8 +1992,6 @@ value can be modified." (unless end (setq end (region-end))) (zz-add-zone start end nil nil nil 'MSG)))) =20 -;; Call `zz-add-zone' if interactive or if `zz-add-zone-anyway-p'. -;; (defadvice narrow-to-defun (after zz-add-zone--defun activate) "Push the defun limits to the current `zz-izones-var'. You can use `C-x n x' to widen to a previous buffer restriction. @@ -1934,7 +2012,6 @@ value can be modified." (when (or (interactive-p) zz-add-zone-anyway-p) (zz-add-zone (point-min) (point-max) nil nil nil 'MSG))) =20 - (when (> emacs-major-version 24) =20 (defun zz-izones-from-noncontiguous-region () @@ -2043,9 +2120,8 @@ The value of variable `zz-izones' defines the zones= ." (let ((region-extract-function (lambda (_ignore) zones))) (replace-regexp regexp to-string delimited start end backward 'R= EGION-NONCONTIGUOUS-P))) =20 - ) - - ) + ) ; Emacs 27+ + ) ; Emacs 25+ =20 (defun zz-noncontiguous-region-from-izones (&optional variable) "Return a noncontiguous region from value of value of VARIABLE. From MAILER-DAEMON Sat Nov 03 05:40:31 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gIsPv-0004Tq-Ai for mharc-emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 05:40:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIsPr-0004Ns-4c for emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 05:40:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIsPg-0002n9-G3 for emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 05:40:20 -0400 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:44485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIsPf-0002mE-Rk for emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 05:40:16 -0400 Received: by vcs0.savannah.gnu.org (Postfix, from userid 67418) id 5F31820468; Sat, 3 Nov 2018 05:40:15 -0400 (EDT) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 5fdaa31: Add 'Mail Command Index' reference in debbugs manual MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Albinus In-Reply-To: <20181103094014.2082.69615@vcs0.savannah.gnu.org> References: <20181103094014.2082.69615@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 5fdaa31d5fda9d32526abd8ccc9d717253b67872 Auto-Submitted: auto-generated Message-Id: <20181103094015.5F31820468@vcs0.savannah.gnu.org> Date: Sat, 3 Nov 2018 05:40:14 -0400 (EDT) From: Michael.Albinus@gmx.de (Michael Albinus) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 09:40:29 -0000 branch: master commit 5fdaa31d5fda9d32526abd8ccc9d717253b67872 Author: Michael Albinus Commit: Michael Albinus Add 'Mail Command Index' reference in debbugs manual =20 * packages/debbugs/debbugs-ug.texi (Control Messages): Add reference to node 'Mail Command Index'. --- packages/debbugs/debbugs-ug.info | 77 ++++++++++++++++++++--------------= ------ packages/debbugs/debbugs-ug.texi | 3 +- 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/packages/debbugs/debbugs-ug.info b/packages/debbugs/debbugs-= ug.info index 6e45558..e6e0c36 100644 --- a/packages/debbugs/debbugs-ug.info +++ b/packages/debbugs/debbugs-ug.info @@ -438,7 +438,8 @@ archived the control message 'unarchive' must be sent= first. =20 In the minibuffer, the following control messages can be requested (assuming that 12345 is the bug the control message is intended for). -The strings show the exact format of the control messages. +The strings show the exact format of the control messages. For the +meaning of the control messages, *Note Mail Command Index::. =20 'block' 'unblock' @@ -636,7 +637,7 @@ Variable Index * debbugs-gnu-default-severities: Retrieving Bugs. (line 63) * debbugs-gnu-default-suppress-bugs: Retrieving Bugs. (line 44) * debbugs-gnu-mail-backend: Tabulated Lists. (line 79) -* debbugs-gnu-send-mail-function: Control Messages. (line 120) +* debbugs-gnu-send-mail-function: Control Messages. (line 121) * debbugs-gnu-suppress-closed: Tabulated Lists. (line 76) * debbugs-gnu-trunk-directory: Applying Patches. (line 18) * debbugs-org-severity-priority: TODO Items. (line 10) @@ -985,41 +986,41 @@ Node: Presenting Bugs=7F11429 Node: Tabulated Lists=7F12005 Node: TODO Items=7F15680 Node: Control Messages=7F16736 -Node: Applying Patches=7F19920 -Node: Minor Mode=7F21286 -Node: Command Index=7F22342 -Node: Variable Index=7F23131 -Node: Key Index=7F24205 -Node: Mail Command Index=7F25771 -Ref: Mail Command Index: reassign=7F25924 -Ref: Mail Command Index: reopen=7F26388 -Ref: Mail Command Index: found=7F27542 -Ref: Mail Command Index: notfound=7F28623 -Ref: Mail Command Index: submitter=7F29032 -Ref: Mail Command Index: forwarded=7F29426 -Ref: Mail Command Index: notforwarded=7F29765 -Ref: Mail Command Index: retitle=7F29966 -Ref: Mail Command Index: severity=7F30350 -Ref: Mail Command Index: clone=7F30615 -Ref: Mail Command Index: merge=7F31379 -Ref: Mail Command Index: forcemerge=7F32766 -Ref: Mail Command Index: unmerge=7F33040 -Ref: Mail Command Index: tags=7F33743 -Ref: Mail Command Index: block=7F34850 -Ref: Mail Command Index: unblock=7F34892 -Ref: Mail Command Index: close=7F35382 -Ref: Mail Command Index: package=7F36032 -Ref: Mail Command Index: owner=7F36644 -Ref: Mail Command Index: noowner=7F37007 -Ref: Mail Command Index: archive=7F37180 -Ref: Mail Command Index: unarchive=7F37321 -Ref: Mail Command Index: #=7F37614 -Ref: Mail Command Index: quit=7F37874 -Ref: Mail Command Index: stop=7F37881 -Ref: Mail Command Index: thank=7F37888 -Ref: Mail Command Index: thanks=7F37896 -Ref: Mail Command Index: thankyou=7F37905 -Ref: Mail Command Index: thank you=7F37916 -Ref: Mail Command Index: --=7F37928 +Node: Applying Patches=7F19990 +Node: Minor Mode=7F21356 +Node: Command Index=7F22412 +Node: Variable Index=7F23201 +Node: Key Index=7F24275 +Node: Mail Command Index=7F25841 +Ref: Mail Command Index: reassign=7F25994 +Ref: Mail Command Index: reopen=7F26458 +Ref: Mail Command Index: found=7F27612 +Ref: Mail Command Index: notfound=7F28693 +Ref: Mail Command Index: submitter=7F29102 +Ref: Mail Command Index: forwarded=7F29496 +Ref: Mail Command Index: notforwarded=7F29835 +Ref: Mail Command Index: retitle=7F30036 +Ref: Mail Command Index: severity=7F30420 +Ref: Mail Command Index: clone=7F30685 +Ref: Mail Command Index: merge=7F31449 +Ref: Mail Command Index: forcemerge=7F32836 +Ref: Mail Command Index: unmerge=7F33110 +Ref: Mail Command Index: tags=7F33813 +Ref: Mail Command Index: block=7F34920 +Ref: Mail Command Index: unblock=7F34962 +Ref: Mail Command Index: close=7F35452 +Ref: Mail Command Index: package=7F36102 +Ref: Mail Command Index: owner=7F36714 +Ref: Mail Command Index: noowner=7F37077 +Ref: Mail Command Index: archive=7F37250 +Ref: Mail Command Index: unarchive=7F37391 +Ref: Mail Command Index: #=7F37684 +Ref: Mail Command Index: quit=7F37944 +Ref: Mail Command Index: stop=7F37951 +Ref: Mail Command Index: thank=7F37958 +Ref: Mail Command Index: thanks=7F37966 +Ref: Mail Command Index: thankyou=7F37975 +Ref: Mail Command Index: thank you=7F37986 +Ref: Mail Command Index: --=7F37998 =1F End Tag Table diff --git a/packages/debbugs/debbugs-ug.texi b/packages/debbugs/debbugs-= ug.texi index f3623dd..b9379aa 100644 --- a/packages/debbugs/debbugs-ug.texi +++ b/packages/debbugs/debbugs-ug.texi @@ -503,7 +503,8 @@ archived the control message @samp{unarchive} must be= sent first. =20 In the minibuffer, the following control messages can be requested (assuming that 12345 is the bug the control message is intended for). -The strings show the exact format of the control messages. +The strings show the exact format of the control messages. For the +meaning of the control messages, @xref{Mail Command Index}. =20 @table @samp @item block From MAILER-DAEMON Sat Nov 03 12:16:37 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gIybF-0002HX-Lf for mharc-emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 12:16:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIybD-0002GU-Ne for emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 12:16:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIybC-00030g-7i for emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 12:16:35 -0400 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:50089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIybB-0002zO-Hw for emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 12:16:33 -0400 Received: by vcs0.savannah.gnu.org (Postfix, from userid 134376) id 62F8A2043E; Sat, 3 Nov 2018 12:16:33 -0400 (EDT) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 211b4a7: [el-search] Fix an infloop in el-search--search-pattern-1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Heerdegen In-Reply-To: <20181103161632.15443.2172@vcs0.savannah.gnu.org> References: <20181103161632.15443.2172@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 211b4a75523366c1deade6768f137c9e821c2db0 Auto-Submitted: auto-generated Message-Id: <20181103161633.62F8A2043E@vcs0.savannah.gnu.org> Date: Sat, 3 Nov 2018 12:16:33 -0400 (EDT) From: michael_heerdegen@web.de (Michael Heerdegen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 16:16:36 -0000 branch: master commit 211b4a75523366c1deade6768f137c9e821c2db0 Author: Michael Heerdegen Commit: Michael Heerdegen [el-search] Fix an infloop in el-search--search-pattern-1 =20 Also bump version to 1.7.11. =20 * packages/el-search/el-search.el (el-search--search-pattern-1): Move forward if a match is discarded because it exceeds a given BOUND. --- packages/el-search/el-search.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-sear= ch.el index 3939b97..1640f55 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -7,7 +7,7 @@ ;; Created: 29 Jul 2015 ;; Keywords: lisp ;; Compatibility: GNU Emacs 25 -;; Version: 1.7.10 +;; Version: 1.7.11 ;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0")) =20 =20 @@ -1135,12 +1135,11 @@ be specified as fourth argument, and COUNT become= s the fifth argument." ;; the thunk hasn't been forced (scan-lists (point) 1 0)))) ((el-search--match-p matcher current-expr) - (setq match-beg - (and (or (not bound) - (<=3D (el-search--end-of-sexp match= -beg) bound) - ;; don't fail for >: a subsequent m= atch may end before BOUND - ) - (point)))) + (if (or (not bound) + (<=3D (el-search--end-of-sexp match-beg) b= ound)) + (setq match-beg (point)) + ;; don't fail: a subsequent match may end before= BOUND + (el-search--skip-expression current-expr))) (t (el-search--skip-expression current-expr)))) (when (and bound (<=3D bound (point))) (throw 'no-match t))) From MAILER-DAEMON Sat Nov 03 14:34:13 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJ0kP-0001rX-O4 for mharc-emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 14:34:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJ0kN-0001rE-9H for emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 14:34:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJ0kJ-0001Jc-RE for emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 14:34:09 -0400 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:51654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJ0kJ-0001I9-Ht for emacs-elpa-diffs@gnu.org; Sat, 03 Nov 2018 14:34:07 -0400 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 31A2220443; Sat, 3 Nov 2018 14:34:07 -0400 (EDT) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/zones a8b3a01: * zones.el: Fix version number MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181103183406.8751.78766@vcs0.savannah.gnu.org> References: <20181103183406.8751.78766@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/zones X-Git-Reftype: branch X-Git-Rev: a8b3a016b7ab7ee1fa54e8aa488bbfa4b38ba0cd Auto-Submitted: auto-generated Message-Id: <20181103183407.31A2220443@vcs0.savannah.gnu.org> Date: Sat, 3 Nov 2018 14:34:06 -0400 (EDT) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 18:34:12 -0000 branch: externals/zones commit a8b3a016b7ab7ee1fa54e8aa488bbfa4b38ba0cd Author: Stefan Monnier Commit: Stefan Monnier * zones.el: Fix version number --- zones.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zones.el b/zones.el index 8569488..5f32b41 100644 --- a/zones.el +++ b/zones.el @@ -7,7 +7,7 @@ ;; Author: Drew Adams ;; Maintainer: Drew Adams ;; Created: Sun Apr 18 12:58:07 2010 (-0700) -;; Version: 2018.11.01 +;; Version: 2018.11.1 ;; Package-Requires: () ;; Last-Updated: Thu Nov 1 09:46:25 2018 (-0700) ;; By: dradams From MAILER-DAEMON Sun Nov 04 10:16:23 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJK8U-0004vY-HA for mharc-emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:16:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJK8Q-0004TK-PC for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:16:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJJvL-0005pX-Sl for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:02:52 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJJvK-0005ng-Bx for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:02:47 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id 4C53E20497; Sun, 4 Nov 2018 10:02:46 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm e597ab4 2/2: Add support for RandR 1.5 monitor MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Chris Feng In-Reply-To: <20181104150245.22573.21763@vcs0.savannah.gnu.org> References: <20181104150245.22573.21763@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Rev: e597ab4f785982d44f56f61ba113b54c501256ac Auto-Submitted: auto-generated Message-Id: <20181104150246.4C53E20497@vcs0.savannah.gnu.org> Date: Sun, 4 Nov 2018 10:02:46 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 15:16:20 -0000 branch: externals/exwm commit e597ab4f785982d44f56f61ba113b54c501256ac Author: Chris Feng Commit: Chris Feng Add support for RandR 1.5 monitor =20 * exwm-randr.el (exwm-randr-workspace-monitor-plist): New user option for specifying which monitor each workspace should be displayed on. (exwm-randr-workspace-monitor-plist): Made obsolete. (exwm-randr--get-monitors): New function for fetching active monitors= . (exwm-randr--refresh): Adapted to use monitor. (exwm-randr--init): Now requires RandR 1.5. =20 * exwm-randr.el: * exwm-workspace.el: Rename `output' to `monitor'. --- exwm-randr.el | 145 +++++++++++++++++++++++++++---------------------= ------ exwm-workspace.el | 18 +++---- 2 files changed, 81 insertions(+), 82 deletions(-) diff --git a/exwm-randr.el b/exwm-randr.el index af900ab..5422252 100644 --- a/exwm-randr.el +++ b/exwm-randr.el @@ -27,11 +27,11 @@ ;; that. =20 ;; To use this module, load, enable it and configure -;; `exwm-randr-workspace-output-plist' and `exwm-randr-screen-change-hoo= k' +;; `exwm-randr-workspace-monitor-plist' and `exwm-randr-screen-change-ho= ok' ;; as follows: ;; ;; (require 'exwm-randr) -;; (setq exwm-randr-workspace-output-plist '(0 "VGA1")) +;; (setq exwm-randr-workspace-monitor-plist '(0 "VGA1")) ;; (add-hook 'exwm-randr-screen-change-hook ;; (lambda () ;; (start-process-shell-command @@ -63,22 +63,34 @@ "Normal hook run when screen changes." :type 'hook) =20 -(defcustom exwm-randr-workspace-output-plist nil - "Plist mapping workspace to output. +(defcustom exwm-randr-workspace-monitor-plist nil + "Plist mapping workspaces to monitors. =20 -If an output is not available, the workspaces mapped to it are displayed= on -the primary output until it becomes available. Unspecified workspaces a= re -all mapped to the primary output. For example, with the following value -workspace other than 1 and 3 would always be displayed on the primary ou= tput -where workspace 1 and 3 would be displayed on their corresponding output -whenever the outputs are available. +In RandR 1.5 a monitor is a rectangle region decoupled from the physical +size of screens, and can be identified with `xrandr --listmonitors' (nam= e of +the primary monitor is prefixed with an `*'). When no monitor is create= d it +automatically fallback to RandR 1.2 output which represents the physical +screen size. RandR 1.5 monitors can be created with `xrandr --setmonito= r'. +For example, to split an output (`LVDS-1') of size 1280x800 into two +side-by-side monitors one could invoke (the digits after `/' are size in= mm) =20 - '(1 \"HDMI-1\" 3 \"DP-1\") + xrandr --setmonitor *LVDS-1-L 640/135x800/163+0+0 LVDS-1 + xrandr --setmonitor LVDS-1-R 640/135x800/163+640+0 none =20 -The outputs available can be identified by running the 'xrandr' utility = with -the first one in result being the primary output." +If a monitor is not active, the workspaces mapped to it are displayed on= the +primary monitor until it becomes active (if ever). Unspecified workspac= es +are all mapped to the primary monitor. For example, with the following +setting workspace other than 1 and 3 would always be displayed on the +primary monitor where workspace 1 and 3 would be displayed on their +corresponding monitors whenever the monitors are active. + + \\=3D'(1 \"HDMI-1\" 3 \"DP-1\")" :type '(plist :key-type integer :value-type string)) =20 +(with-no-warnings + (define-obsolete-variable-alias 'exwm-randr-workspace-output-plist + 'exwm-randr-workspace-monitor-plist "27.1")) + (defvar exwm-workspace--fullscreen-frame-count) (defvar exwm-workspace--list) (declare-function exwm-workspace--count "exwm-workspace.el") @@ -89,57 +101,54 @@ the first one in result being the primary output." (declare-function exwm-workspace--show-minibuffer "exwm-workspace.el" ()= ) (declare-function exwm-workspace--update-workareas "exwm-workspace.el" (= )) =20 +(defun exwm-randr--get-monitors () + "Get RandR monitors." + (let (monitor-name geometry monitor-plist primary-monitor) + (with-slots (monitors) + (xcb:+request-unchecked+reply exwm--connection + (make-instance 'xcb:randr:GetMonitors + :window exwm--root + :get-active 1)) + (dolist (monitor monitors) + (with-slots (name primary x y width height) monitor + (setq monitor-name (x-get-atom-name name) + geometry (make-instance 'xcb:RECTANGLE + :x x + :y y + :width width + :height height) + monitor-plist (plist-put monitor-plist monitor-name geom= etry)) + ;; Save primary monitor when available. + (when (/=3D 0 primary) + (setq primary-monitor monitor-name))))) + (exwm--log "Primary monitor: %s" primary-monitor) + (exwm--log "Monitors: %s" monitor-plist) + (list primary-monitor monitor-plist))) + (defun exwm-randr--refresh () "Refresh workspaces according to the updated RandR info." - (let (output-name geometry output-plist primary-output default-geometr= y - container-output-alist container-frame-alist) - ;; Query all outputs - (with-slots (config-timestamp outputs) - (xcb:+request-unchecked+reply exwm--connection - (make-instance 'xcb:randr:GetScreenResourcesCurrent - :window exwm--root)) - (dolist (output outputs) - (with-slots (crtc connection name) - (xcb:+request-unchecked+reply exwm--connection - (make-instance 'xcb:randr:GetOutputInfo - :output output - :config-timestamp config-timestamp)) - (setf output-name ;UTF-8 encoded - (decode-coding-string (apply #'unibyte-string name) 'utf= -8)) - (if (or (/=3D connection xcb:randr:Connection:Connected) - (=3D 0 crtc)) ;FIXME - (plist-put output-plist output-name nil) - (with-slots (x y width height) - (xcb:+request-unchecked+reply exwm--connection - (make-instance 'xcb:randr:GetCrtcInfo - :crtc crtc - :config-timestamp config-timestamp)) - (setq geometry (make-instance 'xcb:RECTANGLE - :x x :y y - :width width :height height) - output-plist (plist-put output-plist output-name geo= metry)) - (unless primary-output - (setq primary-output output-name - default-geometry geometry))))))) - (exwm--log "(randr) outputs: %s" output-plist) - (when output-plist + (let* ((result (exwm-randr--get-monitors)) + (primary-monitor (elt result 0)) + (monitor-plist (elt result 1)) + container-monitor-alist container-frame-alist) + (when (and primary-monitor monitor-plist) (when exwm-workspace--fullscreen-frame-count ;; Not all workspaces are fullscreen; reset this counter. (setq exwm-workspace--fullscreen-frame-count 0)) (dotimes (i (exwm-workspace--count)) - (let* ((output (plist-get exwm-randr-workspace-output-plist i)) - (geometry (lax-plist-get output-plist output)) + (let* ((monitor (plist-get exwm-randr-workspace-monitor-plist i)= ) + (geometry (lax-plist-get monitor-plist monitor)) (frame (elt exwm-workspace--list i)) (container (frame-parameter frame 'exwm-container))) (unless geometry - (setq geometry default-geometry - output primary-output)) - (setq container-output-alist (nconc - `((,container . ,(intern output)= )) - container-output-alist) + (setq monitor primary-monitor + geometry (lax-plist-get monitor-plist primary-monitor)= )) + (setq container-monitor-alist (nconc + `((,container . ,(intern monito= r))) + container-monitor-alist) container-frame-alist (nconc `((,container . ,frame)) container-frame-alist)) - (set-frame-parameter frame 'exwm-randr-output output) + (set-frame-parameter frame 'exwm-randr-monitor monitor) (set-frame-parameter frame 'exwm-geometry geometry))) ;; Update workareas. (exwm-workspace--update-workareas) @@ -156,23 +165,24 @@ the first one in result being the primary output." ;; Update active/inactive workspaces. (dolist (w exwm-workspace--list) (exwm-workspace--set-active w nil)) + ;; Mark the workspace on the top of each monitor as active. (dolist (xwin (reverse (slot-value (xcb:+request-unchecked+reply exwm--connecti= on (make-instance 'xcb:QueryTree :window exwm--root)) 'children))) - (let ((output (cdr (assq xwin container-output-alist)))) - (when output - (setq container-output-alist - (rassq-delete-all output container-output-alist)) + (let ((monitor (cdr (assq xwin container-monitor-alist)))) + (when monitor + (setq container-monitor-alist + (rassq-delete-all monitor container-monitor-alist)) (exwm-workspace--set-active (cdr (assq xwin container-frame-= alist)) t)))) (xcb:flush exwm--connection) (run-hooks 'exwm-randr-refresh-hook)))) =20 (defun exwm-randr--on-ScreenChangeNotify (_data _synthetic) - (exwm--log "(RandR) ScreenChangeNotify") + (exwm--log) (run-hooks 'exwm-randr-screen-change-hook) (exwm-randr--refresh)) =20 @@ -184,8 +194,8 @@ the first one in result being the primary output." (with-slots (major-version minor-version) (xcb:+request-unchecked+reply exwm--connection (make-instance 'xcb:randr:QueryVersion - :major-version 1 :minor-version 3)) - (if (or (/=3D major-version 1) (< minor-version 3)) + :major-version 1 :minor-version 5)) + (if (or (/=3D major-version 1) (< minor-version 5)) (error "[EXWM] The server only support RandR version up to %d.= %d" major-version minor-version) ;; External monitor(s) may already be connected. @@ -193,26 +203,15 @@ the first one in result being the primary output." (exwm-randr--refresh) (xcb:+event exwm--connection 'xcb:randr:ScreenChangeNotify #'exwm-randr--on-ScreenChangeNotify) - ;; (xcb:+event exwm--connection 'xcb:randr:Notify - ;; (lambda (_data _synthetic) - ;; (exwm--log "(RandR) Notify") - ;; (exwm-randr--refresh))) (xcb:+request exwm--connection (make-instance 'xcb:randr:SelectInput :window exwm--root - :enable xcb:randr:NotifyMask:ScreenChange - ;; :enable (eval-when-compile - ;; (logior - ;; xcb:randr:NotifyMask:ScreenChan= ge - ;; xcb:randr:NotifyMask:OutputChan= ge - ;; xcb:randr:NotifyMask:OutputProp= erty - ;; xcb:randr:NotifyMask:CrtcChange= )) - )) + :enable xcb:randr:NotifyMask:ScreenChange)) (xcb:flush exwm--connection) (add-hook 'exwm-workspace-list-change-hook #'exwm-randr--refresh= )))) ;; Prevent frame parameters introduced by this module from being ;; saved/restored. - (dolist (i '(exwm-randr-output)) + (dolist (i '(exwm-randr-monitor)) (unless (assq i frameset-filter-alist) (push (cons i :never) frameset-filter-alist)))) =20 diff --git a/exwm-workspace.el b/exwm-workspace.el index 383bf53..b8e48b2 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -374,7 +374,7 @@ NIL if FRAME is not a workspace" (run-hooks 'exwm-workspace--update-workareas-hook)) =20 (defun exwm-workspace--set-active (frame active) - "Make frame FRAME active on its output." + "Make frame FRAME active on its monitor." (exwm--log "active=3D%s; frame=3D%s" frame active) (set-frame-parameter frame 'exwm-active active) (if active @@ -543,15 +543,15 @@ for internal use only." (set-frame-parameter (buffer-local-value 'exwm--frame (window-bu= ffer)) 'exwm-selected-window (selected-window))) ;; Show/Hide X windows. - (let ((output-old (frame-parameter old-frame 'exwm-randr-output)) - (output-new (frame-parameter frame 'exwm-randr-output)) + (let ((monitor-old (frame-parameter old-frame 'exwm-randr-monitor)= ) + (monitor-new (frame-parameter frame 'exwm-randr-monitor)) (active-old (exwm-workspace--active-p old-frame)) (active-new (exwm-workspace--active-p frame)) workspaces-to-hide) (cond ((not active-old) (exwm-workspace--set-active frame t)) - ((equal output-old output-new) + ((equal monitor-old monitor-new) (exwm-workspace--set-active frame t) (unless (eq frame old-frame) (exwm-workspace--set-active old-frame nil) @@ -560,8 +560,8 @@ for internal use only." (t (dolist (w exwm-workspace--list) (when (and (exwm-workspace--active-p w) - (equal output-new - (frame-parameter w 'exwm-randr-output))) + (equal monitor-new + (frame-parameter w 'exwm-randr-monitor))) (exwm-workspace--set-active w nil) (setq workspaces-to-hide (append workspaces-to-hide (list = w))))) (exwm-workspace--set-active frame t))) @@ -818,8 +818,8 @@ INDEX must not exceed the current number of workspace= s." ;; Floating. (setq container (frame-parameter exwm--floating-frame 'exwm-container)) - (unless (equal (frame-parameter old-frame 'exwm-randr-output) - (frame-parameter frame 'exwm-randr-output)) + (unless (equal (frame-parameter old-frame 'exwm-randr-monitor) + (frame-parameter frame 'exwm-randr-monitor)) (with-slots (x y) (xcb:+request-unchecked+reply exwm--connection (make-instance 'xcb:GetGeometry @@ -1240,7 +1240,7 @@ Please check `exwm-workspace--minibuffer-own-frame-= p' first." ;; prevent potential problems. The values do not matter here as ;; they'll be updated by the RandR module later. (let ((w (car exwm-workspace--list))) - (dolist (param '(exwm-randr-output + (dolist (param '(exwm-randr-monitor exwm-geometry)) (set-frame-parameter frame param (frame-parameter w param)))) (xcb:+request exwm--connection From MAILER-DAEMON Sun Nov 04 10:16:23 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJK8V-0004vs-KH for mharc-emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:16:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJK8S-0004TK-Gi for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:16:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJJvL-0005pG-Rq for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:02:49 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJJvK-0005nY-8X for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:02:47 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id E00DF2042B; Sun, 4 Nov 2018 10:02:45 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm updated (dbccda2 -> e597ab4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <20181104150245.22573.21763@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Oldrev: dbccda22a6b6e32a9e547954ec660ad8e80b7416 X-Git-Newrev: e597ab4f785982d44f56f61ba113b54c501256ac Auto-Submitted: auto-generated Date: Sun, 4 Nov 2018 10:02:45 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 15:16:21 -0000 ch11ng pushed a change to branch externals/exwm. from dbccda2 Merge branch 'medranocalvo/fix-input-mode-after-ful= lscreen' into externals/exwm new fec85bb Select more sensible buffers after creating new win= dows new e597ab4 Add support for RandR 1.5 monitor Summary of changes: exwm-layout.el | 12 +++-- exwm-randr.el | 145 +++++++++++++++++++++++++++---------------------= ------ exwm-workspace.el | 18 +++---- 3 files changed, 90 insertions(+), 85 deletions(-) From MAILER-DAEMON Sun Nov 04 10:16:24 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJK8V-0004wJ-Qt for mharc-emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:16:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJK8T-0004TK-6X for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:16:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJJvL-0005pF-Ri for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:02:49 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJJvK-0005nb-8Z for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 10:02:47 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id 1DBBB2047B; Sun, 4 Nov 2018 10:02:46 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm fec85bb 1/2: Select more sensible buffers after creating new windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Chris Feng In-Reply-To: <20181104150245.22573.21763@vcs0.savannah.gnu.org> References: <20181104150245.22573.21763@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Rev: fec85bb72a2d93fb86949f3409327b0f88ae60bc Auto-Submitted: auto-generated Message-Id: <20181104150246.1DBBB2047B@vcs0.savannah.gnu.org> Date: Sun, 4 Nov 2018 10:02:46 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 15:16:22 -0000 branch: externals/exwm commit fec85bb72a2d93fb86949f3409327b0f88ae60bc Author: Chris Feng Commit: Chris Feng Select more sensible buffers after creating new windows =20 * exwm-layout.el (exwm-layout--refresh-other) (exwm-layout--refresh-workspace): When filling vacated windows select more sensible buffer by calling `switch-to-next-buffer' for newly created windows. --- exwm-layout.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/exwm-layout.el b/exwm-layout.el index bee6901..b97c2f3 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -296,7 +296,9 @@ selected by `other-buffer'." (dolist (window windows) (with-current-buffer (window-buffer window) (when (derived-mode-p 'exwm-mode) - (switch-to-prev-buffer window)))))) + (if (window-prev-buffers window) + (switch-to-prev-buffer window) + (switch-to-next-buffer window))))))) =20 (defun exwm-layout--refresh-workspace (frame) "Refresh workspace frame FRAME." @@ -346,14 +348,18 @@ selected by `other-buffer'." ;; Set some sensible buffer to vacated windows. (let ((exwm-layout--other-buffer-exclude-buffers covered-buffers)) (dolist (window vacated-windows) - (switch-to-prev-buffer window))) + (if (window-prev-buffers window) + (switch-to-prev-buffer window) + (switch-to-next-buffer window)))) ;; Make sure windows floating / on other workspaces are excluded (let ((exwm-layout--other-buffer-exclude-exwm-mode-buffers t)) (dolist (window (window-list frame 'nomini)) (with-current-buffer (window-buffer window) (when (and (derived-mode-p 'exwm-mode) (or exwm--floating-frame (not (eq frame exwm--frame= )))) - (switch-to-prev-buffer window))))) + (if (window-prev-buffers window) + (switch-to-prev-buffer window) + (switch-to-next-buffer window)))))) (exwm-layout--set-client-list-stacking) (xcb:flush exwm--connection))) =20 From MAILER-DAEMON Sun Nov 04 11:15:38 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJL3q-0001LH-6h for mharc-emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:15:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJL3n-0001Kt-Lr for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:15:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJL3l-0005cv-Oe for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:15:35 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:40211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJL3h-0005Tq-BE for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:15:30 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 134376) id 144BA20497; Sun, 4 Nov 2018 11:15:28 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 66cfba8: [el-search] Follow-up to "Fix nested match issues in *El Occur*" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Heerdegen In-Reply-To: <20181104161528.19344.8016@vcs0.savannah.gnu.org> References: <20181104161528.19344.8016@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 66cfba85edfda22b03fa699f02b7717f516c19e8 Auto-Submitted: auto-generated Message-Id: <20181104161529.144BA20497@vcs0.savannah.gnu.org> Date: Sun, 4 Nov 2018 11:15:28 -0500 (EST) From: michael_heerdegen@web.de (Michael Heerdegen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 16:15:36 -0000 branch: master commit 66cfba85edfda22b03fa699f02b7717f516c19e8 Author: Michael Heerdegen Commit: Michael Heerdegen [el-search] Follow-up to "Fix nested match issues in *El Occur*" =20 Get rid of the now obsolete el-search-match overlay property. Always create match overlays with front-advance flag so added indentation doesn't get part of the overlays. Bump version to 1.7.12. =20 * packages/el-search/el-search.el (el-search-occur-jump-to-match): Us= e the data provided through the 'el-search-occur-match-ov-prop' property. (el-search-occur--next-match): Correct a typo. (el-search--occur): Don't attach the el-search-match property any more. Create all match-spanning overlays with front-advance flag. --- packages/el-search/el-search.el | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-sear= ch.el index 1640f55..cb8cf63 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -7,7 +7,7 @@ ;; Created: 29 Jul 2015 ;; Keywords: lisp ;; Compatibility: GNU Emacs 25 -;; Version: 1.7.11 +;; Version: 1.7.12 ;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0")) =20 =20 @@ -408,8 +408,6 @@ ;; ;; TODO: ;; -;; - Get rid of the redundant el-search-match overlays in occur buffers -;; ;; - There should be a way to go back to the starting position, like ;; in Isearch, which does this with (push-mark isearch-opoint t) in ;; `isearch-done'. @@ -2919,11 +2917,14 @@ Prompt for a new pattern and revert." (el-search-compile-pattern-in-search el-search-occur-search-object) (revert-buffer)) =20 +(defvar el-search-occur-match-ov-prop 'el-occur-match-data) + (defun el-search-occur-jump-to-match () (interactive) (if (button-at (point)) (push-button) - (if-let ((params (get-char-property (point) 'el-search-match))) + (if-let ((params (pcase (get-char-property (point) el-search-occur-m= atch-ov-prop) + (`(,buffer ,match-beg ,file ,_) (list (or file bu= ffer) match-beg))))) (apply #'el-search--occur-button-action params) ;; User clicked not directly on a match (catch 'nothing-here @@ -2936,10 +2937,11 @@ Prompt for a new pattern and revert." (unless (< defun-end (point)) (goto-char defun-beg)))) ;; Try to find corresponding position in source buffer (setq some-match-pos (point)) - (while (and (not done) (setq some-match-pos (funcall #'next-= single-char-property-change - some-ma= tch-pos 'el-search-match))) + (while (and (not done) (setq some-match-pos + (funcall #'next-single-char-pro= perty-change + some-match-pos el-sear= ch-occur-match-ov-prop))) (setq done (or (memq some-match-pos (list (point-min) (poi= nt-max))) - (cl-some (lambda (ov) (overlay-get ov 'el-s= earch-match)) + (cl-some (lambda (ov) (overlay-get ov el-se= arch-occur-match-ov-prop)) (overlays-at some-match-pos)))))) (let ((delta-lines (count-lines clicked-pos some-match-pos))) (when (save-excursion @@ -2948,10 +2950,10 @@ Prompt for a new pattern and revert." (cl-decf delta-lines)) (when (< clicked-pos some-match-pos) (cl-callf - delta-lines)) - (pcase-let ((`(,file-name-or-buffer ,pos) - (get-char-property some-match-pos 'el-search-ma= tch))) + (pcase-let ((`(,buffer ,pos ,file . ,_) + (get-char-property some-match-pos el-search-occ= ur-match-ov-prop))) (el-search--occur-button-action - file-name-or-buffer nil + (or file buffer) nil (lambda () (goto-char pos) (beginning-of-line) @@ -2995,14 +2997,12 @@ Prompt for a new pattern and revert." (add-hook 'post-command-hook #'el-search-hl-post-command-fun t t) (when do-fun (funcall do-fun))))) =20 -(defvar el-search-occur-match-ov-prop 'el-occur-match-data) - (defun el-search-occur--next-match (&optional backward) (let ((pos (point)) new-pos) (cl-flet ((at-a-match-beg-p (lambda (pos) (when-let ((match-data (get-char-property pos el-search= -occur-match-ov-prop))) - (and (not (=3D (point) (if backward (point-min) (poin= t-max)))) + (and (not (=3D pos (if backward (point-min) (point-ma= x)))) (not (eq match-data (get-char-property (1- pos) el-search-o= ccur-match-ov-prop)))))))) (while (and (setq new-pos (funcall (if backward #'previous-single-= char-property-change @@ -3231,11 +3231,9 @@ Prompt for a new pattern and revert." (buffer-substring-n= o-properties (goto-char match-b= eg) (goto-char (el-sea= rch--end-of-sexp))))) - (let ((ov (make-overlay inser= tion-point (point) nil t))) + (let ((ov (make-overlay inser= tion-point (point) nil 'fr-ad))) (overlay-put ov 'face 'el-s= earch-occur-match) (overlay-put - ov 'el-search-match (list = (or file buffer) match-beg)) - (overlay-put ov el-search-occur-match-o= v-prop `(,buffer ,match-beg ,file= ,nbr))) (with-current-buffer buffer (= point))))) @@ -3260,7 +3258,8 @@ Prompt for a new pattern and revert." ov-start (+ ov-start (with-current-buffer= buffer - (el-search--end-of= -sexp mb)))) + (el-search--end-of= -sexp mb))) + nil 'front-advance) ;f-= a is needed for later indenting el-search-occur-match-ov= -prop `(,buffer ,mb ,file ,nbr= ))) (stream-pop matches) From MAILER-DAEMON Sun Nov 04 11:20:26 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJL8U-0003R9-13 for mharc-emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:20:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJL8S-0003QR-HI for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:20:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJL8J-00040f-93 for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:20:19 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:40262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJL8F-0003uv-Ss for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:20:12 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 134376) id BED3D20497; Sun, 4 Nov 2018 11:20:11 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master aada211: [el-search] Don't try to kill modified buffers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Heerdegen In-Reply-To: <20181104162011.21472.50180@vcs0.savannah.gnu.org> References: <20181104162011.21472.50180@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: aada211d709ff4fcb85276482101ea567d3fcb1a Auto-Submitted: auto-generated Message-Id: <20181104162011.BED3D20497@vcs0.savannah.gnu.org> Date: Sun, 4 Nov 2018 11:20:11 -0500 (EST) From: michael_heerdegen@web.de (Michael Heerdegen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 16:20:25 -0000 branch: master commit aada211d709ff4fcb85276482101ea567d3fcb1a Author: Michael Heerdegen Commit: Michael Heerdegen [el-search] Don't try to kill modified buffers =20 This fixes a problem introduced by 1d2bbf66 "Improve working of `el-search-kill-left-over-search-buffers'": We still need to check whether the buffer to be killed has been modified by 'el-search-query-replace' with 'el-search-auto-save-buffers' off. Bump version to 1.7.13. =20 * packages/el-search/el-search.el (el-search-kill-left-over-search-buffers): Exclude modified buffers from killing. --- packages/el-search/el-search.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-sear= ch.el index cb8cf63..98aed80 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -7,7 +7,7 @@ ;; Created: 29 Jul 2015 ;; Keywords: lisp ;; Compatibility: GNU Emacs 25 -;; Version: 1.7.12 +;; Version: 1.7.13 ;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0")) =20 =20 @@ -1286,7 +1286,8 @@ the cursor) are not killed." (interactive) (dolist (buffer (buffer-list)) (when (with-current-buffer buffer el-search--temp-buffer-flag) - (unless (or (el-search--search-buffer-p buffer) + (unless (or (buffer-modified-p buffer) ; e.g. modified by el-s-que= ry-replace and auto-save off + (el-search--search-buffer-p buffer) (with-current-buffer buffer (el-search--pending-search= -p))) (kill-buffer buffer))))) =20 From MAILER-DAEMON Sun Nov 04 11:31:40 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJLJM-0000yo-87 for mharc-emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:31:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJLJI-0000w2-8u for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:31:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJLJE-0003xp-7K for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:31:34 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:40444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJLJ5-0003ij-46 for emacs-elpa-diffs@gnu.org; Sun, 04 Nov 2018 11:31:26 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 134376) id 0ABAD20497; Sun, 4 Nov 2018 11:31:22 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master ff13541: [el-search] Small fix in el-search--reset-wrap-flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Heerdegen In-Reply-To: <20181104163122.26233.97032@vcs0.savannah.gnu.org> References: <20181104163122.26233.97032@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: ff13541b0af48eb8f514bd05034ef6812035c309 Auto-Submitted: auto-generated Message-Id: <20181104163123.0ABAD20497@vcs0.savannah.gnu.org> Date: Sun, 4 Nov 2018 11:31:22 -0500 (EST) From: michael_heerdegen@web.de (Michael Heerdegen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 16:31:37 -0000 branch: master commit ff13541b0af48eb8f514bd05034ef6812035c309 Author: Michael Heerdegen Commit: Michael Heerdegen [el-search] Small fix in el-search--reset-wrap-flag =20 We must reset 'el-search--wrap-flag' when the user does something different than search wrapping with the next command - else a later command could wrap the search even when not at the first or last match. Bump version to 1.7.14 =20 * packages/el-search/el-search.el (el-search--reset-wrap-flag): Reset 'el-search--wrap-flag' also when user hasn't wrapped search. --- packages/el-search/el-search.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-sear= ch.el index 98aed80..4f4b0eb 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -7,7 +7,7 @@ ;; Created: 29 Jul 2015 ;; Keywords: lisp ;; Compatibility: GNU Emacs 25 -;; Version: 1.7.13 +;; Version: 1.7.14 ;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0")) =20 =20 @@ -2352,8 +2352,10 @@ local binding of `window-scroll-functions'." (memq #'el-search-hl-post-command-fun post-command-hook)) =20 (defun el-search--reset-wrap-flag () - (unless (or (eq this-command 'el-search-query-replace) - (eq this-command 'el-search-pattern)) + (unless (eq real-this-command + (if (eq el-search--wrap-flag 'forward) + 'el-search-pattern + 'el-search-pattern-backward)) (remove-hook 'post-command-hook 'el-search--reset-wrap-flag) (setq el-search--wrap-flag nil))) =20 From MAILER-DAEMON Mon Nov 05 18:19:15 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9L-000201-PG for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9K-0001zb-1u for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9I-0003yE-EG for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:13 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9I-0003y1-9x for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:12 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 397B9204F2; Mon, 5 Nov 2018 18:19:12 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 4a4152b 02/66: Add a FIXME MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 4a4152b3d643dca07f1e0aed5a1ad53b8fc77af5 Auto-Submitted: auto-generated Message-Id: <20181105231912.397B9204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:12 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:15 -0000 branch: master commit 4a4152b3d643dca07f1e0aed5a1ad53b8fc77af5 Author: Dmitry Gutov Commit: Dmitry Gutov Add a FIXME --- company-capf.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/company-capf.el b/company-capf.el index ffd9ea3..26656c6 100644 --- a/company-capf.el +++ b/company-capf.el @@ -165,6 +165,11 @@ (if exit-function ;; Follow the example of `completion--done'. (funcall exit-function arg + ;; FIXME: Should probably use an additional heuristic: + ;; completion-at-point doesn't know when the user picke= d a + ;; particular candidate explicitly (it only checks whet= her + ;; futher completions exist). Whereas company user can = press + ;; RET (or use implicit completion with company-tng). (if (eq (try-completion arg table pred) t) 'finished 'sole))))) =20 From MAILER-DAEMON Mon Nov 05 18:19:16 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9M-00020b-EC for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9K-0001za-1V for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9I-0003yS-Kg for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:13 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9I-0003yI-G4 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:12 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 6751C204F2; Mon, 5 Nov 2018 18:19:12 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master e72dfad 03/66: copyright-update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: e72dfadb1ea8f8744c8658e16430958e0f97fa5a Auto-Submitted: auto-generated Message-Id: <20181105231912.6751C204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:12 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:14 -0000 branch: master commit e72dfadb1ea8f8744c8658e16430958e0f97fa5a Author: Dmitry Gutov Commit: Dmitry Gutov copyright-update --- company-capf.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/company-capf.el b/company-capf.el index 26656c6..2a9b191 100644 --- a/company-capf.el +++ b/company-capf.el @@ -1,6 +1,6 @@ ;;; company-capf.el --- company-mode completion-at-point-functions backe= nd -*- lexical-binding: t -*- =20 -;; Copyright (C) 2013-2017 Free Software Foundation, Inc. +;; Copyright (C) 2013-2018 Free Software Foundation, Inc. =20 ;; Author: Stefan Monnier =20 From MAILER-DAEMON Mon Nov 05 18:19:16 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9M-00020w-Ih for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9K-0001zd-3R for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9I-0003y4-A4 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:13 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9I-0003xl-4y for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:12 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 138AD2064E; Mon, 5 Nov 2018 18:19:12 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 2a21bfd 01/66: Extract company--capf-post-completion, for easier debugging MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 2a21bfd4422c74c817062eb935088376ac3d09dc Auto-Submitted: auto-generated Message-Id: <20181105231912.138AD2064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:11 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:15 -0000 branch: master commit 2a21bfd4422c74c817062eb935088376ac3d09dc Author: Dmitry Gutov Commit: Dmitry Gutov Extract company--capf-post-completion, for easier debugging --- company-capf.el | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/company-capf.el b/company-capf.el index 06384c7..ffd9ea3 100644 --- a/company-capf.el +++ b/company-capf.el @@ -154,17 +154,20 @@ (plist-get (nthcdr 4 (company--capf-data)) :company-require-match)) (`init nil) ;Don't bother: plenty of other ways to initialize t= he code. (`post-completion - (let* ((res (company--capf-data)) - (exit-function (plist-get (nthcdr 4 res) :exit-function)) - (table (nth 3 res)) - (pred (plist-get (nthcdr 4 res) :predicate))) - (if exit-function - ;; Follow the example of `completion--done'. - (funcall exit-function arg - (if (eq (try-completion arg table pred) t) - 'finished 'sole))))) + (company--capf-post-completion arg)) )) =20 +(defun company--capf-post-completion (arg) + (let* ((res (company--capf-data)) + (exit-function (plist-get (nthcdr 4 res) :exit-function)) + (table (nth 3 res)) + (pred (plist-get (nthcdr 4 res) :predicate))) + (if exit-function + ;; Follow the example of `completion--done'. + (funcall exit-function arg + (if (eq (try-completion arg table pred) t) + 'finished 'sole))))) + (provide 'company-capf) =20 ;;; company-capf.el ends here From MAILER-DAEMON Mon Nov 05 18:19:23 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9S-00025f-Rc for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9K-0001zc-29 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9I-0003xs-6V for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:13 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9I-0003xW-1L for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:12 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id C2AC4204F2; Mon, 5 Nov 2018 18:19:11 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master updated (ff13541 -> 1e22493) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: ff13541b0af48eb8f514bd05034ef6812035c309 X-Git-Newrev: 1e2249360a5c93b241313b16b3b8c3a8fdb44652 Auto-Submitted: auto-generated Date: Mon, 5 Nov 2018 18:19:11 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:15 -0000 dgutov pushed a change to branch master. from ff13541 [el-search] Small fix in el-search--reset-wrap-flag new 2a21bfd Extract company--capf-post-completion, for easier d= ebugging new 4a4152b Add a FIXME new e72dfad copyright-update new fc81e99 Deprecate company-css new a64d52c Deprecate company-nxml too new 5c2425b Work around python-shell-completion-at-point's beha= vior new 23e6c82 Add NEWS entry new 0dc6945 Fix the build new 0afe18d Allow CMake completion in strings when inside ${...= } new 5698be9 Simplify company-cmake-prefix-dollar-brace-p new 0325a40 Remove an unnecessary test new 07c56b1 Add NEWS entry new 5a856d7 backend: Remove pre-completion command new 5118b59 company-tng: Supress post-completion (#731) new a78f7d8 Merge pull request #764 from nikital/tng-supress-po= st-completion new 1646a10 Always get candidates with prefix string in `compan= y-diag`. new 67650de Merge pull request #769 from tigersoldier/master new 287a5fb Make example backend interactive new ed1085f Merge pull request #771 from Wilfred/interactive-ex= ample new ddfdcb7 Abort when completion-at-point is invoked new 46680da company-css: Improve performance new 7d6ab3c company-keywords: Support thrift-mode new d26ec71 Merge pull request #785 from ylectric/company-keywo= rds/thrift-mode new 779662f Truncate the Clang error in the echo area new 270976b Update Javascript and Python keywords new ffba418 Merge pull request #802 from wyuenho/update-keyword= s new a913803 company-diag: Catch any error in `completions' new 392dadd Per #798, #762: Fix company-capf's highlighting of = non-prefix matches new b0940fb Close #798: look for :company-match function in the= capf's metadata new f404a12 Add some tests for the previous commits new 5b11709 Emacs 24 doesn't have working elisp capf, so don't = test it new ae9dd22 Make fixes after Dmitry's comments new f31d284 Mention #798 in NEWS.md new 382764a Merge pull request #798 from joaotavora/master new 24bbc85 Fix #809 by looking up `face' as well new d0fab46 Properly fix #809 new 1f836b6 Merge pull request #810 from joaotavora/master new 045b23a move golang's keywords to the right place new 4d921fe Merge pull request #817 from chunzhouyu/master new 5015aad Switch to npostavs/emacs-travis binaries new 9e8bd0b Merge pull request #821 from iquiw/emacs-travis-bin new 63fdb96 add some golang fake keywords for a better programm= ing experience new 7e20ee4 update go-mode's keywords sort new 2d87b1f fix golang's keywords sort new f1aef4d add reference url for go-mode's keywords new e14cd4f add some comments for adding go-mode's fake keyword= s new 3162aa2 Update company-keywords.el new b423ba4 Merge pull request #819 from chunzhouyu/master new a163e94 Improve comment new 1c76850 Reformat new 1c28831 add some golang's builtin funcitons to go-mode new c984355 resort the go-mode in company-keywords.el new d2db92b Update company-keywords.el new 44ed412 resort go-mode'e keywords new 2bcaa2e add some refs new ed8bf2a capitalize the comment sentences new 4fe0bec Merge pull request #828 from chunzhouyu/master new 88b8282 add nil and bool to company-keywords for go-mode new 87f479b Merge pull request #829 from chunzhouyu/master new 7c6357a Define variable alias before referent new 4205ad6 Merge pull request #830 from jabranham/alias new afbaad1 company-ispell-available: Better error message new 4fa5a37 Backends are called at the same point where company= begins new 5ab7f42 Merge pull request #838 from bet4it/restore-point new c95a6b4 Release 0.9.7 new 1e22493 Merge commit 'c95a6b41d621de4253b77e512aa61fc0e75ac= ddc' from company Summary of changes: packages/company/.travis.yml | 37 +++++---- packages/company/NEWS.md | 18 +++++ packages/company/company-capf.el | 69 ++++++++++------- packages/company/company-clang.el | 3 +- packages/company/company-cmake.el | 12 ++- packages/company/company-css.el | 10 ++- packages/company/company-gtags.el | 8 +- packages/company/company-ispell.el | 2 +- packages/company/company-keywords.el | 38 +++++++--- packages/company/company-nxml.el | 3 +- packages/company/company-tng.el | 13 +++- packages/company/company.el | 98 +++++++++++++++--------- packages/company/test/all.el | 4 +- packages/company/test/capf-tests.el | 140 +++++++++++++++++++++++++++++= ++++++ packages/company/test/cmake-tests.el | 44 +++++++++++ 15 files changed, 394 insertions(+), 105 deletions(-) create mode 100644 packages/company/test/capf-tests.el create mode 100644 packages/company/test/cmake-tests.el From MAILER-DAEMON Mon Nov 05 18:19:23 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9T-00025w-3U for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9L-0001zj-3i for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-00040A-3x for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:14 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9J-0003z4-A9 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:13 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 401122097A; Mon, 5 Nov 2018 18:19:13 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 0dc6945 08/66: Fix the build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 0dc69458d12c51db8af8a16d5325dd26ce3d15c1 Auto-Submitted: auto-generated Message-Id: <20181105231913.401122097A@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:13 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:16 -0000 branch: master commit 0dc69458d12c51db8af8a16d5325dd26ce3d15c1 Author: Dmitry Gutov Commit: Dmitry Gutov Fix the build --- company.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/company.el b/company.el index bded061..4c79f59 100644 --- a/company.el +++ b/company.el @@ -1364,7 +1364,7 @@ Keywords and function definition names are ignored.= " (defvar comint-last-prompt) (let ((beg (match-beginning 0)) (end (match-end 0)) - (comint-last-prompt comint-last-prompt)) + (comint-last-prompt (bound-and-true-p comint-last-prompt))) (save-excursion (goto-char end) ;; Workaround for python-shell-completion-at-point's behavior: From MAILER-DAEMON Mon Nov 05 18:19:23 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9T-00026G-8g for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9L-0001zl-58 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9J-0003zS-QU for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9I-0003yW-Kx for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:12 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 95CEE204F2; Mon, 5 Nov 2018 18:19:12 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master fc81e99 04/66: Deprecate company-css MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: fc81e999ef5e56991fdba5944066da98baebb718 Auto-Submitted: auto-generated Message-Id: <20181105231912.95CEE204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:12 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:18 -0000 branch: master commit fc81e999ef5e56991fdba5944066da98baebb718 Author: Dmitry Gutov Commit: Dmitry Gutov Deprecate company-css =20 Closes #708 --- NEWS.md | 5 +++++ company-capf.el | 3 ++- company-css.el | 4 +++- company.el | 4 +++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 520766f..19e1fe2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,10 @@ # History of user-visible changes =20 +## Next + +* In Emacs 26 and newer, `company-css` is removed from `company-backends= `. + `company-capf` is used instead. + ## 2018-02-23 (0.9.6) =20 * Workaround for Emacs' ([bug#23980](https://debbugs.gnu.org/23980)) tri= ggered diff --git a/company-capf.el b/company-capf.el index 2a9b191..653243f 100644 --- a/company-capf.el +++ b/company-capf.el @@ -24,7 +24,8 @@ ;; ;; The CAPF back-end provides a bridge to the standard ;; completion-at-point-functions facility, and thus can support any majo= r mode -;; that defines a proper completion function, including emacs-lisp-mode. +;; that defines a proper completion function, including emacs-lisp-mode = and +;; css-mode. =20 ;;; Code: =20 diff --git a/company-css.el b/company-css.el index cf8c683..129cc51 100644 --- a/company-css.el +++ b/company-css.el @@ -1,6 +1,6 @@ ;;; company-css.el --- company-mode completion backend for css-mode -*-= lexical-binding: t -*- =20 -;; Copyright (C) 2009, 2011, 2014 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2011, 2014, 2018 Free Software Foundation, Inc. =20 ;; Author: Nikolaj Schumacher =20 @@ -20,6 +20,8 @@ ;; along with GNU Emacs. If not, see . =20 ;;; Commentary: +;; +;; In newer versions of Emacs, company-capf is used instead. =20 ;;; Code: =20 diff --git a/company.el b/company.el index 13481db..fc5c18f 100644 --- a/company.el +++ b/company.el @@ -322,7 +322,9 @@ This doesn't include the margins and the scroll bar." (defcustom company-backends `(,@(unless (version< "24.3.51" emacs-versio= n) (list 'company-elisp)) company-bbdb - company-nxml company-css + company-nxml + ,@(unless (version<=3D "26" emacs-version) + (list 'company-css)) company-eclim company-semantic company-cla= ng company-xcode company-cmake company-capf From MAILER-DAEMON Mon Nov 05 18:19:23 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9T-00026Z-DT for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00020y-JQ for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-00041s-T7 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9K-00041a-NV for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:14 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id A618E204F2; Mon, 5 Nov 2018 18:19:14 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 1646a10 16/66: Always get candidates with prefix string in `company-diag`. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Caibin Chen In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 1646a101671eb1bc78667a49ea8eaa5ada027f8a Auto-Submitted: auto-generated Message-Id: <20181105231914.A618E204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:14 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:18 -0000 branch: master commit 1646a101671eb1bc78667a49ea8eaa5ada027f8a Author: Caibin Chen Commit: Caibin Chen Always get candidates with prefix string in `company-diag`. --- company.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/company.el b/company.el index cbe3781..f4355b3 100644 --- a/company.el +++ b/company.el @@ -2388,7 +2388,7 @@ If SHOW-VERSION is non-nil, show the version in the= echo area." cc annotations) (when (or (stringp prefix) (consp prefix)) (let ((company-backend backend)) - (setq cc (company-call-backend 'candidates prefix) + (setq cc (company-call-backend 'candidates (company--prefix-str = prefix)) annotations (mapcar (lambda (c) (cons c (company-call-backend 'annotation c))= ) From MAILER-DAEMON Mon Nov 05 18:19:23 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9T-00026s-Kv for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-000211-Ky for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-00040y-Bi for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9K-0003zs-0j for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:14 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id E95132064E; Mon, 5 Nov 2018 18:19:13 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 07c56b1 12/66: Add NEWS entry MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 07c56b1476ca1d091e6d819725ba4515c5076fcf Auto-Submitted: auto-generated Message-Id: <20181105231913.E95132064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:13 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:18 -0000 branch: master commit 07c56b1476ca1d091e6d819725ba4515c5076fcf Author: Dmitry Gutov Commit: Dmitry Gutov Add NEWS entry --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 97ae18c..fbecf7d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ =20 ## Next =20 +* `company-cmake` supports completion inside string interpolations + ([#714](https://github.com/company-mode/company-mode/pull/714)). * Workaround for the conflict between `inferior-python-mode`'s completio= n code and `company-sort-by-occurrence`. * In Emacs 26 and newer, `company-css` is removed from `company-backends= `. From MAILER-DAEMON Mon Nov 05 18:19:24 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9T-00027B-RU for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00020j-H7 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-00040d-87 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9J-0003y1-PO for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:13 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 6C738209DE; Mon, 5 Nov 2018 18:19:13 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 0afe18d 09/66: Allow CMake completion in strings when inside ${...} MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Zuogon Yue In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 0afe18da1f7a4c25f3474e0c040dd56003453047 Auto-Submitted: auto-generated Message-Id: <20181105231913.6C738209DE@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:13 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:18 -0000 branch: master commit 0afe18da1f7a4c25f3474e0c040dd56003453047 Author: Zuogon Yue Commit: Dmitry Gutov Allow CMake completion in strings when inside ${...} --- company-cmake.el | 26 +++++++++++++++++++++++++- test/cmake-tests.el | 52 +++++++++++++++++++++++++++++++++++++++++++++++= +++++ 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/company-cmake.el b/company-cmake.el index 010df32..6d29622 100644 --- a/company-cmake.el +++ b/company-cmake.el @@ -177,6 +177,29 @@ They affect which types of symbols we get completion= candidates for.") (buffer-substring-no-properties (line-beginning-position) (point-max)))))) =20 +(defun company-cmake-prefix-dollar-brace-p () + "Test if the current char is prefix with ${ in the current line." + (let ((position-current (point)) + (position-beg-of-line (line-beginning-position)) + (position-end-of-line (line-end-position)) + (position-matched nil) + (position-matched-right-brace nil)) + + (setq position-matched + (re-search-backward "\$\{" position-beg-of-line t)) + (goto-char position-current) + (setq position-matched-right-brace + (re-search-backward "\}" position-beg-of-line t)) + (goto-char position-current) + + (if (or (and position-matched + position-matched-right-brace + (> position-matched position-matched-right-brace)) + (and position-matched + (not position-matched-right-brace))) + t + nil))) + (defun company-cmake (command &optional arg &rest ignored) "`company-mode' completion backend for CMake. CMake is a cross-platform, open-source make system." @@ -187,7 +210,8 @@ CMake is a cross-platform, open-source make system." (unless company-cmake-executable (error "Company found no cmake executable")))) (prefix (and (memq major-mode company-cmake-modes) - (not (company-in-string-or-comment)) + (or (not (company-in-string-or-comment)) + (company-cmake-prefix-dollar-brace-p)) (company-grab-symbol))) (candidates (company-cmake--candidates arg)) (meta (company-cmake--meta arg)) diff --git a/test/cmake-tests.el b/test/cmake-tests.el new file mode 100644 index 0000000..805ea1a --- /dev/null +++ b/test/cmake-tests.el @@ -0,0 +1,52 @@ +;;; cmake-tests.el --- company-mode tests -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Free Software Foundation, Inc. + +;; Author: Zuogong Yue + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +(require 'company-tests) +(require 'company-cmake) + +(ert-deftest company-cmake-complete-in-string-prefix-quotes () + (with-temp-buffer + (insert "set(MyFlags \"${CMAKE_CXX_FLAGS_R") + (setq-local major-mode 'cmake-mode) + (should (equal (company-cmake 'prefix) + "CMAKE_CXX_FLAGS_R")))) + +(ert-deftest company-cmake-complete-in-string-between-quotes () + (with-temp-buffer + (insert "set(MyFlags \"${CMAKE_CXX_FLAGS_R}\"") + (backward-char 2) + (setq-local major-mode 'cmake-mode) + (should (equal (company-cmake 'prefix) + "CMAKE_CXX_FLAGS_R")))) + +(ert-deftest company-cmake-complete-in-string-more-prefix () + (with-temp-buffer + (insert "set(MyFlags \"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_R") + (setq-local major-mode 'cmake-mode) + (should (equal (company-cmake 'prefix) + "CMAKE_CXX_FLAGS_R")))) + +(ert-deftest company-cmake-complete-in-string-more-prefix-2 () + (with-temp-buffer + (insert "set(MyFlags \"${CMAKE_CXX_FLAGS} CMAKE_CXX_FLAGS_R") + (setq-local major-mode 'cmake-mode) + (should (equal (company-cmake 'prefix) + nil)))) \ No newline at end of file From MAILER-DAEMON Mon Nov 05 18:19:24 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9U-00027h-3H for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00021O-RJ for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9L-00042f-8D for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35374) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9K-000420-UV for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id D3864204F2; Mon, 5 Nov 2018 18:19:14 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 67650de 17/66: Merge pull request #769 from tigersoldier/master MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 67650dee565c57568d22065041326a58eb0f891d Auto-Submitted: auto-generated Message-Id: <20181105231914.D3864204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:14 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:18 -0000 branch: master commit 67650dee565c57568d22065041326a58eb0f891d Merge: a78f7d8 1646a10 Author: Dmitry Gutov Commit: GitHub Merge pull request #769 from tigersoldier/master =20 Always get candidates with prefix string in `company-diag` --- company.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/company.el b/company.el index cbe3781..f4355b3 100644 --- a/company.el +++ b/company.el @@ -2388,7 +2388,7 @@ If SHOW-VERSION is non-nil, show the version in the= echo area." cc annotations) (when (or (stringp prefix) (consp prefix)) (let ((company-backend backend)) - (setq cc (company-call-backend 'candidates prefix) + (setq cc (company-call-backend 'candidates (company--prefix-str = prefix)) annotations (mapcar (lambda (c) (cons c (company-call-backend 'annotation c))= ) From MAILER-DAEMON Mon Nov 05 18:19:25 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9U-00028u-UN for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9L-0001zn-5I for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-000406-3d for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9J-0003yy-4S for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:13 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 14806207DA; Mon, 5 Nov 2018 18:19:13 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 23e6c82 07/66: Add NEWS entry MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 23e6c823327068d3a50b3f3303eebf1205e960fe Auto-Submitted: auto-generated Message-Id: <20181105231913.14806207DA@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:13 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:16 -0000 branch: master commit 23e6c823327068d3a50b3f3303eebf1205e960fe Author: Dmitry Gutov Commit: Dmitry Gutov Add NEWS entry --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 2b25bbb..97ae18c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ =20 ## Next =20 +* Workaround for the conflict between `inferior-python-mode`'s completio= n code + and `company-sort-by-occurrence`. * In Emacs 26 and newer, `company-css` is removed from `company-backends= `. `company-capf` is used instead. * Same for `company-nxml`. From MAILER-DAEMON Mon Nov 05 18:19:25 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9V-00029A-63 for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9L-0001zv-Bx for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-00040S-5w for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9J-0003yo-02 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:13 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id E6FEE207D5; Mon, 5 Nov 2018 18:19:12 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 5c2425b 06/66: Work around python-shell-completion-at-point's behavior MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 5c2425b9863810a395efcbc25abaa5348a7bfe23 Auto-Submitted: auto-generated Message-Id: <20181105231912.E6FEE207D5@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:12 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:17 -0000 branch: master commit 5c2425b9863810a395efcbc25abaa5348a7bfe23 Author: Dmitry Gutov Commit: Dmitry Gutov Work around python-shell-completion-at-point's behavior =20 Closes #549 --- company.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/company.el b/company.el index a694a65..bded061 100644 --- a/company.el +++ b/company.el @@ -1361,10 +1361,18 @@ Keywords and function definition names are ignore= d." noccurs))) =20 (defun company--occurrence-predicate () + (defvar comint-last-prompt) (let ((beg (match-beginning 0)) - (end (match-end 0))) + (end (match-end 0)) + (comint-last-prompt comint-last-prompt)) (save-excursion (goto-char end) + ;; Workaround for python-shell-completion-at-point's behavior: + ;; https://github.com/company-mode/company-mode/issues/759 + ;; https://github.com/company-mode/company-mode/issues/549 + (when (derived-mode-p 'inferior-python-mode) + (let ((lbp (line-beginning-position))) + (setq comint-last-prompt (cons lbp lbp)))) (and (not (memq (get-text-property (1- (point)) 'face) '(font-lock-function-name-face font-lock-keyword-face))) From MAILER-DAEMON Mon Nov 05 18:19:25 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9V-00029W-9h for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9L-0001zi-20 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9J-0003zj-Tx for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:14 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9I-0003yc-Qc for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:13 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id BCF552064E; Mon, 5 Nov 2018 18:19:12 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master a64d52c 05/66: Deprecate company-nxml too MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: a64d52ca033208cda34f2fb7d0a2f951cce8bd29 Auto-Submitted: auto-generated Message-Id: <20181105231912.BCF552064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:12 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:17 -0000 branch: master commit a64d52ca033208cda34f2fb7d0a2f951cce8bd29 Author: Dmitry Gutov Commit: Dmitry Gutov Deprecate company-nxml too --- NEWS.md | 1 + company-capf.el | 4 ++-- company-css.el | 2 +- company-nxml.el | 3 ++- company.el | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 19e1fe2..2b25bbb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ =20 * In Emacs 26 and newer, `company-css` is removed from `company-backends= `. `company-capf` is used instead. +* Same for `company-nxml`. =20 ## 2018-02-23 (0.9.6) =20 diff --git a/company-capf.el b/company-capf.el index 653243f..5d174a3 100644 --- a/company-capf.el +++ b/company-capf.el @@ -24,8 +24,8 @@ ;; ;; The CAPF back-end provides a bridge to the standard ;; completion-at-point-functions facility, and thus can support any majo= r mode -;; that defines a proper completion function, including emacs-lisp-mode = and -;; css-mode. +;; that defines a proper completion function, including emacs-lisp-mode, +;; css-mode and nxml-mode. =20 ;;; Code: =20 diff --git a/company-css.el b/company-css.el index 129cc51..2619def 100644 --- a/company-css.el +++ b/company-css.el @@ -21,7 +21,7 @@ =20 ;;; Commentary: ;; -;; In newer versions of Emacs, company-capf is used instead. +;; In Emacs >=3D 26, company-capf is used instead. =20 ;;; Code: =20 diff --git a/company-nxml.el b/company-nxml.el index 5afa00e..36ff1ce 100644 --- a/company-nxml.el +++ b/company-nxml.el @@ -1,6 +1,6 @@ ;;; company-nxml.el --- company-mode completion backend for nxml-mode =20 -;; Copyright (C) 2009-2011, 2013 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011, 2013, 2018 Free Software Foundation, Inc. =20 ;; Author: Nikolaj Schumacher =20 @@ -22,6 +22,7 @@ =20 ;;; Commentary: ;; +;; In Emacs >=3D 26, company-capf is used instead. =20 ;;; Code: =20 diff --git a/company.el b/company.el index fc5c18f..a694a65 100644 --- a/company.el +++ b/company.el @@ -322,7 +322,8 @@ This doesn't include the margins and the scroll bar." (defcustom company-backends `(,@(unless (version< "24.3.51" emacs-versio= n) (list 'company-elisp)) company-bbdb - company-nxml + ,@(unless (version<=3D "26" emacs-version) + (list 'company-nxml)) ,@(unless (version<=3D "26" emacs-version) (list 'company-css)) company-eclim company-semantic company-cla= ng From MAILER-DAEMON Mon Nov 05 18:19:25 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9V-00029q-FU for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00020i-Gx for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-00040j-8Z for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9J-0003zT-QK for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:13 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 97611209E0; Mon, 5 Nov 2018 18:19:13 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 5698be9 10/66: Simplify company-cmake-prefix-dollar-brace-p MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 5698be9835a71816826fa11899cbd0a4606b420e Auto-Submitted: auto-generated Message-Id: <20181105231913.97611209E0@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:13 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:17 -0000 branch: master commit 5698be9835a71816826fa11899cbd0a4606b420e Author: Dmitry Gutov Commit: Dmitry Gutov Simplify company-cmake-prefix-dollar-brace-p =20 #714 --- company-cmake.el | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/company-cmake.el b/company-cmake.el index 6d29622..1bfb20b 100644 --- a/company-cmake.el +++ b/company-cmake.el @@ -1,6 +1,6 @@ ;;; company-cmake.el --- company-mode completion backend for CMake =20 -;; Copyright (C) 2013-2014 Free Software Foundation, Inc. +;; Copyright (C) 2013-2014, 2017-2018 Free Software Foundation, Inc. =20 ;; Author: Chen Bin ;; Version: 0.2 @@ -178,27 +178,11 @@ They affect which types of symbols we get completio= n candidates for.") (point-max)))))) =20 (defun company-cmake-prefix-dollar-brace-p () - "Test if the current char is prefix with ${ in the current line." - (let ((position-current (point)) - (position-beg-of-line (line-beginning-position)) - (position-end-of-line (line-end-position)) - (position-matched nil) - (position-matched-right-brace nil)) - - (setq position-matched - (re-search-backward "\$\{" position-beg-of-line t)) - (goto-char position-current) - (setq position-matched-right-brace - (re-search-backward "\}" position-beg-of-line t)) - (goto-char position-current) - - (if (or (and position-matched - position-matched-right-brace - (> position-matched position-matched-right-brace)) - (and position-matched - (not position-matched-right-brace))) - t - nil))) + "Test if the current symbol follows ${." + (save-excursion + (skip-syntax-backward "w_") + (and (eq (char-before (point)) ?\{) + (eq (char-before (1- (point))) ?$)))) =20 (defun company-cmake (command &optional arg &rest ignored) "`company-mode' completion backend for CMake. From MAILER-DAEMON Mon Nov 05 18:19:25 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9V-0002AG-N0 for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00020k-Hu for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-00041I-HF for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9K-000413-C6 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:14 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 4C8F9204F2; Mon, 5 Nov 2018 18:19:14 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 5118b59 14/66: company-tng: Supress post-completion (#731) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Nikita Leshenko In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 5118b59668b1e65c8631c1bebac36b9c4320598a Auto-Submitted: auto-generated Message-Id: <20181105231914.4C8F9204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:14 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:18 -0000 branch: master commit 5118b59668b1e65c8631c1bebac36b9c4320598a Author: Nikita Leshenko Commit: Nikita Leshenko company-tng: Supress post-completion (#731) =20 As discussed in #731, most post completions modify the buffer so the = resulting text is different from the text that was previewed in company-tng, cr= eating a surprising transition. For now we decided to disable post-completions= entirely when using company-tng. --- company-tng.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/company-tng.el b/company-tng.el index 46592da..a1d7173 100644 --- a/company-tng.el +++ b/company-tng.el @@ -102,7 +102,8 @@ confirm the selection and finish the completion." (when (and company-selection-changed (not (company--company-command-p (this-command-keys)))) (company--unread-this-command-keys) - (setq this-command 'company-complete-selection))))) + (setq this-command 'company-complete-selection) + (advice-add 'company-call-backend :before-until 'company-tng--sup= ress-post-completion))))) =20 ;;;###autoload (defun company-tng-configure-default () @@ -159,5 +160,15 @@ made explicitly (i.e. `company-selection-changed' is= true)" (setf (nth 3 args) nil)) args) =20 +(defun company-tng--supress-post-completion (command &rest args) + "Installed as a :before-until advice on `company-call-backend' and +prevents the 'post-completion command from being delivered to the backen= d +for the next iteration. post-completion do things like expand snippets +which are undesirable because completions are implicit in company-tng an= d +visible side-effects after the completion are surprising." + (when (eq command 'post-completion) + (advice-remove 'company-call-backend 'company-tng--supress-post-comp= letion) + t)) + (provide 'company-tng) ;;; company-tng.el ends here From MAILER-DAEMON Mon Nov 05 18:19:26 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9V-0002Ad-Tq for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-000212-M9 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-00041c-NR for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9K-00041M-Hh for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:14 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 786C8204F2; Mon, 5 Nov 2018 18:19:14 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master a78f7d8 15/66: Merge pull request #764 from nikital/tng-supress-post-completion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: a78f7d8fe04fa41adf88e64a85f3beb013f8c48c Auto-Submitted: auto-generated Message-Id: <20181105231914.786C8204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:14 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:18 -0000 branch: master commit a78f7d8fe04fa41adf88e64a85f3beb013f8c48c Merge: 07c56b1 5118b59 Author: Dmitry Gutov Commit: GitHub Merge pull request #764 from nikital/tng-supress-post-completion =20 company-tng: Suppress post-completion --- company-tng.el | 13 ++++++++++++- company.el | 1 - 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/company-tng.el b/company-tng.el index 46592da..a1d7173 100644 --- a/company-tng.el +++ b/company-tng.el @@ -102,7 +102,8 @@ confirm the selection and finish the completion." (when (and company-selection-changed (not (company--company-command-p (this-command-keys)))) (company--unread-this-command-keys) - (setq this-command 'company-complete-selection))))) + (setq this-command 'company-complete-selection) + (advice-add 'company-call-backend :before-until 'company-tng--sup= ress-post-completion))))) =20 ;;;###autoload (defun company-tng-configure-default () @@ -159,5 +160,15 @@ made explicitly (i.e. `company-selection-changed' is= true)" (setf (nth 3 args) nil)) args) =20 +(defun company-tng--supress-post-completion (command &rest args) + "Installed as a :before-until advice on `company-call-backend' and +prevents the 'post-completion command from being delivered to the backen= d +for the next iteration. post-completion do things like expand snippets +which are undesirable because completions are implicit in company-tng an= d +visible side-effects after the completion are surprising." + (when (eq command 'post-completion) + (advice-remove 'company-call-backend 'company-tng--supress-post-comp= letion) + t)) + (provide 'company-tng) ;;; company-tng.el ends here diff --git a/company.el b/company.el index 4c79f59..cbe3781 100644 --- a/company.el +++ b/company.el @@ -1629,7 +1629,6 @@ prefix match (same case) will be prioritized." ;; `company-completion-finished-hook' in that case, with right arg= ument. (if (stringp result) (let ((company-backend backend)) - (company-call-backend 'pre-completion result) (run-hook-with-args 'company-completion-finished-hook result= ) (company-call-backend 'post-completion result)) (run-hook-with-args 'company-completion-cancelled-hook result)))= ) From MAILER-DAEMON Mon Nov 05 18:19:26 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9W-0002BH-6n for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-000218-Nm for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-000415-CO for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9K-0003y1-5B for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:14 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 21644207D5; Mon, 5 Nov 2018 18:19:14 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 5a856d7 13/66: backend: Remove pre-completion command MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Nikita Leshenko In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 5a856d7d892fa45662748410bc4a665ba0b04668 Auto-Submitted: auto-generated Message-Id: <20181105231914.21644207D5@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:14 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:18 -0000 branch: master commit 5a856d7d892fa45662748410bc4a665ba0b04668 Author: Nikita Leshenko Commit: Nikita Leshenko backend: Remove pre-completion command =20 It isn't used and was never used in the company codebase --- company.el | 1 - 1 file changed, 1 deletion(-) diff --git a/company.el b/company.el index 4c79f59..cbe3781 100644 --- a/company.el +++ b/company.el @@ -1629,7 +1629,6 @@ prefix match (same case) will be prioritized." ;; `company-completion-finished-hook' in that case, with right arg= ument. (if (stringp result) (let ((company-backend backend)) - (company-call-backend 'pre-completion result) (run-hook-with-args 'company-completion-finished-hook result= ) (company-call-backend 'post-completion result)) (run-hook-with-args 'company-completion-cancelled-hook result)))= ) From MAILER-DAEMON Mon Nov 05 18:19:26 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9W-0002Be-EH for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00024F-4d for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9N-00047g-OU for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:20 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9N-000470-IV for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 7BB252064E; Mon, 5 Nov 2018 18:19:17 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 5b11709 31/66: Emacs 24 doesn't have working elisp capf, so don't test it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 5b11709b4ddd607803e16a443f74c83deb1cd2e1 Auto-Submitted: auto-generated Message-Id: <20181105231917.7BB252064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:17 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:22 -0000 branch: master commit 5b11709b4ddd607803e16a443f74c83deb1cd2e1 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Emacs 24 doesn't have working elisp capf, so don't test it =20 * test/all.el (test-file): Don't load test/capf-tests for emacs-24 --- test/all.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/all.el b/test/all.el index 6d64a62..3d7758f 100644 --- a/test/all.el +++ b/test/all.el @@ -25,4 +25,6 @@ (require 'ert) =20 (dolist (test-file (directory-files company-test-path t "-tests.el$")) - (load test-file nil t)) + (unless (and (=3D emacs-major-version 24) + (equal (file-name-base test-file) "capf-tests")) + (load test-file nil t))) From MAILER-DAEMON Mon Nov 05 18:19:26 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9W-0002Bk-KH for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00024L-9t for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9N-00046h-Bn for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:20 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9N-00045f-5r for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 25C89204F2; Mon, 5 Nov 2018 18:19:17 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master b0940fb 29/66: Close #798: look for :company-match function in the capf's metadata MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: b0940fbd7308a52e659b8ac76bf6feee9d633c6e Auto-Submitted: auto-generated Message-Id: <20181105231917.25C89204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:17 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:24 -0000 branch: master commit b0940fbd7308a52e659b8ac76bf6feee9d633c6e Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Close #798: look for :company-match function in the capf's metadata =20 * company-capf.el (company-capf): In `match', look for the `:company-= match' function in the capf's metadata. --- company-capf.el | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/company-capf.el b/company-capf.el index 5613333..52716a3 100644 --- a/company-capf.el +++ b/company-capf.el @@ -112,23 +112,27 @@ (nth 3 res) (plist-get (nthcdr 4 res) :predicate))= )) (cdr (assq 'display-sort-function meta)))))) (`match - (let* ((match-start nil) (pos -1) - (prop-value nil) (faces nil) - (has-face-p nil) chunks - (limit (length arg))) - (while (< pos limit) - (setq pos - (if (< pos 0) 0 (next-property-change pos arg limit))) - (setq prop-value (or (get-text-property pos 'face arg) - (get-text-property pos 'font-lock-face arg= )) - faces (if (listp prop-value) prop-value (list prop-value)= ) - has-face-p (memq 'completions-common-part faces)) - (cond ((and (not match-start) has-face-p) - (setq match-start pos)) - ((and match-start (not has-face-p)) - (push (cons match-start pos) chunks) - (setq match-start nil)))) - (if chunks (nreverse chunks) (cons 0 (length arg))))) + ;; ask the for the `:company-match' function. If that doesn't help= , + ;; fallback to sniffing for face changes to get a suitable value + (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-match)= )) + (if f (funcall f arg) + (let* ((match-start nil) (pos -1) + (prop-value nil) (faces nil) + (has-face-p nil) chunks + (limit (length arg))) + (while (< pos limit) + (setq pos + (if (< pos 0) 0 (next-property-change pos arg limit))= ) + (setq prop-value (or (get-text-property pos 'face arg) + (get-text-property pos 'font-lock-face= arg)) + faces (if (listp prop-value) prop-value (list prop-va= lue)) + has-face-p (memq 'completions-common-part faces)) + (cond ((and (not match-start) has-face-p) + (setq match-start pos)) + ((and match-start (not has-face-p)) + (push (cons match-start pos) chunks) + (setq match-start nil)))) + (if chunks (nreverse chunks) (cons 0 (length arg))))))) (`duplicates t) (`no-cache t) ;Not much can be done here, as long as we handle ;non-prefix matches. From MAILER-DAEMON Mon Nov 05 18:19:27 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9W-0002CH-Re for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00024K-9a for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9N-00047H-Lj for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:20 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9N-00046n-Cn for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 51005204F2; Mon, 5 Nov 2018 18:19:17 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master f404a12 30/66: Add some tests for the previous commits MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: f404a125b15c9dc57adc07b9efe728ea731c7bfb Auto-Submitted: auto-generated Message-Id: <20181105231917.51005204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:17 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:24 -0000 branch: master commit f404a125b15c9dc57adc07b9efe728ea731c7bfb Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Add some tests for the previous commits =20 * test/capf-tests.el: New file. --- test/capf-tests.el | 115 +++++++++++++++++++++++++++++++++++++++++++++++= ++++++ 1 file changed, 115 insertions(+) diff --git a/test/capf-tests.el b/test/capf-tests.el new file mode 100644 index 0000000..29965b2 --- /dev/null +++ b/test/capf-tests.el @@ -0,0 +1,115 @@ +;;; capf-tests.el --- company tests for the company-capf backend -*- le= xical-binding: t; -*- + +;; Copyright (C) 2013-2015 Free Software Foundation, Inc. + +;; Author: Jo=C3=A3o T=C3=A1vora +;; Keywords:=20 + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see = . + +;;; Commentary: + +;;=20 + +;;; Code: + +(require 'company-tests) +(require 'company-capf) + +(defmacro company-capf-with-buffer (contents &rest body) + (declare (indent 0) (debug (sexp &rest form))) + `(with-temp-buffer + (insert ,contents) + (emacs-lisp-mode) + (re-search-backward "|") + (replace-match "") + (let ((completion-at-point-functions '(elisp-completion-at-point)) + (company-backends '(company-capf))) + ,@body))) + +(ert-deftest company-basic-capf () + "Test basic `company-capf' support." + (company-capf-with-buffer + "(with-current-buffer|)" + (company-mode) + (company-complete) + (should company-candidates))) + +(ert-deftest company-non-prefix-capf () + "Test non-prefix `company-capf' in elisp" + (company-capf-with-buffer + "(w-c-b|)" + (company-mode) + (company-complete) + (should company-candidates) + (should (member "with-current-buffer" company-candidates)))) + +;; Re. "perfect" highliting of the non-prefix in company-capf matches, i= t is +;; only working in recent Emacsen containing this commit. The two follo= wing +;; tests reflect that. +;; +;; commit 325ef57b0e3977f9509f1049c826999e8b7c226d +;; Author: Stefan Monnier +;; Date: Tue Nov 7 12:17:34 2017 -0500 + +(ert-deftest company-non-prefix-fancy-capf-highlighting () + "Test highlighting for non-prefix `company-capf' in elisp" + (skip-unless (version<=3D "27.0" emacs-version)) + (company-capf-with-buffer + "(w-c-b|)" + (company-mode) + (company-complete) + (let* ((cand (car (member "with-current-buffer" company-candidates))= ) + (render + (and cand + (company-fill-propertize cand nil (length cand) nil nil= nil)))) + ;; remove `font-lock-face' and `mouse-face' text properties that a= ren't + ;; relevant to our test + (remove-list-of-text-properties + 0 (length cand) '(font-lock-face mouse-face) render) + (should + (ert-equal-including-properties + render + #("with-current-buffer" + 0 1 (face (company-tooltip-common company-tooltip)) ; "w" + 1 4 (face (company-tooltip)) ; "ith" + 4 6 (face (company-tooltip-common company-tooltip)) ; "-c" + 6 12 (face (company-tooltip)) ; "urren= t" + 12 14 (face (company-tooltip-common company-tooltip)) ; "-b" + 14 19 (face (company-tooltip)))))))) ; "uffer= " + +(ert-deftest company-non-prefix-modest-capf-highlighting () + "Test highlighting for non-prefix `company-capf' in elisp" + (skip-unless (version< emacs-version "27.0")) + (company-capf-with-buffer + "(w-c-b|)" + (company-mode) + (company-complete) + (let* ((cand (car (member "with-current-buffer" company-candidates))= ) + (render + (and cand + (company-fill-propertize cand nil (length cand) nil nil= nil)))) + ;; remove `font-lock-face' and `mouse-face' text properties that a= ren't + ;; relevant to our test + (remove-list-of-text-properties + 0 (length cand) '(font-lock-face mouse-face) render) + (should + (ert-equal-including-properties + render + #("with-current-buffer" + 0 14 (face (company-tooltip-common company-tooltip)); "with-cu= rrent-b" + 14 19 (face (company-tooltip)))))))) ; "uffer" + +(provide 'capf-tests) +;;; capf-tests.el ends here From MAILER-DAEMON Mon Nov 05 18:19:28 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9Y-0002Di-2w for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-000217-Mf for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9K-00040r-9p for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9J-0003zh-Tn for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:14 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id C022C204F2; Mon, 5 Nov 2018 18:19:13 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 0325a40 11/66: Remove an unnecessary test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 0325a4042bb002152cc1fc69a05f22fe71b54fea Auto-Submitted: auto-generated Message-Id: <20181105231913.C022C204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:13 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:18 -0000 branch: master commit 0325a4042bb002152cc1fc69a05f22fe71b54fea Author: Dmitry Gutov Commit: Dmitry Gutov Remove an unnecessary test =20 #714 --- test/cmake-tests.el | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/test/cmake-tests.el b/test/cmake-tests.el index 805ea1a..52467cc 100644 --- a/test/cmake-tests.el +++ b/test/cmake-tests.el @@ -29,14 +29,6 @@ (should (equal (company-cmake 'prefix) "CMAKE_CXX_FLAGS_R")))) =20 -(ert-deftest company-cmake-complete-in-string-between-quotes () - (with-temp-buffer - (insert "set(MyFlags \"${CMAKE_CXX_FLAGS_R}\"") - (backward-char 2) - (setq-local major-mode 'cmake-mode) - (should (equal (company-cmake 'prefix) - "CMAKE_CXX_FLAGS_R")))) - (ert-deftest company-cmake-complete-in-string-more-prefix () (with-temp-buffer (insert "set(MyFlags \"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_R") @@ -49,4 +41,4 @@ (insert "set(MyFlags \"${CMAKE_CXX_FLAGS} CMAKE_CXX_FLAGS_R") (setq-local major-mode 'cmake-mode) (should (equal (company-cmake 'prefix) - nil)))) \ No newline at end of file + nil)))) From MAILER-DAEMON Mon Nov 05 18:19:28 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9Y-0002Dv-96 for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9N-00021t-92 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9L-00043D-K6 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35378) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9L-00042q-Cx for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 524FB204F2; Mon, 5 Nov 2018 18:19:15 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master ed1085f 19/66: Merge pull request #771 from Wilfred/interactive-example MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: ed1085f43376fc26f10517ec6205a41fab43c245 Auto-Submitted: auto-generated Message-Id: <20181105231915.524FB204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:15 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:19 -0000 branch: master commit ed1085f43376fc26f10517ec6205a41fab43c245 Merge: 67650de 287a5fb Author: Dmitry Gutov Commit: GitHub Merge pull request #771 from Wilfred/interactive-example =20 Make example backend interactive --- company.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/company.el b/company.el index f4355b3..a62a2cb 100644 --- a/company.el +++ b/company.el @@ -44,7 +44,9 @@ ;; Here is a simple example completing "foo": ;; ;; (defun company-my-backend (command &optional arg &rest ignored) +;; (interactive (list 'interactive)) ;; (pcase command +;; (`interactive (company-begin-backend 'company-my-backend)) ;; (`prefix (company-grab-symbol)) ;; (`candidates (list "foobar" "foobaz" "foobarbaz")) ;; (`meta (format "This value is named %s" arg)))) From MAILER-DAEMON Mon Nov 05 18:19:28 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9Y-0002EL-HR for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9O-00023b-PJ for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9M-00043t-2Z for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9L-00043d-U3 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id D6C37204F2; Mon, 5 Nov 2018 18:19:15 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 7d6ab3c 22/66: company-keywords: Support thrift-mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Alexander Fomin In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 7d6ab3c7de9fec84d6d439e88014df73ff0ac08a Auto-Submitted: auto-generated Message-Id: <20181105231915.D6C37204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:15 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:22 -0000 branch: master commit 7d6ab3c7de9fec84d6d439e88014df73ff0ac08a Author: Alexander Fomin Commit: Alexander Fomin company-keywords: Support thrift-mode --- company-keywords.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/company-keywords.el b/company-keywords.el index 414c7b0..92ff369 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -255,6 +255,12 @@ "otherwise" "quote" "return" "switch" "throw" "true" "try" "type" "typealias" "using" "while" ) + ;; From https://github.com/apache/thrift/blob/master/contrib/thrift.= el + (thrift-mode + "binary" "bool" "byte" "const" "double" "enum" "exception" "extends= " + "i16" "i32" "i64" "include" "list" "map" "oneway" "optional" "requi= red" + "service" "set" "string" "struct" "throws" "typedef" "void" + ) ;; aliases (js2-mode . javascript-mode) (js2-jsx-mode . javascript-mode) From MAILER-DAEMON Mon Nov 05 18:19:29 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9Z-0002FZ-Eo for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00024G-5L for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9M-00045V-Pw for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00044O-Fv for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 69E6E207D5; Mon, 5 Nov 2018 18:19:16 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 270976b 25/66: Update Javascript and Python keywords MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Jimmy Yuen Ho Wong In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 270976bf80c6d372128ef0132c285f5b39f10089 Auto-Submitted: auto-generated Message-Id: <20181105231916.69E6E207D5@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:16 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:22 -0000 branch: master commit 270976bf80c6d372128ef0132c285f5b39f10089 Author: Jimmy Yuen Ho Wong Commit: Jimmy Yuen Ho Wong Update Javascript and Python keywords --- company-keywords.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 92ff369..2ba12fe 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -149,9 +149,12 @@ "return" "short" "static" "strictfp" "super" "switch" "synchronized= " "this" "throw" "throws" "transient" "try" "void" "volatile" "while"= ) (javascript-mode - "break" "catch" "const" "continue" "delete" "do" "else" "export" "f= or" - "function" "if" "import" "in" "instanceOf" "label" "let" "new" "ret= urn" - "switch" "this" "throw" "try" "typeof" "var" "void" "while" "with" = "yield") + ;; https://tc39.github.io/ecma262/ + async, static and undefined + "async" "await" "break" "case" "catch" "class" "const" "continue" + "debugger" "default" "delete" "do" "else" "enum" "export" "extends"= "false" + "finally" "for" "function" "if" "import" "in" "instanceof" "let" "n= ew" + "null" "return" "static" "super" "switch" "this" "throw" "true" "tr= y" + "typeof" "undefined" "var" "void" "while" "with" "yield") (kotlin-mode "abstract" "annotation" "as" "break" "by" "catch" "class" "companio= n" "const" "constructor" "continue" "data" "do" "else" "enum" "false" = "final" @@ -209,9 +212,11 @@ "print" "private" "protected" "public" "require" "require_once" "re= turn" "static" "switch" "this" "throw" "try" "unset" "use" "var" "while" = "xor") (python-mode - "and" "assert" "break" "class" "continue" "def" "del" "elif" "else" - "except" "exec" "finally" "for" "from" "global" "if" "import" "in" = "is" - "lambda" "not" "or" "pass" "print" "raise" "return" "try" "while" "= yield") + ;; https://docs.python.org/3/reference/lexical_analysis.html#keywor= ds + "False" "None" "True" "and" "as" "assert" "break" "class" "continue= " "def" + "del" "elif" "else" "except" "exec" "finally" "for" "from" "global"= "if" + "import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" "print" "r= aise" + "return" "try" "while" "with" "yield") (ruby-mode "BEGIN" "END" "alias" "and" "begin" "break" "case" "class" "def" "= defined?" "do" "else" "elsif" "end" "ensure" "false" "for" "if" "in" "module= " @@ -267,6 +272,7 @@ (espresso-mode . javascript-mode) (js-mode . javascript-mode) (js-jsx-mode . javascript-mode) + (rjsx-mode . javascript-mode) (cperl-mode . perl-mode) (jde-mode . java-mode) (ess-julia-mode . julia-mode) From MAILER-DAEMON Mon Nov 05 18:19:29 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9Z-0002Fq-KX for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00021Q-Sj for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9L-00042u-D9 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9L-00042S-6p for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 23A082064E; Mon, 5 Nov 2018 18:19:15 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 287a5fb 18/66: Make example backend interactive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Wilfred Hughes In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 287a5fb7bcd0644caadfc6e7f23bd8aee0830718 Auto-Submitted: auto-generated Message-Id: <20181105231915.23A082064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:15 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:18 -0000 branch: master commit 287a5fb7bcd0644caadfc6e7f23bd8aee0830718 Author: Wilfred Hughes Commit: Wilfred Hughes Make example backend interactive =20 When writing your first company backend, it's really helpful to be ab= le to run the example backend with M-x. Many real company backends are interact= ive too. --- company.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/company.el b/company.el index 1721005..d129633 100644 --- a/company.el +++ b/company.el @@ -44,7 +44,9 @@ ;; Here is a simple example completing "foo": ;; ;; (defun company-my-backend (command &optional arg &rest ignored) +;; (interactive (list 'interactive)) ;; (pcase command +;; (`interactive (company-begin-backend 'company-my-backend)) ;; (`prefix (company-grab-symbol)) ;; (`candidates (list "foobar" "foobaz" "foobarbaz")) ;; (`meta (format "This value is named %s" arg)))) From MAILER-DAEMON Mon Nov 05 18:19:30 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9Z-0002GJ-RB for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9N-00022E-LO for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9L-00043Z-Tk for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9L-00043Q-OZ for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id A9E5F204F2; Mon, 5 Nov 2018 18:19:15 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 46680da 21/66: company-css: Improve performance MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 46680da66a3ba70c7b2371832f8b8d9734dec554 Auto-Submitted: auto-generated Message-Id: <20181105231915.A9E5F204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:15 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:22 -0000 branch: master commit 46680da66a3ba70c7b2371832f8b8d9734dec554 Author: Dmitry Gutov Commit: Dmitry Gutov company-css: Improve performance =20 Fixes #779 --- company-css.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/company-css.el b/company-css.el index 2619def..d3ece74 100644 --- a/company-css.el +++ b/company-css.el @@ -424,7 +424,8 @@ Returns \"\" if no property found, but feasible at th= is position." (string=3D (web-mode-language-at-pos) "css"))) (or (company-grab company-css-tag-regexp 1) (company-grab company-css-pseudo-regexp 1) - (company-grab company-css-property-value-regexp 2) + (company-grab company-css-property-value-regexp 2 + (line-beginning-position)) (company-css-grab-property)))) (candidates (cond @@ -432,7 +433,8 @@ Returns \"\" if no property found, but feasible at th= is position." (all-completions arg company-css-html-tags)) ((company-grab company-css-pseudo-regexp 1) (all-completions arg company-css-pseudo-classes)) - ((company-grab company-css-property-value-regexp 2) + ((company-grab company-css-property-value-regexp 2 + (line-beginning-position)) (all-completions arg (company-css-property-values (company-grab company-css-property-value-regexp= 1)))) From MAILER-DAEMON Mon Nov 05 18:19:34 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9e-0002K6-Mw for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00024E-3L for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9M-00045G-O6 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00043x-4D for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 0E95B204F2; Mon, 5 Nov 2018 18:19:16 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master d26ec71 23/66: Merge pull request #785 from ylectric/company-keywords/thrift-mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: d26ec7182471efcc631bac3c2be122cfcd0f3c4d Auto-Submitted: auto-generated Message-Id: <20181105231916.0E95B204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:15 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:22 -0000 branch: master commit d26ec7182471efcc631bac3c2be122cfcd0f3c4d Merge: 46680da 7d6ab3c Author: Dmitry Gutov Commit: GitHub Merge pull request #785 from ylectric/company-keywords/thrift-mode =20 company-keywords: Support thrift-mode --- company-keywords.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/company-keywords.el b/company-keywords.el index 414c7b0..92ff369 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -255,6 +255,12 @@ "otherwise" "quote" "return" "switch" "throw" "true" "try" "type" "typealias" "using" "while" ) + ;; From https://github.com/apache/thrift/blob/master/contrib/thrift.= el + (thrift-mode + "binary" "bool" "byte" "const" "double" "enum" "exception" "extends= " + "i16" "i32" "i64" "include" "list" "map" "oneway" "optional" "requi= red" + "service" "set" "string" "struct" "throws" "typedef" "void" + ) ;; aliases (js2-mode . javascript-mode) (js2-jsx-mode . javascript-mode) From MAILER-DAEMON Mon Nov 05 18:19:35 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9e-0002KE-SE for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00024J-9D for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9N-00046S-8o for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:20 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9N-00044t-0J for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id EEBF22064E; Mon, 5 Nov 2018 18:19:16 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 392dadd 28/66: Per #798, #762: Fix company-capf's highlighting of non-prefix matches MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 392dadddb8f97062a2a390cba45d4c55867c2248 Auto-Submitted: auto-generated Message-Id: <20181105231916.EEBF22064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:16 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:24 -0000 branch: master commit 392dadddb8f97062a2a390cba45d4c55867c2248 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Per #798, #762: Fix company-capf's highlighting of non-prefix matches =20 In the process, allow a list of regions as a response to a `match' re= quest. =20 * company-capf.el (company-capf): In match, sniff for face changes in completion candidate. =20 * company.el (company-fill-propertize): Accept a list of regions to highlight as a response to a match request. (company-backends): Describe new `match' behaviour in docstring. --- company-capf.el | 29 +++++++++++++++++------------ company.el | 28 ++++++++++++++++++---------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/company-capf.el b/company-capf.el index 5d174a3..5613333 100644 --- a/company-capf.el +++ b/company-capf.el @@ -112,18 +112,23 @@ (nth 3 res) (plist-get (nthcdr 4 res) :predicate))= )) (cdr (assq 'display-sort-function meta)))))) (`match - ;; Can't just use 0 when base-size (see above) is non-zero. - (let ((start (if (get-text-property 0 'face arg) - 0 - (next-single-property-change 0 'face arg)))) - (when start - ;; completions-common-part comes first, but we can't just look = for this - ;; value because it can be in a list. - (or - (let ((value (get-text-property start 'face arg))) - (text-property-not-all start (length arg) - 'face value arg)) - (length arg))))) + (let* ((match-start nil) (pos -1) + (prop-value nil) (faces nil) + (has-face-p nil) chunks + (limit (length arg))) + (while (< pos limit) + (setq pos + (if (< pos 0) 0 (next-property-change pos arg limit))) + (setq prop-value (or (get-text-property pos 'face arg) + (get-text-property pos 'font-lock-face arg= )) + faces (if (listp prop-value) prop-value (list prop-value)= ) + has-face-p (memq 'completions-common-part faces)) + (cond ((and (not match-start) has-face-p) + (setq match-start pos)) + ((and match-start (not has-face-p)) + (push (cons match-start pos) chunks) + (setq match-start nil)))) + (if chunks (nreverse chunks) (cons 0 (length arg))))) (`duplicates t) (`no-cache t) ;Not much can be done here, as long as we handle ;non-prefix matches. diff --git a/company.el b/company.el index e465495..1259b6c 100644 --- a/company.el +++ b/company.el @@ -403,10 +403,13 @@ be kept if they have different annotations. For th= at to work properly, backends should store the related information on candidates using text properties. =20 -`match': The second argument is a completion candidate. Return the inde= x -after the end of text matching `prefix' within the candidate string. It -will be used when rendering the popup. This command only makes sense fo= r -backends that provide non-prefix completion. +`match': The second argument is a completion candidate. Return a positi= ve +integer, the index after the end of text matching `prefix' within the +candidate string. Alternatively, return a list of (CHUNK-START +. CHUNK-END) elements, where CHUNK-START and CHUNK-END are indexes withi= n +the candidate string. The corresponding regions are be used when render= ing +the popup. This command only makes sense for backends that provide +non-prefix completion. =20 `require-match': If this returns t, the user is not allowed to enter anything not offered as a candidate. Please don't use that value in nor= mal @@ -2507,7 +2510,6 @@ If SHOW-VERSION is non-nil, show the version in the= echo area." (- width (length annot= ation))) annotation)) right))) - (setq common (+ (min common width) margin)) (setq width (+ width margin (length right))) =20 (font-lock-append-text-property 0 width 'mouse-face @@ -2519,11 +2521,17 @@ If SHOW-VERSION is non-nil, show the version in t= he echo area." 'company-tooltip-annotation-se= lection 'company-tooltip-annotation) line)) - (font-lock-prepend-text-property margin common 'face - (if selected - 'company-tooltip-common-selecti= on - 'company-tooltip-common) - line) + (cl-loop + with width =3D (- width (length right)) + for (comp-beg . comp-end) in (if (integerp common) `((0 . ,common))= common) + for inline-beg =3D (+ margin comp-beg) + for inline-end =3D (min (+ margin comp-end) width) + when (< inline-beg width) + do (font-lock-prepend-text-property inline-beg inline-end 'face + (if selected + 'company-tooltip-common-sel= ection + 'company-tooltip-common) + line)) (when (let ((re (funcall company-search-regexp-function company-search-string))) (and (not (string=3D re "")) From MAILER-DAEMON Mon Nov 05 18:19:35 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9f-0002KZ-3M for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00027U-1w for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004EU-KZ for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00045f-6l for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 2B07E2064E; Mon, 5 Nov 2018 18:19:21 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master f1aef4d 45/66: add reference url for go-mode's keywords MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, chunzhouyu In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: f1aef4db06c60494a9bf5ac59856219252fca827 Auto-Submitted: auto-generated Message-Id: <20181105231921.2B07E2064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:21 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:27 -0000 branch: master commit f1aef4db06c60494a9bf5ac59856219252fca827 Author: chunzhouyu Commit: chunzhouyu add reference url for go-mode's keywords --- company-keywords.el | 1 + 1 file changed, 1 insertion(+) diff --git a/company-keywords.el b/company-keywords.el index 68e73e3..57486c9 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -142,6 +142,7 @@ "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode + ;; from https://golang.org/ref/spec#Keywords "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" "default" "defer" "else" "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "import" "int" "int16" "int32" "int64= " "int8" "interface" "map" "package" "range" "return" "select" "string" "struct" "switch" "type" "uint" "uint16"= "uint32" "uint64" "uint8" "uintptr" "var") From MAILER-DAEMON Mon Nov 05 18:19:35 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9f-0002Kw-98 for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00028a-MI for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004E2-FA for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-0004C4-3o for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 41A0C204F2; Mon, 5 Nov 2018 18:19:18 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 4d921fe 39/66: Merge pull request #817 from chunzhouyu/master MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 4d921fe0face2d89be2014d869b0f1e742dd4480 Auto-Submitted: auto-generated Message-Id: <20181105231920.41A0C204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:18 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:28 -0000 branch: master commit 4d921fe0face2d89be2014d869b0f1e742dd4480 Merge: 1f836b6 045b23a Author: Dmitry Gutov Commit: GitHub Merge pull request #817 from chunzhouyu/master =20 move golang's keywords to the right place --- company-keywords.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 2ba12fe..52fc226 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -141,6 +141,11 @@ "sum_suffix" "system_clock" "tan" "tanh" "target" "template" "then= " "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) + (go-mode + ;; from https://golang.org/ref/spec#Keywords + "break" "case" "chan" "const" "continue" "default" "defer" "else" "= fallthrough" + "for" "func" "go" "goto" "if" "import" "interface" "map" "package" = "range" + "return" "select" "struct" "switch" "type" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" @@ -224,10 +229,6 @@ "then" "true" "undef" "unless" "until" "when" "while" "yield") ;; From https://doc.rust-lang.org/grammar.html#keywords ;; but excluding unused reserved words: https://www.reddit.com/r/rus= t/comments/34fq0k/is_there_a_good_list_of_rusts_keywords/cqucvnj - (go-mode - "break" "case" "chan" "const" "continue" "default" "defer" "else" "= fallthrough" - "for" "func" "go" "goto" "if" "import" "interface" "map" "package" = "range" - "return" "select" "struct" "switch" "type" "var") (rust-mode "Self" "as" "box" "break" "const" "continue" "crate" "else" "enum" "extern= " From MAILER-DAEMON Mon Nov 05 18:19:35 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9f-0002LL-G7 for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9W-0002BM-AX for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9S-0004G7-DI for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9S-0004FU-3X for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 0BEE52064E; Mon, 5 Nov 2018 18:19:22 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 1c76850 50/66: Reformat MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 1c768504eb0ed7c416be4f7844311b6c68f789fb Auto-Submitted: auto-generated Message-Id: <20181105231922.0BEE52064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:21 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:29 -0000 branch: master commit 1c768504eb0ed7c416be4f7844311b6c68f789fb Author: Dmitry Gutov Commit: Dmitry Gutov Reformat --- company-keywords.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index aa51e2c..e321c17 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -144,9 +144,12 @@ (go-mode ;; From https://golang.org/ref/spec#Keywords ;; Plus some basic types, for better programming experience. - "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" "default" "defer" "else" "fallthrough" "float32" "float64" - "for" "func" "go" "goto" "if" "import" "int" "int16" "int32" "int64= " "int8" "interface" "map" "package" "range" - "return" "select" "string" "struct" "switch" "type" "uint" "uint16"= "uint32" "uint64" "uint8" "uintptr" "var") + "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" + "default" "defer" "else" "fallthrough" "float32" "float64" + "for" "func" "go" "goto" "if" "import" "int" "int16" "int32" + "int64" "int8" "interface" "map" "package" "range" + "return" "select" "string" "struct" "switch" "type" + "uint" "uint16" "uint32" "uint64" "uint8" "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" From MAILER-DAEMON Mon Nov 05 18:19:36 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9f-0002Lf-PJ for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9N-00022D-Ky for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9L-00043L-O3 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9L-000438-IV for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:15 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 7EFCC2064E; Mon, 5 Nov 2018 18:19:15 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master ddfdcb7 20/66: Abort when completion-at-point is invoked MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: ddfdcb78c1f7abc25e1a2db1eb68721b20d00a95 Auto-Submitted: auto-generated Message-Id: <20181105231915.7EFCC2064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:15 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:22 -0000 branch: master commit ddfdcb78c1f7abc25e1a2db1eb68721b20d00a95 Author: Dmitry Gutov Commit: Dmitry Gutov Abort when completion-at-point is invoked =20 Closes #778 --- company.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/company.el b/company.el index a62a2cb..04dcdd9 100644 --- a/company.el +++ b/company.el @@ -605,7 +605,8 @@ treated as if it was on this list." =20 (defcustom company-continue-commands '(not save-buffer save-some-buffers save-buffers-kill-terminal - save-buffers-kill-emacs) + save-buffers-kill-emacs + completion-at-point) "A list of commands that are allowed during completion. If this is t, or if `company-begin-commands' is t, any command is allowe= d. Otherwise, the value must be a list of symbols. If it starts with `not'= , From MAILER-DAEMON Mon Nov 05 18:19:39 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9f-0002Lx-VF for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00028Z-M2 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004Ee-KJ for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-0004CB-3M for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 899EF209E6; Mon, 5 Nov 2018 18:19:20 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 5015aad 41/66: Switch to npostavs/emacs-travis binaries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Iku Iwasa In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 5015aaddb7190ffd607476a8c557bf2e646e6beb Auto-Submitted: auto-generated Message-Id: <20181105231920.899EF209E6@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:20 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:28 -0000 branch: master commit 5015aaddb7190ffd607476a8c557bf2e646e6beb Author: Iku Iwasa Commit: Iku Iwasa Switch to npostavs/emacs-travis binaries =20 Supported versions are 24.5, 25.3, 26.1 and master. master is allowed to be failed. --- .travis.yml | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index b8eb249..03933bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,23 @@ -sudo: false - language: generic =20 -matrix: - include: - - env: EMACS=3Demacs24 - addons: - apt: - sources: [ { sourceline: 'ppa:cassou/emacs' } ] - packages: [ emacs24, emacs24-el ] - - env: EMACS=3Demacs25 - addons: - apt: - sources: [ { sourceline: 'ppa:kelleyk/emacs' } ] - packages: [ emacs25 ] - - env: EMACS=3Demacs-snapshot - addons: - apt: - sources: [ { sourceline: 'ppa:ubuntu-elisp/ppa' } ] - packages: [ emacs-snapshot ] +sudo: false + +env: + global: + - CURL=3D"curl -fsSkL --retry 9 --retry-delay 9" + matrix: + - EMACS_VERSION=3D24.5 + - EMACS_VERSION=3D25.3 + - EMACS_VERSION=3D26.1 + - EMACS_VERSION=3Dmaster + allow_failures: + - env: EMACS_VERSION=3Dmaster =20 -install: true +install: + - $CURL -O https://github.com/npostavs/emacs-travis/releases/download/= bins/emacs-bin-${EMACS_VERSION}.tar.gz + - tar -xaf emacs-bin-${EMACS_VERSION}.tar.gz -C / + - export EMACS=3D/tmp/emacs/bin/emacs + - $EMACS --version =20 script: make test-batch EMACS=3D${EMACS} From MAILER-DAEMON Mon Nov 05 18:19:39 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9j-0002NM-0J for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9Y-0002EJ-Gs for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9S-0004GW-Iq for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:26 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9S-0004Fs-8f for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 37A87204F2; Mon, 5 Nov 2018 18:19:22 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 1c28831 51/66: add some golang's builtin funcitons to go-mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Franky In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 1c288318276771a67b11c503885600160d75b901 Auto-Submitted: auto-generated Message-Id: <20181105231922.37A87204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:22 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:29 -0000 branch: master commit 1c288318276771a67b11c503885600160d75b901 Author: Franky Commit: GitHub add some golang's builtin funcitons to go-mode --- company-keywords.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index e321c17..2d10c6e 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -142,14 +142,18 @@ "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode - ;; From https://golang.org/ref/spec#Keywords - ;; Plus some basic types, for better programming experience. - "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" - "default" "defer" "else" "fallthrough" "float32" "float64" - "for" "func" "go" "goto" "if" "import" "int" "int16" "int32" - "int64" "int8" "interface" "map" "package" "range" - "return" "select" "string" "struct" "switch" "type" - "uint" "uint16" "uint32" "uint64" "uint8" "uintptr" "var") + ;; Basic Keywords + "break" "case" "chan" "const" "continue" "default" "defer" "else"=20 + "fallthrough" "for" "func" "go" "goto" "if" "import" "interface"=20 + "map" "package" "range" "return" "select" "struct" "switch" "type" = "var" + =20 + ;; Plus some basic types + "bool" "complex128" "complex64" "float32" "float64" "int" "int16" "= int32" + "int64" "int8" "string" "uint" "uint16" "uint32" "uint64" "uint8" "= uintptr" + =20 + ;; Plus golang's builtin functions + "append" "cap" "close" "complex" "copy" "delete" "imag" "len" "make= " "new" + "panic" "print" "println" "real" "recover") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" From MAILER-DAEMON Mon Nov 05 18:19:39 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9j-0002Nj-4i for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9a-0002Gb-8A for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9S-0004Gl-NZ for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:26 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9S-0004CC-Dl for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 62A302064E; Mon, 5 Nov 2018 18:19:22 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master c984355 52/66: resort the go-mode in company-keywords.el MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Franky In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: c984355420276136cbd1e62c64259866a836d482 Auto-Submitted: auto-generated Message-Id: <20181105231922.62A302064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:22 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:33 -0000 branch: master commit c984355420276136cbd1e62c64259866a836d482 Author: Franky Commit: GitHub resort the go-mode in company-keywords.el --- company-keywords.el | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 2d10c6e..dc117f2 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -143,17 +143,13 @@ "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode ;; Basic Keywords - "break" "case" "chan" "const" "continue" "default" "defer" "else"=20 - "fallthrough" "for" "func" "go" "goto" "if" "import" "interface"=20 - "map" "package" "range" "return" "select" "struct" "switch" "type" = "var" - =20 - ;; Plus some basic types - "bool" "complex128" "complex64" "float32" "float64" "int" "int16" "= int32" - "int64" "int8" "string" "uint" "uint16" "uint32" "uint64" "uint8" "= uintptr" - =20 - ;; Plus golang's builtin functions - "append" "cap" "close" "complex" "copy" "delete" "imag" "len" "make= " "new" - "panic" "print" "println" "real" "recover") + "append" "bool" "break" "cap" "case" "chan" "close" "complex" "com= plex128"=20 + "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse"=20 + "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "im= ag" "import"=20 + "interface" "int" "int16" "int32" "int64" "int8" "len" "make" "map"= "new"=20 + "package" "panic" "print" "println" "range" "real" "recover" "retur= n" "select"=20 + "string" "struct" "switch" "type" "uint" "uint16" "uint32" "uint64"= "uint8"=20 + "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" From MAILER-DAEMON Mon Nov 05 18:19:39 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9j-0002O8-AO for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9c-0002Gz-Bi for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9U-0004JO-9m for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-0004CE-0J for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id EEDDF204F2; Mon, 5 Nov 2018 18:19:23 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 4205ad6 61/66: Merge pull request #830 from jabranham/alias MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 4205ad678436e0e0d314792cb2ad222541458a16 Auto-Submitted: auto-generated Message-Id: <20181105231923.EEDDF204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:23 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:33 -0000 branch: master commit 4205ad678436e0e0d314792cb2ad222541458a16 Merge: 87f479b 7c6357a Author: Dmitry Gutov Commit: GitHub Merge pull request #830 from jabranham/alias =20 Define variable alias before referent --- company-gtags.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/company-gtags.el b/company-gtags.el index 02513ca..2a85f23 100644 --- a/company-gtags.el +++ b/company-gtags.el @@ -33,15 +33,15 @@ "Completion backend for GNU Global." :group 'company) =20 +(define-obsolete-variable-alias + 'company-gtags-gnu-global-program-name + 'company-gtags-executable "earlier") + (defcustom company-gtags-executable (executable-find "global") "Location of GNU global executable." :type 'string) =20 -(define-obsolete-variable-alias - 'company-gtags-gnu-global-program-name - 'company-gtags-executable "earlier") - (defcustom company-gtags-insert-arguments t "When non-nil, insert function arguments as a template after completio= n." :type 'boolean From MAILER-DAEMON Mon Nov 05 18:19:40 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9k-0002PH-CA for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00027P-0Q for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004EA-HF for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-0004CC-3W for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 65D04209E4; Mon, 5 Nov 2018 18:19:20 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 63fdb96 40/66: add some golang fake keywords for a better programming experience MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, chunzhouyu In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 63fdb9696514a77009b24c6f723e55c57017b952 Auto-Submitted: auto-generated Message-Id: <20181105231920.65D04209E4@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:20 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:27 -0000 branch: master commit 63fdb9696514a77009b24c6f723e55c57017b952 Author: chunzhouyu Commit: chunzhouyu add some golang fake keywords for a better programming experience --- company-keywords.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/company-keywords.el b/company-keywords.el index 52fc226..c751190 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -145,7 +145,14 @@ ;; from https://golang.org/ref/spec#Keywords "break" "case" "chan" "const" "continue" "default" "defer" "else" "= fallthrough" "for" "func" "go" "goto" "if" "import" "interface" "map" "package" = "range" - "return" "select" "struct" "switch" "type" "var") + "return" "select" "struct" "switch" "type" "var" + ;; basic type keywords, from https://golang.org/pkg/go/types/ + "bool" + "int" "int8" "int16" "int32" "int64" + "uint" "uint8" "uint16" "uint32" "uint64" "uintptr" + "float32" "float64" + "complex64" "complex128" + "string") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" From MAILER-DAEMON Mon Nov 05 18:19:40 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9k-0002PY-JZ for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00028T-JC for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004Ea-KW for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-0004CD-3q for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id AEACF209E7; Mon, 5 Nov 2018 18:19:20 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 9e8bd0b 42/66: Merge pull request #821 from iquiw/emacs-travis-bin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 9e8bd0b76a8352ea70c91eb40b6b34ac9af10077 Auto-Submitted: auto-generated Message-Id: <20181105231920.AEACF209E7@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:20 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:27 -0000 branch: master commit 9e8bd0b76a8352ea70c91eb40b6b34ac9af10077 Merge: 4d921fe 5015aad Author: Dmitry Gutov Commit: GitHub Merge pull request #821 from iquiw/emacs-travis-bin =20 Switch to npostavs/emacs-travis binaries for Travis CI build --- .travis.yml | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index b8eb249..03933bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,23 @@ -sudo: false - language: generic =20 -matrix: - include: - - env: EMACS=3Demacs24 - addons: - apt: - sources: [ { sourceline: 'ppa:cassou/emacs' } ] - packages: [ emacs24, emacs24-el ] - - env: EMACS=3Demacs25 - addons: - apt: - sources: [ { sourceline: 'ppa:kelleyk/emacs' } ] - packages: [ emacs25 ] - - env: EMACS=3Demacs-snapshot - addons: - apt: - sources: [ { sourceline: 'ppa:ubuntu-elisp/ppa' } ] - packages: [ emacs-snapshot ] +sudo: false + +env: + global: + - CURL=3D"curl -fsSkL --retry 9 --retry-delay 9" + matrix: + - EMACS_VERSION=3D24.5 + - EMACS_VERSION=3D25.3 + - EMACS_VERSION=3D26.1 + - EMACS_VERSION=3Dmaster + allow_failures: + - env: EMACS_VERSION=3Dmaster =20 -install: true +install: + - $CURL -O https://github.com/npostavs/emacs-travis/releases/download/= bins/emacs-bin-${EMACS_VERSION}.tar.gz + - tar -xaf emacs-bin-${EMACS_VERSION}.tar.gz -C / + - export EMACS=3D/tmp/emacs/bin/emacs + - $EMACS --version =20 script: make test-batch EMACS=3D${EMACS} From MAILER-DAEMON Mon Nov 05 18:19:41 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9k-0002Q3-Sl for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00024D-3J for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9M-000455-N6 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00044C-9V for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 384162064E; Mon, 5 Nov 2018 18:19:16 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 779662f 24/66: Truncate the Clang error in the echo area MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 779662f9e994c351002107a18f99cd06e00ed6c1 Auto-Submitted: auto-generated Message-Id: <20181105231916.384162064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:16 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:22 -0000 branch: master commit 779662f9e994c351002107a18f99cd06e00ed6c1 Author: Dmitry Gutov Commit: Dmitry Gutov Truncate the Clang error in the echo area =20 Closes #788 --- company-clang.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/company-clang.el b/company-clang.el index 90a372e..962db1e 100644 --- a/company-clang.el +++ b/company-clang.el @@ -183,11 +183,12 @@ or automatically through a custom `company-clang-pr= efix-guesser'." (let* ((buf (get-buffer-create company-clang--error-buffer-name)) (cmd (concat company-clang-executable " " (mapconcat 'identity = args " "))) (pattern (format company-clang--completion-pattern "")) + (message-truncate-lines t) (err (if (re-search-forward pattern nil t) (buffer-substring-no-properties (point-min) (1- (match-beginning 0= ))) ;; Warn the user more aggressively if no match was found= . - (message "clang failed with error %d:\n%s" res cmd) + (message "clang failed with error %d: %s" res cmd) (buffer-string)))) =20 (with-current-buffer buf From MAILER-DAEMON Mon Nov 05 18:19:41 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9l-0002QF-4x for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00024H-7R for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9N-00046C-43 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:20 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00045f-RT for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id C099A204F2; Mon, 5 Nov 2018 18:19:16 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master a913803 27/66: company-diag: Catch any error in `completions' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: a9138030819833c481cea93ddf52442237e4874e Auto-Submitted: auto-generated Message-Id: <20181105231916.C099A204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:16 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:22 -0000 branch: master commit a9138030819833c481cea93ddf52442237e4874e Author: Dmitry Gutov Commit: Dmitry Gutov company-diag: Catch any error in `completions' =20 Mentioned in #801. --- company.el | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/company.el b/company.el index 04dcdd9..e465495 100644 --- a/company.el +++ b/company.el @@ -2391,11 +2391,13 @@ If SHOW-VERSION is non-nil, show the version in t= he echo area." cc annotations) (when (or (stringp prefix) (consp prefix)) (let ((company-backend backend)) - (setq cc (company-call-backend 'candidates (company--prefix-str = prefix)) - annotations - (mapcar - (lambda (c) (cons c (company-call-backend 'annotation c))= ) - cc)))) + (condition-case nil + (setq cc (company-call-backend 'candidates (company--prefix-= str prefix)) + annotations + (mapcar + (lambda (c) (cons c (company-call-backend 'annotation= c))) + cc)) + (error (setq annotations 'error))))) (pop-to-buffer (get-buffer-create "*company-diag*")) (setq buffer-read-only nil) (erase-buffer) @@ -2414,11 +2416,13 @@ If SHOW-VERSION is non-nil, show the version in t= he echo area." (insert "\n") (insert (message "Completions:")) (unless cc (insert " none")) - (save-excursion - (dolist (c annotations) - (insert "\n " (prin1-to-string (car c))) - (when (cdr c) - (insert " " (prin1-to-string (cdr c)))))) + (if (eq annotations 'error) + (insert "(error fetching)") + (save-excursion + (dolist (c annotations) + (insert "\n " (prin1-to-string (car c))) + (when (cdr c) + (insert " " (prin1-to-string (cdr c))))))) (special-mode))) =20 ;;; pseudo-tooltip ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;;;;;; From MAILER-DAEMON Mon Nov 05 18:19:43 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9l-0002QZ-BY for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00024I-86 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9O-000499-UN for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:20 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9N-00047b-OV for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:17 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id A7D08204F2; Mon, 5 Nov 2018 18:19:17 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master ae9dd22 32/66: Make fixes after Dmitry's comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: ae9dd22452f75522bbcd778143b4baf8853875ce Auto-Submitted: auto-generated Message-Id: <20181105231917.A7D08204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:17 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:22 -0000 branch: master commit ae9dd22452f75522bbcd778143b4baf8853875ce Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Make fixes after Dmitry's comments =20 * company-capf.el (company-capf): Capitalize and punctuate comment. (company-capf): Only care about 'face text property. =20 * test/capf-tests.el: Fix copyright years. Fix top-level comment. --- company-capf.el | 11 +++++------ test/capf-tests.el | 9 +++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/company-capf.el b/company-capf.el index 52716a3..7e76dfc 100644 --- a/company-capf.el +++ b/company-capf.el @@ -88,8 +88,8 @@ (let* ((table (nth 3 res)) (pred (plist-get (nthcdr 4 res) :predicate)) (meta (completion-metadata - (buffer-substring (nth 1 res) (nth 2 res)) - table pred)) + (buffer-substring (nth 1 res) (nth 2 res)) + table pred)) (sortfun (cdr (assq 'display-sort-function meta))) (candidates (completion-all-completions arg table pred (= length arg))) (last (last candidates)) @@ -112,8 +112,8 @@ (nth 3 res) (plist-get (nthcdr 4 res) :predicate))= )) (cdr (assq 'display-sort-function meta)))))) (`match - ;; ask the for the `:company-match' function. If that doesn't help= , - ;; fallback to sniffing for face changes to get a suitable value + ;; Ask the for the `:company-match' function. If that doesn't help= , + ;; fallback to sniffing for face changes to get a suitable value. (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-match)= )) (if f (funcall f arg) (let* ((match-start nil) (pos -1) @@ -123,8 +123,7 @@ (while (< pos limit) (setq pos (if (< pos 0) 0 (next-property-change pos arg limit))= ) - (setq prop-value (or (get-text-property pos 'face arg) - (get-text-property pos 'font-lock-face= arg)) + (setq prop-value (get-text-property pos 'font-lock-face arg= ) faces (if (listp prop-value) prop-value (list prop-va= lue)) has-face-p (memq 'completions-common-part faces)) (cond ((and (not match-start) has-face-p) diff --git a/test/capf-tests.el b/test/capf-tests.el index 29965b2..b70131c 100644 --- a/test/capf-tests.el +++ b/test/capf-tests.el @@ -1,6 +1,6 @@ ;;; capf-tests.el --- company tests for the company-capf backend -*- le= xical-binding: t; -*- =20 -;; Copyright (C) 2013-2015 Free Software Foundation, Inc. +;; Copyright (C) 2018 Free Software Foundation, Inc. =20 ;; Author: Jo=C3=A3o T=C3=A1vora ;; Keywords:=20 @@ -55,9 +55,10 @@ (should company-candidates) (should (member "with-current-buffer" company-candidates)))) =20 -;; Re. "perfect" highliting of the non-prefix in company-capf matches, i= t is -;; only working in recent Emacsen containing this commit. The two follo= wing -;; tests reflect that. +;; Re. "perfect" highlighting of the non-prefix in company-capf matches,= it is +;; only working-out-of-the box (i.e. without the `:company-match' meta) = in +;; recent Emacsen containing the following commit. The two tests that f= ollow +;; reflect that. ;; ;; commit 325ef57b0e3977f9509f1049c826999e8b7c226d ;; Author: Stefan Monnier From MAILER-DAEMON Mon Nov 05 18:19:43 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9l-0002Qr-Gz for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00028B-BL for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004Ek-Ly for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00044t-CZ for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 577FB204F2; Mon, 5 Nov 2018 18:19:21 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master e14cd4f 46/66: add some comments for adding go-mode's fake keywords MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, chunzhouyu In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: e14cd4f9fc242d3bc9b24cce9d1d864d32cbf86a Auto-Submitted: auto-generated Message-Id: <20181105231921.577FB204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:21 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:27 -0000 branch: master commit e14cd4f9fc242d3bc9b24cce9d1d864d32cbf86a Author: chunzhouyu Commit: chunzhouyu add some comments for adding go-mode's fake keywords --- company-keywords.el | 1 + 1 file changed, 1 insertion(+) diff --git a/company-keywords.el b/company-keywords.el index 57486c9..9283057 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -143,6 +143,7 @@ "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode ;; from https://golang.org/ref/spec#Keywords + ;; also, i add some fake keywords for a better programming experien= ce, all of them are basic type in golang "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" "default" "defer" "else" "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "import" "int" "int16" "int32" "int64= " "int8" "interface" "map" "package" "range" "return" "select" "string" "struct" "switch" "type" "uint" "uint16"= "uint32" "uint64" "uint8" "uintptr" "var") From MAILER-DAEMON Mon Nov 05 18:19:43 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9n-0002RQ-NG for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00027j-3j for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004EO-IH for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-0004CT-4O for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 0159F209F6; Mon, 5 Nov 2018 18:19:20 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 2d87b1f 44/66: fix golang's keywords sort MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, chunzhouyu In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 2d87b1f89efaf20af08426eb9c64c130f6a35dd0 Auto-Submitted: auto-generated Message-Id: <20181105231921.0159F209F6@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:20 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:27 -0000 branch: master commit 2d87b1f89efaf20af08426eb9c64c130f6a35dd0 Author: chunzhouyu Commit: chunzhouyu fix golang's keywords sort --- company-keywords.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index c5d3c9c..68e73e3 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -143,8 +143,8 @@ "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" "default" "defer" "else" "fallthrough" "float32" "float64" - "for" "func" "go" "goto" "if" "import" "int" "int8" "int16" "int32"= "int64" "interface" "map" "package" "range" - "return" "select" "string" "struct" "switch" "type" "uint" "uint8" = "uint16" "uint32" "uint64" "uintptr" "var") + "for" "func" "go" "goto" "if" "import" "int" "int16" "int32" "int64= " "int8" "interface" "map" "package" "range" + "return" "select" "string" "struct" "switch" "type" "uint" "uint16"= "uint32" "uint64" "uint8" "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" From MAILER-DAEMON Mon Nov 05 18:19:44 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9n-0002Rl-Uh for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9V-0002Aa-Sr for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9T-0004H3-0m for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9S-0004CE-KB for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 8DAEE204F2; Mon, 5 Nov 2018 18:19:22 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master d2db92b 53/66: Update company-keywords.el MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Franky In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: d2db92bbbeb43e04a317b4db0aa95ddec7571d17 Auto-Submitted: auto-generated Message-Id: <20181105231922.8DAEE204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:22 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:28 -0000 branch: master commit d2db92bbbeb43e04a317b4db0aa95ddec7571d17 Author: Franky Commit: GitHub Update company-keywords.el --- company-keywords.el | 1 - 1 file changed, 1 deletion(-) diff --git a/company-keywords.el b/company-keywords.el index dc117f2..0a55437 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -142,7 +142,6 @@ "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode - ;; Basic Keywords "append" "bool" "break" "cap" "case" "chan" "close" "complex" "com= plex128"=20 "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse"=20 "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "im= ag" "import"=20 From MAILER-DAEMON Mon Nov 05 18:19:44 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9o-0002Rx-4Q for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00028A-BB for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004Dh-C7 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9O-00044t-S0 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:20 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id BA6E5209E0; Mon, 5 Nov 2018 18:19:18 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 045b23a 38/66: move golang's keywords to the right place MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, chunzhouyu In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 045b23a2a9ca4d002d6f1b1e21b8cb1381935c60 Auto-Submitted: auto-generated Message-Id: <20181105231918.BA6E5209E0@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:18 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:28 -0000 branch: master commit 045b23a2a9ca4d002d6f1b1e21b8cb1381935c60 Author: chunzhouyu Commit: chunzhouyu move golang's keywords to the right place --- company-keywords.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 2ba12fe..52fc226 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -141,6 +141,11 @@ "sum_suffix" "system_clock" "tan" "tanh" "target" "template" "then= " "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) + (go-mode + ;; from https://golang.org/ref/spec#Keywords + "break" "case" "chan" "const" "continue" "default" "defer" "else" "= fallthrough" + "for" "func" "go" "goto" "if" "import" "interface" "map" "package" = "range" + "return" "select" "struct" "switch" "type" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" @@ -224,10 +229,6 @@ "then" "true" "undef" "unless" "until" "when" "while" "yield") ;; From https://doc.rust-lang.org/grammar.html#keywords ;; but excluding unused reserved words: https://www.reddit.com/r/rus= t/comments/34fq0k/is_there_a_good_list_of_rusts_keywords/cqucvnj - (go-mode - "break" "case" "chan" "const" "continue" "default" "defer" "else" "= fallthrough" - "for" "func" "go" "goto" "if" "import" "interface" "map" "package" = "range" - "return" "select" "struct" "switch" "type" "var") (rust-mode "Self" "as" "box" "break" "const" "continue" "crate" "else" "enum" "extern= " From MAILER-DAEMON Mon Nov 05 18:19:44 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9o-0002SO-AI for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00028f-P0 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004Cr-8j for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9O-00048I-43 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 0F5A1207D5; Mon, 5 Nov 2018 18:19:18 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 382764a 34/66: Merge pull request #798 from joaotavora/master MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 382764a73899edcef69cf0eff1a52df2490f0971 Auto-Submitted: auto-generated Message-Id: <20181105231918.0F5A1207D5@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:17 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:29 -0000 branch: master commit 382764a73899edcef69cf0eff1a52df2490f0971 Merge: a913803 f31d284 Author: Dmitry Gutov Commit: GitHub Merge pull request #798 from joaotavora/master =20 Allow list of common chunks as response to `match' request --- NEWS.md | 8 ++++ company-capf.el | 36 ++++++++++------- company.el | 28 ++++++++----- test/all.el | 4 +- test/capf-tests.el | 116 +++++++++++++++++++++++++++++++++++++++++++++++= ++++++ 5 files changed, 167 insertions(+), 25 deletions(-) diff --git a/NEWS.md b/NEWS.md index fbecf7d..2a06363 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,14 @@ =20 ## Next =20 +* For more sophisticated highlighting in non-prefix completion, a backen= d may + now respond to a `match` request with a list of regions. See + `company-backends`. + ([#798](https://github.com/company-mode/company-mode/issues/798), + [#762](https://github.com/company-mode/company-mode/issues/762)) +* The `company-capf` backend will pick up on a `:company-match` metadata= element + on the capf function (similar to `:company-location` or `:company-doc-= buffer`) + and use it as a response to aforementioned `match` request. * `company-cmake` supports completion inside string interpolations ([#714](https://github.com/company-mode/company-mode/pull/714)). * Workaround for the conflict between `inferior-python-mode`'s completio= n code diff --git a/company-capf.el b/company-capf.el index 5d174a3..7e76dfc 100644 --- a/company-capf.el +++ b/company-capf.el @@ -88,8 +88,8 @@ (let* ((table (nth 3 res)) (pred (plist-get (nthcdr 4 res) :predicate)) (meta (completion-metadata - (buffer-substring (nth 1 res) (nth 2 res)) - table pred)) + (buffer-substring (nth 1 res) (nth 2 res)) + table pred)) (sortfun (cdr (assq 'display-sort-function meta))) (candidates (completion-all-completions arg table pred (= length arg))) (last (last candidates)) @@ -112,18 +112,26 @@ (nth 3 res) (plist-get (nthcdr 4 res) :predicate))= )) (cdr (assq 'display-sort-function meta)))))) (`match - ;; Can't just use 0 when base-size (see above) is non-zero. - (let ((start (if (get-text-property 0 'face arg) - 0 - (next-single-property-change 0 'face arg)))) - (when start - ;; completions-common-part comes first, but we can't just look = for this - ;; value because it can be in a list. - (or - (let ((value (get-text-property start 'face arg))) - (text-property-not-all start (length arg) - 'face value arg)) - (length arg))))) + ;; Ask the for the `:company-match' function. If that doesn't help= , + ;; fallback to sniffing for face changes to get a suitable value. + (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-match)= )) + (if f (funcall f arg) + (let* ((match-start nil) (pos -1) + (prop-value nil) (faces nil) + (has-face-p nil) chunks + (limit (length arg))) + (while (< pos limit) + (setq pos + (if (< pos 0) 0 (next-property-change pos arg limit))= ) + (setq prop-value (get-text-property pos 'font-lock-face arg= ) + faces (if (listp prop-value) prop-value (list prop-va= lue)) + has-face-p (memq 'completions-common-part faces)) + (cond ((and (not match-start) has-face-p) + (setq match-start pos)) + ((and match-start (not has-face-p)) + (push (cons match-start pos) chunks) + (setq match-start nil)))) + (if chunks (nreverse chunks) (cons 0 (length arg))))))) (`duplicates t) (`no-cache t) ;Not much can be done here, as long as we handle ;non-prefix matches. diff --git a/company.el b/company.el index e465495..1259b6c 100644 --- a/company.el +++ b/company.el @@ -403,10 +403,13 @@ be kept if they have different annotations. For th= at to work properly, backends should store the related information on candidates using text properties. =20 -`match': The second argument is a completion candidate. Return the inde= x -after the end of text matching `prefix' within the candidate string. It -will be used when rendering the popup. This command only makes sense fo= r -backends that provide non-prefix completion. +`match': The second argument is a completion candidate. Return a positi= ve +integer, the index after the end of text matching `prefix' within the +candidate string. Alternatively, return a list of (CHUNK-START +. CHUNK-END) elements, where CHUNK-START and CHUNK-END are indexes withi= n +the candidate string. The corresponding regions are be used when render= ing +the popup. This command only makes sense for backends that provide +non-prefix completion. =20 `require-match': If this returns t, the user is not allowed to enter anything not offered as a candidate. Please don't use that value in nor= mal @@ -2507,7 +2510,6 @@ If SHOW-VERSION is non-nil, show the version in the= echo area." (- width (length annot= ation))) annotation)) right))) - (setq common (+ (min common width) margin)) (setq width (+ width margin (length right))) =20 (font-lock-append-text-property 0 width 'mouse-face @@ -2519,11 +2521,17 @@ If SHOW-VERSION is non-nil, show the version in t= he echo area." 'company-tooltip-annotation-se= lection 'company-tooltip-annotation) line)) - (font-lock-prepend-text-property margin common 'face - (if selected - 'company-tooltip-common-selecti= on - 'company-tooltip-common) - line) + (cl-loop + with width =3D (- width (length right)) + for (comp-beg . comp-end) in (if (integerp common) `((0 . ,common))= common) + for inline-beg =3D (+ margin comp-beg) + for inline-end =3D (min (+ margin comp-end) width) + when (< inline-beg width) + do (font-lock-prepend-text-property inline-beg inline-end 'face + (if selected + 'company-tooltip-common-sel= ection + 'company-tooltip-common) + line)) (when (let ((re (funcall company-search-regexp-function company-search-string))) (and (not (string=3D re "")) diff --git a/test/all.el b/test/all.el index 6d64a62..3d7758f 100644 --- a/test/all.el +++ b/test/all.el @@ -25,4 +25,6 @@ (require 'ert) =20 (dolist (test-file (directory-files company-test-path t "-tests.el$")) - (load test-file nil t)) + (unless (and (=3D emacs-major-version 24) + (equal (file-name-base test-file) "capf-tests")) + (load test-file nil t))) diff --git a/test/capf-tests.el b/test/capf-tests.el new file mode 100644 index 0000000..b70131c --- /dev/null +++ b/test/capf-tests.el @@ -0,0 +1,116 @@ +;;; capf-tests.el --- company tests for the company-capf backend -*- le= xical-binding: t; -*- + +;; Copyright (C) 2018 Free Software Foundation, Inc. + +;; Author: Jo=C3=A3o T=C3=A1vora +;; Keywords:=20 + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see = . + +;;; Commentary: + +;;=20 + +;;; Code: + +(require 'company-tests) +(require 'company-capf) + +(defmacro company-capf-with-buffer (contents &rest body) + (declare (indent 0) (debug (sexp &rest form))) + `(with-temp-buffer + (insert ,contents) + (emacs-lisp-mode) + (re-search-backward "|") + (replace-match "") + (let ((completion-at-point-functions '(elisp-completion-at-point)) + (company-backends '(company-capf))) + ,@body))) + +(ert-deftest company-basic-capf () + "Test basic `company-capf' support." + (company-capf-with-buffer + "(with-current-buffer|)" + (company-mode) + (company-complete) + (should company-candidates))) + +(ert-deftest company-non-prefix-capf () + "Test non-prefix `company-capf' in elisp" + (company-capf-with-buffer + "(w-c-b|)" + (company-mode) + (company-complete) + (should company-candidates) + (should (member "with-current-buffer" company-candidates)))) + +;; Re. "perfect" highlighting of the non-prefix in company-capf matches,= it is +;; only working-out-of-the box (i.e. without the `:company-match' meta) = in +;; recent Emacsen containing the following commit. The two tests that f= ollow +;; reflect that. +;; +;; commit 325ef57b0e3977f9509f1049c826999e8b7c226d +;; Author: Stefan Monnier +;; Date: Tue Nov 7 12:17:34 2017 -0500 + +(ert-deftest company-non-prefix-fancy-capf-highlighting () + "Test highlighting for non-prefix `company-capf' in elisp" + (skip-unless (version<=3D "27.0" emacs-version)) + (company-capf-with-buffer + "(w-c-b|)" + (company-mode) + (company-complete) + (let* ((cand (car (member "with-current-buffer" company-candidates))= ) + (render + (and cand + (company-fill-propertize cand nil (length cand) nil nil= nil)))) + ;; remove `font-lock-face' and `mouse-face' text properties that a= ren't + ;; relevant to our test + (remove-list-of-text-properties + 0 (length cand) '(font-lock-face mouse-face) render) + (should + (ert-equal-including-properties + render + #("with-current-buffer" + 0 1 (face (company-tooltip-common company-tooltip)) ; "w" + 1 4 (face (company-tooltip)) ; "ith" + 4 6 (face (company-tooltip-common company-tooltip)) ; "-c" + 6 12 (face (company-tooltip)) ; "urren= t" + 12 14 (face (company-tooltip-common company-tooltip)) ; "-b" + 14 19 (face (company-tooltip)))))))) ; "uffer= " + +(ert-deftest company-non-prefix-modest-capf-highlighting () + "Test highlighting for non-prefix `company-capf' in elisp" + (skip-unless (version< emacs-version "27.0")) + (company-capf-with-buffer + "(w-c-b|)" + (company-mode) + (company-complete) + (let* ((cand (car (member "with-current-buffer" company-candidates))= ) + (render + (and cand + (company-fill-propertize cand nil (length cand) nil nil= nil)))) + ;; remove `font-lock-face' and `mouse-face' text properties that a= ren't + ;; relevant to our test + (remove-list-of-text-properties + 0 (length cand) '(font-lock-face mouse-face) render) + (should + (ert-equal-including-properties + render + #("with-current-buffer" + 0 14 (face (company-tooltip-common company-tooltip)); "with-cu= rrent-b" + 14 19 (face (company-tooltip)))))))) ; "uffer" + +(provide 'capf-tests) +;;; capf-tests.el ends here From MAILER-DAEMON Mon Nov 05 18:19:44 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9o-0002Sl-I2 for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9c-0002Gv-AO for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9U-0004Il-0G for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9T-0004IJ-Lz for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 9AEC0204F2; Mon, 5 Nov 2018 18:19:23 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 87f479b 59/66: Merge pull request #829 from chunzhouyu/master MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 87f479b5e5c363460ebb2f744042a96a425804e1 Auto-Submitted: auto-generated Message-Id: <20181105231923.9AEC0204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:23 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:33 -0000 branch: master commit 87f479b5e5c363460ebb2f744042a96a425804e1 Merge: 4fe0bec 88b8282 Author: Dmitry Gutov Commit: GitHub Merge pull request #829 from chunzhouyu/master =20 add nil and bool to company-keywords for go-mode --- company-keywords.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 971c44c..b6dfd1d 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -146,10 +146,10 @@ ;; 2. Builtin functions and types ref: https://golang.org/pkg/built= in/ "append" "bool" "break" "byte" "cap" "case" "chan" "close" "complex= " "complex128" "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse" "error" - "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "im= ag" + "fallthrough" "false" "float32" "float64" "for" "func" "go" "goto" = "if" "imag" "import" "int" "int16" "int32" "int64" "int8" "interface" "len" "ma= ke" - "map" "new" "package" "panic" "print" "println" "range" "real" "rec= over" - "return" "rune" "select" "string" "struct" "switch" "type" "uint" "= uint16" + "map" "new" "nil" "package" "panic" "print" "println" "range" "real= " "recover" + "return" "rune" "select" "string" "struct" "switch" "true" "type" "= uint" "uint16" "uint32" "uint64" "uint8" "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" From MAILER-DAEMON Mon Nov 05 18:19:45 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9o-0002Sx-PQ for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9c-0002Gw-Ay for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9U-0004J3-3y for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9T-0004IX-RY for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id C59962064E; Mon, 5 Nov 2018 18:19:23 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 7c6357a 60/66: Define variable alias before referent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Alex Branham In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 7c6357af3f014a1ead3ba203152037a1a394e6b3 Auto-Submitted: auto-generated Message-Id: <20181105231923.C59962064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:23 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:33 -0000 branch: master commit 7c6357af3f014a1ead3ba203152037a1a394e6b3 Author: Alex Branham Commit: Alex Branham Define variable alias before referent =20 To avoid Emacs bug #5950 --- company-gtags.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/company-gtags.el b/company-gtags.el index 02513ca..2a85f23 100644 --- a/company-gtags.el +++ b/company-gtags.el @@ -33,15 +33,15 @@ "Completion backend for GNU Global." :group 'company) =20 +(define-obsolete-variable-alias + 'company-gtags-gnu-global-program-name + 'company-gtags-executable "earlier") + (defcustom company-gtags-executable (executable-find "global") "Location of GNU global executable." :type 'string) =20 -(define-obsolete-variable-alias - 'company-gtags-gnu-global-program-name - 'company-gtags-executable "earlier") - (defcustom company-gtags-insert-arguments t "When non-nil, insert function arguments as a template after completio= n." :type 'boolean From MAILER-DAEMON Mon Nov 05 18:19:45 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9p-0002TK-4E for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9c-0002Gt-9q for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9T-0004IN-OH for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9T-0004Hu-H5 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 7037D2064E; Mon, 5 Nov 2018 18:19:23 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 88b8282 58/66: add nil and bool to company-keywords for go-mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, chunzhouyu In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 88b82827908c1f9a0ea8b51be24d2d660cdf35a6 Auto-Submitted: auto-generated Message-Id: <20181105231923.7037D2064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:23 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:33 -0000 branch: master commit 88b82827908c1f9a0ea8b51be24d2d660cdf35a6 Author: chunzhouyu Commit: chunzhouyu add nil and bool to company-keywords for go-mode --- company-keywords.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 971c44c..b6dfd1d 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -146,10 +146,10 @@ ;; 2. Builtin functions and types ref: https://golang.org/pkg/built= in/ "append" "bool" "break" "byte" "cap" "case" "chan" "close" "complex= " "complex128" "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse" "error" - "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "im= ag" + "fallthrough" "false" "float32" "float64" "for" "func" "go" "goto" = "if" "imag" "import" "int" "int16" "int32" "int64" "int8" "interface" "len" "ma= ke" - "map" "new" "package" "panic" "print" "println" "range" "real" "rec= over" - "return" "rune" "select" "string" "struct" "switch" "type" "uint" "= uint16" + "map" "new" "nil" "package" "panic" "print" "println" "range" "real= " "recover" + "return" "rune" "select" "string" "struct" "switch" "true" "type" "= uint" "uint16" "uint32" "uint64" "uint8" "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" From MAILER-DAEMON Mon Nov 05 18:19:45 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9p-0002Tm-Dx for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9c-0002Gy-B7 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9T-0004I9-JS for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9T-0004Hl-BX for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 47517204F2; Mon, 5 Nov 2018 18:19:23 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 4fe0bec 57/66: Merge pull request #828 from chunzhouyu/master MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 4fe0bec4974b4ad0575e758afb16b2029ce97d1f Auto-Submitted: auto-generated Message-Id: <20181105231923.47517204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:23 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:33 -0000 branch: master commit 4fe0bec4974b4ad0575e758afb16b2029ce97d1f Merge: 1c76850 ed8bf2a Author: Dmitry Gutov Commit: GitHub Merge pull request #828 from chunzhouyu/master =20 add some golang's builtin funcitons to go-mode --- company-keywords.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index e321c17..971c44c 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -142,14 +142,15 @@ "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode - ;; From https://golang.org/ref/spec#Keywords - ;; Plus some basic types, for better programming experience. - "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" - "default" "defer" "else" "fallthrough" "float32" "float64" - "for" "func" "go" "goto" "if" "import" "int" "int16" "int32" - "int64" "int8" "interface" "map" "package" "range" - "return" "select" "string" "struct" "switch" "type" - "uint" "uint16" "uint32" "uint64" "uint8" "uintptr" "var") + ;; 1. Keywords ref: https://golang.org/ref/spec#Keywords + ;; 2. Builtin functions and types ref: https://golang.org/pkg/built= in/ + "append" "bool" "break" "byte" "cap" "case" "chan" "close" "complex= " "complex128" + "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse" "error" + "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "im= ag" + "import" "int" "int16" "int32" "int64" "int8" "interface" "len" "ma= ke" + "map" "new" "package" "panic" "print" "println" "range" "real" "rec= over" + "return" "rune" "select" "string" "struct" "switch" "type" "uint" "= uint16" + "uint32" "uint64" "uint8" "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" From MAILER-DAEMON Mon Nov 05 18:19:45 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9p-0002U3-Jj for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9f-0002Ka-4E for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9U-0004KE-NW for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:30 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00045f-Bv for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 52CA7204F2; Mon, 5 Nov 2018 18:19:24 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 4fa5a37 63/66: Backends are called at the same point where company begins MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Bet4 <16643669+bet4it@users.noreply.github.com> In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 4fa5a3753091b6911e27a8ff579a7861dc7ab9f9 Auto-Submitted: auto-generated Message-Id: <20181105231924.52CA7204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:24 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:39 -0000 branch: master commit 4fa5a3753091b6911e27a8ff579a7861dc7ab9f9 Author: Bet4 <16643669+bet4it@users.noreply.github.com> Commit: Bet4 <16643669+bet4it@users.noreply.github.com> Backends are called at the same point where company begins --- company.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/company.el b/company.el index 1259b6c..f05aaf5 100644 --- a/company.el +++ b/company.el @@ -2827,7 +2827,6 @@ Returns a negative number if the tooltip should be = displayed above point." =20 (defun company-pseudo-tooltip-show (row column selection) (company-pseudo-tooltip-hide) - (save-excursion =20 (let* ((height (company--pseudo-tooltip-height)) above) @@ -2836,15 +2835,17 @@ Returns a negative number if the tooltip should b= e displayed above point." (setq row (+ row height -1) above t)) =20 - (let* ((nl (< (move-to-window-line row) row)) - (beg (point)) - (end (save-excursion - (move-to-window-line (+ row (abs height))) - (point))) - (ov (make-overlay beg end nil t)) - (args (list (mapcar 'company-plainify - (company-buffer-lines beg end)) - column nl above))) + (let (nl beg end ov args) + (save-excursion + (setq nl (< (move-to-window-line row) row) + beg (point) + end (save-excursion + (move-to-window-line (+ row (abs height))) + (point)) + ov (make-overlay beg end nil t) + args (list (mapcar 'company-plainify + (company-buffer-lines beg end)) + column nl above))) =20 (setq company-pseudo-tooltip-overlay ov) (overlay-put ov 'company-replacement-args args) @@ -2855,7 +2856,7 @@ Returns a negative number if the tooltip should be = displayed above point." (overlay-put ov 'company-width (string-width (car lines)))) =20 (overlay-put ov 'company-column column) - (overlay-put ov 'company-height height))))) + (overlay-put ov 'company-height height)))) =20 (defun company-pseudo-tooltip-show-at-point (pos column-offset) (let* ((col-row (company--col-row pos)) From MAILER-DAEMON Mon Nov 05 18:19:47 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9r-0002VW-0d for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9c-0002Gx-As for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9T-0004Hg-An for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9T-0004CC-4Z for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 1B3D9204F2; Mon, 5 Nov 2018 18:19:23 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master ed8bf2a 56/66: capitalize the comment sentences MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, chunzhouyu In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: ed8bf2ab52545c836c52e0460ab509ccaea71b6a Auto-Submitted: auto-generated Message-Id: <20181105231923.1B3D9204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:23 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:33 -0000 branch: master commit ed8bf2ab52545c836c52e0460ab509ccaea71b6a Author: chunzhouyu Commit: chunzhouyu capitalize the comment sentences --- company-keywords.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 1f49c97..971c44c 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -142,8 +142,8 @@ "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode - ;; 1. keywords ref: https://golang.org/ref/spec#Keywords - ;; 2. builtin functions and types ref: https://golang.org/pkg/built= in/ + ;; 1. Keywords ref: https://golang.org/ref/spec#Keywords + ;; 2. Builtin functions and types ref: https://golang.org/pkg/built= in/ "append" "bool" "break" "byte" "cap" "case" "chan" "close" "complex= " "complex128" "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse" "error" "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "im= ag" From MAILER-DAEMON Mon Nov 05 18:19:47 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9r-0002Vs-7u for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9f-0002Kb-4L for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9U-0004Kn-Vr for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:30 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-0004CE-NW for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id AAC6B204F2; Mon, 5 Nov 2018 18:19:24 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master c95a6b4 65/66: Release 0.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: c95a6b41d621de4253b77e512aa61fc0e75acddc Auto-Submitted: auto-generated Message-Id: <20181105231924.AAC6B204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:24 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:39 -0000 branch: master commit c95a6b41d621de4253b77e512aa61fc0e75acddc Author: Dmitry Gutov Commit: Dmitry Gutov Release 0.9.7 --- NEWS.md | 2 +- company.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 2a06363..d75973c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # History of user-visible changes =20 -## Next +## 2018-11-06 (0.9.7) =20 * For more sophisticated highlighting in non-prefix completion, a backen= d may now respond to a `match` request with a list of regions. See diff --git a/company.el b/company.el index f05aaf5..f60fa1b 100644 --- a/company.el +++ b/company.el @@ -5,7 +5,7 @@ ;; Author: Nikolaj Schumacher ;; Maintainer: Dmitry Gutov ;; URL: http://company-mode.github.io/ -;; Version: 0.9.6 +;; Version: 0.9.7 ;; Keywords: abbrev, convenience, matching ;; Package-Requires: ((emacs "24.3")) =20 From MAILER-DAEMON Mon Nov 05 18:19:47 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9r-0002W4-Ec for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9l-0002Qs-Mc for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9V-0004LH-Ba for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9V-0004Kl-0B for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id DE2932064E; Mon, 5 Nov 2018 18:19:24 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 1e22493 66/66: Merge commit 'c95a6b41d621de4253b77e512aa61fc0e75acddc' from company MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 1e2249360a5c93b241313b16b3b8c3a8fdb44652 Auto-Submitted: auto-generated Message-Id: <20181105231924.DE2932064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:24 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:46 -0000 branch: master commit 1e2249360a5c93b241313b16b3b8c3a8fdb44652 Merge: ff13541 c95a6b4 Author: Dmitry Gutov Commit: Dmitry Gutov Merge commit 'c95a6b41d621de4253b77e512aa61fc0e75acddc' from company --- packages/company/.travis.yml | 37 +++++---- packages/company/NEWS.md | 18 +++++ packages/company/company-capf.el | 69 ++++++++++------- packages/company/company-clang.el | 3 +- packages/company/company-cmake.el | 12 ++- packages/company/company-css.el | 10 ++- packages/company/company-gtags.el | 8 +- packages/company/company-ispell.el | 2 +- packages/company/company-keywords.el | 38 +++++++--- packages/company/company-nxml.el | 3 +- packages/company/company-tng.el | 13 +++- packages/company/company.el | 98 +++++++++++++++--------- packages/company/test/all.el | 4 +- packages/company/test/capf-tests.el | 140 +++++++++++++++++++++++++++++= ++++++ packages/company/test/cmake-tests.el | 44 +++++++++++ 15 files changed, 394 insertions(+), 105 deletions(-) diff --git a/packages/company/.travis.yml b/packages/company/.travis.yml index b8eb249..03933bf 100644 --- a/packages/company/.travis.yml +++ b/packages/company/.travis.yml @@ -1,26 +1,23 @@ -sudo: false - language: generic =20 -matrix: - include: - - env: EMACS=3Demacs24 - addons: - apt: - sources: [ { sourceline: 'ppa:cassou/emacs' } ] - packages: [ emacs24, emacs24-el ] - - env: EMACS=3Demacs25 - addons: - apt: - sources: [ { sourceline: 'ppa:kelleyk/emacs' } ] - packages: [ emacs25 ] - - env: EMACS=3Demacs-snapshot - addons: - apt: - sources: [ { sourceline: 'ppa:ubuntu-elisp/ppa' } ] - packages: [ emacs-snapshot ] +sudo: false + +env: + global: + - CURL=3D"curl -fsSkL --retry 9 --retry-delay 9" + matrix: + - EMACS_VERSION=3D24.5 + - EMACS_VERSION=3D25.3 + - EMACS_VERSION=3D26.1 + - EMACS_VERSION=3Dmaster + allow_failures: + - env: EMACS_VERSION=3Dmaster =20 -install: true +install: + - $CURL -O https://github.com/npostavs/emacs-travis/releases/download/= bins/emacs-bin-${EMACS_VERSION}.tar.gz + - tar -xaf emacs-bin-${EMACS_VERSION}.tar.gz -C / + - export EMACS=3D/tmp/emacs/bin/emacs + - $EMACS --version =20 script: make test-batch EMACS=3D${EMACS} diff --git a/packages/company/NEWS.md b/packages/company/NEWS.md index 520766f..d75973c 100644 --- a/packages/company/NEWS.md +++ b/packages/company/NEWS.md @@ -1,5 +1,23 @@ # History of user-visible changes =20 +## 2018-11-06 (0.9.7) + +* For more sophisticated highlighting in non-prefix completion, a backen= d may + now respond to a `match` request with a list of regions. See + `company-backends`. + ([#798](https://github.com/company-mode/company-mode/issues/798), + [#762](https://github.com/company-mode/company-mode/issues/762)) +* The `company-capf` backend will pick up on a `:company-match` metadata= element + on the capf function (similar to `:company-location` or `:company-doc-= buffer`) + and use it as a response to aforementioned `match` request. +* `company-cmake` supports completion inside string interpolations + ([#714](https://github.com/company-mode/company-mode/pull/714)). +* Workaround for the conflict between `inferior-python-mode`'s completio= n code + and `company-sort-by-occurrence`. +* In Emacs 26 and newer, `company-css` is removed from `company-backends= `. + `company-capf` is used instead. +* Same for `company-nxml`. + ## 2018-02-23 (0.9.6) =20 * Workaround for Emacs' ([bug#23980](https://debbugs.gnu.org/23980)) tri= ggered diff --git a/packages/company/company-capf.el b/packages/company/company-= capf.el index 06384c7..343edca 100644 --- a/packages/company/company-capf.el +++ b/packages/company/company-capf.el @@ -1,6 +1,6 @@ ;;; company-capf.el --- company-mode completion-at-point-functions backe= nd -*- lexical-binding: t -*- =20 -;; Copyright (C) 2013-2017 Free Software Foundation, Inc. +;; Copyright (C) 2013-2018 Free Software Foundation, Inc. =20 ;; Author: Stefan Monnier =20 @@ -24,7 +24,8 @@ ;; ;; The CAPF back-end provides a bridge to the standard ;; completion-at-point-functions facility, and thus can support any majo= r mode -;; that defines a proper completion function, including emacs-lisp-mode. +;; that defines a proper completion function, including emacs-lisp-mode, +;; css-mode and nxml-mode. =20 ;;; Code: =20 @@ -87,8 +88,8 @@ (let* ((table (nth 3 res)) (pred (plist-get (nthcdr 4 res) :predicate)) (meta (completion-metadata - (buffer-substring (nth 1 res) (nth 2 res)) - table pred)) + (buffer-substring (nth 1 res) (nth 2 res)) + table pred)) (sortfun (cdr (assq 'display-sort-function meta))) (candidates (completion-all-completions arg table pred (= length arg))) (last (last candidates)) @@ -111,18 +112,28 @@ (nth 3 res) (plist-get (nthcdr 4 res) :predicate))= )) (cdr (assq 'display-sort-function meta)))))) (`match - ;; Can't just use 0 when base-size (see above) is non-zero. - (let ((start (if (get-text-property 0 'face arg) - 0 - (next-single-property-change 0 'face arg)))) - (when start - ;; completions-common-part comes first, but we can't just look = for this - ;; value because it can be in a list. - (or - (let ((value (get-text-property start 'face arg))) - (text-property-not-all start (length arg) - 'face value arg)) - (length arg))))) + ;; Ask the for the `:company-match' function. If that doesn't help= , + ;; fallback to sniffing for face changes to get a suitable value. + (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-match)= )) + (if f (funcall f arg) + (let* ((match-start nil) (pos -1) + (prop-value nil) (faces nil) + (has-face-p nil) chunks + (limit (length arg))) + (while (< pos limit) + (setq pos + (if (< pos 0) 0 (next-property-change pos arg limit))= ) + (setq prop-value (or + (get-text-property pos 'face arg) + (get-text-property pos 'font-lock-face ar= g)) + faces (if (listp prop-value) prop-value (list prop-va= lue)) + has-face-p (memq 'completions-common-part faces)) + (cond ((and (not match-start) has-face-p) + (setq match-start pos)) + ((and match-start (not has-face-p)) + (push (cons match-start pos) chunks) + (setq match-start nil)))) + (nreverse chunks))))) (`duplicates t) (`no-cache t) ;Not much can be done here, as long as we handle ;non-prefix matches. @@ -154,17 +165,25 @@ (plist-get (nthcdr 4 (company--capf-data)) :company-require-match)) (`init nil) ;Don't bother: plenty of other ways to initialize t= he code. (`post-completion - (let* ((res (company--capf-data)) - (exit-function (plist-get (nthcdr 4 res) :exit-function)) - (table (nth 3 res)) - (pred (plist-get (nthcdr 4 res) :predicate))) - (if exit-function - ;; Follow the example of `completion--done'. - (funcall exit-function arg - (if (eq (try-completion arg table pred) t) - 'finished 'sole))))) + (company--capf-post-completion arg)) )) =20 +(defun company--capf-post-completion (arg) + (let* ((res (company--capf-data)) + (exit-function (plist-get (nthcdr 4 res) :exit-function)) + (table (nth 3 res)) + (pred (plist-get (nthcdr 4 res) :predicate))) + (if exit-function + ;; Follow the example of `completion--done'. + (funcall exit-function arg + ;; FIXME: Should probably use an additional heuristic: + ;; completion-at-point doesn't know when the user picke= d a + ;; particular candidate explicitly (it only checks whet= her + ;; futher completions exist). Whereas company user can = press + ;; RET (or use implicit completion with company-tng). + (if (eq (try-completion arg table pred) t) + 'finished 'sole))))) + (provide 'company-capf) =20 ;;; company-capf.el ends here diff --git a/packages/company/company-clang.el b/packages/company/company= -clang.el index 90a372e..962db1e 100644 --- a/packages/company/company-clang.el +++ b/packages/company/company-clang.el @@ -183,11 +183,12 @@ or automatically through a custom `company-clang-pr= efix-guesser'." (let* ((buf (get-buffer-create company-clang--error-buffer-name)) (cmd (concat company-clang-executable " " (mapconcat 'identity = args " "))) (pattern (format company-clang--completion-pattern "")) + (message-truncate-lines t) (err (if (re-search-forward pattern nil t) (buffer-substring-no-properties (point-min) (1- (match-beginning 0= ))) ;; Warn the user more aggressively if no match was found= . - (message "clang failed with error %d:\n%s" res cmd) + (message "clang failed with error %d: %s" res cmd) (buffer-string)))) =20 (with-current-buffer buf diff --git a/packages/company/company-cmake.el b/packages/company/company= -cmake.el index 010df32..1bfb20b 100644 --- a/packages/company/company-cmake.el +++ b/packages/company/company-cmake.el @@ -1,6 +1,6 @@ ;;; company-cmake.el --- company-mode completion backend for CMake =20 -;; Copyright (C) 2013-2014 Free Software Foundation, Inc. +;; Copyright (C) 2013-2014, 2017-2018 Free Software Foundation, Inc. =20 ;; Author: Chen Bin ;; Version: 0.2 @@ -177,6 +177,13 @@ They affect which types of symbols we get completion= candidates for.") (buffer-substring-no-properties (line-beginning-position) (point-max)))))) =20 +(defun company-cmake-prefix-dollar-brace-p () + "Test if the current symbol follows ${." + (save-excursion + (skip-syntax-backward "w_") + (and (eq (char-before (point)) ?\{) + (eq (char-before (1- (point))) ?$)))) + (defun company-cmake (command &optional arg &rest ignored) "`company-mode' completion backend for CMake. CMake is a cross-platform, open-source make system." @@ -187,7 +194,8 @@ CMake is a cross-platform, open-source make system." (unless company-cmake-executable (error "Company found no cmake executable")))) (prefix (and (memq major-mode company-cmake-modes) - (not (company-in-string-or-comment)) + (or (not (company-in-string-or-comment)) + (company-cmake-prefix-dollar-brace-p)) (company-grab-symbol))) (candidates (company-cmake--candidates arg)) (meta (company-cmake--meta arg)) diff --git a/packages/company/company-css.el b/packages/company/company-c= ss.el index cf8c683..d3ece74 100644 --- a/packages/company/company-css.el +++ b/packages/company/company-css.el @@ -1,6 +1,6 @@ ;;; company-css.el --- company-mode completion backend for css-mode -*-= lexical-binding: t -*- =20 -;; Copyright (C) 2009, 2011, 2014 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2011, 2014, 2018 Free Software Foundation, Inc. =20 ;; Author: Nikolaj Schumacher =20 @@ -20,6 +20,8 @@ ;; along with GNU Emacs. If not, see . =20 ;;; Commentary: +;; +;; In Emacs >=3D 26, company-capf is used instead. =20 ;;; Code: =20 @@ -422,7 +424,8 @@ Returns \"\" if no property found, but feasible at th= is position." (string=3D (web-mode-language-at-pos) "css"))) (or (company-grab company-css-tag-regexp 1) (company-grab company-css-pseudo-regexp 1) - (company-grab company-css-property-value-regexp 2) + (company-grab company-css-property-value-regexp 2 + (line-beginning-position)) (company-css-grab-property)))) (candidates (cond @@ -430,7 +433,8 @@ Returns \"\" if no property found, but feasible at th= is position." (all-completions arg company-css-html-tags)) ((company-grab company-css-pseudo-regexp 1) (all-completions arg company-css-pseudo-classes)) - ((company-grab company-css-property-value-regexp 2) + ((company-grab company-css-property-value-regexp 2 + (line-beginning-position)) (all-completions arg (company-css-property-values (company-grab company-css-property-value-regexp= 1)))) diff --git a/packages/company/company-gtags.el b/packages/company/company= -gtags.el index 02513ca..2a85f23 100644 --- a/packages/company/company-gtags.el +++ b/packages/company/company-gtags.el @@ -33,15 +33,15 @@ "Completion backend for GNU Global." :group 'company) =20 +(define-obsolete-variable-alias + 'company-gtags-gnu-global-program-name + 'company-gtags-executable "earlier") + (defcustom company-gtags-executable (executable-find "global") "Location of GNU global executable." :type 'string) =20 -(define-obsolete-variable-alias - 'company-gtags-gnu-global-program-name - 'company-gtags-executable "earlier") - (defcustom company-gtags-insert-arguments t "When non-nil, insert function arguments as a template after completio= n." :type 'boolean diff --git a/packages/company/company-ispell.el b/packages/company/compan= y-ispell.el index c275bbe..ed658f2 100644 --- a/packages/company/company-ispell.el +++ b/packages/company/company-ispell.el @@ -53,7 +53,7 @@ If nil, use `ispell-complete-word-dict'." (company-ispell--lookup-words "WHATEVER") (setq company-ispell-available t)) (error - (message "Company: ispell-look-command not found") + (message "Company-Ispell: %s" (error-message-string err)) (setq company-ispell-available nil)))) company-ispell-available) =20 diff --git a/packages/company/company-keywords.el b/packages/company/comp= any-keywords.el index 414c7b0..b6dfd1d 100644 --- a/packages/company/company-keywords.el +++ b/packages/company/company-keywords.el @@ -141,6 +141,16 @@ "sum_suffix" "system_clock" "tan" "tanh" "target" "template" "then= " "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) + (go-mode + ;; 1. Keywords ref: https://golang.org/ref/spec#Keywords + ;; 2. Builtin functions and types ref: https://golang.org/pkg/built= in/ + "append" "bool" "break" "byte" "cap" "case" "chan" "close" "complex= " "complex128" + "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse" "error" + "fallthrough" "false" "float32" "float64" "for" "func" "go" "goto" = "if" "imag" + "import" "int" "int16" "int32" "int64" "int8" "interface" "len" "ma= ke" + "map" "new" "nil" "package" "panic" "print" "println" "range" "real= " "recover" + "return" "rune" "select" "string" "struct" "switch" "true" "type" "= uint" "uint16" + "uint32" "uint64" "uint8" "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" @@ -149,9 +159,12 @@ "return" "short" "static" "strictfp" "super" "switch" "synchronized= " "this" "throw" "throws" "transient" "try" "void" "volatile" "while"= ) (javascript-mode - "break" "catch" "const" "continue" "delete" "do" "else" "export" "f= or" - "function" "if" "import" "in" "instanceOf" "label" "let" "new" "ret= urn" - "switch" "this" "throw" "try" "typeof" "var" "void" "while" "with" = "yield") + ;; https://tc39.github.io/ecma262/ + async, static and undefined + "async" "await" "break" "case" "catch" "class" "const" "continue" + "debugger" "default" "delete" "do" "else" "enum" "export" "extends"= "false" + "finally" "for" "function" "if" "import" "in" "instanceof" "let" "n= ew" + "null" "return" "static" "super" "switch" "this" "throw" "true" "tr= y" + "typeof" "undefined" "var" "void" "while" "with" "yield") (kotlin-mode "abstract" "annotation" "as" "break" "by" "catch" "class" "companio= n" "const" "constructor" "continue" "data" "do" "else" "enum" "false" = "final" @@ -209,9 +222,11 @@ "print" "private" "protected" "public" "require" "require_once" "re= turn" "static" "switch" "this" "throw" "try" "unset" "use" "var" "while" = "xor") (python-mode - "and" "assert" "break" "class" "continue" "def" "del" "elif" "else" - "except" "exec" "finally" "for" "from" "global" "if" "import" "in" = "is" - "lambda" "not" "or" "pass" "print" "raise" "return" "try" "while" "= yield") + ;; https://docs.python.org/3/reference/lexical_analysis.html#keywor= ds + "False" "None" "True" "and" "as" "assert" "break" "class" "continue= " "def" + "del" "elif" "else" "except" "exec" "finally" "for" "from" "global"= "if" + "import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" "print" "r= aise" + "return" "try" "while" "with" "yield") (ruby-mode "BEGIN" "END" "alias" "and" "begin" "break" "case" "class" "def" "= defined?" "do" "else" "elsif" "end" "ensure" "false" "for" "if" "in" "module= " @@ -219,10 +234,6 @@ "then" "true" "undef" "unless" "until" "when" "while" "yield") ;; From https://doc.rust-lang.org/grammar.html#keywords ;; but excluding unused reserved words: https://www.reddit.com/r/rus= t/comments/34fq0k/is_there_a_good_list_of_rusts_keywords/cqucvnj - (go-mode - "break" "case" "chan" "const" "continue" "default" "defer" "else" "= fallthrough" - "for" "func" "go" "goto" "if" "import" "interface" "map" "package" = "range" - "return" "select" "struct" "switch" "type" "var") (rust-mode "Self" "as" "box" "break" "const" "continue" "crate" "else" "enum" "extern= " @@ -255,12 +266,19 @@ "otherwise" "quote" "return" "switch" "throw" "true" "try" "type" "typealias" "using" "while" ) + ;; From https://github.com/apache/thrift/blob/master/contrib/thrift.= el + (thrift-mode + "binary" "bool" "byte" "const" "double" "enum" "exception" "extends= " + "i16" "i32" "i64" "include" "list" "map" "oneway" "optional" "requi= red" + "service" "set" "string" "struct" "throws" "typedef" "void" + ) ;; aliases (js2-mode . javascript-mode) (js2-jsx-mode . javascript-mode) (espresso-mode . javascript-mode) (js-mode . javascript-mode) (js-jsx-mode . javascript-mode) + (rjsx-mode . javascript-mode) (cperl-mode . perl-mode) (jde-mode . java-mode) (ess-julia-mode . julia-mode) diff --git a/packages/company/company-nxml.el b/packages/company/company-= nxml.el index 5afa00e..36ff1ce 100644 --- a/packages/company/company-nxml.el +++ b/packages/company/company-nxml.el @@ -1,6 +1,6 @@ ;;; company-nxml.el --- company-mode completion backend for nxml-mode =20 -;; Copyright (C) 2009-2011, 2013 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011, 2013, 2018 Free Software Foundation, Inc. =20 ;; Author: Nikolaj Schumacher =20 @@ -22,6 +22,7 @@ =20 ;;; Commentary: ;; +;; In Emacs >=3D 26, company-capf is used instead. =20 ;;; Code: =20 diff --git a/packages/company/company-tng.el b/packages/company/company-t= ng.el index 46592da..a1d7173 100644 --- a/packages/company/company-tng.el +++ b/packages/company/company-tng.el @@ -102,7 +102,8 @@ confirm the selection and finish the completion." (when (and company-selection-changed (not (company--company-command-p (this-command-keys)))) (company--unread-this-command-keys) - (setq this-command 'company-complete-selection))))) + (setq this-command 'company-complete-selection) + (advice-add 'company-call-backend :before-until 'company-tng--sup= ress-post-completion))))) =20 ;;;###autoload (defun company-tng-configure-default () @@ -159,5 +160,15 @@ made explicitly (i.e. `company-selection-changed' is= true)" (setf (nth 3 args) nil)) args) =20 +(defun company-tng--supress-post-completion (command &rest args) + "Installed as a :before-until advice on `company-call-backend' and +prevents the 'post-completion command from being delivered to the backen= d +for the next iteration. post-completion do things like expand snippets +which are undesirable because completions are implicit in company-tng an= d +visible side-effects after the completion are surprising." + (when (eq command 'post-completion) + (advice-remove 'company-call-backend 'company-tng--supress-post-comp= letion) + t)) + (provide 'company-tng) ;;; company-tng.el ends here diff --git a/packages/company/company.el b/packages/company/company.el index 4a86c83..4718203 100644 --- a/packages/company/company.el +++ b/packages/company/company.el @@ -5,7 +5,7 @@ ;; Author: Nikolaj Schumacher ;; Maintainer: Dmitry Gutov ;; URL: http://company-mode.github.io/ -;; Version: 0.9.6 +;; Version: 0.9.7 ;; Keywords: abbrev, convenience, matching ;; Package-Requires: ((emacs "24.3")) =20 @@ -44,7 +44,9 @@ ;; Here is a simple example completing "foo": ;; ;; (defun company-my-backend (command &optional arg &rest ignored) +;; (interactive (list 'interactive)) ;; (pcase command +;; (`interactive (company-begin-backend 'company-my-backend)) ;; (`prefix (company-grab-symbol)) ;; (`candidates (list "foobar" "foobaz" "foobarbaz")) ;; (`meta (format "This value is named %s" arg)))) @@ -322,7 +324,10 @@ This doesn't include the margins and the scroll bar.= " (defcustom company-backends `(,@(unless (version< "24.3.51" emacs-versio= n) (list 'company-elisp)) company-bbdb - company-nxml company-css + ,@(unless (version<=3D "26" emacs-version) + (list 'company-nxml)) + ,@(unless (version<=3D "26" emacs-version) + (list 'company-css)) company-eclim company-semantic company-cla= ng company-xcode company-cmake company-capf @@ -398,10 +403,13 @@ be kept if they have different annotations. For th= at to work properly, backends should store the related information on candidates using text properties. =20 -`match': The second argument is a completion candidate. Return the inde= x -after the end of text matching `prefix' within the candidate string. It -will be used when rendering the popup. This command only makes sense fo= r -backends that provide non-prefix completion. +`match': The second argument is a completion candidate. Return a positi= ve +integer, the index after the end of text matching `prefix' within the +candidate string. Alternatively, return a list of (CHUNK-START +. CHUNK-END) elements, where CHUNK-START and CHUNK-END are indexes withi= n +the candidate string. The corresponding regions are be used when render= ing +the popup. This command only makes sense for backends that provide +non-prefix completion. =20 `require-match': If this returns t, the user is not allowed to enter anything not offered as a candidate. Please don't use that value in nor= mal @@ -600,7 +608,8 @@ treated as if it was on this list." =20 (defcustom company-continue-commands '(not save-buffer save-some-buffers save-buffers-kill-terminal - save-buffers-kill-emacs) + save-buffers-kill-emacs + completion-at-point) "A list of commands that are allowed during completion. If this is t, or if `company-begin-commands' is t, any command is allowe= d. Otherwise, the value must be a list of symbols. If it starts with `not'= , @@ -1358,10 +1367,18 @@ Keywords and function definition names are ignore= d." noccurs))) =20 (defun company--occurrence-predicate () + (defvar comint-last-prompt) (let ((beg (match-beginning 0)) - (end (match-end 0))) + (end (match-end 0)) + (comint-last-prompt (bound-and-true-p comint-last-prompt))) (save-excursion (goto-char end) + ;; Workaround for python-shell-completion-at-point's behavior: + ;; https://github.com/company-mode/company-mode/issues/759 + ;; https://github.com/company-mode/company-mode/issues/549 + (when (derived-mode-p 'inferior-python-mode) + (let ((lbp (line-beginning-position))) + (setq comint-last-prompt (cons lbp lbp)))) (and (not (memq (get-text-property (1- (point)) 'face) '(font-lock-function-name-face font-lock-keyword-face))) @@ -1618,7 +1635,6 @@ prefix match (same case) will be prioritized." ;; `company-completion-finished-hook' in that case, with right arg= ument. (if (stringp result) (let ((company-backend backend)) - (company-call-backend 'pre-completion result) (run-hook-with-args 'company-completion-finished-hook result= ) (company-call-backend 'post-completion result)) (run-hook-with-args 'company-completion-cancelled-hook result)))= ) @@ -2378,11 +2394,13 @@ If SHOW-VERSION is non-nil, show the version in t= he echo area." cc annotations) (when (or (stringp prefix) (consp prefix)) (let ((company-backend backend)) - (setq cc (company-call-backend 'candidates prefix) - annotations - (mapcar - (lambda (c) (cons c (company-call-backend 'annotation c))= ) - cc)))) + (condition-case nil + (setq cc (company-call-backend 'candidates (company--prefix-= str prefix)) + annotations + (mapcar + (lambda (c) (cons c (company-call-backend 'annotation= c))) + cc)) + (error (setq annotations 'error))))) (pop-to-buffer (get-buffer-create "*company-diag*")) (setq buffer-read-only nil) (erase-buffer) @@ -2401,11 +2419,13 @@ If SHOW-VERSION is non-nil, show the version in t= he echo area." (insert "\n") (insert (message "Completions:")) (unless cc (insert " none")) - (save-excursion - (dolist (c annotations) - (insert "\n " (prin1-to-string (car c))) - (when (cdr c) - (insert " " (prin1-to-string (cdr c)))))) + (if (eq annotations 'error) + (insert "(error fetching)") + (save-excursion + (dolist (c annotations) + (insert "\n " (prin1-to-string (car c))) + (when (cdr c) + (insert " " (prin1-to-string (cdr c))))))) (special-mode))) =20 ;;; pseudo-tooltip ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;;;;;; @@ -2490,7 +2510,6 @@ If SHOW-VERSION is non-nil, show the version in the= echo area." (- width (length annot= ation))) annotation)) right))) - (setq common (+ (min common width) margin)) (setq width (+ width margin (length right))) =20 (font-lock-append-text-property 0 width 'mouse-face @@ -2502,11 +2521,17 @@ If SHOW-VERSION is non-nil, show the version in t= he echo area." 'company-tooltip-annotation-se= lection 'company-tooltip-annotation) line)) - (font-lock-prepend-text-property margin common 'face - (if selected - 'company-tooltip-common-selecti= on - 'company-tooltip-common) - line) + (cl-loop + with width =3D (- width (length right)) + for (comp-beg . comp-end) in (if (integerp common) `((0 . ,common))= common) + for inline-beg =3D (+ margin comp-beg) + for inline-end =3D (min (+ margin comp-end) width) + when (< inline-beg width) + do (font-lock-prepend-text-property inline-beg inline-end 'face + (if selected + 'company-tooltip-common-sel= ection + 'company-tooltip-common) + line)) (when (let ((re (funcall company-search-regexp-function company-search-string))) (and (not (string=3D re "")) @@ -2802,7 +2827,6 @@ Returns a negative number if the tooltip should be = displayed above point." =20 (defun company-pseudo-tooltip-show (row column selection) (company-pseudo-tooltip-hide) - (save-excursion =20 (let* ((height (company--pseudo-tooltip-height)) above) @@ -2811,15 +2835,17 @@ Returns a negative number if the tooltip should b= e displayed above point." (setq row (+ row height -1) above t)) =20 - (let* ((nl (< (move-to-window-line row) row)) - (beg (point)) - (end (save-excursion - (move-to-window-line (+ row (abs height))) - (point))) - (ov (make-overlay beg end nil t)) - (args (list (mapcar 'company-plainify - (company-buffer-lines beg end)) - column nl above))) + (let (nl beg end ov args) + (save-excursion + (setq nl (< (move-to-window-line row) row) + beg (point) + end (save-excursion + (move-to-window-line (+ row (abs height))) + (point)) + ov (make-overlay beg end nil t) + args (list (mapcar 'company-plainify + (company-buffer-lines beg end)) + column nl above))) =20 (setq company-pseudo-tooltip-overlay ov) (overlay-put ov 'company-replacement-args args) @@ -2830,7 +2856,7 @@ Returns a negative number if the tooltip should be = displayed above point." (overlay-put ov 'company-width (string-width (car lines)))) =20 (overlay-put ov 'company-column column) - (overlay-put ov 'company-height height))))) + (overlay-put ov 'company-height height)))) =20 (defun company-pseudo-tooltip-show-at-point (pos column-offset) (let* ((col-row (company--col-row pos)) diff --git a/packages/company/test/all.el b/packages/company/test/all.el index 6d64a62..3d7758f 100644 --- a/packages/company/test/all.el +++ b/packages/company/test/all.el @@ -25,4 +25,6 @@ (require 'ert) =20 (dolist (test-file (directory-files company-test-path t "-tests.el$")) - (load test-file nil t)) + (unless (and (=3D emacs-major-version 24) + (equal (file-name-base test-file) "capf-tests")) + (load test-file nil t))) diff --git a/packages/company/test/capf-tests.el b/packages/company/test/= capf-tests.el new file mode 100644 index 0000000..c8d4202 --- /dev/null +++ b/packages/company/test/capf-tests.el @@ -0,0 +1,140 @@ +;;; capf-tests.el --- company tests for the company-capf backend -*- le= xical-binding: t; -*- + +;; Copyright (C) 2018 Free Software Foundation, Inc. + +;; Author: Jo=C3=A3o T=C3=A1vora +;; Keywords:=20 + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see = . + +;;; Commentary: + +;;=20 + +;;; Code: + +(require 'company-tests) +(require 'company-capf) + +(defmacro company-capf-with-buffer (contents &rest body) + (declare (indent 0) (debug (sexp &rest form))) + `(with-temp-buffer + (insert ,contents) + (emacs-lisp-mode) + (re-search-backward "|") + (replace-match "") + (let ((completion-at-point-functions '(elisp-completion-at-point)) + (company-backends '(company-capf))) + ,@body))) + +(ert-deftest company-basic-capf () + "Test basic `company-capf' support." + (company-capf-with-buffer + "(with-current-buffer|)" + (company-mode) + (company-complete) + (should company-candidates))) + +(ert-deftest company-non-prefix-capf () + "Test non-prefix `company-capf' in elisp" + (company-capf-with-buffer + "(w-c-b|)" + (company-mode) + (company-complete) + (should company-candidates) + (should (member "with-current-buffer" company-candidates)))) + +(ert-deftest company-basic-capf-highlighting () + "Test basic `company-capf' support, with basic prefix completion." + (company-capf-with-buffer + "(with|)" + (company-mode) + (company-complete) + (should company-candidates) + (let* ((cand (car (member "with-current-buffer" company-candidates))= ) + (render + (and cand + (company-fill-propertize cand nil (length cand) nil nil= nil)))) + ;; remove `font-lock-face' and `mouse-face' text properties that a= ren't + ;; relevant to our test + (remove-list-of-text-properties + 0 (length cand) '(font-lock-face mouse-face) render) + (should + (ert-equal-including-properties + render + #("with-current-buffer" + 0 4 (face (company-tooltip-common company-tooltip)) ; "with" + 4 19 (face (company-tooltip)))))))) + + + +;; Re. "perfect" highlighting of the non-prefix in company-capf matches,= it is +;; only working-out-of-the box (i.e. without the `:company-match' meta) = in +;; recent Emacsen containing the following commit. The two tests that f= ollow +;; reflect that. +;; +;; commit 325ef57b0e3977f9509f1049c826999e8b7c226d +;; Author: Stefan Monnier +;; Date: Tue Nov 7 12:17:34 2017 -0500 + +(ert-deftest company-non-prefix-fancy-capf-highlighting () + "Test highlighting for non-prefix `company-capf' in elisp" + (skip-unless (version<=3D "27.0" emacs-version)) + (company-capf-with-buffer + "(w-c-b|)" + (company-mode) + (company-complete) + (let* ((cand (car (member "with-current-buffer" company-candidates))= ) + (render + (and cand + (company-fill-propertize cand nil (length cand) nil nil= nil)))) + ;; remove `font-lock-face' and `mouse-face' text properties that a= ren't + ;; relevant to our test + (remove-list-of-text-properties + 0 (length cand) '(font-lock-face mouse-face) render) + (should + (ert-equal-including-properties + render + #("with-current-buffer" + 0 1 (face (company-tooltip-common company-tooltip)) ; "w" + 1 4 (face (company-tooltip)) ; "ith" + 4 6 (face (company-tooltip-common company-tooltip)) ; "-c" + 6 12 (face (company-tooltip)) ; "urren= t" + 12 14 (face (company-tooltip-common company-tooltip)) ; "-b" + 14 19 (face (company-tooltip)))))))) ; "uffer= " + +(ert-deftest company-non-prefix-modest-capf-highlighting () + "Test highlighting for non-prefix `company-capf' in elisp" + (skip-unless (version< emacs-version "27.0")) + (company-capf-with-buffer + "(w-c-b|)" + (company-mode) + (company-complete) + (let* ((cand (car (member "with-current-buffer" company-candidates))= ) + (render + (and cand + (company-fill-propertize cand nil (length cand) nil nil= nil)))) + ;; remove `font-lock-face' and `mouse-face' text properties that a= ren't + ;; relevant to our test + (remove-list-of-text-properties + 0 (length cand) '(font-lock-face mouse-face) render) + (should + (ert-equal-including-properties + render + #("with-current-buffer" + 0 14 (face (company-tooltip-common company-tooltip)); "with-cu= rrent-b" + 14 19 (face (company-tooltip)))))))) ; "uffer" + +(provide 'capf-tests) +;;; capf-tests.el ends here diff --git a/packages/company/test/cmake-tests.el b/packages/company/test= /cmake-tests.el new file mode 100644 index 0000000..52467cc --- /dev/null +++ b/packages/company/test/cmake-tests.el @@ -0,0 +1,44 @@ +;;; cmake-tests.el --- company-mode tests -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Free Software Foundation, Inc. + +;; Author: Zuogong Yue + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +(require 'company-tests) +(require 'company-cmake) + +(ert-deftest company-cmake-complete-in-string-prefix-quotes () + (with-temp-buffer + (insert "set(MyFlags \"${CMAKE_CXX_FLAGS_R") + (setq-local major-mode 'cmake-mode) + (should (equal (company-cmake 'prefix) + "CMAKE_CXX_FLAGS_R")))) + +(ert-deftest company-cmake-complete-in-string-more-prefix () + (with-temp-buffer + (insert "set(MyFlags \"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_R") + (setq-local major-mode 'cmake-mode) + (should (equal (company-cmake 'prefix) + "CMAKE_CXX_FLAGS_R")))) + +(ert-deftest company-cmake-complete-in-string-more-prefix-2 () + (with-temp-buffer + (insert "set(MyFlags \"${CMAKE_CXX_FLAGS} CMAKE_CXX_FLAGS_R") + (setq-local major-mode 'cmake-mode) + (should (equal (company-cmake 'prefix) + nil)))) From MAILER-DAEMON Mon Nov 05 18:19:49 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9t-0002Y8-IQ for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-00024M-9v for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9M-00045u-W1 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:20 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9M-00044t-M4 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:16 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 93719207DA; Mon, 5 Nov 2018 18:19:16 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master ffba418 26/66: Merge pull request #802 from wyuenho/update-keywords MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: ffba418877368c0242070061ca86ae5575cff127 Auto-Submitted: auto-generated Message-Id: <20181105231916.93719207DA@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:16 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:24 -0000 branch: master commit ffba418877368c0242070061ca86ae5575cff127 Merge: 779662f 270976b Author: Dmitry Gutov Commit: GitHub Merge pull request #802 from wyuenho/update-keywords =20 Update Javascript and Python keywords --- company-keywords.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 92ff369..2ba12fe 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -149,9 +149,12 @@ "return" "short" "static" "strictfp" "super" "switch" "synchronized= " "this" "throw" "throws" "transient" "try" "void" "volatile" "while"= ) (javascript-mode - "break" "catch" "const" "continue" "delete" "do" "else" "export" "f= or" - "function" "if" "import" "in" "instanceOf" "label" "let" "new" "ret= urn" - "switch" "this" "throw" "try" "typeof" "var" "void" "while" "with" = "yield") + ;; https://tc39.github.io/ecma262/ + async, static and undefined + "async" "await" "break" "case" "catch" "class" "const" "continue" + "debugger" "default" "delete" "do" "else" "enum" "export" "extends"= "false" + "finally" "for" "function" "if" "import" "in" "instanceof" "let" "n= ew" + "null" "return" "static" "super" "switch" "this" "throw" "true" "tr= y" + "typeof" "undefined" "var" "void" "while" "with" "yield") (kotlin-mode "abstract" "annotation" "as" "break" "by" "catch" "class" "companio= n" "const" "constructor" "continue" "data" "do" "else" "enum" "false" = "final" @@ -209,9 +212,11 @@ "print" "private" "protected" "public" "require" "require_once" "re= turn" "static" "switch" "this" "throw" "try" "unset" "use" "var" "while" = "xor") (python-mode - "and" "assert" "break" "class" "continue" "def" "del" "elif" "else" - "except" "exec" "finally" "for" "from" "global" "if" "import" "in" = "is" - "lambda" "not" "or" "pass" "print" "raise" "return" "try" "while" "= yield") + ;; https://docs.python.org/3/reference/lexical_analysis.html#keywor= ds + "False" "None" "True" "and" "as" "assert" "break" "class" "continue= " "def" + "del" "elif" "else" "except" "exec" "finally" "for" "from" "global"= "if" + "import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" "print" "r= aise" + "return" "try" "while" "with" "yield") (ruby-mode "BEGIN" "END" "alias" "and" "begin" "break" "case" "class" "def" "= defined?" "do" "else" "elsif" "end" "ensure" "false" "for" "if" "in" "module= " @@ -267,6 +272,7 @@ (espresso-mode . javascript-mode) (js-mode . javascript-mode) (js-jsx-mode . javascript-mode) + (rjsx-mode . javascript-mode) (cperl-mode . perl-mode) (jde-mode . java-mode) (ess-julia-mode . julia-mode) From MAILER-DAEMON Mon Nov 05 18:19:49 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9t-0002YJ-OS for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9f-0002Kd-4N for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9U-0004Kb-Rn for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:30 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-0004CC-Hn for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 802E82064E; Mon, 5 Nov 2018 18:19:24 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 5ab7f42 64/66: Merge pull request #838 from bet4it/restore-point MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 5ab7f42cb3ba75e80f0d8cadcdbf05bdffbd6b76 Auto-Submitted: auto-generated Message-Id: <20181105231924.802E82064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:24 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:39 -0000 branch: master commit 5ab7f42cb3ba75e80f0d8cadcdbf05bdffbd6b76 Merge: afbaad1 4fa5a37 Author: Dmitry Gutov Commit: GitHub Merge pull request #838 from bet4it/restore-point =20 Restore point before backends are called --- company.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/company.el b/company.el index 1259b6c..f05aaf5 100644 --- a/company.el +++ b/company.el @@ -2827,7 +2827,6 @@ Returns a negative number if the tooltip should be = displayed above point." =20 (defun company-pseudo-tooltip-show (row column selection) (company-pseudo-tooltip-hide) - (save-excursion =20 (let* ((height (company--pseudo-tooltip-height)) above) @@ -2836,15 +2835,17 @@ Returns a negative number if the tooltip should b= e displayed above point." (setq row (+ row height -1) above t)) =20 - (let* ((nl (< (move-to-window-line row) row)) - (beg (point)) - (end (save-excursion - (move-to-window-line (+ row (abs height))) - (point))) - (ov (make-overlay beg end nil t)) - (args (list (mapcar 'company-plainify - (company-buffer-lines beg end)) - column nl above))) + (let (nl beg end ov args) + (save-excursion + (setq nl (< (move-to-window-line row) row) + beg (point) + end (save-excursion + (move-to-window-line (+ row (abs height))) + (point)) + ov (make-overlay beg end nil t) + args (list (mapcar 'company-plainify + (company-buffer-lines beg end)) + column nl above))) =20 (setq company-pseudo-tooltip-overlay ov) (overlay-put ov 'company-replacement-args args) @@ -2855,7 +2856,7 @@ Returns a negative number if the tooltip should be = displayed above point." (overlay-put ov 'company-width (string-width (car lines)))) =20 (overlay-put ov 'company-column column) - (overlay-put ov 'company-height height))))) + (overlay-put ov 'company-height height)))) =20 (defun company-pseudo-tooltip-show-at-point (pos column-offset) (let* ((col-row (company--col-row pos)) From MAILER-DAEMON Mon Nov 05 18:19:50 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9t-0002Yd-UG for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9S-00024t-Ae for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004CL-4b for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9N-000487-UN for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id D326C2064E; Mon, 5 Nov 2018 18:19:17 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master f31d284 33/66: Mention #798 in NEWS.md MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: f31d284dd61361d1b6f47e362e7b52cd957a4b76 Auto-Submitted: auto-generated Message-Id: <20181105231917.D326C2064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:17 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:25 -0000 branch: master commit f31d284dd61361d1b6f47e362e7b52cd957a4b76 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Mention #798 in NEWS.md =20 * NEWS.md (Next): Mention improvements of #798. --- NEWS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NEWS.md b/NEWS.md index fbecf7d..2a06363 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,14 @@ =20 ## Next =20 +* For more sophisticated highlighting in non-prefix completion, a backen= d may + now respond to a `match` request with a list of regions. See + `company-backends`. + ([#798](https://github.com/company-mode/company-mode/issues/798), + [#762](https://github.com/company-mode/company-mode/issues/762)) +* The `company-capf` backend will pick up on a `:company-match` metadata= element + on the capf function (similar to `:company-location` or `:company-doc-= buffer`) + and use it as a response to aforementioned `match` request. * `company-cmake` supports completion inside string interpolations ([#714](https://github.com/company-mode/company-mode/pull/714)). * Workaround for the conflict between `inferior-python-mode`'s completio= n code From MAILER-DAEMON Mon Nov 05 18:19:50 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9u-0002ZA-6U for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9S-00025E-J4 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004CW-4m for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9O-00048d-FB for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 640E92097A; Mon, 5 Nov 2018 18:19:18 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master d0fab46 36/66: Properly fix #809 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: d0fab46fade0555f7b4c28d73fc593127ff09d09 Auto-Submitted: auto-generated Message-Id: <20181105231918.640E92097A@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:18 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:26 -0000 branch: master commit d0fab46fade0555f7b4c28d73fc593127ff09d09 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Properly fix #809 =20 * company-capf.el (company-capf): Return nil when no faces were sniff= ed. =20 * test/capf-tests.el (company-basic-capf-highlighting): New test. --- company-capf.el | 2 +- test/capf-tests.el | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/company-capf.el b/company-capf.el index 409687b..343edca 100644 --- a/company-capf.el +++ b/company-capf.el @@ -133,7 +133,7 @@ ((and match-start (not has-face-p)) (push (cons match-start pos) chunks) (setq match-start nil)))) - (if chunks (nreverse chunks) (cons 0 (length arg))))))) + (nreverse chunks))))) (`duplicates t) (`no-cache t) ;Not much can be done here, as long as we handle ;non-prefix matches. diff --git a/test/capf-tests.el b/test/capf-tests.el index b70131c..c8d4202 100644 --- a/test/capf-tests.el +++ b/test/capf-tests.el @@ -55,6 +55,30 @@ (should company-candidates) (should (member "with-current-buffer" company-candidates)))) =20 +(ert-deftest company-basic-capf-highlighting () + "Test basic `company-capf' support, with basic prefix completion." + (company-capf-with-buffer + "(with|)" + (company-mode) + (company-complete) + (should company-candidates) + (let* ((cand (car (member "with-current-buffer" company-candidates))= ) + (render + (and cand + (company-fill-propertize cand nil (length cand) nil nil= nil)))) + ;; remove `font-lock-face' and `mouse-face' text properties that a= ren't + ;; relevant to our test + (remove-list-of-text-properties + 0 (length cand) '(font-lock-face mouse-face) render) + (should + (ert-equal-including-properties + render + #("with-current-buffer" + 0 4 (face (company-tooltip-common company-tooltip)) ; "with" + 4 19 (face (company-tooltip)))))))) + + + ;; Re. "perfect" highlighting of the non-prefix in company-capf matches,= it is ;; only working-out-of-the box (i.e. without the `:company-match' meta) = in ;; recent Emacsen containing the following commit. The two tests that f= ollow From MAILER-DAEMON Mon Nov 05 18:19:50 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9u-0002ZP-FF for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00028W-L7 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004EH-I7 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-0004CE-3Q for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id D4944209EB; Mon, 5 Nov 2018 18:19:20 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 7e20ee4 43/66: update go-mode's keywords sort MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, chunzhouyu In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 7e20ee46b7d12b12fdf4b954d60c0c09fb7ed7ec Auto-Submitted: auto-generated Message-Id: <20181105231920.D4944209EB@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:20 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:27 -0000 branch: master commit 7e20ee46b7d12b12fdf4b954d60c0c09fb7ed7ec Author: chunzhouyu Commit: chunzhouyu update go-mode's keywords sort --- company-keywords.el | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index c751190..c5d3c9c 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -142,17 +142,9 @@ "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode - ;; from https://golang.org/ref/spec#Keywords - "break" "case" "chan" "const" "continue" "default" "defer" "else" "= fallthrough" - "for" "func" "go" "goto" "if" "import" "interface" "map" "package" = "range" - "return" "select" "struct" "switch" "type" "var" - ;; basic type keywords, from https://golang.org/pkg/go/types/ - "bool" - "int" "int8" "int16" "int32" "int64" - "uint" "uint8" "uint16" "uint32" "uint64" "uintptr" - "float32" "float64" - "complex64" "complex128" - "string") + "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" "default" "defer" "else" "fallthrough" "float32" "float64" + "for" "func" "go" "goto" "if" "import" "int" "int8" "int16" "int32"= "int64" "interface" "map" "package" "range" + "return" "select" "string" "struct" "switch" "type" "uint" "uint8" = "uint16" "uint32" "uint64" "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" From MAILER-DAEMON Mon Nov 05 18:19:50 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9u-0002Zj-KQ for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9a-0002Gq-Ds for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9T-0004HW-88 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:26 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9S-00045f-Ux for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:23 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id E43DD207D5; Mon, 5 Nov 2018 18:19:22 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 2bcaa2e 55/66: add some refs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, chunzhouyu In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 2bcaa2ef6490513aef0f599f3da61f6f974b9b52 Auto-Submitted: auto-generated Message-Id: <20181105231922.E43DD207D5@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:22 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:33 -0000 branch: master commit 2bcaa2ef6490513aef0f599f3da61f6f974b9b52 Author: chunzhouyu Commit: chunzhouyu add some refs --- company-keywords.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 916cd58..1f49c97 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -142,12 +142,14 @@ "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode - "append" "bool" "break" "cap" "case" "chan" "close" "complex" "comp= lex128" - "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse" + ;; 1. keywords ref: https://golang.org/ref/spec#Keywords + ;; 2. builtin functions and types ref: https://golang.org/pkg/built= in/ + "append" "bool" "break" "byte" "cap" "case" "chan" "close" "complex= " "complex128" + "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse" "error" "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "im= ag" "import" "int" "int16" "int32" "int64" "int8" "interface" "len" "ma= ke" "map" "new" "package" "panic" "print" "println" "range" "real" "rec= over" - "return" "select" "string" "struct" "switch" "type" "uint" "uint16" + "return" "rune" "select" "string" "struct" "switch" "type" "uint" "= uint16" "uint32" "uint64" "uint8" "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" From MAILER-DAEMON Mon Nov 05 18:19:51 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9u-0002a4-Rf for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9c-0002Gu-AL for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9U-0004Jj-F0 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-0004CT-5s for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 265972064E; Mon, 5 Nov 2018 18:19:24 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master afbaad1 62/66: company-ispell-available: Better error message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: afbaad1527e6bd315237fa6db2e0caedc61e495d Auto-Submitted: auto-generated Message-Id: <20181105231924.265972064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:24 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:33 -0000 branch: master commit afbaad1527e6bd315237fa6db2e0caedc61e495d Author: Dmitry Gutov Commit: Dmitry Gutov company-ispell-available: Better error message =20 Closes #836 --- company-ispell.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/company-ispell.el b/company-ispell.el index c275bbe..ed658f2 100644 --- a/company-ispell.el +++ b/company-ispell.el @@ -53,7 +53,7 @@ If nil, use `ispell-complete-word-dict'." (company-ispell--lookup-words "WHATEVER") (setq company-ispell-available t)) (error - (message "Company: ispell-look-command not found") + (message "Company-Ispell: %s" (error-message-string err)) (setq company-ispell-available nil)))) company-ispell-available) =20 From MAILER-DAEMON Mon Nov 05 18:19:51 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9v-0002ay-KA for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9S-00024p-9m for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004CM-7O for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9O-00048U-9w for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:18 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 3A5C1207DA; Mon, 5 Nov 2018 18:19:18 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 24bbc85 35/66: Fix #809 by looking up `face' as well MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 24bbc85080332c613fbb390af08ff3b76c011b13 Auto-Submitted: auto-generated Message-Id: <20181105231918.3A5C1207DA@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:18 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:25 -0000 branch: master commit 24bbc85080332c613fbb390af08ff3b76c011b13 Author: Dmitry Gutov Commit: Dmitry Gutov Fix #809 by looking up `face' as well --- company-capf.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/company-capf.el b/company-capf.el index 7e76dfc..409687b 100644 --- a/company-capf.el +++ b/company-capf.el @@ -123,7 +123,9 @@ (while (< pos limit) (setq pos (if (< pos 0) 0 (next-property-change pos arg limit))= ) - (setq prop-value (get-text-property pos 'font-lock-face arg= ) + (setq prop-value (or + (get-text-property pos 'face arg) + (get-text-property pos 'font-lock-face ar= g)) faces (if (listp prop-value) prop-value (list prop-va= lue)) has-face-p (memq 'completions-common-part faces)) (cond ((and (not match-start) has-face-p) From MAILER-DAEMON Mon Nov 05 18:19:52 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9v-0002bP-TE for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9U-00028S-Ig for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004DL-B2 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:24 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9O-00045f-S3 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:20 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 92053209DE; Mon, 5 Nov 2018 18:19:18 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 1f836b6 37/66: Merge pull request #810 from joaotavora/master MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 1f836b6b16d313bddef2cccebf49f42d36c58e28 Auto-Submitted: auto-generated Message-Id: <20181105231918.92053209DE@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:18 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:27 -0000 branch: master commit 1f836b6b16d313bddef2cccebf49f42d36c58e28 Merge: 24bbc85 d0fab46 Author: Dmitry Gutov Commit: GitHub Merge pull request #810 from joaotavora/master =20 Properly fix #809 --- company-capf.el | 2 +- test/capf-tests.el | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/company-capf.el b/company-capf.el index 409687b..343edca 100644 --- a/company-capf.el +++ b/company-capf.el @@ -133,7 +133,7 @@ ((and match-start (not has-face-p)) (push (cons match-start pos) chunks) (setq match-start nil)))) - (if chunks (nreverse chunks) (cons 0 (length arg))))))) + (nreverse chunks))))) (`duplicates t) (`no-cache t) ;Not much can be done here, as long as we handle ;non-prefix matches. diff --git a/test/capf-tests.el b/test/capf-tests.el index b70131c..c8d4202 100644 --- a/test/capf-tests.el +++ b/test/capf-tests.el @@ -55,6 +55,30 @@ (should company-candidates) (should (member "with-current-buffer" company-candidates)))) =20 +(ert-deftest company-basic-capf-highlighting () + "Test basic `company-capf' support, with basic prefix completion." + (company-capf-with-buffer + "(with|)" + (company-mode) + (company-complete) + (should company-candidates) + (let* ((cand (car (member "with-current-buffer" company-candidates))= ) + (render + (and cand + (company-fill-propertize cand nil (length cand) nil nil= nil)))) + ;; remove `font-lock-face' and `mouse-face' text properties that a= ren't + ;; relevant to our test + (remove-list-of-text-properties + 0 (length cand) '(font-lock-face mouse-face) render) + (should + (ert-equal-including-properties + render + #("with-current-buffer" + 0 4 (face (company-tooltip-common company-tooltip)) ; "with" + 4 19 (face (company-tooltip)))))))) + + + ;; Re. "perfect" highlighting of the non-prefix in company-capf matches,= it is ;; only working-out-of-the box (i.e. without the `:company-match' meta) = in ;; recent Emacsen containing the following commit. The two tests that f= ollow From MAILER-DAEMON Mon Nov 05 18:19:52 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9w-0002bc-4S for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9V-00029Q-94 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004Eu-Ox for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-0004C4-I7 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id 8224A2064E; Mon, 5 Nov 2018 18:19:21 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 3162aa2 47/66: Update company-keywords.el MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, cz <40715392+chunzhouyu@users.noreply.github.com> In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 3162aa246d0e25ec5477a4be6304c7ea0f064bee Auto-Submitted: auto-generated Message-Id: <20181105231921.8224A2064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:21 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:28 -0000 branch: master commit 3162aa246d0e25ec5477a4be6304c7ea0f064bee Author: cz <40715392+chunzhouyu@users.noreply.github.com> Commit: GitHub Update company-keywords.el --- company-keywords.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/company-keywords.el b/company-keywords.el index 9283057..e7858df 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -143,7 +143,7 @@ "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode ;; from https://golang.org/ref/spec#Keywords - ;; also, i add some fake keywords for a better programming experien= ce, all of them are basic type in golang + ;; also, i added some fake keywords for a better programming experi= ence, all of them are basic type in golang "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" "default" "defer" "else" "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "import" "int" "int16" "int32" "int64= " "int8" "interface" "map" "package" "range" "return" "select" "string" "struct" "switch" "type" "uint" "uint16"= "uint32" "uint64" "uint8" "uintptr" "var") From MAILER-DAEMON Mon Nov 05 18:19:52 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9w-0002bv-8u for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9V-00029R-90 for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9R-0004F7-TR for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-0004Er-OL for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id AD181204F2; Mon, 5 Nov 2018 18:19:21 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master b423ba4 48/66: Merge pull request #819 from chunzhouyu/master MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: b423ba41ce992ef21463d2af4663a8223876a0d0 Auto-Submitted: auto-generated Message-Id: <20181105231921.AD181204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:21 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:28 -0000 branch: master commit b423ba41ce992ef21463d2af4663a8223876a0d0 Merge: 9e8bd0b 3162aa2 Author: Dmitry Gutov Commit: GitHub Merge pull request #819 from chunzhouyu/master =20 add some golang fake keywords for a better programming experience --- company-keywords.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 52fc226..e7858df 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -143,9 +143,10 @@ "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode ;; from https://golang.org/ref/spec#Keywords - "break" "case" "chan" "const" "continue" "default" "defer" "else" "= fallthrough" - "for" "func" "go" "goto" "if" "import" "interface" "map" "package" = "range" - "return" "select" "struct" "switch" "type" "var") + ;; also, i added some fake keywords for a better programming experi= ence, all of them are basic type in golang + "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" "default" "defer" "else" "fallthrough" "float32" "float64" + "for" "func" "go" "goto" "if" "import" "int" "int16" "int32" "int64= " "int8" "interface" "map" "package" "range" + "return" "select" "string" "struct" "switch" "type" "uint" "uint16"= "uint32" "uint64" "uint8" "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" From MAILER-DAEMON Mon Nov 05 18:19:52 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9w-0002cE-G2 for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9V-00029p-FZ for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9S-0004FQ-2i for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:25 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9R-0004FB-Tk for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id D67FE204F2; Mon, 5 Nov 2018 18:19:21 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master a163e94 49/66: Improve comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dmitry Gutov In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: a163e94e99684a52f86dd8171844a839877cf6db Auto-Submitted: auto-generated Message-Id: <20181105231921.D67FE204F2@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:21 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:28 -0000 branch: master commit a163e94e99684a52f86dd8171844a839877cf6db Author: Dmitry Gutov Commit: Dmitry Gutov Improve comment --- company-keywords.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index e7858df..aa51e2c 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -142,8 +142,8 @@ "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode - ;; from https://golang.org/ref/spec#Keywords - ;; also, i added some fake keywords for a better programming experi= ence, all of them are basic type in golang + ;; From https://golang.org/ref/spec#Keywords + ;; Plus some basic types, for better programming experience. "bool" "break" "case" "chan" "complex128" "complex64" "const" "cont= inue" "default" "defer" "else" "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "import" "int" "int16" "int32" "int64= " "int8" "interface" "map" "package" "range" "return" "select" "string" "struct" "switch" "type" "uint" "uint16"= "uint32" "uint64" "uint8" "uintptr" "var") From MAILER-DAEMON Mon Nov 05 18:19:52 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJo9w-0002ck-NK for mharc-emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9a-0002Gr-EW for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJo9T-0004HB-3d for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:26 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJo9S-0004CT-PD for emacs-elpa-diffs@gnu.org; Mon, 05 Nov 2018 18:19:22 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 125553) id B7AEB2064E; Mon, 5 Nov 2018 18:19:22 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 44ed412 54/66: resort go-mode'e keywords MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, chunzhouyu In-Reply-To: <20181105231910.27475.93972@vcs0.savannah.gnu.org> References: <20181105231910.27475.93972@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 44ed412c7ab1b2212e97676ee63d442e796a55b8 Auto-Submitted: auto-generated Message-Id: <20181105231922.B7AEB2064E@vcs0.savannah.gnu.org> Date: Mon, 5 Nov 2018 18:19:22 -0500 (EST) From: dgutov@yandex.ru (Dmitry Gutov) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 23:19:33 -0000 branch: master commit 44ed412c7ab1b2212e97676ee63d442e796a55b8 Author: chunzhouyu Commit: chunzhouyu resort go-mode'e keywords --- company-keywords.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/company-keywords.el b/company-keywords.el index 0a55437..916cd58 100644 --- a/company-keywords.el +++ b/company-keywords.el @@ -142,13 +142,13 @@ "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpac= k" "use" "value" "verify" "volatile" "wait" "where" "while" "with" "w= rite")) (go-mode - "append" "bool" "break" "cap" "case" "chan" "close" "complex" "com= plex128"=20 - "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse"=20 - "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "im= ag" "import"=20 - "interface" "int" "int16" "int32" "int64" "int8" "len" "make" "map"= "new"=20 - "package" "panic" "print" "println" "range" "real" "recover" "retur= n" "select"=20 - "string" "struct" "switch" "type" "uint" "uint16" "uint32" "uint64"= "uint8"=20 - "uintptr" "var") + "append" "bool" "break" "cap" "case" "chan" "close" "complex" "comp= lex128" + "complex64" "const" "continue" "copy" "default" "defer" "delete" "e= lse" + "fallthrough" "float32" "float64" "for" "func" "go" "goto" "if" "im= ag" + "import" "int" "int16" "int32" "int64" "int8" "interface" "len" "ma= ke" + "map" "new" "package" "panic" "print" "println" "range" "real" "rec= over" + "return" "select" "string" "struct" "switch" "type" "uint" "uint16" + "uint32" "uint64" "uint8" "uintptr" "var") (java-mode "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" = "class" "continue" "default" "do" "double" "else" "enum" "extends" "final" From MAILER-DAEMON Tue Nov 06 00:51:00 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gJuGS-0001kb-LY for mharc-emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 00:51:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJuGQ-0001kT-RO for emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 00:51:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJuGP-00079t-KL for emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 00:50:58 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:40453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJuGP-00079l-HS for emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 00:50:57 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 131183) id 38010204F2; Tue, 6 Nov 2018 00:50:57 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 0a7b060: [gnus-mock] Fix two small bugs, bump version to 0.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Eric Abrahamsen In-Reply-To: <20181106055056.15429.7074@vcs0.savannah.gnu.org> References: <20181106055056.15429.7074@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 0a7b060c35771c3bfb14b44da42ea155db1d7ad4 Auto-Submitted: auto-generated Message-Id: <20181106055057.38010204F2@vcs0.savannah.gnu.org> Date: Tue, 6 Nov 2018 00:50:56 -0500 (EST) From: eric@ericabrahamsen.net (Eric Abrahamsen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 05:51:00 -0000 branch: master commit 0a7b060c35771c3bfb14b44da42ea155db1d7ad4 Author: Eric Abrahamsen Commit: Eric Abrahamsen [gnus-mock] Fix two small bugs, bump version to 0.2.1 =20 * packages/gnus-mock/gnus-mock.el (gnus-mock-start): First, mock-tmp-dir is referred to within the condition-case error cases, so needs to be let outside of that. Second, gnus-init-file was bein= g defined without the trailing ".el", which Gnus can handle, but wasn't matching the destination of `gnus-mock-gnus-file'. Unify on "gnus.el". --- packages/gnus-mock/gnus-mock.el | 234 ++++++++++++++++++++--------------= ------ 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/packages/gnus-mock/gnus-mock.el b/packages/gnus-mock/gnus-mo= ck.el index 2e7813a..661559b 100644 --- a/packages/gnus-mock/gnus-mock.el +++ b/packages/gnus-mock/gnus-mock.el @@ -5,7 +5,7 @@ ;; Author: Eric Abrahamsen ;; Maintainer: Eric Abrahamsen ;; Package-Type: multi -;; Version: 0.2.0 +;; Version: 0.2.1 =20 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -138,124 +138,124 @@ The new Emacs process will be started as \"-Q\", = with the mock Gnus settings pre-loaded. Any of the normal Gnus entry points will start a mock Gnus session." (interactive) - (condition-case nil - (let* ((mock-tmp-dir (make-temp-file "emacs-gnus-mock-" t)) - (init-file (expand-file-name "init.el" mock-tmp-dir))) - (with-temp-buffer - (let ((standard-output (current-buffer)) - (print-circle nil)) - (prin1 - `(setq gnus-home-directory ,mock-tmp-dir - init-file-user "mockturtle" - sendmail-program - ,(expand-file-name gnus-mock-sendmail-program - mock-tmp-dir) - message-directory ,mock-tmp-dir - gnus-startup-file - ,(expand-file-name ".newsrc" mock-tmp-dir) - gnus-init-file - ,(expand-file-name ".gnus" mock-tmp-dir) - nndraft-directory - ,(expand-file-name "drafts/" mock-tmp-dir) - gnus-agent-directory - ,(expand-file-name "agent/" mock-tmp-dir) - gnus-directory - ,(expand-file-name "News/" mock-tmp-dir))) - (princ "\n\n") - ;; Constant that can be checked if we need to know it's a mock - ;; session. - (prin1 '(defconst gnus-mock-p t)) - (princ "\n") - ;; Constant for use in `gnus-mock-reload', which is defined in - ;; the .gnus.el startup file. - (prin1 `(defconst gnus-mock-data-dir ,gnus-mock-data-dir)) - (when gnus-mock-cleanup-p - (princ "\n") - (prin1 `(add-hook 'kill-emacs-hook - (lambda () (delete-directory - ,mock-tmp-dir t))))) - (when gnus-mock-use-images - (princ "\n") - (prin1 `(add-to-list 'load-path - ,(format "%s/data" mock-tmp-dir)))) - (write-file init-file))) - ;; Put our data and config in place. - (copy-directory - gnus-mock-data-dir - (file-name-as-directory mock-tmp-dir) nil nil t) - ;; Git doesn't let us commit empty directories, so create our - ;; necessary empty maildir bits. - (mapc (lambda (path) (make-directory path t)) - (mapcar (lambda (dir) - (format "%s/test/%s" mock-tmp-dir dir)) - '("Welcome/new" "Welcome/tmp" "Welcome/.nnmaildir/marks" - "incoming/tmp" "incoming/new" "incoming/cur" - "incoming/.nnmaildir/marks" "incoming/.nnmaildir/nov" - "mails/tmp" "mails/new" "mails/.nnmaildir/marks"))) - ;; Possibly insert additional config. - (when gnus-mock-init-file - (with-temp-buffer - (insert-file-contents gnus-mock-init-file) - (append-to-file - (point-min) (point-max) init-file))) - (when gnus-mock-gnus-file + (let ((mock-tmp-dir (make-temp-file "emacs-gnus-mock-" t))) + (condition-case nil + (let ((init-file (expand-file-name "init.el" mock-tmp-dir))) (with-temp-buffer - (insert-file-contents gnus-mock-gnus-file) - (append-to-file - (point-min) (point-max) - (expand-file-name ".gnus.el" mock-tmp-dir)))) - ;; Possibly add an nnimap server. - (when gnus-mock-dovecot-imap-program - (with-temp-buffer - (insert "\n\n") - (prin1 - `(add-to-list - 'gnus-secondary-select-methods - (quote (nnimap - "Mocky" - (nnimap-stream shell) - (nnimap-shell-program - ,(concat - gnus-mock-dovecot-imap-program - (format " -o mail_location=3Dmaildir:%s/imapmail/mail" - mock-tmp-dir)))))) - (current-buffer)) - (append-to-file - (point-min) (point-max) - (expand-file-name ".gnus.el" mock-tmp-dir)))) - ;; There are absolute paths in the .newsrc.eld file, so doctor - ;; that file. - (with-current-buffer (find-file-noselect - (expand-file-name ".newsrc.eld" mock-tmp-dir)) - (while (re-search-forward "REPLACE_ME" (point-max) t) - (replace-match mock-tmp-dir t)) + (let ((standard-output (current-buffer)) + (print-circle nil)) + (prin1 + `(setq gnus-home-directory ,mock-tmp-dir + init-file-user "mockturtle" + sendmail-program + ,(expand-file-name gnus-mock-sendmail-program + mock-tmp-dir) + message-directory ,mock-tmp-dir + gnus-startup-file + ,(expand-file-name ".newsrc" mock-tmp-dir) + gnus-init-file + ,(expand-file-name ".gnus.el" mock-tmp-dir) + nndraft-directory + ,(expand-file-name "drafts/" mock-tmp-dir) + gnus-agent-directory + ,(expand-file-name "agent/" mock-tmp-dir) + gnus-directory + ,(expand-file-name "News/" mock-tmp-dir))) + (princ "\n\n") + ;; Constant that can be checked if we need to know it's a mock + ;; session. + (prin1 '(defconst gnus-mock-p t)) + (princ "\n") + ;; Constant for use in `gnus-mock-reload', which is defined in + ;; the .gnus.el startup file. + (prin1 `(defconst gnus-mock-data-dir ,gnus-mock-data-dir)) + (when gnus-mock-cleanup-p + (princ "\n") + (prin1 `(add-hook 'kill-emacs-hook + (lambda () (delete-directory + ,mock-tmp-dir t))))) + (when gnus-mock-use-images + (princ "\n") + (prin1 `(add-to-list 'load-path + ,(format "%s/data" mock-tmp-dir)))) + (write-file init-file))) + ;; Put our data and config in place. + (copy-directory + gnus-mock-data-dir + (file-name-as-directory mock-tmp-dir) nil nil t) + ;; Git doesn't let us commit empty directories, so create our + ;; necessary empty maildir bits. + (mapc (lambda (path) (make-directory path t)) + (mapcar (lambda (dir) + (format "%s/test/%s" mock-tmp-dir dir)) + '("Welcome/new" "Welcome/tmp" "Welcome/.nnmaildir/marks" + "incoming/tmp" "incoming/new" "incoming/cur" + "incoming/.nnmaildir/marks" "incoming/.nnmaildir/nov" + "mails/tmp" "mails/new" "mails/.nnmaildir/marks"))) + ;; Possibly insert additional config. + (when gnus-mock-init-file + (with-temp-buffer + (insert-file-contents gnus-mock-init-file) + (append-to-file + (point-min) (point-max) init-file))) + (when gnus-mock-gnus-file + (with-temp-buffer + (insert-file-contents gnus-mock-gnus-file) + (append-to-file + (point-min) (point-max) + (expand-file-name ".gnus.el" mock-tmp-dir)))) + ;; Possibly add an nnimap server. (when gnus-mock-dovecot-imap-program - (goto-char (point-max)) - (insert "\n\n") - (prin1 - '(setq - gnus-newsrc-alist - (append - gnus-newsrc-alist - '(("nnimap+Mocky:INBOX" 3 nil ((unexist) (seen (1 . 32))) - "nnimap:Mocky" ((modseq . "33") (uidvalidity . "1541087103") - (active 1 . 32) - (permanent-flags %Answered %Flagged %Deleted - %Seen %Draft %*))) - ("nnimap+Mocky:emacs-devel" 3 nil ((unexist 0)) - "nnimap:Mocky" ((modseq . "21") (uidvalidity . "1541087104") - (active 0 . 20) - (permanent-flags %Answered %Flagged %Deleted - %Seen %Draft %*)))))) - (current-buffer))) - (basic-save-buffer)) - (make-process :name "gnus-mock" :buffer nil - :command (list gnus-mock-emacs-program - "-Q" "--load" init-file) - :stderr "*gnus mock errors*")) - (error (when (and gnus-mock-cleanup-p - (file-exists-p mock-tmp-dir)) - (delete-directory mock-tmp-dir t))))) + (with-temp-buffer + (insert "\n\n") + (prin1 + `(add-to-list + 'gnus-secondary-select-methods + (quote (nnimap + "Mocky" + (nnimap-stream shell) + (nnimap-shell-program + ,(concat + gnus-mock-dovecot-imap-program + (format " -o mail_location=3Dmaildir:%s/imapmail/mail" + mock-tmp-dir)))))) + (current-buffer)) + (append-to-file + (point-min) (point-max) + (expand-file-name ".gnus.el" mock-tmp-dir)))) + ;; There are absolute paths in the .newsrc.eld file, so doctor + ;; that file. + (with-current-buffer (find-file-noselect + (expand-file-name ".newsrc.eld" mock-tmp-dir)) + (while (re-search-forward "REPLACE_ME" (point-max) t) + (replace-match mock-tmp-dir t)) + (when gnus-mock-dovecot-imap-program + (goto-char (point-max)) + (insert "\n\n") + (prin1 + '(setq + gnus-newsrc-alist + (append + gnus-newsrc-alist + '(("nnimap+Mocky:INBOX" 3 nil ((unexist) (seen (1 . 32))) + "nnimap:Mocky" ((modseq . "33") (uidvalidity . "1541087103") + (active 1 . 32) + (permanent-flags %Answered %Flagged %Deleted + %Seen %Draft %*))) + ("nnimap+Mocky:emacs-devel" 3 nil ((unexist 0)) + "nnimap:Mocky" ((modseq . "21") (uidvalidity . "1541087104") + (active 0 . 20) + (permanent-flags %Answered %Flagged %Deleted + %Seen %Draft %*)))))) + (current-buffer))) + (basic-save-buffer)) + (make-process :name "gnus-mock" :buffer nil + :command (list gnus-mock-emacs-program + "-Q" "--load" init-file) + :stderr "*gnus mock errors*")) + (error (when (and gnus-mock-cleanup-p + (file-exists-p mock-tmp-dir)) + (delete-directory mock-tmp-dir t)))))) =20 (provide 'gnus-mock) ;;; gnus-mock.el ends here From MAILER-DAEMON Tue Nov 06 15:36:38 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gK85W-00060j-7E for mharc-emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 15:36:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK85T-00060c-SU for emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 15:36:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gK85P-0002XO-TC for emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 15:36:33 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:51683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK85F-0001uW-Kv for emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 15:36:23 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 134376) id 2DB582043C; Tue, 6 Nov 2018 15:36:21 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master eafdd36: [el-search] Don't initially fold El Occur buffers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Heerdegen In-Reply-To: <20181106203620.21509.62522@vcs0.savannah.gnu.org> References: <20181106203620.21509.62522@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: eafdd36ee0a776a695fc02962dfe9e303593055d Auto-Submitted: auto-generated Message-Id: <20181106203621.2DB582043C@vcs0.savannah.gnu.org> Date: Tue, 6 Nov 2018 15:36:20 -0500 (EST) From: michael_heerdegen@web.de (Michael Heerdegen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 20:36:36 -0000 branch: master commit eafdd36ee0a776a695fc02962dfe9e303593055d Author: Michael Heerdegen Commit: Michael Heerdegen [el-search] Don't initially fold El Occur buffers =20 This didn't always work correctly and may also be irritating for new users. Bump version to 1.7.15. =20 * packages/el-search/el-search.el (el-search--occur): Don't initially fold *El Occur* buffer. --- packages/el-search/NEWS | 4 ++++ packages/el-search/el-search.el | 19 +++++-------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/packages/el-search/NEWS b/packages/el-search/NEWS index 863d2f5..cc5d877 100644 --- a/packages/el-search/NEWS +++ b/packages/el-search/NEWS @@ -1,6 +1,10 @@ Some of the user visible news were: =20 =20 +Version: 1.7.15 + + *El Occur* buffers are now initially unfolded. + Version: 1.7.8 =20 Similar to isearch, el-search now opens invisible text. diff --git a/packages/el-search/el-search.el b/packages/el-search/el-sear= ch.el index 4f4b0eb..2c7246a 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -7,7 +7,7 @@ ;; Created: 29 Jul 2015 ;; Keywords: lisp ;; Compatibility: GNU Emacs 25 -;; Version: 1.7.14 +;; Version: 1.7.15 ;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0")) =20 =20 @@ -256,9 +256,8 @@ ;; match in that buffer or file. With S-tab you can (un)collapse all ;; file sections like in `org-mode' to see only file names and the ;; number of matches, or everything. Tab folds and unfolds -;; expressions (this uses hideshow; initially, all expressions are -;; folded to one line) and also sections at the beginning of -;; headlines. +;; expressions (this uses hideshow) and also sections at the beginning +;; of headlines. ;; ;; ;; Multiple multi searches @@ -3273,14 +3272,7 @@ Prompt for a new pattern and revert." (point) (el-search--end-of-sexp co= ntext-beg)))))) =20 (let ((inhibit-message t) (message-log-max= nil)) - (indent-region insertion-point (point)) - (save-excursion - (goto-char insertion-point) - (ignore-errors - ;; This can error... - (if nil ;if need-context - (hs-hide-level 1) - (hs-hide-block))))) + (indent-region insertion-point (point))) (insert "\n"))))))) =20 (save-excursion @@ -3315,8 +3307,7 @@ Prompt for a new pattern and revert." =20 Buffers and files are separated by headlines. Matches are highlighted with face `el-search-match'. For short matches, some -context is shown, and nearby matches are grouped. Initially all -expressions are folded to one line. +context is shown, and nearby matches are grouped. \\ Clicking on a file or buffer name displays it in a different window and goes to the first match. From MAILER-DAEMON Tue Nov 06 18:48:59 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gKB5f-0007Rf-Nm for mharc-emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 18:48:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKB5c-0007Pq-PT for emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 18:48:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKB3b-0005Rs-1i for emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 18:46:52 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:53993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKB3X-0004wA-Su for emacs-elpa-diffs@gnu.org; Tue, 06 Nov 2018 18:46:48 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id C39692040A; Tue, 6 Nov 2018 18:46:46 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 542c7d0: * nhexl-mode.el: Make C-u use hexadecimal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181106234646.9720.17411@vcs0.savannah.gnu.org> References: <20181106234646.9720.17411@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 542c7d0b6802135877b47b66c6b13d66e5f9f30b Auto-Submitted: auto-generated Message-Id: <20181106234647.C39692040A@vcs0.savannah.gnu.org> Date: Tue, 6 Nov 2018 18:46:46 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 23:48:58 -0000 branch: master commit 542c7d0b6802135877b47b66c6b13d66e5f9f30b Author: Stefan Monnier Commit: Stefan Monnier * nhexl-mode.el: Make C-u use hexadecimal =20 (nhexl-universal-argument-map): New var. (nhexl--universal-argument-description) (nhexl--universal-argument-mode): New advice functions. (nhexl-digit-argument): New command. --- packages/nhexl-mode/nhexl-mode.el | 72 +++++++++++++++++++++++++++++++++= +++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/packages/nhexl-mode/nhexl-mode.el b/packages/nhexl-mode/nhex= l-mode.el index 4635251..b7221bf 100644 --- a/packages/nhexl-mode/nhexl-mode.el +++ b/packages/nhexl-mode/nhexl-mode.el @@ -4,7 +4,7 @@ =20 ;; Author: Stefan Monnier ;; Keywords: data -;; Version: 0.9 +;; Version: 1.0 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5")) =20 ;; This program is free software; you can redistribute it and/or modify @@ -40,6 +40,9 @@ ;; - `nhexl-overwrite-only-mode': a minor mode to try and avoid moving t= ext. ;; In this minor mode, not only self-inserting keys overwrite existing ;; text, but commands like `yank' and `kill-region' as well. +;; +;; - it overrides C-u to use hexadecimal, so you can do C-u a 4 C-f +;; to advance by #xa4 characters. =20 ;; Even though the hex addresses displayed by this mode aren't actually ;; part of the buffer's text (contrary to hexl-mode, for example), you c= an @@ -836,5 +839,72 @@ existing text, if needed with `nhexl-overwrite-clear= -byte'." (unless (eql pow2bytes nhexl-line-width) (setq-local nhexl-line-width pow2bytes)))))) =20 +;;;;; The main prefix command. + +(defvar nhexl-universal-argument-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map universal-argument-map) + (define-key map [?\C-u] 'universal-argument-more) + (define-key map [remap digit-argument] 'nhexl-digit-argument) + (dolist (k '("a" "b" "c" "d" "e" "f")) + (define-key map k 'nhexl-digit-argument)) + map) + "Keymap used while processing nhexl-mode's \\[universal-argument].") + +;; FIXME: Using advice is ugly! + +;; Instead of an advice, we'd prefer to replace universal-argument--desc= ription +;; on prefix-command-echo-keystrokes-functions, but there's no mechanism= to +;; do that. +(advice-add 'universal-argument--description :around + #'nhexl--universal-argument-description) +(defun nhexl--universal-argument-description (orig-fun &rest args) + (cond + ((not nhexl-mode) (apply orig-fun args)) + ((null prefix-arg) nil) + (t + (concat "C-u" + (pcase prefix-arg + (`(-) " -") + (`(,(and (pred integerp) n)) + (let ((str "")) + (while (and (> n 4) (=3D (mod n 4) 0)) + (setq str (concat str " C-u")) + (setq n (/ n 4))) + (if (=3D n 4) str (format " %s" prefix-arg)))) + ((pred integerp) (format " #x%X" prefix-arg)) + (_ (format " %s" prefix-arg))))))) + +(advice-add 'universal-argument--mode :around + #'nhexl--universal-argument-mode) +(defun nhexl--universal-argument-mode (orig-fun &rest args) + (if (not nhexl-mode) + (apply orig-fun args) + (let ((universal-argument-map nhexl-universal-argument-map)) + (apply orig-fun args)))) + +(defun nhexl-digit-argument (arg) + "Part of the hexadecimal numeric argument for the next command. +\\[universal-argument] following digits or minus sign ends the argument.= " + (interactive "P") + (prefix-command-preserve-state) + (let* ((keys (this-command-keys)) + (key (aref keys (1- (length keys)))) + (char (if (integerp key) (logand key #x7f))) + (digit (cond + ((<=3D ?a char ?f) (+ 10 (- char ?a))) + ((<=3D ?A char ?F) (+ 10 (- char ?A))) + ((<=3D ?0 char ?9) (- char ?0))))) + (setq prefix-arg (cond ((integerp arg) + (+ (* arg 16) + (if (< arg 0) (- digit) digit))) + ((eq arg '-) + ;; Treat -0 as just -, so that -01 will work= . + (if (zerop digit) '- (- digit))) + (t + digit)))) + (universal-argument--mode)) + + (provide 'nhexl-mode) ;;; nhexl-mode.el ends here From MAILER-DAEMON Wed Nov 07 11:10:21 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gKQPN-0003v1-Nl for mharc-emacs-elpa-diffs@gnu.org; Wed, 07 Nov 2018 11:10:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKQPK-0003tc-I7 for emacs-elpa-diffs@gnu.org; Wed, 07 Nov 2018 11:10:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKQPJ-0007uc-8I for emacs-elpa-diffs@gnu.org; Wed, 07 Nov 2018 11:10:18 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:40719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKQPJ-0007ts-00 for emacs-elpa-diffs@gnu.org; Wed, 07 Nov 2018 11:10:17 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id C1EA32044D; Wed, 7 Nov 2018 11:10:16 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master fa31d3a: * nhexl-mode.el: Improve handling of mouse events MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181107161015.20595.10244@vcs0.savannah.gnu.org> References: <20181107161015.20595.10244@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: fa31d3a8482c220f2f850ce33d244be108dfaae5 Auto-Submitted: auto-generated Message-Id: <20181107161016.C1EA32044D@vcs0.savannah.gnu.org> Date: Wed, 7 Nov 2018 11:10:16 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2018 16:10:19 -0000 branch: master commit fa31d3a8482c220f2f850ce33d244be108dfaae5 Author: Stefan Monnier Commit: Stefan Monnier * nhexl-mode.el: Improve handling of mouse events =20 (nhexl--posn-hexadjust): New function extracted from nhexl-mouse-set-= point. (nhexl-mouse-set-point): Use it. (nhexl-mouse-drag-region, nhexl-mouse-set-region): New commands. (nhexl-mode-map): Remap to them. (nhexl--make-line): Circumvent some misbehavior in the presence of bu= ttons. --- packages/nhexl-mode/nhexl-mode.el | 72 ++++++++++++++++++++++++++++-----= ------ 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/packages/nhexl-mode/nhexl-mode.el b/packages/nhexl-mode/nhex= l-mode.el index b7221bf..b58b81d 100644 --- a/packages/nhexl-mode/nhexl-mode.el +++ b/packages/nhexl-mode/nhexl-mode.el @@ -328,6 +328,8 @@ existing text, if needed with `nhexl-overwrite-clear-= byte'." (define-key map [remap scroll-up-command] #'nhexl-scroll-up) (define-key map [remap scroll-down-command] #'nhexl-scroll-down) (define-key map [remap mouse-set-point] #'nhexl-mouse-set-point) + (define-key map [remap mouse-drag-region] #'nhexl-mouse-drag-region) + (define-key map [remap mouse-set-region] #'nhexl-mouse-set-region) ;; FIXME: Find a key binding for nhexl-nibble-edit-mode! map)) =20 @@ -466,35 +468,55 @@ existing text, if needed with `nhexl-overwrite-clea= r-byte'." (eval-and-compile (defvar nhexl--put-LF-in-string nil)) =20 -(defun nhexl-mouse-set-point (event) - "Move point to the position clicked on with the mouse." - (interactive "e") - ;; (cl-assert (eq last-)) - (let* ((posn (event-end event)) - (str-data (posn-string posn)) +(defun nhexl--posn-hexadjust (posn) + "Adjust POSN when clicking on the hex area. +Return the corresponding nibble, if applicable." + ;; When clicking in the hex area, (nth 1 posn) contains the first posi= tion + ;; covered by the before-string, and (nth 5 posn) as well. Improve th= is by + ;; setting nth-5 (the one used by `posn-point') to the closest buffer + ;; position corresponding to the hex on which we clicked. + (let* ((str-data (posn-string posn)) + (base-pos (nth 1 posn)) (addr-offset (eval-when-compile (+ (if nhexl--put-LF-in-string 1 0) - 9 ;for "
:" - 1)))) ;for the following (stretch)spac= e + 9 ;for "
:" + 1)))) ;for the following (stretch)space ;; (message "NMSP: strdata=3D%S" str-data) - (cond - ((and (consp str-data) (stringp (car str-data)) - (integerp (cdr str-data)) (> (cdr str-data) addr-offset)) + (when (and (consp str-data) (stringp (car str-data)) (integerp base-= pos) + (integerp (cdr str-data)) (> (cdr str-data) addr-offset)) (let* ((hexchars (- (cdr str-data) addr-offset)) ;; FIXME: Calculations here go wrong in the presence of ;; chars with code > 255. (hex-no-spaces (- hexchars (/ (1+ hexchars) 5))) (bytes (min (/ hex-no-spaces 2) ;; Bound, for clicks between the hex and ascii = areas. - (1- (nhexl--line-width))))) - ;; This will select the window if needed and move point to the - ;; beginning of the line. - (posn-set-point posn) - (forward-char bytes) - (when nhexl-nibble-edit-mode - (let* ((nibble (- hex-no-spaces (* bytes 2)))) - (nhexl--nibble-set (min nibble 1)))))) - (t (call-interactively #'mouse-set-point))))) + (1- (nhexl--line-width)))) + (newpos (min (+ base-pos bytes) (point-max)))) + (setf (nth 5 posn) newpos) + (let* ((nibble (- hex-no-spaces (* bytes 2)))) + (min nibble 1)))))) + +(defun nhexl-mouse-set-point (event) + "Move point to the position clicked on with the mouse." + (interactive "e") + (let* ((nibble (nhexl--posn-hexadjust (event-end event)))) + (call-interactively #'mouse-set-point) + (when (and nibble nhexl-nibble-edit-mode) + (nhexl--nibble-set nibble) + (nhexl--refresh-cursor)))) + +(defun nhexl-mouse-drag-region (event) + "Set the region to the text that the mouse is dragged over." + (interactive "e") + (nhexl--posn-hexadjust (event-start event)) + (call-interactively #'mouse-drag-region)) + +(defun nhexl-mouse-set-region (event) + "Set the region to the text dragged over, and copy to kill ring." + (interactive "e") + (nhexl--posn-hexadjust (event-start event)) + (nhexl--posn-hexadjust (event-end event)) + (call-interactively #'mouse-set-region)) =20 (defun nhexl--change-function (beg end len) ;; Round modifications up-to the hexl-line length since nhexl--jit wil= l need @@ -616,6 +638,16 @@ existing text, if needed with `nhexl-overwrite-clear= -byte'." ,(+ (/ (* lw 5) 2) 12 3)))))) (font-lock-append-text-property 0 (length s) prop 'default s) + ;; If the first char of the text has a button (e.g. it's part of + ;; a hyperlink), clicking in the hex part of the display might signa= l + ;; an error because it thinks we're clicking on the hyperlink. + ;; So override the relevant properties. + (put-text-property 0 (length s) 'keymap (make-sparse-keymap) s) + (put-text-property 0 (length s) 'follow-link #'ignore s) + ;; Override any `category' property that might otherwise be inherite= d from + ;; the text (e.g. that of some button). + ;; FIXME: This doesn't have the intended effect! + (put-text-property 0 (length s) 'category t s) s)) =20 (defun nhexl--jit (from to) From MAILER-DAEMON Fri Nov 09 04:59:15 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gL3ZL-000698-J2 for mharc-emacs-elpa-diffs@gnu.org; Fri, 09 Nov 2018 04:59:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL3ZI-00068o-T4 for emacs-elpa-diffs@gnu.org; Fri, 09 Nov 2018 04:59:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gL3ZH-0001fB-QK for emacs-elpa-diffs@gnu.org; Fri, 09 Nov 2018 04:59:12 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:37666) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL3ZH-0001f5-MF for emacs-elpa-diffs@gnu.org; Fri, 09 Nov 2018 04:59:11 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 67418) id 4F94D2084C; Fri, 9 Nov 2018 04:59:11 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 1126dde: * packages/debbugs/debbugs-ug.texi (Control Messages): Fix typos. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Albinus In-Reply-To: <20181109095910.1196.15164@vcs0.savannah.gnu.org> References: <20181109095910.1196.15164@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 1126dde084d6bb2b545a38bfc5063316567801be Auto-Submitted: auto-generated Message-Id: <20181109095911.4F94D2084C@vcs0.savannah.gnu.org> Date: Fri, 9 Nov 2018 04:59:10 -0500 (EST) From: Michael.Albinus@gmx.de (Michael Albinus) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2018 09:59:14 -0000 branch: master commit 1126dde084d6bb2b545a38bfc5063316567801be Author: Michael Albinus Commit: Michael Albinus * packages/debbugs/debbugs-ug.texi (Control Messages): Fix typos. --- packages/debbugs/debbugs-ug.info | 78 ++++++++++++++++++++--------------= ------ packages/debbugs/debbugs-ug.texi | 6 ++-- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/packages/debbugs/debbugs-ug.info b/packages/debbugs/debbugs-= ug.info index e6e0c36..7823ebe 100644 --- a/packages/debbugs/debbugs-ug.info +++ b/packages/debbugs/debbugs-ug.info @@ -452,7 +452,7 @@ meaning of the control messages, *Note Mail Command I= ndex::. "close 12345 25.1" =20 The second argument, the Emacs version, is read interactively if - the bugs belongs to the '"emacs"' package. + the bug belongs to the '"emacs"' package. =20 'confirmed' 'easy' @@ -472,7 +472,7 @@ meaning of the control messages, *Note Mail Command I= ndex::. If the command invoking the control message has been prefixed with 'C-u', the respective tag is removed from the bug, like =20 - "tags 12345 -confirmed" + "tags 12345 - confirmed" =20 'done' 'donenotabug' @@ -482,7 +482,7 @@ meaning of the control messages, *Note Mail Command I= ndex::. "close 12345 25.1" =20 The second argument in the close message, the Emacs version, is - read interactively if the bugs belongs to the '"emacs"' package. + read interactively if the bug belongs to the '"emacs"' package. =20 'forwarded' "forwarded 12345 ADDRESS" @@ -986,41 +986,41 @@ Node: Presenting Bugs=7F11429 Node: Tabulated Lists=7F12005 Node: TODO Items=7F15680 Node: Control Messages=7F16736 -Node: Applying Patches=7F19990 -Node: Minor Mode=7F21356 -Node: Command Index=7F22412 -Node: Variable Index=7F23201 -Node: Key Index=7F24275 -Node: Mail Command Index=7F25841 -Ref: Mail Command Index: reassign=7F25994 -Ref: Mail Command Index: reopen=7F26458 -Ref: Mail Command Index: found=7F27612 -Ref: Mail Command Index: notfound=7F28693 -Ref: Mail Command Index: submitter=7F29102 -Ref: Mail Command Index: forwarded=7F29496 -Ref: Mail Command Index: notforwarded=7F29835 -Ref: Mail Command Index: retitle=7F30036 -Ref: Mail Command Index: severity=7F30420 -Ref: Mail Command Index: clone=7F30685 -Ref: Mail Command Index: merge=7F31449 -Ref: Mail Command Index: forcemerge=7F32836 -Ref: Mail Command Index: unmerge=7F33110 -Ref: Mail Command Index: tags=7F33813 -Ref: Mail Command Index: block=7F34920 -Ref: Mail Command Index: unblock=7F34962 -Ref: Mail Command Index: close=7F35452 -Ref: Mail Command Index: package=7F36102 -Ref: Mail Command Index: owner=7F36714 -Ref: Mail Command Index: noowner=7F37077 -Ref: Mail Command Index: archive=7F37250 -Ref: Mail Command Index: unarchive=7F37391 -Ref: Mail Command Index: #=7F37684 -Ref: Mail Command Index: quit=7F37944 -Ref: Mail Command Index: stop=7F37951 -Ref: Mail Command Index: thank=7F37958 -Ref: Mail Command Index: thanks=7F37966 -Ref: Mail Command Index: thankyou=7F37975 -Ref: Mail Command Index: thank you=7F37986 -Ref: Mail Command Index: --=7F37998 +Node: Applying Patches=7F19989 +Node: Minor Mode=7F21355 +Node: Command Index=7F22411 +Node: Variable Index=7F23200 +Node: Key Index=7F24274 +Node: Mail Command Index=7F25840 +Ref: Mail Command Index: reassign=7F25993 +Ref: Mail Command Index: reopen=7F26457 +Ref: Mail Command Index: found=7F27611 +Ref: Mail Command Index: notfound=7F28692 +Ref: Mail Command Index: submitter=7F29101 +Ref: Mail Command Index: forwarded=7F29495 +Ref: Mail Command Index: notforwarded=7F29834 +Ref: Mail Command Index: retitle=7F30035 +Ref: Mail Command Index: severity=7F30419 +Ref: Mail Command Index: clone=7F30684 +Ref: Mail Command Index: merge=7F31448 +Ref: Mail Command Index: forcemerge=7F32835 +Ref: Mail Command Index: unmerge=7F33109 +Ref: Mail Command Index: tags=7F33812 +Ref: Mail Command Index: block=7F34919 +Ref: Mail Command Index: unblock=7F34961 +Ref: Mail Command Index: close=7F35451 +Ref: Mail Command Index: package=7F36101 +Ref: Mail Command Index: owner=7F36713 +Ref: Mail Command Index: noowner=7F37076 +Ref: Mail Command Index: archive=7F37249 +Ref: Mail Command Index: unarchive=7F37390 +Ref: Mail Command Index: #=7F37683 +Ref: Mail Command Index: quit=7F37943 +Ref: Mail Command Index: stop=7F37950 +Ref: Mail Command Index: thank=7F37957 +Ref: Mail Command Index: thanks=7F37965 +Ref: Mail Command Index: thankyou=7F37974 +Ref: Mail Command Index: thank you=7F37985 +Ref: Mail Command Index: --=7F37997 =1F End Tag Table diff --git a/packages/debbugs/debbugs-ug.texi b/packages/debbugs/debbugs-= ug.texi index b9379aa..ea6d51e 100644 --- a/packages/debbugs/debbugs-ug.texi +++ b/packages/debbugs/debbugs-ug.texi @@ -518,7 +518,7 @@ of comma-separated bug numbers. "close 12345 25.1" =20 The second argument, the Emacs version, is read interactively if the -bugs belongs to the @code{"emacs"} package. +bug belongs to the @code{"emacs"} package. =20 @item confirmed @itemx easy @@ -538,7 +538,7 @@ bugs belongs to the @code{"emacs"} package. If the command invoking the control message has been prefixed with @kbd{C-u}, the respective tag is removed from the bug, like =20 -"tags 12345 -confirmed" +"tags 12345 - confirmed" =20 @item done @itemx donenotabug @@ -548,7 +548,7 @@ If the command invoking the control message has been = prefixed with "close 12345 25.1" =20 The second argument in the close message, the Emacs version, is read -interactively if the bugs belongs to the @code{"emacs"} package. +interactively if the bug belongs to the @code{"emacs"} package. =20 @item forwarded "forwarded 12345 @var{address}" From MAILER-DAEMON Sun Nov 11 03:50:09 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLlRZ-0008V8-Sf for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLlRY-0008TY-J6 for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLlRS-0001Jt-Gp for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:04 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:55084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLlRP-00018n-7M for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:00 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id 252B3207F2; Sun, 11 Nov 2018 03:49:59 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm 9dcfff5 1/2: Expose `exwm-randr-refresh' public interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Chris Feng In-Reply-To: <20181111084958.19944.4880@vcs0.savannah.gnu.org> References: <20181111084958.19944.4880@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Rev: 9dcfff568f8c1205bf57877e3d1d5ebe8466ce8d Auto-Submitted: auto-generated Message-Id: <20181111084959.252B3207F2@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 03:49:59 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 08:50:09 -0000 branch: externals/exwm commit 9dcfff568f8c1205bf57877e3d1d5ebe8466ce8d Author: Chris Feng Commit: Chris Feng Expose `exwm-randr-refresh' public interface =20 * exwm-randr.el (exwm-randr-refresh): New public interface allowing users to manually refresh when RandR settings are changed output EXWM= . (exwm-randr--refresh): Made obsolete. --- exwm-randr.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/exwm-randr.el b/exwm-randr.el index 5422252..2ec4789 100644 --- a/exwm-randr.el +++ b/exwm-randr.el @@ -125,8 +125,10 @@ corresponding monitors whenever the monitors are act= ive. (exwm--log "Monitors: %s" monitor-plist) (list primary-monitor monitor-plist))) =20 -(defun exwm-randr--refresh () +;;;###autoload +(defun exwm-randr-refresh () "Refresh workspaces according to the updated RandR info." + (interactive) (let* ((result (exwm-randr--get-monitors)) (primary-monitor (elt result 0)) (monitor-plist (elt result 1)) @@ -181,6 +183,9 @@ corresponding monitors whenever the monitors are acti= ve. (xcb:flush exwm--connection) (run-hooks 'exwm-randr-refresh-hook)))) =20 +(define-obsolete-function-alias 'exwm-randr--refresh #'exwm-randr-refres= h + "27.1") + (defun exwm-randr--on-ScreenChangeNotify (_data _synthetic) (exwm--log) (run-hooks 'exwm-randr-screen-change-hook) From MAILER-DAEMON Sun Nov 11 03:50:10 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLlRa-0008Vr-GK for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLlRY-0008TZ-JF for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLlRS-0001KV-Ht for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:04 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:55082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLlRP-00018X-7L for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:00 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id E7E2F20406; Sun, 11 Nov 2018 03:49:58 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm updated (e597ab4 -> d650159) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <20181111084958.19944.4880@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Oldrev: e597ab4f785982d44f56f61ba113b54c501256ac X-Git-Newrev: d650159648e88ec4a67c126834cd24fed6e3fc24 Auto-Submitted: auto-generated Date: Sun, 11 Nov 2018 03:49:58 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 08:50:09 -0000 ch11ng pushed a change to branch externals/exwm. from e597ab4 Add support for RandR 1.5 monitor new 9dcfff5 Expose `exwm-randr-refresh' public interface new d650159 Fix wrong stacking order of tiling X windows Summary of changes: exwm-manage.el | 19 ++++++++++++++----- exwm-randr.el | 7 ++++++- 2 files changed, 20 insertions(+), 6 deletions(-) From MAILER-DAEMON Sun Nov 11 03:50:13 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLlRb-000059-0E for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLlRY-0008Ta-MC for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLlRS-0001KJ-KI for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:06 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:55087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLlRP-00019Q-CH for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 03:50:00 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id 5016D20AC1; Sun, 11 Nov 2018 03:49:59 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm d650159 2/2: Fix wrong stacking order of tiling X windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Chris Feng In-Reply-To: <20181111084958.19944.4880@vcs0.savannah.gnu.org> References: <20181111084958.19944.4880@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Rev: d650159648e88ec4a67c126834cd24fed6e3fc24 Auto-Submitted: auto-generated Message-Id: <20181111084959.5016D20AC1@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 03:49:59 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 08:50:09 -0000 branch: externals/exwm commit d650159648e88ec4a67c126834cd24fed6e3fc24 Author: Chris Feng Commit: Chris Feng Fix wrong stacking order of tiling X windows =20 * exwm-manage.el (exwm-manage--on-MapNotify): Avoid restacking tiling X windows on the top when force triggering hierarchy change events. --- exwm-manage.el | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/exwm-manage.el b/exwm-manage.el index 79c5405..d7b5c36 100644 --- a/exwm-manage.el +++ b/exwm-manage.el @@ -674,11 +674,20 @@ border-width: %d; sibling: #x%x; stack-mode: %d" (exwm--log "id=3D#x%x" window) ;; With this we ensure that a "window hierarchy change" happens = after ;; mapping the window, as some servers (XQuartz) do not generate= it. - (xcb:+request exwm--connection - (make-instance 'xcb:ConfigureWindow - :window window - :value-mask xcb:ConfigWindow:StackMode - :stack-mode xcb:StackMode:Above)) + (with-current-buffer (exwm--id->buffer window) + (if exwm--floating-frame + (xcb:+request exwm--connection + (make-instance 'xcb:ConfigureWindow + :window window + :value-mask xcb:ConfigWindow:StackMode + :stack-mode xcb:StackMode:Above)) + (xcb:+request exwm--connection + (make-instance 'xcb:ConfigureWindow + :window window + :value-mask (logior xcb:ConfigWindow:Sibl= ing + xcb:ConfigWindow:Stac= kMode) + :sibling exwm--guide-window + :stack-mode xcb:StackMode:Above)))) (xcb:flush exwm--connection))))) =20 (defun exwm-manage--on-DestroyNotify (data synthetic) From MAILER-DAEMON Sun Nov 11 04:55:55 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLmTD-0001ks-6O for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 04:55:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLmTB-0001km-3e for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 04:55:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLmTA-0005Ma-A6 for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 04:55:53 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:56030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLmTA-0005MT-6M for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 04:55:52 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 134376) id 23E1A20B25; Sun, 11 Nov 2018 04:55:52 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 4ce0ed8: [el-search] Make y move forward after replacing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Heerdegen In-Reply-To: <20181111095551.15964.95329@vcs0.savannah.gnu.org> References: <20181111095551.15964.95329@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 4ce0ed8bba7ee23ef5da8cd6b691c0f5c7503e38 Auto-Submitted: auto-generated Message-Id: <20181111095552.23E1A20B25@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 04:55:51 -0500 (EST) From: michael_heerdegen@web.de (Michael Heerdegen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 09:55:54 -0000 branch: master commit 4ce0ed8bba7ee23ef5da8cd6b691c0f5c7503e38 Author: Michael Heerdegen Commit: Michael Heerdegen [el-search] Make y move forward after replacing =20 Make y in 'el-search-query-replace' instead of n move to the next match after replacing a match with r. This feels more logical when thinking about y and n as abbreviating "yes" and "no". Also do some related minor rewording. =20 * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Make y the key to confirm a replacement and go to the next match after replacing the current matc= h with r. --- packages/el-search/el-search.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-sear= ch.el index 2c7246a..d598a2b 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -298,9 +298,9 @@ ;; `(foo ,b ,a . ,rest) RET ;; ;; Type y to replace a match and go to the next one, r to replace -;; without moving, SPC or n to go to the next match and ! to replace -;; all remaining matches automatically. q quits. And ? shows a quick -;; help summarizing all of these keys. +;; without moving, n to go to the next match without replacing and ! +;; to replace all remaining matches automatically. q quits. ? shows +;; a quick help summarizing all of these keys. ;; ;; It is possible to replace a match with an arbitrary number of ;; expressions using "splicing mode". When it is active, the @@ -3711,13 +3711,14 @@ exactly you did? Thanks!")))) (+ nbr-done nbr-to-do))) (delq nil (list + `(?y "y" + ,(if replaced-this + "Keep replacement an= d move to the next match" + "Replace match and mov= e to the next")) (and (not replaced-this) - '(?y "y" "Replace this ma= tch and move to the next")) - (list ?n - (if replaced-this "next"= "n") - "Go to the next match") + '(?n "n" "Move to the nex= t match")) (and (not replaced-this) - '(?r "r" "Replace this ma= tch but don't move")) + '(?r "r" "Replace match b= ut don't move")) '(?! "all" "Replace all remain= ing matches in this buffer") '(?b "skip buf" "Skip this buffer and any= remaining matches in it") @@ -3737,10 +3738,11 @@ Toggle splicing mode (\\[describe-function] el-se= arch-query-replace for details) (while (not (pcase (funcall query) (?r (funcall do-replace) nil) - (?y (funcall do-replace) - t) + (?y + (unless replaced-this (funcall= do-replace)) + t) (?n - (unless replaced-this (cl-incf= nbr-skipped)) + (cl-incf nbr-skipped) t) (?! (when (and use-current-search From MAILER-DAEMON Sun Nov 11 15:04:53 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLvyX-0003BO-KT for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyV-0003Aq-7l for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLvyU-00052y-IS for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:51 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyT-00052U-G3 for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:49 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 404DD20498; Sun, 11 Nov 2018 15:04:49 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master updated (4ce0ed8 -> 7294b59) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <20181111200448.26295.47303@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 4ce0ed8bba7ee23ef5da8cd6b691c0f5c7503e38 X-Git-Newrev: 7294b5971588676b80319d3086679f0341e8fb7a Auto-Submitted: auto-generated Date: Sun, 11 Nov 2018 15:04:48 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 20:04:52 -0000 skolar42 pushed a change to branch master. from 4ce0ed8 [el-search] Make y move forward after replacing new e7ec6a8 Implemented finder cache new de3f6fa Bumped version new 9c48be8 Updated tests for new form expansion new e875a03 Improved contributing section in documentation new 71ee9f6 Added tests for cache new 26b0a6e Added documentation about using a timeout for cache new 7294b59 Merge commit '26b0a6e6fb03fe4b895bb03972bbb0d80ce2e= 8e3' Summary of changes: packages/org-edna/org-edna-tests.el | 95 ++++++++++- packages/org-edna/org-edna.el | 97 ++++++++++- packages/org-edna/org-edna.info | 322 ++++++++++++++++++++++++++----= ------ packages/org-edna/org-edna.org | 154 +++++++++++++++-- 4 files changed, 557 insertions(+), 111 deletions(-) From MAILER-DAEMON Sun Nov 11 15:04:54 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLvyY-0003Bo-4E for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyV-0003As-Ph for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLvyU-000537-Jn for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:51 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyU-00052k-Bz for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:50 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 4BDE6204D7; Sun, 11 Nov 2018 15:04:49 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master de3f6fa 2/7: Bumped version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181111200448.26295.47303@vcs0.savannah.gnu.org> References: <20181111200448.26295.47303@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: de3f6fa360387797bbb8bae3441eef7db49db947 Auto-Submitted: auto-generated Message-Id: <20181111200450.4BDE6204D7@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 15:04:49 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 20:04:52 -0000 branch: master commit de3f6fa360387797bbb8bae3441eef7db49db947 Author: Ian Dunn Commit: Ian Dunn Bumped version =20 * org-edna.org: Added entry for cache to changelog --- org-edna.el | 2 +- org-edna.org | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/org-edna.el b/org-edna.el index 5184350..773fd74 100644 --- a/org-edna.el +++ b/org-edna.el @@ -7,7 +7,7 @@ ;; Keywords: convenience, text, org ;; URL: https://savannah.nongnu.org/projects/org-edna-el/ ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5")) -;; Version: 1.0beta6 +;; Version: 1.0beta7 =20 ;; This file is part of GNU Emacs. =20 diff --git a/org-edna.org b/org-edna.org index e3422de..31240c9 100644 --- a/org-edna.org +++ b/org-edna.org @@ -1291,6 +1291,8 @@ making any changes: :PROPERTIES: :DESCRIPTION: List of changes by version :END: +** 1.0beta7 +- Added cache to the finders to improve performance ** 1.0beta6 Lots of parsing fixes. =20 From MAILER-DAEMON Sun Nov 11 15:04:54 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLvyY-0003C1-99 for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyV-0003Ar-Mp for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLvyU-00052x-IS for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:51 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyT-00052X-KI for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:49 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 7ACBF2049B; Sun, 11 Nov 2018 15:04:49 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master e7ec6a8 1/7: Implemented finder cache MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181111200448.26295.47303@vcs0.savannah.gnu.org> References: <20181111200448.26295.47303@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: e7ec6a832f3085e1a9e3dd37388dc2c37842b181 Auto-Submitted: auto-generated Message-Id: <20181111200449.7ACBF2049B@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 15:04:49 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 20:04:52 -0000 branch: master commit e7ec6a832f3085e1a9e3dd37388dc2c37842b181 Author: Ian Dunn Commit: Ian Dunn Implemented finder cache =20 * org-edna.el (org-edna--finder-input): (org-edna--finder-cache-entry): New structs. (org-edna-finder-use-cache): New defcustom to toggle cache. (org-edna--finder-cache): Internal cache table. (org-edna-finder-cache-timeout): New defcustom to control cache dur= ation. (org-edna--add-to-finder-cache): Internal helper function. (org-edna--finder-cache-timeout): Placeholder function. (org-edna--handle-finder): Handles cache for finders. (org-edna--expand-single-sexp-form): Use new finder function. --- org-edna.el | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/org-edna.el b/org-edna.el index 9974e3a..5184350 100644 --- a/org-edna.el +++ b/org-edna.el @@ -387,7 +387,7 @@ correspond to internal variables." (`(,type . ,func) (org-edna--function-for-key key))) (pcase type ('finder - `(setq ,target-var (org-edna--add-targets ,target-var (,func ,@ar= gs)))) + `(setq ,target-var (org-edna--add-targets ,target-var (org-edna--= handle-finder ',func ',args)))) ('action `(org-edna--handle-action ',func ,target-var (point-marker) ',arg= s)) ('condition @@ -464,6 +464,78 @@ which of the two types is allowed in STRING-FORM." (org-edna-eval-sexp-form (org-edna-string-form-to-sexp-form string-form action-or-condition))) =20 +;;; Cache + +;; Cache works because the returned values of finders are all markers. = Markers +;; will automatically update themselves when a buffer is edited. + +(cl-defstruct org-edna--finder-input + func-sym args) + +(cl-defstruct org-edna--finder-cache-entry + input results last-run-time) + +(defvar org-edna--finder-cache (make-hash-table :test 'equal)) + +(defcustom org-edna-finder-use-cache nil + "Whether to use cache for improved performance with finders. + +When cache is used for a finder, each finder call will store its +results for up to `org-edna-finder-cache-timeout' seconds. The +results and input are both stored, so the same form for a given +finder will yield the results of the previous call. + +If enough time has passed since the results in cache for a +specific form were generated, the results will be regenerated and +stored in cache. + +Minor changes to an Org file, such as setting properties or +adding unrelated headlines, will be taken into account." + :group 'org-edna + :type 'boolean) + +(defcustom org-edna-finder-cache-timeout 300 + "Maximum age to keep entries in cache, in seconds." + :group 'org-edna + :type 'number) + +(defun org-edna--add-to-finder-cache (func-sym args) + (let* ((results (apply func-sym args)) + (input (make-org-edna--finder-input :func-sym func-sym + :args args)) + (entry (make-org-edna--finder-cache-entry :input input + :results results + :last-run-time (curre= nt-time)))) + (map-put org-edna--finder-cache input entry))) + +(defun org-edna--finder-cache-timeout (_func-sym) + ;; In the future, we may want to support configurable timeouts on a pe= r-finder + ;; basis. + org-edna-finder-cache-timeout) + +(defun org-edna--handle-finder (func-sym args) + (if (not org-edna-finder-use-cache) + ;; Not using cache, so use the function directly. + (apply func-sym args) + (let* ((input (make-org-edna--finder-input :func-sym func-sym + :args args)) + (entry (map-elt org-edna--finder-cache input))) + (cond + ;; If we don't have an entry, rerun and make a new one. + ((not entry) + (org-edna--add-to-finder-cache func-sym args)) + ;; If we do have an entry, but it's timed out, then create a new = one. + ((>=3D (float-time (time-subtract (current-time) + (org-edna--finder-cache-entry-last= -run-time entry))) + (org-edna--finder-cache-timeout func-sym)) + (org-edna--add-to-finder-cache func-sym args)) + ;; If any element of the results is an invalid marker, then rerun= . + ((seq-find (lambda (x) (not (markerp x))) (org-edna--finder-cache= -entry-results entry) nil) + (org-edna--add-to-finder-cache func-sym args)) + ;; We have an entry created within the allowed interval. + (t + (org-edna--finder-cache-entry-results entry)))))) + =0C =20 (defmacro org-edna-run (change-plist &rest body) From MAILER-DAEMON Sun Nov 11 15:04:54 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLvyY-0003Ci-OR for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyW-0003BA-Tl for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLvyV-00053u-Or for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:52 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyV-00053l-Hy for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:51 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 7AC8820498; Sun, 11 Nov 2018 15:04:50 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 9c48be8 3/7: Updated tests for new form expansion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181111200448.26295.47303@vcs0.savannah.gnu.org> References: <20181111200448.26295.47303@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 9c48be86742dd659951dfec950d961188058af65 Auto-Submitted: auto-generated Message-Id: <20181111200451.7AC8820498@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 15:04:50 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 20:04:54 -0000 branch: master commit 9c48be86742dd659951dfec950d961188058af65 Author: Ian Dunn Commit: Ian Dunn Updated tests for new form expansion =20 * org-edna-tests.el (org-edna-action-scheduled/landing-no-hour): New = test to ensure landing doesn't mess with assigned time. --- org-edna-tests.el | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/org-edna-tests.el b/org-edna-tests.el index 0a9ddca..827e242 100644 --- a/org-edna-tests.el +++ b/org-edna-tests.el @@ -270,7 +270,7 @@ '(let ((targets1 nil) (consideration1 nil) (blocking-entry1 nil)) - (setq targets1 (org-edna--add-targets targets1 (org-edna= -finder/self))) + (setq targets1 (org-edna--add-targets targets1 (org-edna= --handle-finder 'org-edna-finder/self 'nil))) (setq blocking-entry1 (or blocking-entry1 (org-edna--handle-condition 'org-edna-conditio= n/done? @@ -303,7 +303,7 @@ (blocking-entry2 blocking-entry1)) (setq targets2 (org-edna--add-targets targets2 - (org-edna-finder/match "= checklist"))) + (org-edna--handle-finder= 'org-edna-finder/match '("checklist")))) (org-edna--handle-action 'org-edna-action/todo! targets2 (point-marker) @@ -313,7 +313,7 @@ (blocking-entry5 blocking-entry1)) (setq targets5 (org-edna--add-targets targets5 - (org-edna-finder/sibling= s))) + (org-edna--handle-finder= 'org-edna-finder/siblings 'nil))) (org-edna--handle-action 'org-edna-action/todo! targets5 (point-marker) @@ -355,7 +355,7 @@ ;; Add targets for checklist match (setq targets3 (org-edna--add-targets targets3 - (org-edna-finder/ma= tch "checklist"))) + (org-edna--handle-f= inder 'org-edna-finder/match '("checklist")))) ;; Handle condition (setq blocking-entry3 (or blocking-entry3 @@ -365,7 +365,7 @@ ;; Add targets for self finder (setq targets1 (org-edna--add-targets targets1 - (org-edna-finder/sel= f))) + (org-edna--handle-fi= nder 'org-edna-finder/self 'nil))) ;; Mark as TODO (org-edna--handle-action 'org-edna-action/todo! t= argets1 (point-marker) @@ -375,7 +375,7 @@ ;; Find siblings (setq targets1 (org-edna--add-targets targets1 - (org-edna-finder/sibli= ngs))) + (org-edna--handle-find= er 'org-edna-finder/siblings 'nil))) ;; Mark as DONE (org-edna--handle-action 'org-edna-action/todo! tar= gets1 (point-marker) @@ -416,7 +416,7 @@ ;; Add targets for checklist match (setq targets3 (org-edna--add-targets targets3 - (org-edna-finder/ma= tch "checklist"))) + (org-edna--handle-f= inder 'org-edna-finder/match '("checklist")))) ;; Handle condition (setq blocking-entry3 (or blocking-entry3 @@ -426,7 +426,7 @@ ;; Add targets for self finder (setq targets1 (org-edna--add-targets targets1 - (org-edna-finder/sel= f))) + (org-edna--handle-fi= nder 'org-edna-finder/self 'nil))) ;; Mark as TODO (org-edna--handle-action 'org-edna-action/todo! t= argets1 (point-marker) @@ -1198,6 +1198,30 @@ (should (string-equal (org-entry-get nil "SCHEDULED") "<2000-01-15 Sat 00:00>"))))) =20 +(ert-deftest org-edna-action-scheduled/landing-no-hour () + "Test landing arguments to scheduled increment, without hour." + ;; Override `current-time' so we can get a deterministic value + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (org-agenda-files `(,org-edna-test-file)) + (target (org-id-find "caf27724-0887-4565-9765-ed2f1edcfb16"= t))) + (org-with-point-at target + ;; Time starts at Jan 1, 2017 + (org-edna-action/scheduled! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-01 Sun>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-08 Sun>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/scheduled! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-16 Mon>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-01 Sun>"))))) + (ert-deftest org-edna-action-scheduled/float () (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) From MAILER-DAEMON Sun Nov 11 15:04:56 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLvyZ-0003E0-Ur for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyX-0003BK-JQ for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLvyW-00054p-Ff for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:53 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyW-00054U-88 for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:52 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 2FFBD2049B; Sun, 11 Nov 2018 15:04:52 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 26b0a6e 6/7: Added documentation about using a timeout for cache MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181111200448.26295.47303@vcs0.savannah.gnu.org> References: <20181111200448.26295.47303@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 26b0a6e6fb03fe4b895bb03972bbb0d80ce2e8e3 Auto-Submitted: auto-generated Message-Id: <20181111200452.2FFBD2049B@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 15:04:52 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 20:04:54 -0000 branch: master commit 26b0a6e6fb03fe4b895bb03972bbb0d80ce2e8e3 Author: Ian Dunn Commit: Ian Dunn Added documentation about using a timeout for cache --- org-edna.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/org-edna.el b/org-edna.el index 5a152e6..37c9849 100644 --- a/org-edna.el +++ b/org-edna.el @@ -469,6 +469,11 @@ which of the two types is allowed in STRING-FORM." ;; Cache works because the returned values of finders are all markers. = Markers ;; will automatically update themselves when a buffer is edited. =20 +;; We use a timeout for cache because it's expected that the Org files +;; themselves will change. Thus, there's no assured way to determine if= we need +;; to update the cache without actually running again. Therefore, we as= sume +;; most operations that the user wants to expedite will be performed in = bulk. + (cl-defstruct org-edna--finder-input func-sym args) =20 From MAILER-DAEMON Sun Nov 11 15:04:57 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLvyb-0003FS-Fy for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyY-0003Bz-91 for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLvyW-00054g-BS for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:54 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyW-00054N-2c for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:52 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id EFA1620498; Sun, 11 Nov 2018 15:04:51 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 71ee9f6 5/7: Added tests for cache MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181111200448.26295.47303@vcs0.savannah.gnu.org> References: <20181111200448.26295.47303@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 71ee9f672b538684b3a517cd35d682c6c689fa93 Auto-Submitted: auto-generated Message-Id: <20181111200451.EFA1620498@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 15:04:51 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 20:04:55 -0000 branch: master commit 71ee9f672b538684b3a517cd35d682c6c689fa93 Author: Ian Dunn Commit: Ian Dunn Added tests for cache =20 * org-edna.el (org-edna--get-cache-entry): New function for finding a= n entry in cache. (org-edna--handle-finder): Use it. (org-edna--expand-single-sexp-form): Update calling method of `org-edna--handle-finder'. =20 * org-edna-tests.el (org-edna-cache/no-entry): (org-edna-cache/added-new-entry): (org-edna-cache/timed-out): New tests for cache. --- org-edna-tests.el | 71 ++++++++++++++++++++++++++++++++++++++++++++++++-= ------ org-edna.el | 58 +++++++++++++++++++++++++++++---------------- 2 files changed, 100 insertions(+), 29 deletions(-) diff --git a/org-edna-tests.el b/org-edna-tests.el index 827e242..890ddd9 100644 --- a/org-edna-tests.el +++ b/org-edna-tests.el @@ -270,7 +270,7 @@ '(let ((targets1 nil) (consideration1 nil) (blocking-entry1 nil)) - (setq targets1 (org-edna--add-targets targets1 (org-edna= --handle-finder 'org-edna-finder/self 'nil))) + (setq targets1 (org-edna--add-targets targets1 (org-edna= --handle-finder 'org-edna-finder/self (quote)))) (setq blocking-entry1 (or blocking-entry1 (org-edna--handle-condition 'org-edna-conditio= n/done? @@ -303,7 +303,7 @@ (blocking-entry2 blocking-entry1)) (setq targets2 (org-edna--add-targets targets2 - (org-edna--handle-finder= 'org-edna-finder/match '("checklist")))) + (org-edna--handle-finder= 'org-edna-finder/match '"checklist"))) (org-edna--handle-action 'org-edna-action/todo! targets2 (point-marker) @@ -313,7 +313,7 @@ (blocking-entry5 blocking-entry1)) (setq targets5 (org-edna--add-targets targets5 - (org-edna--handle-finder= 'org-edna-finder/siblings 'nil))) + (org-edna--handle-finder= 'org-edna-finder/siblings (quote)))) (org-edna--handle-action 'org-edna-action/todo! targets5 (point-marker) @@ -355,7 +355,7 @@ ;; Add targets for checklist match (setq targets3 (org-edna--add-targets targets3 - (org-edna--handle-f= inder 'org-edna-finder/match '("checklist")))) + (org-edna--handle-f= inder 'org-edna-finder/match '"checklist"))) ;; Handle condition (setq blocking-entry3 (or blocking-entry3 @@ -365,7 +365,7 @@ ;; Add targets for self finder (setq targets1 (org-edna--add-targets targets1 - (org-edna--handle-fi= nder 'org-edna-finder/self 'nil))) + (org-edna--handle-fi= nder 'org-edna-finder/self (quote)))) ;; Mark as TODO (org-edna--handle-action 'org-edna-action/todo! t= argets1 (point-marker) @@ -375,7 +375,7 @@ ;; Find siblings (setq targets1 (org-edna--add-targets targets1 - (org-edna--handle-find= er 'org-edna-finder/siblings 'nil))) + (org-edna--handle-find= er 'org-edna-finder/siblings (quote)))) ;; Mark as DONE (org-edna--handle-action 'org-edna-action/todo! tar= gets1 (point-marker) @@ -416,7 +416,7 @@ ;; Add targets for checklist match (setq targets3 (org-edna--add-targets targets3 - (org-edna--handle-f= inder 'org-edna-finder/match '("checklist")))) + (org-edna--handle-f= inder 'org-edna-finder/match '"checklist"))) ;; Handle condition (setq blocking-entry3 (or blocking-entry3 @@ -426,7 +426,7 @@ ;; Add targets for self finder (setq targets1 (org-edna--add-targets targets1 - (org-edna--handle-fi= nder 'org-edna-finder/self 'nil))) + (org-edna--handle-fi= nder 'org-edna-finder/self (quote)))) ;; Mark as TODO (org-edna--handle-action 'org-edna-action/todo! t= argets1 (point-marker) @@ -1073,6 +1073,61 @@ (org-with-point-at current (org-edna-finder/relatives arg 'deadline-down size)= ))))) =20 +(ert-deftest org-edna-cache/no-entry () + (let* ((org-edna-finder-use-cache t) + (org-edna--finder-cache (make-hash-table :test 'equal))) + ;; Empty, so `org-edna--get-cache-entry' should return nil. + (should (not (org-edna--get-cache-entry 'org-edna-finder/match '("te= st&1")))))) + +(ert-deftest org-edna-cache/added-new-entry () + (let* ((org-edna-finder-use-cache t) + (org-edna--finder-cache (make-hash-table :test 'equal)) + (org-agenda-files `(,org-edna-test-file)) + (targets (org-edna--handle-finder 'org-edna-finder/match "test&= 1"))) + (should (=3D (length targets) 2)) + (should (string-equal (org-edna-heading (nth 0 targets)) "Tagged Hea= ding 1")) + (should (string-equal (org-edna-heading (nth 1 targets)) "Tagged Hea= ding 2")) + (should (=3D (hash-table-count org-edna--finder-cache) 1)) + ;; Verify that we've got a valid cache entry. + (should (org-edna--get-cache-entry 'org-edna-finder/match '("test&1"= ))) + ;; Verify that any other signature returns nil. + (should (not (org-edna--get-cache-entry 'org-edna-finder/match '("te= st&2")))) + (let ((cache-entry (gethash (make-org-edna--finder-input :func-sym '= org-edna-finder/match + :args '("te= st&1")) + org-edna--finder-cache))) + (should cache-entry) + (should (equal (org-edna--finder-cache-entry-input cache-entry) + (make-org-edna--finder-input :func-sym 'org-edna-fi= nder/match + :args '("test&1")))) + (should (equal (org-edna--finder-cache-entry-results cache-entry) + targets))))) + +(ert-deftest org-edna-cache/timed-out () + (let* ((org-edna-finder-use-cache t) + (org-edna--finder-cache (make-hash-table :test 'equal)) + (org-edna-finder-cache-timeout 1) ;; Set timeout to 1 second + (org-agenda-files `(,org-edna-test-file)) + (targets (org-edna--handle-finder 'org-edna-finder/match "test&= 1")) + ;; Time increment required to invalidate a cache entry + (time-increment `(0 ,org-edna-finder-cache-timeout))) + (should (org-edna--get-cache-entry 'org-edna-finder/match '("test&1"= ))) + ;; Validate the cache entry + (let ((cache-entry (gethash (make-org-edna--finder-input :func-sym '= org-edna-finder/match + :args '("te= st&1")) + org-edna--finder-cache))) + (should cache-entry) + (should (equal (org-edna--finder-cache-entry-input cache-entry) + (make-org-edna--finder-input :func-sym 'org-edna-fi= nder/match + :args '("test&1")))) + (should (equal (org-edna--finder-cache-entry-results cache-entry) + targets)) + ;; Override `current-time' so we can get a deterministic value + ;; The value invalidates the cache entry + (cl-letf* (((symbol-function 'current-time) + (lambda () (time-add (org-edna--finder-cache-entry-las= t-run-time cache-entry) + time-increment)))) + (should (not (org-edna--get-cache-entry 'org-edna-finder/match '= ("test&1")))))))) + =0C ;; Actions =20 diff --git a/org-edna.el b/org-edna.el index 773fd74..5a152e6 100644 --- a/org-edna.el +++ b/org-edna.el @@ -387,7 +387,7 @@ correspond to internal variables." (`(,type . ,func) (org-edna--function-for-key key))) (pcase type ('finder - `(setq ,target-var (org-edna--add-targets ,target-var (org-edna--= handle-finder ',func ',args)))) + `(setq ,target-var (org-edna--add-targets ,target-var (org-edna--= handle-finder ',func ',@args)))) ('action `(org-edna--handle-action ',func ,target-var (point-marker) ',arg= s)) ('condition @@ -506,35 +506,51 @@ adding unrelated headlines, will be taken into acco= unt." (entry (make-org-edna--finder-cache-entry :input input :results results :last-run-time (curre= nt-time)))) - (map-put org-edna--finder-cache input entry))) + (puthash input entry org-edna--finder-cache) + ;; Returning the results here passes them to the calling function. = It's the + ;; only part of the entry we care about here. + results)) =20 (defun org-edna--finder-cache-timeout (_func-sym) ;; In the future, we may want to support configurable timeouts on a pe= r-finder ;; basis. org-edna-finder-cache-timeout) =20 -(defun org-edna--handle-finder (func-sym args) +(defun org-edna--get-cache-entry (func-sym args) + "Find a valid entry in the cache. + +If none exists, return nil. An entry is invalid for any of the +following reasons: + +- It doesn't exist +- It has timed out +- It contains an invalid marker" + (let* ((input (make-org-edna--finder-input :func-sym func-sym + :args args)) + (entry (gethash input org-edna--finder-cache))) + (cond + ;; If we don't have an entry, rerun and make a new one. + ((not entry) nil) + ;; If we do have an entry, but it's timed out, then create a new on= e. + ((>=3D (float-time (time-subtract (current-time) + (org-edna--finder-cache-entry-last-r= un-time entry))) + (org-edna--finder-cache-timeout func-sym)) + nil) + ;; If any element of the results is an invalid marker, then rerun. + ((seq-find (lambda (x) (not (markerp x))) (org-edna--finder-cache-e= ntry-results entry) nil) + nil) + ;; We have an entry created within the allowed interval. + (t entry)))) + +(defun org-edna--handle-finder (func-sym &rest args) (if (not org-edna-finder-use-cache) ;; Not using cache, so use the function directly. (apply func-sym args) - (let* ((input (make-org-edna--finder-input :func-sym func-sym - :args args)) - (entry (map-elt org-edna--finder-cache input))) - (cond - ;; If we don't have an entry, rerun and make a new one. - ((not entry) - (org-edna--add-to-finder-cache func-sym args)) - ;; If we do have an entry, but it's timed out, then create a new = one. - ((>=3D (float-time (time-subtract (current-time) - (org-edna--finder-cache-entry-last= -run-time entry))) - (org-edna--finder-cache-timeout func-sym)) - (org-edna--add-to-finder-cache func-sym args)) - ;; If any element of the results is an invalid marker, then rerun= . - ((seq-find (lambda (x) (not (markerp x))) (org-edna--finder-cache= -entry-results entry) nil) - (org-edna--add-to-finder-cache func-sym args)) - ;; We have an entry created within the allowed interval. - (t - (org-edna--finder-cache-entry-results entry)))))) + (let* ((entry (org-edna--get-cache-entry func-sym args))) + (if entry + (org-edna--finder-cache-entry-results entry) + ;; Adds the entry to the cache, and returns the results. + (org-edna--add-to-finder-cache func-sym args))))) =20 =0C =20 From MAILER-DAEMON Sun Nov 11 15:05:01 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLvyd-0003H4-5w for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:05:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyY-0003Cq-TO for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLvyW-00054E-1G for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:54 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyV-000542-QL for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:51 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id B3AD12049B; Sun, 11 Nov 2018 15:04:51 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master e875a03 4/7: Improved contributing section in documentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181111200448.26295.47303@vcs0.savannah.gnu.org> References: <20181111200448.26295.47303@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: e875a03af1cfd2cfc6b6672244d8a9c61cdc4783 Auto-Submitted: auto-generated Message-Id: <20181111200451.B3AD12049B@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 15:04:51 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 20:04:57 -0000 branch: master commit e875a03af1cfd2cfc6b6672244d8a9c61cdc4783 Author: Ian Dunn Commit: Ian Dunn Improved contributing section in documentation =20 * org-edna.org (Installation and Setup): Removed compilation instruct= ions. (Finder Cache): New section documenting cache setup. (Working with EDE): New section about EDE. (Compiling Edna): New section about compiling Edna. (Testing Edna): New section on how to test Edna. (Before Sending Changes): Moved out of "development" (Developing with Bazaar): Moved out of "development" (Development): Removed. (Changelog): Updated. --- org-edna.info | 322 ++++++++++++++++++++++++++++++++++++++++++----------= ------ org-edna.org | 152 ++++++++++++++++++++++++--- 2 files changed, 373 insertions(+), 101 deletions(-) diff --git a/org-edna.info b/org-edna.info index 33b6708..fde1e6e 100644 --- a/org-edna.info +++ b/org-edna.info @@ -76,6 +76,7 @@ Actions =20 Advanced Features =20 +* Finder Cache:: Making the finders work faster * Conditions:: More than just DONE headings * Consideration:: Only some of them * Conditional Forms:: If/Then/Else @@ -102,11 +103,16 @@ Extending Edna Contributing =20 * Bugs:: -* Development:: +* Working with EDE:: And all its quirks +* Compiling Edna:: How to compile Edna +* Testing Edna:: Ensuring Edna works the way we think sh= e will +* Before Sending Changes:: Follow these instructions before sendin= g us anything +* Developing with Bazaar:: How to use this strange VCS * Documentation:: Improving the documentation =20 Changelog =20 +* 1.0beta7: 10beta7. * 1.0beta6: 10beta6. * 1.0beta5: 10beta5. * 1.0beta4: 10beta4. @@ -184,13 +190,12 @@ org 9.0.5 From Source: =20 bzr branch https://bzr.savannah.gnu.org/r/org-edna-el/ org-edna - make -C org-edna compile autoloads =20 After that, add the following to your init file (typically .emacs): =20 ;; Only necessary if installing from source (add-to-list 'load-path "/full/path/to/org-edna/") - (load "/path/to/org-edna/org-edna-autoloads.el") + (require 'org-edna) =20 ;; Always necessary (org-edna-load) @@ -1056,13 +1061,39 @@ Advanced Features =20 * Menu: =20 +* Finder Cache:: Making the finders work faster * Conditions:: More than just DONE headings * Consideration:: Only some of them * Conditional Forms:: If/Then/Else * Setting the Properties:: The easy way to set BLOCKER and TRIGGER =20 =1F -File: org-edna.info, Node: Conditions, Next: Consideration, Up: Advan= ced Features +File: org-edna.info, Node: Finder Cache, Next: Conditions, Up: Advanc= ed Features + +Finder Cache +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Some finders, =E2=80=98match=E2=80=99 in particular, can take a long tim= e to run. +Oftentimes, this can make it unappealing to use Edna at all, especially +with long checklists. + + The finder cache is one solution to this. To enable it, set +=E2=80=98org-edna-finder-use-cache=E2=80=99 to non-nil. This can be don= e through the +customization interface, or manually with =E2=80=98setq=E2=80=99. + + When enabled, the cache will store the results of every finder form +for a configurable amount of time. This timeout is controlled by +=E2=80=98org-edna-finder-cache-timeout=E2=80=99. The cache is also inva= lidated if any +of the results are invalid, which can happen if their target files have +been closed. + + For example, if there are several entries in a checklist that all use +the form =E2=80=98match("daily")=E2=80=99 as part of their trigger, the = results of that +form will be cached. When the next item is marked as DONE, the results +will be searched for in cache, not recomputed. + +=1F +File: org-edna.info, Node: Conditions, Next: Consideration, Prev: Fin= der Cache, Up: Advanced Features =20 Conditions =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -1441,11 +1472,15 @@ We are all happy for any help you may provide. * Menu: =20 * Bugs:: -* Development:: +* Working with EDE:: And all its quirks +* Compiling Edna:: How to compile Edna +* Testing Edna:: Ensuring Edna works the way we think sh= e will +* Before Sending Changes:: Follow these instructions before sendin= g us anything +* Developing with Bazaar:: How to use this strange VCS * Documentation:: Improving the documentation =20 =1F -File: org-edna.info, Node: Bugs, Next: Development, Up: Contributing +File: org-edna.info, Node: Bugs, Next: Working with EDE, Up: Contribu= ting =20 Bugs =3D=3D=3D=3D @@ -1459,10 +1494,111 @@ There are two ways to submit bug reports: caused the bug, with as much context as possible. =20 =1F -File: org-edna.info, Node: Development, Next: Documentation, Prev: Bu= gs, Up: Contributing +File: org-edna.info, Node: Working with EDE, Next: Compiling Edna, Pr= ev: Bugs, Up: Contributing + +Working with EDE +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Our build system uses EDE. EDE can be a little finicky at times, but we +feel the benefits, namely package dependency handling and Makefile +generation, outweigh the costs. + + One of the issues that many will likely encounter is the error +=E2=80=9CCorrupt file on disk=E2=80=9D. This is most often due to EDE n= ot loading all +its subprojects as needed. If you find yourself dealing with this error +often, place the following in your .emacs file: + + ;; Target types needed for working with edna + (require 'ede/proj-elisp) + (require 'ede/proj-aux) + (require 'ede/proj-misc) + + These are the three target types that edna uses: elisp for +compilation and autoloads; aux for auxiliary files such as +documentation; and misc for tests. + + When creating a new file, EDE will ask if you want to add it to a +target. Consult with one of the edna devs for guidance, but usually +selecting =E2=80=9Cnone=E2=80=9D and letting one of us handle it is a go= od way to go. + +=1F +File: org-edna.info, Node: Compiling Edna, Next: Testing Edna, Prev: = Working with EDE, Up: Contributing + +Compiling Edna +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +To compile Edna, you=E2=80=99ve got to have EDE create the Makefile firs= t. Run +the following in your Emacs instance to generate the Makefile: + + M-x ede-proj-regenerate + + This will create the Makefile and point it to the correct version of +Org. The targets are as follows: + +compile + Compiles the code. This should be done to verify that everything + will compile, as ELPA requires this. +autoloads + Creates the autoloads file. This should also run without problems, + so it=E2=80=99s a good idea to check this one as well. +check + Runs the tests in =E2=80=98org-edna-tests.el=E2=80=99. + + To run any target, call =E2=80=98make=E2=80=99: + + make compile autoloads + + The above command compiles Edna and generates the autoloads file. + +=1F +File: org-edna.info, Node: Testing Edna, Next: Before Sending Changes,= Prev: Compiling Edna, Up: Contributing + +Testing Edna +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +There are two ways to test Edna: the command-line and through Emacs. + + The command-line version is simple, and we ask that you do any final +testing using this method. This is how we periodically check to verify +that new versions of Org mode haven=E2=80=99t broken Edna. It uses the +Makefile, which is generated with EDE. See *note Compiling Edna:: for +how to do that. Once you have, run =E2=80=98make check=E2=80=99 on the = command line. + + Edna tests are written using =E2=80=98ERT=E2=80=99, the Emacs Regress= ion Testing +framework. In order to use it interactively in Emacs, the following +must be done: + + 1. Load =E2=80=98org-edna-tests.el=E2=80=99 + 2. Run =E2=80=98M-x ert-run-tests-interactively=E2=80=99 + 3. Select which tests to run, or just the letter =E2=80=9Ct=E2=80=9D t= o run all of + them. + + Results are printed in their own buffer. See the ERT documentation +for more details. + +=1F +File: org-edna.info, Node: Before Sending Changes, Next: Developing wi= th Bazaar, Prev: Testing Edna, Up: Contributing + +Before Sending Changes +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +There are a few rules to follow: + + =E2=80=A2 Verify that any new Edna keywords follow the appropriate na= ming + conventions + =E2=80=A2 Any new keywords should be documented + =E2=80=A2 We operate on headings, not headlines + =E2=80=A2 Use one word in documentation to avoid confusion + =E2=80=A2 Make sure your changes compile + =E2=80=A2 Run =E2=80=99make check=E2=80=99 to verify that your mods d= on=E2=80=99t break anything + =E2=80=A2 Avoid additional or altered dependencies if at all possible + =E2=80=A2 Exception: New versions of Org mode are allowed + +=1F +File: org-edna.info, Node: Developing with Bazaar, Next: Documentation= , Prev: Before Sending Changes, Up: Contributing =20 -Development -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Developing with Bazaar +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 If you=E2=80=99re new to bazaar, we recommend using Emacs=E2=80=99s buil= t-in VC package. It eases the overhead of dealing with a brand new VCS with a few @@ -1478,19 +1614,8 @@ Emacs, this is C-h r m Introduction to VC RET). Then, use =E2=80=98org-edna-submit-bug-report=E2=80=99 and attach =E2= =80=9Cfile-name.txt=E2=80=9D. We can then merge that into the main development branch. =20 - There are a few rules to follow: - - =E2=80=A2 Verify that any new Edna keywords follow the appropriate na= ming - conventions - =E2=80=A2 Any new keywords should be documented - =E2=80=A2 We operate on headings, not headlines - =E2=80=A2 Use one word to avoid confusion - =E2=80=A2 Run =E2=80=99make check=E2=80=99 to verify that your mods d= on=E2=80=99t break anything - =E2=80=A2 Avoid additional or altered dependencies if at all possible - =E2=80=A2 Exception: New versions of Org mode are allowed - =1F -File: org-edna.info, Node: Documentation, Prev: Development, Up: Cont= ributing +File: org-edna.info, Node: Documentation, Prev: Developing with Bazaar= , Up: Contributing =20 Documentation =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -1511,6 +1636,7 @@ Changelog =20 * Menu: =20 +* 1.0beta7: 10beta7. * 1.0beta6: 10beta6. * 1.0beta5: 10beta5. * 1.0beta4: 10beta4. @@ -1518,7 +1644,21 @@ Changelog * 1.0beta2: 10beta2. =20 =1F -File: org-edna.info, Node: 10beta6, Next: 10beta5, Up: Changelog +File: org-edna.info, Node: 10beta7, Next: 10beta6, Up: Changelog + +1.0beta7 +=3D=3D=3D=3D=3D=3D=3D=3D + +Biggest change here is the cache. + + =E2=80=A2 Added cache to the finders to improve performance + + =E2=80=A2 Updated documentation to include EDE + + =E2=80=A2 Added testing and compiling documentation + +=1F +File: org-edna.info, Node: 10beta6, Next: 10beta5, Prev: 10beta7, Up= : Changelog =20 1.0beta6 =3D=3D=3D=3D=3D=3D=3D=3D @@ -1610,72 +1750,78 @@ Big release here, with three new features. =1F Tag Table: Node: Top=7F225 -Node: Copying=7F3693 -Node: Introduction=7F4515 -Node: Installation and Setup=7F5463 -Node: Basic Operation=7F6256 -Node: Blockers=7F8107 -Node: Triggers=7F8393 -Node: Syntax=7F8655 -Node: Basic Features=7F9345 -Node: Finders=7F9648 -Node: ancestors=7F11413 -Node: children=7F12007 -Node: descendants=7F12417 -Node: file=7F12939 -Node: first-child=7F13688 -Node: ids=7F13948 -Node: match=7F14609 -Node: next-sibling=7F15247 -Node: next-sibling-wrap=7F15504 -Node: olp=7F15818 -Node: org-file=7F16230 -Node: parent=7F16875 -Node: previous-sibling=7F17073 -Node: previous-sibling-wrap=7F17334 -Node: relatives=7F17613 -Node: rest-of-siblings=7F21234 -Node: rest-of-siblings-wrap=7F21519 -Node: self=7F21868 -Node: siblings=7F22029 -Node: siblings-wrap=7F22266 -Node: Actions=7F22570 -Node: Scheduled/Deadline=7F23312 -Node: TODO State=7F26887 -Node: Archive=7F27255 -Node: Chain Property=7F27575 -Node: Clocking=7F27858 -Node: Property=7F28270 -Node: Priority=7F30457 -Node: Tag=7F31026 -Node: Effort=7F31243 -Node: Advanced Features=7F31632 -Node: Conditions=7F32016 -Node: done=7F32631 -Node: headings=7F32795 -Node: todo-state=7F33171 -Node: variable-set=7F33427 -Node: has-property=7F33856 -Node: re-search=7F34125 -Node: Negating Conditions=7F34485 -Node: Consideration=7F34872 -Node: Conditional Forms=7F36441 -Node: Setting the Properties=7F39097 -Node: Extending Edna=7F40181 -Node: Naming Conventions=7F40671 -Node: Finders 1=7F41132 -Node: Actions 1=7F41494 -Node: Conditions 1=7F41953 -Node: Contributing=7F42839 -Node: Bugs=7F43390 -Node: Development=7F43742 -Node: Documentation=7F44895 -Node: Changelog=7F45340 -Node: 10beta6=7F45548 -Node: 10beta5=7F45808 -Node: 10beta4=7F46195 -Node: 10beta3=7F46448 -Node: 10beta2=7F46887 +Node: Copying=7F4093 +Node: Introduction=7F4915 +Node: Installation and Setup=7F5863 +Node: Basic Operation=7F6587 +Node: Blockers=7F8438 +Node: Triggers=7F8724 +Node: Syntax=7F8986 +Node: Basic Features=7F9676 +Node: Finders=7F9979 +Node: ancestors=7F11744 +Node: children=7F12338 +Node: descendants=7F12748 +Node: file=7F13270 +Node: first-child=7F14019 +Node: ids=7F14279 +Node: match=7F14940 +Node: next-sibling=7F15578 +Node: next-sibling-wrap=7F15835 +Node: olp=7F16149 +Node: org-file=7F16561 +Node: parent=7F17206 +Node: previous-sibling=7F17404 +Node: previous-sibling-wrap=7F17665 +Node: relatives=7F17944 +Node: rest-of-siblings=7F21565 +Node: rest-of-siblings-wrap=7F21850 +Node: self=7F22199 +Node: siblings=7F22360 +Node: siblings-wrap=7F22597 +Node: Actions=7F22901 +Node: Scheduled/Deadline=7F23643 +Node: TODO State=7F27218 +Node: Archive=7F27586 +Node: Chain Property=7F27906 +Node: Clocking=7F28189 +Node: Property=7F28601 +Node: Priority=7F30788 +Node: Tag=7F31357 +Node: Effort=7F31574 +Node: Advanced Features=7F31963 +Node: Finder Cache=7F32411 +Node: Conditions=7F33450 +Node: done=7F34086 +Node: headings=7F34250 +Node: todo-state=7F34626 +Node: variable-set=7F34882 +Node: has-property=7F35311 +Node: re-search=7F35580 +Node: Negating Conditions=7F35940 +Node: Consideration=7F36327 +Node: Conditional Forms=7F37896 +Node: Setting the Properties=7F40552 +Node: Extending Edna=7F41636 +Node: Naming Conventions=7F42126 +Node: Finders 1=7F42587 +Node: Actions 1=7F42949 +Node: Conditions 1=7F43408 +Node: Contributing=7F44294 +Node: Bugs=7F45160 +Node: Working with EDE=7F45517 +Node: Compiling Edna=7F46601 +Node: Testing Edna=7F47470 +Node: Before Sending Changes=7F48451 +Node: Developing with Bazaar=7F49138 +Node: Documentation=7F49879 +Node: Changelog=7F50335 +Node: 10beta7=7F50564 +Node: 10beta6=7F50842 +Node: 10beta5=7F51118 +Node: 10beta4=7F51505 +Node: 10beta3=7F51758 +Node: 10beta2=7F52197 =1F End Tag Table =20 diff --git a/org-edna.org b/org-edna.org index 31240c9..6e6c35f 100644 --- a/org-edna.org +++ b/org-edna.org @@ -70,7 +70,6 @@ From Source: =20 #+BEGIN_SRC shell bzr branch https://bzr.savannah.gnu.org/r/org-edna-el/ org-edna -make -C org-edna compile autoloads #+END_SRC =20 After that, add the following to your init file (typically .emacs): @@ -78,7 +77,7 @@ After that, add the following to your init file (typica= lly .emacs): #+BEGIN_SRC emacs-lisp ;; Only necessary if installing from source (add-to-list 'load-path "/full/path/to/org-edna/") -(load "/path/to/org-edna/org-edna-autoloads.el") +(require 'org-edna) =20 ;; Always necessary (org-edna-load) @@ -874,6 +873,30 @@ Sets the effort of all targets according to VALUE: :PROPERTIES: :CUSTOM_ID: advanced :END: +** Finder Cache +:PROPERTIES: +:CUSTOM_ID: cache +:DESCRIPTION: Making the finders work faster +:END: + +Some finders, ~match~ in particular, can take a long time to run. Often= times, +this can make it unappealing to use Edna at all, especially with long +checklists. + +The finder cache is one solution to this. To enable it, set +~org-edna-finder-use-cache~ to non-nil. This can be done through the +customization interface, or manually with ~setq~. + +When enabled, the cache will store the results of every finder form for = a +configurable amount of time. This timeout is controlled by +~org-edna-finder-cache-timeout~. The cache is also invalidated if any o= f the +results are invalid, which can happen if their target files have been cl= osed. + +For example, if there are several entries in a checklist that all use th= e form +~match("daily")~ as part of their trigger, the results of that form will= be +cached. When the next item is marked as DONE, the results will be searc= hed for +in cache, not recomputed. + ** Conditions :PROPERTIES: :CUSTOM_ID: conditions @@ -1238,6 +1261,9 @@ git clone git://orgmode.org/org-mode.git #+END_SRC =20 ** Bugs +:PROPERTIES: +:CUSTOM_ID: bugs +:END: =20 There are two ways to submit bug reports: =20 @@ -1247,7 +1273,110 @@ There are two ways to submit bug reports: When submitting a bug report, be sure to include the Edna form that caus= ed the bug, with as much context as possible. =20 -** Development +** Working with EDE +:PROPERTIES: +:CUSTOM_ID: ede +:DESCRIPTION: And all its quirks +:END: + +Our build system uses EDE. EDE can be a little finicky at times, but we= feel +the benefits, namely package dependency handling and Makefile generation= , +outweigh the costs. + +One of the issues that many will likely encounter is the error "Corrupt = file on +disk". This is most often due to EDE not loading all its subprojects as= needed. +If you find yourself dealing with this error often, place the following = in your +.emacs file: + +#+begin_src emacs-lisp +;; Target types needed for working with edna +(require 'ede/proj-elisp) +(require 'ede/proj-aux) +(require 'ede/proj-misc) +#+end_src + +These are the three target types that edna uses: elisp for compilation a= nd +autoloads; aux for auxiliary files such as documentation; and misc for t= ests. + +When creating a new file, EDE will ask if you want to add it to a target= . +Consult with one of the edna devs for guidance, but usually selecting "n= one" +and letting one of us handle it is a good way to go. + +** Compiling Edna +:PROPERTIES: +:CUSTOM_ID: compiling +:DESCRIPTION: How to compile Edna +:END: +To compile Edna, you've got to have EDE create the Makefile first. Run = the +following in your Emacs instance to generate the Makefile: + +#+begin_example +M-x ede-proj-regenerate +#+end_example + +This will create the Makefile and point it to the correct version of Org= . The +targets are as follows: + +- compile :: Compiles the code. This should be done to verify that ever= ything + will compile, as ELPA requires this. +- autoloads :: Creates the autoloads file. This should also run without + problems, so it's a good idea to check this one as well. +- check :: Runs the tests in ~org-edna-tests.el~. + +To run any target, call ~make~: + +#+begin_src shell +make compile autoloads +#+end_src + +The above command compiles Edna and generates the autoloads file. + +** Testing Edna +:PROPERTIES: +:CUSTOM_ID: testing +:DESCRIPTION: Ensuring Edna works the way we think she will +:END: + +There are two ways to test Edna: the command-line and through Emacs. + +The command-line version is simple, and we ask that you do any final tes= ting +using this method. This is how we periodically check to verify that new +versions of Org mode haven't broken Edna. It uses the Makefile, which i= s +generated with EDE. See [[#compiling][Compiling Edna]] for how to do th= at. Once you have, run +~make check~ on the command line. + +Edna tests are written using ~ERT~, the Emacs Regression Testing framewo= rk. In +order to use it interactively in Emacs, the following must be done: + +1. Load ~org-edna-tests.el~ +2. Run ~M-x ert-run-tests-interactively~ +3. Select which tests to run, or just the letter "t" to run all of them. + +Results are printed in their own buffer. See the ERT documentation for = more +details. + +** Before Sending Changes +:PROPERTIES: +:CUSTOM_ID: commit_checklist +:DESCRIPTION: Follow these instructions before sending us anything +:END: + +There are a few rules to follow: + +- Verify that any new Edna keywords follow the appropriate naming conven= tions +- Any new keywords should be documented +- We operate on headings, not headlines + - Use one word in documentation to avoid confusion +- Make sure your changes compile +- Run 'make check' to verify that your mods don't break anything +- Avoid additional or altered dependencies if at all possible + - Exception: New versions of Org mode are allowed + +** Developing with Bazaar +:PROPERTIES: +:CUSTOM_ID: bzr_dev +:DESCRIPTION: How to use this strange VCS +:END: =20 If you're new to bazaar, we recommend using Emacs's built-in VC package.= It eases the overhead of dealing with a brand new VCS with a few standard c= ommands. @@ -1265,16 +1394,6 @@ $ bzr send -o file-name.txt Then, use ~org-edna-submit-bug-report~ and attach "file-name.txt". We c= an then merge that into the main development branch. =20 -There are a few rules to follow: - -- Verify that any new Edna keywords follow the appropriate naming conven= tions -- Any new keywords should be documented -- We operate on headings, not headlines - - Use one word to avoid confusion -- Run 'make check' to verify that your mods don't break anything -- Avoid additional or altered dependencies if at all possible - - Exception: New versions of Org mode are allowed - ** Documentation :PROPERTIES: :CUSTOM_ID: docs @@ -1292,7 +1411,14 @@ making any changes: :DESCRIPTION: List of changes by version :END: ** 1.0beta7 +Biggest change here is the cache. + - Added cache to the finders to improve performance + +- Updated documentation to include EDE + +- Added testing and compiling documentation + ** 1.0beta6 Lots of parsing fixes. =20 From MAILER-DAEMON Sun Nov 11 15:05:03 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gLvyh-0003Iu-Lt for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:05:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvya-0003EX-C3 for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:05:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLvyW-00055H-OL for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:56 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:39152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLvyW-00054t-Fb for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 15:04:52 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 6C05C20498; Sun, 11 Nov 2018 15:04:52 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 7294b59 7/7: Merge commit '26b0a6e6fb03fe4b895bb03972bbb0d80ce2e8e3' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181111200448.26295.47303@vcs0.savannah.gnu.org> References: <20181111200448.26295.47303@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 7294b5971588676b80319d3086679f0341e8fb7a Auto-Submitted: auto-generated Message-Id: <20181111200452.6C05C20498@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 15:04:52 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 20:05:02 -0000 branch: master commit 7294b5971588676b80319d3086679f0341e8fb7a Merge: 4ce0ed8 26b0a6e Author: Ian Dunn Commit: Ian Dunn Merge commit '26b0a6e6fb03fe4b895bb03972bbb0d80ce2e8e3' --- packages/org-edna/org-edna-tests.el | 95 ++++++++++- packages/org-edna/org-edna.el | 97 ++++++++++- packages/org-edna/org-edna.info | 322 ++++++++++++++++++++++++++----= ------ packages/org-edna/org-edna.org | 154 +++++++++++++++-- 4 files changed, 557 insertions(+), 111 deletions(-) diff --git a/packages/org-edna/org-edna-tests.el b/packages/org-edna/org-= edna-tests.el index 0a9ddca..890ddd9 100644 --- a/packages/org-edna/org-edna-tests.el +++ b/packages/org-edna/org-edna-tests.el @@ -270,7 +270,7 @@ '(let ((targets1 nil) (consideration1 nil) (blocking-entry1 nil)) - (setq targets1 (org-edna--add-targets targets1 (org-edna= -finder/self))) + (setq targets1 (org-edna--add-targets targets1 (org-edna= --handle-finder 'org-edna-finder/self (quote)))) (setq blocking-entry1 (or blocking-entry1 (org-edna--handle-condition 'org-edna-conditio= n/done? @@ -303,7 +303,7 @@ (blocking-entry2 blocking-entry1)) (setq targets2 (org-edna--add-targets targets2 - (org-edna-finder/match "= checklist"))) + (org-edna--handle-finder= 'org-edna-finder/match '"checklist"))) (org-edna--handle-action 'org-edna-action/todo! targets2 (point-marker) @@ -313,7 +313,7 @@ (blocking-entry5 blocking-entry1)) (setq targets5 (org-edna--add-targets targets5 - (org-edna-finder/sibling= s))) + (org-edna--handle-finder= 'org-edna-finder/siblings (quote)))) (org-edna--handle-action 'org-edna-action/todo! targets5 (point-marker) @@ -355,7 +355,7 @@ ;; Add targets for checklist match (setq targets3 (org-edna--add-targets targets3 - (org-edna-finder/ma= tch "checklist"))) + (org-edna--handle-f= inder 'org-edna-finder/match '"checklist"))) ;; Handle condition (setq blocking-entry3 (or blocking-entry3 @@ -365,7 +365,7 @@ ;; Add targets for self finder (setq targets1 (org-edna--add-targets targets1 - (org-edna-finder/sel= f))) + (org-edna--handle-fi= nder 'org-edna-finder/self (quote)))) ;; Mark as TODO (org-edna--handle-action 'org-edna-action/todo! t= argets1 (point-marker) @@ -375,7 +375,7 @@ ;; Find siblings (setq targets1 (org-edna--add-targets targets1 - (org-edna-finder/sibli= ngs))) + (org-edna--handle-find= er 'org-edna-finder/siblings (quote)))) ;; Mark as DONE (org-edna--handle-action 'org-edna-action/todo! tar= gets1 (point-marker) @@ -416,7 +416,7 @@ ;; Add targets for checklist match (setq targets3 (org-edna--add-targets targets3 - (org-edna-finder/ma= tch "checklist"))) + (org-edna--handle-f= inder 'org-edna-finder/match '"checklist"))) ;; Handle condition (setq blocking-entry3 (or blocking-entry3 @@ -426,7 +426,7 @@ ;; Add targets for self finder (setq targets1 (org-edna--add-targets targets1 - (org-edna-finder/sel= f))) + (org-edna--handle-fi= nder 'org-edna-finder/self (quote)))) ;; Mark as TODO (org-edna--handle-action 'org-edna-action/todo! t= argets1 (point-marker) @@ -1073,6 +1073,61 @@ (org-with-point-at current (org-edna-finder/relatives arg 'deadline-down size)= ))))) =20 +(ert-deftest org-edna-cache/no-entry () + (let* ((org-edna-finder-use-cache t) + (org-edna--finder-cache (make-hash-table :test 'equal))) + ;; Empty, so `org-edna--get-cache-entry' should return nil. + (should (not (org-edna--get-cache-entry 'org-edna-finder/match '("te= st&1")))))) + +(ert-deftest org-edna-cache/added-new-entry () + (let* ((org-edna-finder-use-cache t) + (org-edna--finder-cache (make-hash-table :test 'equal)) + (org-agenda-files `(,org-edna-test-file)) + (targets (org-edna--handle-finder 'org-edna-finder/match "test&= 1"))) + (should (=3D (length targets) 2)) + (should (string-equal (org-edna-heading (nth 0 targets)) "Tagged Hea= ding 1")) + (should (string-equal (org-edna-heading (nth 1 targets)) "Tagged Hea= ding 2")) + (should (=3D (hash-table-count org-edna--finder-cache) 1)) + ;; Verify that we've got a valid cache entry. + (should (org-edna--get-cache-entry 'org-edna-finder/match '("test&1"= ))) + ;; Verify that any other signature returns nil. + (should (not (org-edna--get-cache-entry 'org-edna-finder/match '("te= st&2")))) + (let ((cache-entry (gethash (make-org-edna--finder-input :func-sym '= org-edna-finder/match + :args '("te= st&1")) + org-edna--finder-cache))) + (should cache-entry) + (should (equal (org-edna--finder-cache-entry-input cache-entry) + (make-org-edna--finder-input :func-sym 'org-edna-fi= nder/match + :args '("test&1")))) + (should (equal (org-edna--finder-cache-entry-results cache-entry) + targets))))) + +(ert-deftest org-edna-cache/timed-out () + (let* ((org-edna-finder-use-cache t) + (org-edna--finder-cache (make-hash-table :test 'equal)) + (org-edna-finder-cache-timeout 1) ;; Set timeout to 1 second + (org-agenda-files `(,org-edna-test-file)) + (targets (org-edna--handle-finder 'org-edna-finder/match "test&= 1")) + ;; Time increment required to invalidate a cache entry + (time-increment `(0 ,org-edna-finder-cache-timeout))) + (should (org-edna--get-cache-entry 'org-edna-finder/match '("test&1"= ))) + ;; Validate the cache entry + (let ((cache-entry (gethash (make-org-edna--finder-input :func-sym '= org-edna-finder/match + :args '("te= st&1")) + org-edna--finder-cache))) + (should cache-entry) + (should (equal (org-edna--finder-cache-entry-input cache-entry) + (make-org-edna--finder-input :func-sym 'org-edna-fi= nder/match + :args '("test&1")))) + (should (equal (org-edna--finder-cache-entry-results cache-entry) + targets)) + ;; Override `current-time' so we can get a deterministic value + ;; The value invalidates the cache entry + (cl-letf* (((symbol-function 'current-time) + (lambda () (time-add (org-edna--finder-cache-entry-las= t-run-time cache-entry) + time-increment)))) + (should (not (org-edna--get-cache-entry 'org-edna-finder/match '= ("test&1")))))))) + =0C ;; Actions =20 @@ -1198,6 +1253,30 @@ (should (string-equal (org-entry-get nil "SCHEDULED") "<2000-01-15 Sat 00:00>"))))) =20 +(ert-deftest org-edna-action-scheduled/landing-no-hour () + "Test landing arguments to scheduled increment, without hour." + ;; Override `current-time' so we can get a deterministic value + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (org-agenda-files `(,org-edna-test-file)) + (target (org-id-find "caf27724-0887-4565-9765-ed2f1edcfb16"= t))) + (org-with-point-at target + ;; Time starts at Jan 1, 2017 + (org-edna-action/scheduled! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-01 Sun>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-08 Sun>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/scheduled! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-16 Mon>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-01 Sun>"))))) + (ert-deftest org-edna-action-scheduled/float () (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) diff --git a/packages/org-edna/org-edna.el b/packages/org-edna/org-edna.e= l index 9974e3a..37c9849 100644 --- a/packages/org-edna/org-edna.el +++ b/packages/org-edna/org-edna.el @@ -7,7 +7,7 @@ ;; Keywords: convenience, text, org ;; URL: https://savannah.nongnu.org/projects/org-edna-el/ ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5")) -;; Version: 1.0beta6 +;; Version: 1.0beta7 =20 ;; This file is part of GNU Emacs. =20 @@ -387,7 +387,7 @@ correspond to internal variables." (`(,type . ,func) (org-edna--function-for-key key))) (pcase type ('finder - `(setq ,target-var (org-edna--add-targets ,target-var (,func ,@ar= gs)))) + `(setq ,target-var (org-edna--add-targets ,target-var (org-edna--= handle-finder ',func ',@args)))) ('action `(org-edna--handle-action ',func ,target-var (point-marker) ',arg= s)) ('condition @@ -464,6 +464,99 @@ which of the two types is allowed in STRING-FORM." (org-edna-eval-sexp-form (org-edna-string-form-to-sexp-form string-form action-or-condition))) =20 +;;; Cache + +;; Cache works because the returned values of finders are all markers. = Markers +;; will automatically update themselves when a buffer is edited. + +;; We use a timeout for cache because it's expected that the Org files +;; themselves will change. Thus, there's no assured way to determine if= we need +;; to update the cache without actually running again. Therefore, we as= sume +;; most operations that the user wants to expedite will be performed in = bulk. + +(cl-defstruct org-edna--finder-input + func-sym args) + +(cl-defstruct org-edna--finder-cache-entry + input results last-run-time) + +(defvar org-edna--finder-cache (make-hash-table :test 'equal)) + +(defcustom org-edna-finder-use-cache nil + "Whether to use cache for improved performance with finders. + +When cache is used for a finder, each finder call will store its +results for up to `org-edna-finder-cache-timeout' seconds. The +results and input are both stored, so the same form for a given +finder will yield the results of the previous call. + +If enough time has passed since the results in cache for a +specific form were generated, the results will be regenerated and +stored in cache. + +Minor changes to an Org file, such as setting properties or +adding unrelated headlines, will be taken into account." + :group 'org-edna + :type 'boolean) + +(defcustom org-edna-finder-cache-timeout 300 + "Maximum age to keep entries in cache, in seconds." + :group 'org-edna + :type 'number) + +(defun org-edna--add-to-finder-cache (func-sym args) + (let* ((results (apply func-sym args)) + (input (make-org-edna--finder-input :func-sym func-sym + :args args)) + (entry (make-org-edna--finder-cache-entry :input input + :results results + :last-run-time (curre= nt-time)))) + (puthash input entry org-edna--finder-cache) + ;; Returning the results here passes them to the calling function. = It's the + ;; only part of the entry we care about here. + results)) + +(defun org-edna--finder-cache-timeout (_func-sym) + ;; In the future, we may want to support configurable timeouts on a pe= r-finder + ;; basis. + org-edna-finder-cache-timeout) + +(defun org-edna--get-cache-entry (func-sym args) + "Find a valid entry in the cache. + +If none exists, return nil. An entry is invalid for any of the +following reasons: + +- It doesn't exist +- It has timed out +- It contains an invalid marker" + (let* ((input (make-org-edna--finder-input :func-sym func-sym + :args args)) + (entry (gethash input org-edna--finder-cache))) + (cond + ;; If we don't have an entry, rerun and make a new one. + ((not entry) nil) + ;; If we do have an entry, but it's timed out, then create a new on= e. + ((>=3D (float-time (time-subtract (current-time) + (org-edna--finder-cache-entry-last-r= un-time entry))) + (org-edna--finder-cache-timeout func-sym)) + nil) + ;; If any element of the results is an invalid marker, then rerun. + ((seq-find (lambda (x) (not (markerp x))) (org-edna--finder-cache-e= ntry-results entry) nil) + nil) + ;; We have an entry created within the allowed interval. + (t entry)))) + +(defun org-edna--handle-finder (func-sym &rest args) + (if (not org-edna-finder-use-cache) + ;; Not using cache, so use the function directly. + (apply func-sym args) + (let* ((entry (org-edna--get-cache-entry func-sym args))) + (if entry + (org-edna--finder-cache-entry-results entry) + ;; Adds the entry to the cache, and returns the results. + (org-edna--add-to-finder-cache func-sym args))))) + =0C =20 (defmacro org-edna-run (change-plist &rest body) diff --git a/packages/org-edna/org-edna.info b/packages/org-edna/org-edna= .info index 33b6708..fde1e6e 100644 --- a/packages/org-edna/org-edna.info +++ b/packages/org-edna/org-edna.info @@ -76,6 +76,7 @@ Actions =20 Advanced Features =20 +* Finder Cache:: Making the finders work faster * Conditions:: More than just DONE headings * Consideration:: Only some of them * Conditional Forms:: If/Then/Else @@ -102,11 +103,16 @@ Extending Edna Contributing =20 * Bugs:: -* Development:: +* Working with EDE:: And all its quirks +* Compiling Edna:: How to compile Edna +* Testing Edna:: Ensuring Edna works the way we think sh= e will +* Before Sending Changes:: Follow these instructions before sendin= g us anything +* Developing with Bazaar:: How to use this strange VCS * Documentation:: Improving the documentation =20 Changelog =20 +* 1.0beta7: 10beta7. * 1.0beta6: 10beta6. * 1.0beta5: 10beta5. * 1.0beta4: 10beta4. @@ -184,13 +190,12 @@ org 9.0.5 From Source: =20 bzr branch https://bzr.savannah.gnu.org/r/org-edna-el/ org-edna - make -C org-edna compile autoloads =20 After that, add the following to your init file (typically .emacs): =20 ;; Only necessary if installing from source (add-to-list 'load-path "/full/path/to/org-edna/") - (load "/path/to/org-edna/org-edna-autoloads.el") + (require 'org-edna) =20 ;; Always necessary (org-edna-load) @@ -1056,13 +1061,39 @@ Advanced Features =20 * Menu: =20 +* Finder Cache:: Making the finders work faster * Conditions:: More than just DONE headings * Consideration:: Only some of them * Conditional Forms:: If/Then/Else * Setting the Properties:: The easy way to set BLOCKER and TRIGGER =20 =1F -File: org-edna.info, Node: Conditions, Next: Consideration, Up: Advan= ced Features +File: org-edna.info, Node: Finder Cache, Next: Conditions, Up: Advanc= ed Features + +Finder Cache +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Some finders, =E2=80=98match=E2=80=99 in particular, can take a long tim= e to run. +Oftentimes, this can make it unappealing to use Edna at all, especially +with long checklists. + + The finder cache is one solution to this. To enable it, set +=E2=80=98org-edna-finder-use-cache=E2=80=99 to non-nil. This can be don= e through the +customization interface, or manually with =E2=80=98setq=E2=80=99. + + When enabled, the cache will store the results of every finder form +for a configurable amount of time. This timeout is controlled by +=E2=80=98org-edna-finder-cache-timeout=E2=80=99. The cache is also inva= lidated if any +of the results are invalid, which can happen if their target files have +been closed. + + For example, if there are several entries in a checklist that all use +the form =E2=80=98match("daily")=E2=80=99 as part of their trigger, the = results of that +form will be cached. When the next item is marked as DONE, the results +will be searched for in cache, not recomputed. + +=1F +File: org-edna.info, Node: Conditions, Next: Consideration, Prev: Fin= der Cache, Up: Advanced Features =20 Conditions =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -1441,11 +1472,15 @@ We are all happy for any help you may provide. * Menu: =20 * Bugs:: -* Development:: +* Working with EDE:: And all its quirks +* Compiling Edna:: How to compile Edna +* Testing Edna:: Ensuring Edna works the way we think sh= e will +* Before Sending Changes:: Follow these instructions before sendin= g us anything +* Developing with Bazaar:: How to use this strange VCS * Documentation:: Improving the documentation =20 =1F -File: org-edna.info, Node: Bugs, Next: Development, Up: Contributing +File: org-edna.info, Node: Bugs, Next: Working with EDE, Up: Contribu= ting =20 Bugs =3D=3D=3D=3D @@ -1459,10 +1494,111 @@ There are two ways to submit bug reports: caused the bug, with as much context as possible. =20 =1F -File: org-edna.info, Node: Development, Next: Documentation, Prev: Bu= gs, Up: Contributing +File: org-edna.info, Node: Working with EDE, Next: Compiling Edna, Pr= ev: Bugs, Up: Contributing + +Working with EDE +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Our build system uses EDE. EDE can be a little finicky at times, but we +feel the benefits, namely package dependency handling and Makefile +generation, outweigh the costs. + + One of the issues that many will likely encounter is the error +=E2=80=9CCorrupt file on disk=E2=80=9D. This is most often due to EDE n= ot loading all +its subprojects as needed. If you find yourself dealing with this error +often, place the following in your .emacs file: + + ;; Target types needed for working with edna + (require 'ede/proj-elisp) + (require 'ede/proj-aux) + (require 'ede/proj-misc) + + These are the three target types that edna uses: elisp for +compilation and autoloads; aux for auxiliary files such as +documentation; and misc for tests. + + When creating a new file, EDE will ask if you want to add it to a +target. Consult with one of the edna devs for guidance, but usually +selecting =E2=80=9Cnone=E2=80=9D and letting one of us handle it is a go= od way to go. + +=1F +File: org-edna.info, Node: Compiling Edna, Next: Testing Edna, Prev: = Working with EDE, Up: Contributing + +Compiling Edna +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +To compile Edna, you=E2=80=99ve got to have EDE create the Makefile firs= t. Run +the following in your Emacs instance to generate the Makefile: + + M-x ede-proj-regenerate + + This will create the Makefile and point it to the correct version of +Org. The targets are as follows: + +compile + Compiles the code. This should be done to verify that everything + will compile, as ELPA requires this. +autoloads + Creates the autoloads file. This should also run without problems, + so it=E2=80=99s a good idea to check this one as well. +check + Runs the tests in =E2=80=98org-edna-tests.el=E2=80=99. + + To run any target, call =E2=80=98make=E2=80=99: + + make compile autoloads + + The above command compiles Edna and generates the autoloads file. + +=1F +File: org-edna.info, Node: Testing Edna, Next: Before Sending Changes,= Prev: Compiling Edna, Up: Contributing + +Testing Edna +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +There are two ways to test Edna: the command-line and through Emacs. + + The command-line version is simple, and we ask that you do any final +testing using this method. This is how we periodically check to verify +that new versions of Org mode haven=E2=80=99t broken Edna. It uses the +Makefile, which is generated with EDE. See *note Compiling Edna:: for +how to do that. Once you have, run =E2=80=98make check=E2=80=99 on the = command line. + + Edna tests are written using =E2=80=98ERT=E2=80=99, the Emacs Regress= ion Testing +framework. In order to use it interactively in Emacs, the following +must be done: + + 1. Load =E2=80=98org-edna-tests.el=E2=80=99 + 2. Run =E2=80=98M-x ert-run-tests-interactively=E2=80=99 + 3. Select which tests to run, or just the letter =E2=80=9Ct=E2=80=9D t= o run all of + them. + + Results are printed in their own buffer. See the ERT documentation +for more details. + +=1F +File: org-edna.info, Node: Before Sending Changes, Next: Developing wi= th Bazaar, Prev: Testing Edna, Up: Contributing + +Before Sending Changes +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +There are a few rules to follow: + + =E2=80=A2 Verify that any new Edna keywords follow the appropriate na= ming + conventions + =E2=80=A2 Any new keywords should be documented + =E2=80=A2 We operate on headings, not headlines + =E2=80=A2 Use one word in documentation to avoid confusion + =E2=80=A2 Make sure your changes compile + =E2=80=A2 Run =E2=80=99make check=E2=80=99 to verify that your mods d= on=E2=80=99t break anything + =E2=80=A2 Avoid additional or altered dependencies if at all possible + =E2=80=A2 Exception: New versions of Org mode are allowed + +=1F +File: org-edna.info, Node: Developing with Bazaar, Next: Documentation= , Prev: Before Sending Changes, Up: Contributing =20 -Development -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Developing with Bazaar +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 If you=E2=80=99re new to bazaar, we recommend using Emacs=E2=80=99s buil= t-in VC package. It eases the overhead of dealing with a brand new VCS with a few @@ -1478,19 +1614,8 @@ Emacs, this is C-h r m Introduction to VC RET). Then, use =E2=80=98org-edna-submit-bug-report=E2=80=99 and attach =E2= =80=9Cfile-name.txt=E2=80=9D. We can then merge that into the main development branch. =20 - There are a few rules to follow: - - =E2=80=A2 Verify that any new Edna keywords follow the appropriate na= ming - conventions - =E2=80=A2 Any new keywords should be documented - =E2=80=A2 We operate on headings, not headlines - =E2=80=A2 Use one word to avoid confusion - =E2=80=A2 Run =E2=80=99make check=E2=80=99 to verify that your mods d= on=E2=80=99t break anything - =E2=80=A2 Avoid additional or altered dependencies if at all possible - =E2=80=A2 Exception: New versions of Org mode are allowed - =1F -File: org-edna.info, Node: Documentation, Prev: Development, Up: Cont= ributing +File: org-edna.info, Node: Documentation, Prev: Developing with Bazaar= , Up: Contributing =20 Documentation =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -1511,6 +1636,7 @@ Changelog =20 * Menu: =20 +* 1.0beta7: 10beta7. * 1.0beta6: 10beta6. * 1.0beta5: 10beta5. * 1.0beta4: 10beta4. @@ -1518,7 +1644,21 @@ Changelog * 1.0beta2: 10beta2. =20 =1F -File: org-edna.info, Node: 10beta6, Next: 10beta5, Up: Changelog +File: org-edna.info, Node: 10beta7, Next: 10beta6, Up: Changelog + +1.0beta7 +=3D=3D=3D=3D=3D=3D=3D=3D + +Biggest change here is the cache. + + =E2=80=A2 Added cache to the finders to improve performance + + =E2=80=A2 Updated documentation to include EDE + + =E2=80=A2 Added testing and compiling documentation + +=1F +File: org-edna.info, Node: 10beta6, Next: 10beta5, Prev: 10beta7, Up= : Changelog =20 1.0beta6 =3D=3D=3D=3D=3D=3D=3D=3D @@ -1610,72 +1750,78 @@ Big release here, with three new features. =1F Tag Table: Node: Top=7F225 -Node: Copying=7F3693 -Node: Introduction=7F4515 -Node: Installation and Setup=7F5463 -Node: Basic Operation=7F6256 -Node: Blockers=7F8107 -Node: Triggers=7F8393 -Node: Syntax=7F8655 -Node: Basic Features=7F9345 -Node: Finders=7F9648 -Node: ancestors=7F11413 -Node: children=7F12007 -Node: descendants=7F12417 -Node: file=7F12939 -Node: first-child=7F13688 -Node: ids=7F13948 -Node: match=7F14609 -Node: next-sibling=7F15247 -Node: next-sibling-wrap=7F15504 -Node: olp=7F15818 -Node: org-file=7F16230 -Node: parent=7F16875 -Node: previous-sibling=7F17073 -Node: previous-sibling-wrap=7F17334 -Node: relatives=7F17613 -Node: rest-of-siblings=7F21234 -Node: rest-of-siblings-wrap=7F21519 -Node: self=7F21868 -Node: siblings=7F22029 -Node: siblings-wrap=7F22266 -Node: Actions=7F22570 -Node: Scheduled/Deadline=7F23312 -Node: TODO State=7F26887 -Node: Archive=7F27255 -Node: Chain Property=7F27575 -Node: Clocking=7F27858 -Node: Property=7F28270 -Node: Priority=7F30457 -Node: Tag=7F31026 -Node: Effort=7F31243 -Node: Advanced Features=7F31632 -Node: Conditions=7F32016 -Node: done=7F32631 -Node: headings=7F32795 -Node: todo-state=7F33171 -Node: variable-set=7F33427 -Node: has-property=7F33856 -Node: re-search=7F34125 -Node: Negating Conditions=7F34485 -Node: Consideration=7F34872 -Node: Conditional Forms=7F36441 -Node: Setting the Properties=7F39097 -Node: Extending Edna=7F40181 -Node: Naming Conventions=7F40671 -Node: Finders 1=7F41132 -Node: Actions 1=7F41494 -Node: Conditions 1=7F41953 -Node: Contributing=7F42839 -Node: Bugs=7F43390 -Node: Development=7F43742 -Node: Documentation=7F44895 -Node: Changelog=7F45340 -Node: 10beta6=7F45548 -Node: 10beta5=7F45808 -Node: 10beta4=7F46195 -Node: 10beta3=7F46448 -Node: 10beta2=7F46887 +Node: Copying=7F4093 +Node: Introduction=7F4915 +Node: Installation and Setup=7F5863 +Node: Basic Operation=7F6587 +Node: Blockers=7F8438 +Node: Triggers=7F8724 +Node: Syntax=7F8986 +Node: Basic Features=7F9676 +Node: Finders=7F9979 +Node: ancestors=7F11744 +Node: children=7F12338 +Node: descendants=7F12748 +Node: file=7F13270 +Node: first-child=7F14019 +Node: ids=7F14279 +Node: match=7F14940 +Node: next-sibling=7F15578 +Node: next-sibling-wrap=7F15835 +Node: olp=7F16149 +Node: org-file=7F16561 +Node: parent=7F17206 +Node: previous-sibling=7F17404 +Node: previous-sibling-wrap=7F17665 +Node: relatives=7F17944 +Node: rest-of-siblings=7F21565 +Node: rest-of-siblings-wrap=7F21850 +Node: self=7F22199 +Node: siblings=7F22360 +Node: siblings-wrap=7F22597 +Node: Actions=7F22901 +Node: Scheduled/Deadline=7F23643 +Node: TODO State=7F27218 +Node: Archive=7F27586 +Node: Chain Property=7F27906 +Node: Clocking=7F28189 +Node: Property=7F28601 +Node: Priority=7F30788 +Node: Tag=7F31357 +Node: Effort=7F31574 +Node: Advanced Features=7F31963 +Node: Finder Cache=7F32411 +Node: Conditions=7F33450 +Node: done=7F34086 +Node: headings=7F34250 +Node: todo-state=7F34626 +Node: variable-set=7F34882 +Node: has-property=7F35311 +Node: re-search=7F35580 +Node: Negating Conditions=7F35940 +Node: Consideration=7F36327 +Node: Conditional Forms=7F37896 +Node: Setting the Properties=7F40552 +Node: Extending Edna=7F41636 +Node: Naming Conventions=7F42126 +Node: Finders 1=7F42587 +Node: Actions 1=7F42949 +Node: Conditions 1=7F43408 +Node: Contributing=7F44294 +Node: Bugs=7F45160 +Node: Working with EDE=7F45517 +Node: Compiling Edna=7F46601 +Node: Testing Edna=7F47470 +Node: Before Sending Changes=7F48451 +Node: Developing with Bazaar=7F49138 +Node: Documentation=7F49879 +Node: Changelog=7F50335 +Node: 10beta7=7F50564 +Node: 10beta6=7F50842 +Node: 10beta5=7F51118 +Node: 10beta4=7F51505 +Node: 10beta3=7F51758 +Node: 10beta2=7F52197 =1F End Tag Table =20 diff --git a/packages/org-edna/org-edna.org b/packages/org-edna/org-edna.= org index e3422de..6e6c35f 100644 --- a/packages/org-edna/org-edna.org +++ b/packages/org-edna/org-edna.org @@ -70,7 +70,6 @@ From Source: =20 #+BEGIN_SRC shell bzr branch https://bzr.savannah.gnu.org/r/org-edna-el/ org-edna -make -C org-edna compile autoloads #+END_SRC =20 After that, add the following to your init file (typically .emacs): @@ -78,7 +77,7 @@ After that, add the following to your init file (typica= lly .emacs): #+BEGIN_SRC emacs-lisp ;; Only necessary if installing from source (add-to-list 'load-path "/full/path/to/org-edna/") -(load "/path/to/org-edna/org-edna-autoloads.el") +(require 'org-edna) =20 ;; Always necessary (org-edna-load) @@ -874,6 +873,30 @@ Sets the effort of all targets according to VALUE: :PROPERTIES: :CUSTOM_ID: advanced :END: +** Finder Cache +:PROPERTIES: +:CUSTOM_ID: cache +:DESCRIPTION: Making the finders work faster +:END: + +Some finders, ~match~ in particular, can take a long time to run. Often= times, +this can make it unappealing to use Edna at all, especially with long +checklists. + +The finder cache is one solution to this. To enable it, set +~org-edna-finder-use-cache~ to non-nil. This can be done through the +customization interface, or manually with ~setq~. + +When enabled, the cache will store the results of every finder form for = a +configurable amount of time. This timeout is controlled by +~org-edna-finder-cache-timeout~. The cache is also invalidated if any o= f the +results are invalid, which can happen if their target files have been cl= osed. + +For example, if there are several entries in a checklist that all use th= e form +~match("daily")~ as part of their trigger, the results of that form will= be +cached. When the next item is marked as DONE, the results will be searc= hed for +in cache, not recomputed. + ** Conditions :PROPERTIES: :CUSTOM_ID: conditions @@ -1238,6 +1261,9 @@ git clone git://orgmode.org/org-mode.git #+END_SRC =20 ** Bugs +:PROPERTIES: +:CUSTOM_ID: bugs +:END: =20 There are two ways to submit bug reports: =20 @@ -1247,7 +1273,110 @@ There are two ways to submit bug reports: When submitting a bug report, be sure to include the Edna form that caus= ed the bug, with as much context as possible. =20 -** Development +** Working with EDE +:PROPERTIES: +:CUSTOM_ID: ede +:DESCRIPTION: And all its quirks +:END: + +Our build system uses EDE. EDE can be a little finicky at times, but we= feel +the benefits, namely package dependency handling and Makefile generation= , +outweigh the costs. + +One of the issues that many will likely encounter is the error "Corrupt = file on +disk". This is most often due to EDE not loading all its subprojects as= needed. +If you find yourself dealing with this error often, place the following = in your +.emacs file: + +#+begin_src emacs-lisp +;; Target types needed for working with edna +(require 'ede/proj-elisp) +(require 'ede/proj-aux) +(require 'ede/proj-misc) +#+end_src + +These are the three target types that edna uses: elisp for compilation a= nd +autoloads; aux for auxiliary files such as documentation; and misc for t= ests. + +When creating a new file, EDE will ask if you want to add it to a target= . +Consult with one of the edna devs for guidance, but usually selecting "n= one" +and letting one of us handle it is a good way to go. + +** Compiling Edna +:PROPERTIES: +:CUSTOM_ID: compiling +:DESCRIPTION: How to compile Edna +:END: +To compile Edna, you've got to have EDE create the Makefile first. Run = the +following in your Emacs instance to generate the Makefile: + +#+begin_example +M-x ede-proj-regenerate +#+end_example + +This will create the Makefile and point it to the correct version of Org= . The +targets are as follows: + +- compile :: Compiles the code. This should be done to verify that ever= ything + will compile, as ELPA requires this. +- autoloads :: Creates the autoloads file. This should also run without + problems, so it's a good idea to check this one as well. +- check :: Runs the tests in ~org-edna-tests.el~. + +To run any target, call ~make~: + +#+begin_src shell +make compile autoloads +#+end_src + +The above command compiles Edna and generates the autoloads file. + +** Testing Edna +:PROPERTIES: +:CUSTOM_ID: testing +:DESCRIPTION: Ensuring Edna works the way we think she will +:END: + +There are two ways to test Edna: the command-line and through Emacs. + +The command-line version is simple, and we ask that you do any final tes= ting +using this method. This is how we periodically check to verify that new +versions of Org mode haven't broken Edna. It uses the Makefile, which i= s +generated with EDE. See [[#compiling][Compiling Edna]] for how to do th= at. Once you have, run +~make check~ on the command line. + +Edna tests are written using ~ERT~, the Emacs Regression Testing framewo= rk. In +order to use it interactively in Emacs, the following must be done: + +1. Load ~org-edna-tests.el~ +2. Run ~M-x ert-run-tests-interactively~ +3. Select which tests to run, or just the letter "t" to run all of them. + +Results are printed in their own buffer. See the ERT documentation for = more +details. + +** Before Sending Changes +:PROPERTIES: +:CUSTOM_ID: commit_checklist +:DESCRIPTION: Follow these instructions before sending us anything +:END: + +There are a few rules to follow: + +- Verify that any new Edna keywords follow the appropriate naming conven= tions +- Any new keywords should be documented +- We operate on headings, not headlines + - Use one word in documentation to avoid confusion +- Make sure your changes compile +- Run 'make check' to verify that your mods don't break anything +- Avoid additional or altered dependencies if at all possible + - Exception: New versions of Org mode are allowed + +** Developing with Bazaar +:PROPERTIES: +:CUSTOM_ID: bzr_dev +:DESCRIPTION: How to use this strange VCS +:END: =20 If you're new to bazaar, we recommend using Emacs's built-in VC package.= It eases the overhead of dealing with a brand new VCS with a few standard c= ommands. @@ -1265,16 +1394,6 @@ $ bzr send -o file-name.txt Then, use ~org-edna-submit-bug-report~ and attach "file-name.txt". We c= an then merge that into the main development branch. =20 -There are a few rules to follow: - -- Verify that any new Edna keywords follow the appropriate naming conven= tions -- Any new keywords should be documented -- We operate on headings, not headlines - - Use one word to avoid confusion -- Run 'make check' to verify that your mods don't break anything -- Avoid additional or altered dependencies if at all possible - - Exception: New versions of Org mode are allowed - ** Documentation :PROPERTIES: :CUSTOM_ID: docs @@ -1291,6 +1410,15 @@ making any changes: :PROPERTIES: :DESCRIPTION: List of changes by version :END: +** 1.0beta7 +Biggest change here is the cache. + +- Added cache to the finders to improve performance + +- Updated documentation to include EDE + +- Added testing and compiling documentation + ** 1.0beta6 Lots of parsing fixes. =20 From MAILER-DAEMON Sun Nov 11 20:52:05 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gM1OX-0004kD-0K for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 20:52:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gM1OS-0004dU-86 for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 20:52:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gM1FP-0003lV-7B for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 20:42:41 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:50337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gM1FL-0003kn-M6 for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 20:42:38 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id A565020498; Sun, 11 Nov 2018 20:42:35 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master bec310f 1/2: Quick fix for handle finders. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181112014234.11992.95047@vcs0.savannah.gnu.org> References: <20181112014234.11992.95047@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: bec310f1a793e58bfd31a12a612e7ffe931505d0 Auto-Submitted: auto-generated Message-Id: <20181112014235.A565020498@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 20:42:35 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 01:52:01 -0000 branch: master commit bec310f1a793e58bfd31a12a612e7ffe931505d0 Author: Ian Dunn Commit: Ian Dunn Quick fix for handle finders. =20 Attempt to expand empty argument list resulted in calling `quote' wit= h no arguments. =20 * org-edna.el (org-edna--handle-finder): Pass arguments as a list. (org-edna--expand-single-sexp-form): Don't expand arguments. --- org-edna-tests.el | 20 +++---- org-edna.el | 6 +-- org-edna.info | 157 +++++++++++++++++++++++++++++-------------------= ------ org-edna.org | 3 +- 4 files changed, 99 insertions(+), 87 deletions(-) diff --git a/org-edna-tests.el b/org-edna-tests.el index 890ddd9..da766a9 100644 --- a/org-edna-tests.el +++ b/org-edna-tests.el @@ -270,7 +270,7 @@ '(let ((targets1 nil) (consideration1 nil) (blocking-entry1 nil)) - (setq targets1 (org-edna--add-targets targets1 (org-edna= --handle-finder 'org-edna-finder/self (quote)))) + (setq targets1 (org-edna--add-targets targets1 (org-edna= --handle-finder 'org-edna-finder/self 'nil))) (setq blocking-entry1 (or blocking-entry1 (org-edna--handle-condition 'org-edna-conditio= n/done? @@ -303,7 +303,7 @@ (blocking-entry2 blocking-entry1)) (setq targets2 (org-edna--add-targets targets2 - (org-edna--handle-finder= 'org-edna-finder/match '"checklist"))) + (org-edna--handle-finder= 'org-edna-finder/match '("checklist")))) (org-edna--handle-action 'org-edna-action/todo! targets2 (point-marker) @@ -313,7 +313,7 @@ (blocking-entry5 blocking-entry1)) (setq targets5 (org-edna--add-targets targets5 - (org-edna--handle-finder= 'org-edna-finder/siblings (quote)))) + (org-edna--handle-finder= 'org-edna-finder/siblings 'nil))) (org-edna--handle-action 'org-edna-action/todo! targets5 (point-marker) @@ -355,7 +355,7 @@ ;; Add targets for checklist match (setq targets3 (org-edna--add-targets targets3 - (org-edna--handle-f= inder 'org-edna-finder/match '"checklist"))) + (org-edna--handle-f= inder 'org-edna-finder/match '("checklist")))) ;; Handle condition (setq blocking-entry3 (or blocking-entry3 @@ -365,7 +365,7 @@ ;; Add targets for self finder (setq targets1 (org-edna--add-targets targets1 - (org-edna--handle-fi= nder 'org-edna-finder/self (quote)))) + (org-edna--handle-fi= nder 'org-edna-finder/self 'nil))) ;; Mark as TODO (org-edna--handle-action 'org-edna-action/todo! t= argets1 (point-marker) @@ -375,7 +375,7 @@ ;; Find siblings (setq targets1 (org-edna--add-targets targets1 - (org-edna--handle-find= er 'org-edna-finder/siblings (quote)))) + (org-edna--handle-find= er 'org-edna-finder/siblings 'nil))) ;; Mark as DONE (org-edna--handle-action 'org-edna-action/todo! tar= gets1 (point-marker) @@ -416,7 +416,7 @@ ;; Add targets for checklist match (setq targets3 (org-edna--add-targets targets3 - (org-edna--handle-f= inder 'org-edna-finder/match '"checklist"))) + (org-edna--handle-f= inder 'org-edna-finder/match '("checklist")))) ;; Handle condition (setq blocking-entry3 (or blocking-entry3 @@ -426,7 +426,7 @@ ;; Add targets for self finder (setq targets1 (org-edna--add-targets targets1 - (org-edna--handle-fi= nder 'org-edna-finder/self (quote)))) + (org-edna--handle-fi= nder 'org-edna-finder/self 'nil))) ;; Mark as TODO (org-edna--handle-action 'org-edna-action/todo! t= argets1 (point-marker) @@ -1083,7 +1083,7 @@ (let* ((org-edna-finder-use-cache t) (org-edna--finder-cache (make-hash-table :test 'equal)) (org-agenda-files `(,org-edna-test-file)) - (targets (org-edna--handle-finder 'org-edna-finder/match "test&= 1"))) + (targets (org-edna--handle-finder 'org-edna-finder/match '("tes= t&1")))) (should (=3D (length targets) 2)) (should (string-equal (org-edna-heading (nth 0 targets)) "Tagged Hea= ding 1")) (should (string-equal (org-edna-heading (nth 1 targets)) "Tagged Hea= ding 2")) @@ -1107,7 +1107,7 @@ (org-edna--finder-cache (make-hash-table :test 'equal)) (org-edna-finder-cache-timeout 1) ;; Set timeout to 1 second (org-agenda-files `(,org-edna-test-file)) - (targets (org-edna--handle-finder 'org-edna-finder/match "test&= 1")) + (targets (org-edna--handle-finder 'org-edna-finder/match '("tes= t&1"))) ;; Time increment required to invalidate a cache entry (time-increment `(0 ,org-edna-finder-cache-timeout))) (should (org-edna--get-cache-entry 'org-edna-finder/match '("test&1"= ))) diff --git a/org-edna.el b/org-edna.el index 37c9849..e271cb0 100644 --- a/org-edna.el +++ b/org-edna.el @@ -7,7 +7,7 @@ ;; Keywords: convenience, text, org ;; URL: https://savannah.nongnu.org/projects/org-edna-el/ ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5")) -;; Version: 1.0beta7 +;; Version: 1.0beta8 =20 ;; This file is part of GNU Emacs. =20 @@ -387,7 +387,7 @@ correspond to internal variables." (`(,type . ,func) (org-edna--function-for-key key))) (pcase type ('finder - `(setq ,target-var (org-edna--add-targets ,target-var (org-edna--= handle-finder ',func ',@args)))) + `(setq ,target-var (org-edna--add-targets ,target-var (org-edna--= handle-finder ',func ',args)))) ('action `(org-edna--handle-action ',func ,target-var (point-marker) ',arg= s)) ('condition @@ -547,7 +547,7 @@ following reasons: ;; We have an entry created within the allowed interval. (t entry)))) =20 -(defun org-edna--handle-finder (func-sym &rest args) +(defun org-edna--handle-finder (func-sym args) (if (not org-edna-finder-use-cache) ;; Not using cache, so use the function directly. (apply func-sym args) diff --git a/org-edna.info b/org-edna.info index fde1e6e..4f29ebe 100644 --- a/org-edna.info +++ b/org-edna.info @@ -112,6 +112,7 @@ Contributing =20 Changelog =20 +* 1.0beta8: 10beta8. * 1.0beta7: 10beta7. * 1.0beta6: 10beta6. * 1.0beta5: 10beta5. @@ -1636,6 +1637,7 @@ Changelog =20 * Menu: =20 +* 1.0beta8: 10beta8. * 1.0beta7: 10beta7. * 1.0beta6: 10beta6. * 1.0beta5: 10beta5. @@ -1644,7 +1646,15 @@ Changelog * 1.0beta2: 10beta2. =20 =1F -File: org-edna.info, Node: 10beta7, Next: 10beta6, Up: Changelog +File: org-edna.info, Node: 10beta8, Next: 10beta7, Up: Changelog + +1.0beta8 +=3D=3D=3D=3D=3D=3D=3D=3D + +Quick fix for beta7. + +=1F +File: org-edna.info, Node: 10beta7, Next: 10beta6, Prev: 10beta8, Up= : Changelog =20 1.0beta7 =3D=3D=3D=3D=3D=3D=3D=3D @@ -1750,78 +1760,79 @@ Big release here, with three new features. =1F Tag Table: Node: Top=7F225 -Node: Copying=7F4093 -Node: Introduction=7F4915 -Node: Installation and Setup=7F5863 -Node: Basic Operation=7F6587 -Node: Blockers=7F8438 -Node: Triggers=7F8724 -Node: Syntax=7F8986 -Node: Basic Features=7F9676 -Node: Finders=7F9979 -Node: ancestors=7F11744 -Node: children=7F12338 -Node: descendants=7F12748 -Node: file=7F13270 -Node: first-child=7F14019 -Node: ids=7F14279 -Node: match=7F14940 -Node: next-sibling=7F15578 -Node: next-sibling-wrap=7F15835 -Node: olp=7F16149 -Node: org-file=7F16561 -Node: parent=7F17206 -Node: previous-sibling=7F17404 -Node: previous-sibling-wrap=7F17665 -Node: relatives=7F17944 -Node: rest-of-siblings=7F21565 -Node: rest-of-siblings-wrap=7F21850 -Node: self=7F22199 -Node: siblings=7F22360 -Node: siblings-wrap=7F22597 -Node: Actions=7F22901 -Node: Scheduled/Deadline=7F23643 -Node: TODO State=7F27218 -Node: Archive=7F27586 -Node: Chain Property=7F27906 -Node: Clocking=7F28189 -Node: Property=7F28601 -Node: Priority=7F30788 -Node: Tag=7F31357 -Node: Effort=7F31574 -Node: Advanced Features=7F31963 -Node: Finder Cache=7F32411 -Node: Conditions=7F33450 -Node: done=7F34086 -Node: headings=7F34250 -Node: todo-state=7F34626 -Node: variable-set=7F34882 -Node: has-property=7F35311 -Node: re-search=7F35580 -Node: Negating Conditions=7F35940 -Node: Consideration=7F36327 -Node: Conditional Forms=7F37896 -Node: Setting the Properties=7F40552 -Node: Extending Edna=7F41636 -Node: Naming Conventions=7F42126 -Node: Finders 1=7F42587 -Node: Actions 1=7F42949 -Node: Conditions 1=7F43408 -Node: Contributing=7F44294 -Node: Bugs=7F45160 -Node: Working with EDE=7F45517 -Node: Compiling Edna=7F46601 -Node: Testing Edna=7F47470 -Node: Before Sending Changes=7F48451 -Node: Developing with Bazaar=7F49138 -Node: Documentation=7F49879 -Node: Changelog=7F50335 -Node: 10beta7=7F50564 -Node: 10beta6=7F50842 -Node: 10beta5=7F51118 -Node: 10beta4=7F51505 -Node: 10beta3=7F51758 -Node: 10beta2=7F52197 +Node: Copying=7F4114 +Node: Introduction=7F4936 +Node: Installation and Setup=7F5884 +Node: Basic Operation=7F6608 +Node: Blockers=7F8459 +Node: Triggers=7F8745 +Node: Syntax=7F9007 +Node: Basic Features=7F9697 +Node: Finders=7F10000 +Node: ancestors=7F11765 +Node: children=7F12359 +Node: descendants=7F12769 +Node: file=7F13291 +Node: first-child=7F14040 +Node: ids=7F14300 +Node: match=7F14961 +Node: next-sibling=7F15599 +Node: next-sibling-wrap=7F15856 +Node: olp=7F16170 +Node: org-file=7F16582 +Node: parent=7F17227 +Node: previous-sibling=7F17425 +Node: previous-sibling-wrap=7F17686 +Node: relatives=7F17965 +Node: rest-of-siblings=7F21586 +Node: rest-of-siblings-wrap=7F21871 +Node: self=7F22220 +Node: siblings=7F22381 +Node: siblings-wrap=7F22618 +Node: Actions=7F22922 +Node: Scheduled/Deadline=7F23664 +Node: TODO State=7F27239 +Node: Archive=7F27607 +Node: Chain Property=7F27927 +Node: Clocking=7F28210 +Node: Property=7F28622 +Node: Priority=7F30809 +Node: Tag=7F31378 +Node: Effort=7F31595 +Node: Advanced Features=7F31984 +Node: Finder Cache=7F32432 +Node: Conditions=7F33471 +Node: done=7F34107 +Node: headings=7F34271 +Node: todo-state=7F34647 +Node: variable-set=7F34903 +Node: has-property=7F35332 +Node: re-search=7F35601 +Node: Negating Conditions=7F35961 +Node: Consideration=7F36348 +Node: Conditional Forms=7F37917 +Node: Setting the Properties=7F40573 +Node: Extending Edna=7F41657 +Node: Naming Conventions=7F42147 +Node: Finders 1=7F42608 +Node: Actions 1=7F42970 +Node: Conditions 1=7F43429 +Node: Contributing=7F44315 +Node: Bugs=7F45181 +Node: Working with EDE=7F45538 +Node: Compiling Edna=7F46622 +Node: Testing Edna=7F47491 +Node: Before Sending Changes=7F48472 +Node: Developing with Bazaar=7F49159 +Node: Documentation=7F49900 +Node: Changelog=7F50356 +Node: 10beta8=7F50606 +Node: 10beta7=7F50718 +Node: 10beta6=7F51012 +Node: 10beta5=7F51288 +Node: 10beta4=7F51675 +Node: 10beta3=7F51928 +Node: 10beta2=7F52367 =1F End Tag Table =20 diff --git a/org-edna.org b/org-edna.org index 6e6c35f..1f01709 100644 --- a/org-edna.org +++ b/org-edna.org @@ -1410,6 +1410,8 @@ making any changes: :PROPERTIES: :DESCRIPTION: List of changes by version :END: +** 1.0beta8 +Quick fix for beta7. ** 1.0beta7 Biggest change here is the cache. =20 @@ -1418,7 +1420,6 @@ Biggest change here is the cache. - Updated documentation to include EDE =20 - Added testing and compiling documentation - ** 1.0beta6 Lots of parsing fixes. =20 From MAILER-DAEMON Sun Nov 11 20:52:05 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gM1OX-0004kX-6w for mharc-emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 20:52:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gM1OS-0004hB-IF for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 20:52:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gM1FP-0003lZ-7I for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 20:42:41 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:50339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gM1FL-0003kp-Rc for emacs-elpa-diffs@gnu.org; Sun, 11 Nov 2018 20:42:38 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id D71EA2049B; Sun, 11 Nov 2018 20:42:35 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 7d6c50e 2/2: Merge commit 'bec310f1a793e58bfd31a12a612e7ffe931505d0' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181112014234.11992.95047@vcs0.savannah.gnu.org> References: <20181112014234.11992.95047@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 7d6c50eec653461ef747e97d03c45afcd65c10a3 Auto-Submitted: auto-generated Message-Id: <20181112014235.D71EA2049B@vcs0.savannah.gnu.org> Date: Sun, 11 Nov 2018 20:42:35 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 01:52:02 -0000 branch: master commit 7d6c50eec653461ef747e97d03c45afcd65c10a3 Merge: 7294b59 bec310f Author: Ian Dunn Commit: Ian Dunn Merge commit 'bec310f1a793e58bfd31a12a612e7ffe931505d0' --- packages/org-edna/org-edna-tests.el | 20 ++--- packages/org-edna/org-edna.el | 6 +- packages/org-edna/org-edna.info | 157 +++++++++++++++++++-----------= ------ packages/org-edna/org-edna.org | 3 +- 4 files changed, 99 insertions(+), 87 deletions(-) diff --git a/packages/org-edna/org-edna-tests.el b/packages/org-edna/org-= edna-tests.el index 890ddd9..da766a9 100644 --- a/packages/org-edna/org-edna-tests.el +++ b/packages/org-edna/org-edna-tests.el @@ -270,7 +270,7 @@ '(let ((targets1 nil) (consideration1 nil) (blocking-entry1 nil)) - (setq targets1 (org-edna--add-targets targets1 (org-edna= --handle-finder 'org-edna-finder/self (quote)))) + (setq targets1 (org-edna--add-targets targets1 (org-edna= --handle-finder 'org-edna-finder/self 'nil))) (setq blocking-entry1 (or blocking-entry1 (org-edna--handle-condition 'org-edna-conditio= n/done? @@ -303,7 +303,7 @@ (blocking-entry2 blocking-entry1)) (setq targets2 (org-edna--add-targets targets2 - (org-edna--handle-finder= 'org-edna-finder/match '"checklist"))) + (org-edna--handle-finder= 'org-edna-finder/match '("checklist")))) (org-edna--handle-action 'org-edna-action/todo! targets2 (point-marker) @@ -313,7 +313,7 @@ (blocking-entry5 blocking-entry1)) (setq targets5 (org-edna--add-targets targets5 - (org-edna--handle-finder= 'org-edna-finder/siblings (quote)))) + (org-edna--handle-finder= 'org-edna-finder/siblings 'nil))) (org-edna--handle-action 'org-edna-action/todo! targets5 (point-marker) @@ -355,7 +355,7 @@ ;; Add targets for checklist match (setq targets3 (org-edna--add-targets targets3 - (org-edna--handle-f= inder 'org-edna-finder/match '"checklist"))) + (org-edna--handle-f= inder 'org-edna-finder/match '("checklist")))) ;; Handle condition (setq blocking-entry3 (or blocking-entry3 @@ -365,7 +365,7 @@ ;; Add targets for self finder (setq targets1 (org-edna--add-targets targets1 - (org-edna--handle-fi= nder 'org-edna-finder/self (quote)))) + (org-edna--handle-fi= nder 'org-edna-finder/self 'nil))) ;; Mark as TODO (org-edna--handle-action 'org-edna-action/todo! t= argets1 (point-marker) @@ -375,7 +375,7 @@ ;; Find siblings (setq targets1 (org-edna--add-targets targets1 - (org-edna--handle-find= er 'org-edna-finder/siblings (quote)))) + (org-edna--handle-find= er 'org-edna-finder/siblings 'nil))) ;; Mark as DONE (org-edna--handle-action 'org-edna-action/todo! tar= gets1 (point-marker) @@ -416,7 +416,7 @@ ;; Add targets for checklist match (setq targets3 (org-edna--add-targets targets3 - (org-edna--handle-f= inder 'org-edna-finder/match '"checklist"))) + (org-edna--handle-f= inder 'org-edna-finder/match '("checklist")))) ;; Handle condition (setq blocking-entry3 (or blocking-entry3 @@ -426,7 +426,7 @@ ;; Add targets for self finder (setq targets1 (org-edna--add-targets targets1 - (org-edna--handle-fi= nder 'org-edna-finder/self (quote)))) + (org-edna--handle-fi= nder 'org-edna-finder/self 'nil))) ;; Mark as TODO (org-edna--handle-action 'org-edna-action/todo! t= argets1 (point-marker) @@ -1083,7 +1083,7 @@ (let* ((org-edna-finder-use-cache t) (org-edna--finder-cache (make-hash-table :test 'equal)) (org-agenda-files `(,org-edna-test-file)) - (targets (org-edna--handle-finder 'org-edna-finder/match "test&= 1"))) + (targets (org-edna--handle-finder 'org-edna-finder/match '("tes= t&1")))) (should (=3D (length targets) 2)) (should (string-equal (org-edna-heading (nth 0 targets)) "Tagged Hea= ding 1")) (should (string-equal (org-edna-heading (nth 1 targets)) "Tagged Hea= ding 2")) @@ -1107,7 +1107,7 @@ (org-edna--finder-cache (make-hash-table :test 'equal)) (org-edna-finder-cache-timeout 1) ;; Set timeout to 1 second (org-agenda-files `(,org-edna-test-file)) - (targets (org-edna--handle-finder 'org-edna-finder/match "test&= 1")) + (targets (org-edna--handle-finder 'org-edna-finder/match '("tes= t&1"))) ;; Time increment required to invalidate a cache entry (time-increment `(0 ,org-edna-finder-cache-timeout))) (should (org-edna--get-cache-entry 'org-edna-finder/match '("test&1"= ))) diff --git a/packages/org-edna/org-edna.el b/packages/org-edna/org-edna.e= l index 37c9849..e271cb0 100644 --- a/packages/org-edna/org-edna.el +++ b/packages/org-edna/org-edna.el @@ -7,7 +7,7 @@ ;; Keywords: convenience, text, org ;; URL: https://savannah.nongnu.org/projects/org-edna-el/ ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5")) -;; Version: 1.0beta7 +;; Version: 1.0beta8 =20 ;; This file is part of GNU Emacs. =20 @@ -387,7 +387,7 @@ correspond to internal variables." (`(,type . ,func) (org-edna--function-for-key key))) (pcase type ('finder - `(setq ,target-var (org-edna--add-targets ,target-var (org-edna--= handle-finder ',func ',@args)))) + `(setq ,target-var (org-edna--add-targets ,target-var (org-edna--= handle-finder ',func ',args)))) ('action `(org-edna--handle-action ',func ,target-var (point-marker) ',arg= s)) ('condition @@ -547,7 +547,7 @@ following reasons: ;; We have an entry created within the allowed interval. (t entry)))) =20 -(defun org-edna--handle-finder (func-sym &rest args) +(defun org-edna--handle-finder (func-sym args) (if (not org-edna-finder-use-cache) ;; Not using cache, so use the function directly. (apply func-sym args) diff --git a/packages/org-edna/org-edna.info b/packages/org-edna/org-edna= .info index fde1e6e..4f29ebe 100644 --- a/packages/org-edna/org-edna.info +++ b/packages/org-edna/org-edna.info @@ -112,6 +112,7 @@ Contributing =20 Changelog =20 +* 1.0beta8: 10beta8. * 1.0beta7: 10beta7. * 1.0beta6: 10beta6. * 1.0beta5: 10beta5. @@ -1636,6 +1637,7 @@ Changelog =20 * Menu: =20 +* 1.0beta8: 10beta8. * 1.0beta7: 10beta7. * 1.0beta6: 10beta6. * 1.0beta5: 10beta5. @@ -1644,7 +1646,15 @@ Changelog * 1.0beta2: 10beta2. =20 =1F -File: org-edna.info, Node: 10beta7, Next: 10beta6, Up: Changelog +File: org-edna.info, Node: 10beta8, Next: 10beta7, Up: Changelog + +1.0beta8 +=3D=3D=3D=3D=3D=3D=3D=3D + +Quick fix for beta7. + +=1F +File: org-edna.info, Node: 10beta7, Next: 10beta6, Prev: 10beta8, Up= : Changelog =20 1.0beta7 =3D=3D=3D=3D=3D=3D=3D=3D @@ -1750,78 +1760,79 @@ Big release here, with three new features. =1F Tag Table: Node: Top=7F225 -Node: Copying=7F4093 -Node: Introduction=7F4915 -Node: Installation and Setup=7F5863 -Node: Basic Operation=7F6587 -Node: Blockers=7F8438 -Node: Triggers=7F8724 -Node: Syntax=7F8986 -Node: Basic Features=7F9676 -Node: Finders=7F9979 -Node: ancestors=7F11744 -Node: children=7F12338 -Node: descendants=7F12748 -Node: file=7F13270 -Node: first-child=7F14019 -Node: ids=7F14279 -Node: match=7F14940 -Node: next-sibling=7F15578 -Node: next-sibling-wrap=7F15835 -Node: olp=7F16149 -Node: org-file=7F16561 -Node: parent=7F17206 -Node: previous-sibling=7F17404 -Node: previous-sibling-wrap=7F17665 -Node: relatives=7F17944 -Node: rest-of-siblings=7F21565 -Node: rest-of-siblings-wrap=7F21850 -Node: self=7F22199 -Node: siblings=7F22360 -Node: siblings-wrap=7F22597 -Node: Actions=7F22901 -Node: Scheduled/Deadline=7F23643 -Node: TODO State=7F27218 -Node: Archive=7F27586 -Node: Chain Property=7F27906 -Node: Clocking=7F28189 -Node: Property=7F28601 -Node: Priority=7F30788 -Node: Tag=7F31357 -Node: Effort=7F31574 -Node: Advanced Features=7F31963 -Node: Finder Cache=7F32411 -Node: Conditions=7F33450 -Node: done=7F34086 -Node: headings=7F34250 -Node: todo-state=7F34626 -Node: variable-set=7F34882 -Node: has-property=7F35311 -Node: re-search=7F35580 -Node: Negating Conditions=7F35940 -Node: Consideration=7F36327 -Node: Conditional Forms=7F37896 -Node: Setting the Properties=7F40552 -Node: Extending Edna=7F41636 -Node: Naming Conventions=7F42126 -Node: Finders 1=7F42587 -Node: Actions 1=7F42949 -Node: Conditions 1=7F43408 -Node: Contributing=7F44294 -Node: Bugs=7F45160 -Node: Working with EDE=7F45517 -Node: Compiling Edna=7F46601 -Node: Testing Edna=7F47470 -Node: Before Sending Changes=7F48451 -Node: Developing with Bazaar=7F49138 -Node: Documentation=7F49879 -Node: Changelog=7F50335 -Node: 10beta7=7F50564 -Node: 10beta6=7F50842 -Node: 10beta5=7F51118 -Node: 10beta4=7F51505 -Node: 10beta3=7F51758 -Node: 10beta2=7F52197 +Node: Copying=7F4114 +Node: Introduction=7F4936 +Node: Installation and Setup=7F5884 +Node: Basic Operation=7F6608 +Node: Blockers=7F8459 +Node: Triggers=7F8745 +Node: Syntax=7F9007 +Node: Basic Features=7F9697 +Node: Finders=7F10000 +Node: ancestors=7F11765 +Node: children=7F12359 +Node: descendants=7F12769 +Node: file=7F13291 +Node: first-child=7F14040 +Node: ids=7F14300 +Node: match=7F14961 +Node: next-sibling=7F15599 +Node: next-sibling-wrap=7F15856 +Node: olp=7F16170 +Node: org-file=7F16582 +Node: parent=7F17227 +Node: previous-sibling=7F17425 +Node: previous-sibling-wrap=7F17686 +Node: relatives=7F17965 +Node: rest-of-siblings=7F21586 +Node: rest-of-siblings-wrap=7F21871 +Node: self=7F22220 +Node: siblings=7F22381 +Node: siblings-wrap=7F22618 +Node: Actions=7F22922 +Node: Scheduled/Deadline=7F23664 +Node: TODO State=7F27239 +Node: Archive=7F27607 +Node: Chain Property=7F27927 +Node: Clocking=7F28210 +Node: Property=7F28622 +Node: Priority=7F30809 +Node: Tag=7F31378 +Node: Effort=7F31595 +Node: Advanced Features=7F31984 +Node: Finder Cache=7F32432 +Node: Conditions=7F33471 +Node: done=7F34107 +Node: headings=7F34271 +Node: todo-state=7F34647 +Node: variable-set=7F34903 +Node: has-property=7F35332 +Node: re-search=7F35601 +Node: Negating Conditions=7F35961 +Node: Consideration=7F36348 +Node: Conditional Forms=7F37917 +Node: Setting the Properties=7F40573 +Node: Extending Edna=7F41657 +Node: Naming Conventions=7F42147 +Node: Finders 1=7F42608 +Node: Actions 1=7F42970 +Node: Conditions 1=7F43429 +Node: Contributing=7F44315 +Node: Bugs=7F45181 +Node: Working with EDE=7F45538 +Node: Compiling Edna=7F46622 +Node: Testing Edna=7F47491 +Node: Before Sending Changes=7F48472 +Node: Developing with Bazaar=7F49159 +Node: Documentation=7F49900 +Node: Changelog=7F50356 +Node: 10beta8=7F50606 +Node: 10beta7=7F50718 +Node: 10beta6=7F51012 +Node: 10beta5=7F51288 +Node: 10beta4=7F51675 +Node: 10beta3=7F51928 +Node: 10beta2=7F52367 =1F End Tag Table =20 diff --git a/packages/org-edna/org-edna.org b/packages/org-edna/org-edna.= org index 6e6c35f..1f01709 100644 --- a/packages/org-edna/org-edna.org +++ b/packages/org-edna/org-edna.org @@ -1410,6 +1410,8 @@ making any changes: :PROPERTIES: :DESCRIPTION: List of changes by version :END: +** 1.0beta8 +Quick fix for beta7. ** 1.0beta7 Biggest change here is the cache. =20 @@ -1418,7 +1420,6 @@ Biggest change here is the cache. - Updated documentation to include EDE =20 - Added testing and compiling documentation - ** 1.0beta6 Lots of parsing fixes. =20 From MAILER-DAEMON Tue Nov 13 14:28:35 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gMeMV-00024k-D0 for mharc-emacs-elpa-diffs@gnu.org; Tue, 13 Nov 2018 14:28:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMeMT-00024e-Fv for emacs-elpa-diffs@gnu.org; Tue, 13 Nov 2018 14:28:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMeMQ-0007Jl-48 for emacs-elpa-diffs@gnu.org; Tue, 13 Nov 2018 14:28:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:59566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMeMP-0007JZ-Hx for emacs-elpa-diffs@gnu.org; Tue, 13 Nov 2018 14:28:29 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 131183) id 4A1E9209E4; Tue, 13 Nov 2018 14:28:29 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 217f407: [gnorb] New option gnorb-gnus-refile-use-outline-path, bump to 1.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Eric Abrahamsen In-Reply-To: <20181113192828.2185.79861@vcs0.savannah.gnu.org> References: <20181113192828.2185.79861@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 217f4079a936670f25634ab6d586a30ffb683737 Auto-Submitted: auto-generated Message-Id: <20181113192829.4A1E9209E4@vcs0.savannah.gnu.org> Date: Tue, 13 Nov 2018 14:28:28 -0500 (EST) From: eric@ericabrahamsen.net (Eric Abrahamsen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 19:28:34 -0000 branch: master commit 217f4079a936670f25634ab6d586a30ffb683737 Author: Eric Abrahamsen Commit: Eric Abrahamsen [gnorb] New option gnorb-gnus-refile-use-outline-path, bump to 1.6.0 =20 * packages/gnorb/gnorb-gnus.el (gnorb-gnus-refile-use-outline-path): New option equivalent to `org-refile-use-outline-path'. Also, remov= e defvar for `org-refile-targets'; we require 'org at top-level, and shouldn't need it. * packages/gnorb/gnorb-gnus.el (gnorb-gnus-attach-part): (gnorb-gnus-incoming-do-todo): (gnorb-gnus-outgoing-do-todo): Use new option. * packages/gnorb/gnorb.org: Document. --- packages/gnorb/gnorb-gnus.el | 26 +++++++++++++++++++++++++- packages/gnorb/gnorb.el | 2 +- packages/gnorb/gnorb.info | 6 +++++- packages/gnorb/gnorb.org | 4 ++++ packages/gnorb/gnorb.texi | 5 +++++ 5 files changed, 40 insertions(+), 3 deletions(-) diff --git a/packages/gnorb/gnorb-gnus.el b/packages/gnorb/gnorb-gnus.el index 3c56f47..07d61f6 100644 --- a/packages/gnorb/gnorb-gnus.el +++ b/packages/gnorb/gnorb-gnus.el @@ -39,7 +39,6 @@ (declare-function org-gnus-follow-link "org-gnus" (group article)) (declare-function org-make-tags-matcher "org" (match)) -(defvar org-refile-targets) =20 (defgroup gnorb-gnus nil "The Gnus bits of Gnorb." @@ -164,6 +163,19 @@ Must be prefixed with \"u\", eg. \"%uG\"." :group 'gnorb-gnus :type 'list) =20 +(defcustom gnorb-gnus-refile-use-outline-path 'org + "Gnorb equivalent of `org-refile-use-outline-path' (which see). +Used when selecting Org headings for triggering or attaching +attachments." + :group 'gnorb-gnus + :type '(choice + (const :tag "Not" nil) + (const :tag "Yes" t) + (const :tag "Start with file name" file) + (const :tag "Start with full file path" full-file-path) + (const :tag "Start with buffer name" buffer-name) + (const :tag "Use org-refile-use-outline-path" org))) + (defcustom gnorb-gnus-sent-groups nil "A list of strings indicating sent mail groups. =20 @@ -207,6 +219,10 @@ each message." "Attach HANDLE to an existing org heading." (let* ((filename (gnorb-gnus-save-part handle)) (org-refile-targets gnorb-gnus-trigger-refile-targets) + (org-refile-use-outline-path + (if (eq gnorb-gnus-refile-use-outline-path 'org) + org-refile-use-outline-path + gnorb-gnus-refile-use-outline-path)) (headers (gnus-data-header (gnus-data-find (gnus-summary-article-number)))) @@ -345,6 +361,10 @@ the outgoing message will still be available -- noth= ing else will work." (interactive "P") (let ((org-refile-targets gnorb-gnus-trigger-refile-targets) + (org-refile-use-outline-path + (if (eq gnorb-gnus-refile-use-outline-path 'org) + org-refile-use-outline-path + gnorb-gnus-refile-use-outline-path)) (compose-marker (make-marker)) header-ids ref-ids rel-headings gnorb-window-conf in-reply-to) @@ -536,6 +556,10 @@ you'll stay in the Gnus summary buffer." (point) (point-max)))) (link (call-interactively 'org-store-link)) (org-refile-targets gnorb-gnus-trigger-refile-targets) + (org-refile-use-outline-path + (if (eq gnorb-gnus-refile-use-outline-path 'org) + org-refile-use-outline-path + gnorb-gnus-refile-use-outline-path)) (ref-msg-ids (concat (mail-header-references headers) " " msg-id)) (related-headings diff --git a/packages/gnorb/gnorb.el b/packages/gnorb/gnorb.el index 9356db0..bd0f0b9 100644 --- a/packages/gnorb/gnorb.el +++ b/packages/gnorb/gnorb.el @@ -2,7 +2,7 @@ =20 ;; Copyright (C) 2018 Free Software Foundation, Inc. =20 -;; Version: 1.5.7 +;; Version: 1.6.0 ;; Package-Requires: ((cl-lib "0.5")) =20 ;; Maintainer: Eric Abrahamsen diff --git a/packages/gnorb/gnorb.info b/packages/gnorb/gnorb.info index ee9a0df..b888083 100644 --- a/packages/gnorb/gnorb.info +++ b/packages/gnorb/gnorb.info @@ -736,6 +736,10 @@ File: gnorb.info, Node: User Options 2, Prev: Sear= ching With the Registry, Up interface. This option will be used as the value of =E2=80=98org-refile-targets=E2=80=99 during that process: see the d= ocstring of =E2=80=98org-refile-targets=E2=80=99 for the appropriate syntax. +=E2=80=98gnorb-gnus-refile-use-outline-path=E2=80=99 + Similar to the previous option, this option will be used as the + value of =E2=80=98org-refile-use-outline-path=E2=80=99 when selecti= ng a heading: + see the its docstring for the meaning of its potential values. =E2=80=98gnorb-gnus-new-todo-capture-key=E2=80=99 Set this to a single-character string pointing at an Org capture template to use when creating TODOs from outgoing messages. The @@ -842,7 +846,7 @@ Node: User Options 1=7F25455 Node: Misc Gnus=7F28353 Node: Searching With the Registry=7F28547 Node: User Options 2=7F29849 -Node: Default Keybindings=7F33027 +Node: Default Keybindings=7F33279 =1F End Tag Table =20 diff --git a/packages/gnorb/gnorb.org b/packages/gnorb/gnorb.org index 951c014..e37036b 100644 --- a/packages/gnorb/gnorb.org +++ b/packages/gnorb/gnorb.org @@ -529,6 +529,10 @@ These functions are not bound by default; you might = consider: This option will be used as the value of `org-refile-targets' during that process: see the docstring of `org-refile-targets' for the appropriate syntax. +- `gnorb-gnus-refile-use-outline-path' :: Similar to the previous + option, this option will be used as the value of + `org-refile-use-outline-path' when selecting a heading: see the + its docstring for the meaning of its potential values. - `gnorb-gnus-new-todo-capture-key' :: Set this to a single-character string pointing at an Org capture template to use when creating TODOs from outgoing messages. The template is a regular capture diff --git a/packages/gnorb/gnorb.texi b/packages/gnorb/gnorb.texi index 5eed70d..7082fc1 100644 --- a/packages/gnorb/gnorb.texi +++ b/packages/gnorb/gnorb.texi @@ -730,6 +730,11 @@ it can't, it will prompt you for one, using the refi= le interface. This option will be used as the value of `org-refile-targets' during that process: see the docstring of `org-refile-targets' for the appropriate syntax. +@item `gnorb-gnus-refile-use-outline-path' +Similar to the previous +option, this option will be used as the value of +`org-refile-use-outline-path' when selecting a heading: see the +its docstring for the meaning of its potential values. @item `gnorb-gnus-new-todo-capture-key' Set this to a single-character string pointing at an Org capture template to use when creating From MAILER-DAEMON Wed Nov 14 12:12:26 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gMyiI-0008Qi-Mi for mharc-emacs-elpa-diffs@gnu.org; Wed, 14 Nov 2018 12:12:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMyiF-0008PJ-Rj for emacs-elpa-diffs@gnu.org; Wed, 14 Nov 2018 12:12:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMyiC-0007hX-09 for emacs-elpa-diffs@gnu.org; Wed, 14 Nov 2018 12:12:23 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:55283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMyiB-0007gq-1L for emacs-elpa-diffs@gnu.org; Wed, 14 Nov 2018 12:12:19 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id D335F2047B; Wed, 14 Nov 2018 12:12:18 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/zones 312105d: * zones.el: Add zz-create-face-zones MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181114171218.27679.38686@vcs0.savannah.gnu.org> References: <20181114171218.27679.38686@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/zones X-Git-Reftype: branch X-Git-Rev: 312105d08aa00fd76a8a57a7c9d84edcdf53f13b Auto-Submitted: auto-generated Message-Id: <20181114171218.D335F2047B@vcs0.savannah.gnu.org> Date: Wed, 14 Nov 2018 12:12:18 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 17:12:25 -0000 branch: externals/zones commit 312105d08aa00fd76a8a57a7c9d84edcdf53f13b Author: Stefan Monnier Commit: Stefan Monnier * zones.el: Add zz-create-face-zones =20 (zz-do-zones, zz-map-zones, zz-do-izones, zz-map-izones): New functio= ns. (zz-zone-union-1): Replace with iterative version. (zz-unite-zones): Better message, give number of resulting zones. (zz-(add|set)-zones-from-highlighting): Add autoload cookie. (zz-create-face-zones): New command. --- zones.el | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---= ------ 1 file changed, 111 insertions(+), 17 deletions(-) diff --git a/zones.el b/zones.el index 5f32b41..3fd47a2 100644 --- a/zones.el +++ b/zones.el @@ -7,7 +7,7 @@ ;; Author: Drew Adams ;; Maintainer: Drew Adams ;; Created: Sun Apr 18 12:58:07 2010 (-0700) -;; Version: 2018.11.1 +;; Version: 2018.11.13 ;; Package-Requires: () ;; Last-Updated: Thu Nov 1 09:46:25 2018 (-0700) ;; By: dradams @@ -78,12 +78,12 @@ ;; `zz-add-zone', `zz-add-zone-and-coalesce', ;; `zz-add-zone-and-unite', `zz-add-zones-from-highlighting', ;; `zz-clone-and-coalesce-zones', `zz-clone-and-unite-zones', -;; `zz-clone-zones', `zz-coalesce-zones', `zz-delete-zone', -;; `zz-narrow', `zz-narrow-repeat', `zz-query-replace-zones' (Emacs -;; 25+), `zz-query-replace-regexp-zones' (Emacs 25+), -;; `zz-select-region', `zz-select-region-repeat', -;; `zz-set-izones-var', `zz-set-zones-from-highlighting', -;; `zz-unite-zones'. +;; `zz-clone-zones', `zz-coalesce-zones', `zz-create-face-zones', +;; `zz-delete-zone', `zz-narrow', `zz-narrow-repeat', +;; `zz-query-replace-zones' (Emacs 25+), +;; `zz-query-replace-regexp-zones' (Emacs 25+), `zz-select-region', +;; `zz-select-region-repeat', `zz-set-izones-var', +;; `zz-set-zones-from-highlighting', `zz-unite-zones'. ;; ;; User options defined here: ;; @@ -96,13 +96,14 @@ ;; Non-interactive functions defined here: ;; ;; `zz-buffer-narrowed-p' (Emacs 22-23), `zz-buffer-of-markers', -;; `zz-car-<', `zz-dot-pairs', `zz-every', -;; `zz-izone-has-other-buffer-marker-p', `zz-izone-limits', -;; `zz-izone-limits-in-bufs', `zz-izones', +;; `zz-car-<', `zz-do-izones', `zz-do-zones', `zz-dot-pairs', +;; `zz-every', `zz-izone-has-other-buffer-marker-p', +;; `zz-izone-limits', `zz-izone-limits-in-bufs', `zz-izones', ;; `zz-izones-from-noncontiguous-region' (Emacs 25+), ;; `zz-izones-from-zones', `zz-izones-p', `zz-izones-renumber', -;; `zz-marker-from-object', `zz-markerize', `zz-max', `zz-min', -;; `zz-narrowing-lighter', `zz-noncontiguous-region-from-izones', +;; `zz-map-izones', `zz-map-zones', `zz-marker-from-object', +;; `zz-markerize', `zz-max', `zz-min', `zz-narrowing-lighter', +;; `zz-noncontiguous-region-from-izones', ;; `zz-noncontiguous-region-from-zones', `zz-number-or-marker-p', ;; `zz-overlays-to-zones', `zz-overlay-to-zone', ;; `zz-overlay-union', `zz-rassoc-delete-all', @@ -527,6 +528,13 @@ ;; ;;(@* "Change log") ;; +;; 2018/11/13 dadams +;; Added: zz-do-izones, zz-do-zones, zz-map-izones, zz-map-zones. +;; 2018/11/12 dadams +;; Added: zz-create-face-zones. +;; zz-zone-union-1: Replaced recursive version with iterative versio= n. +;; zz-unite-zones: Better message: give number of resulting zones. +;; zz-(add|set)-zones-from-highlighting: Added autoload cookie. ;; 2018/10/31 dadams ;; Do not overwrite any user key bindings on narrow-map or ctl-x-map= . ;; Simplified defadvice. @@ -923,6 +931,45 @@ marker that points nowhere, then raise an error." (unless (equal buf1 buf2) (error "Zone has conflicting buffers: %S" = zone)) buf1)) =20 +(defun zz-do-zones (function &optional zones) + "Like `zz-map-zones', but without returning the result of mapping. +The return value is undefined." + (when (functionp function) + (when (zz-izones-p zones) + (setq zones (zz-izone-limits zones nil 'ONLY-THIS-BUFFER))) + (setq zones (zz-zone-union zones)) + (dolist (zone zones) (funcall function (car zone) (cadr zone))))) + +(defun zz-map-zones (function &optional zones) + "Map binary FUNCTION over ZONES, applying it to the limits of each zon= e. +ZONES can be a list of basic zones or a list like `zz-izones', that +is, zones that have identifiers. By default, ZONES is the value of +`zz-izones'." + (if (not (functionp function)) + (or zones zz-izones) + (when (zz-izones-p zones) + (setq zones (zz-izone-limits zones nil 'ONLY-THIS-BUFFER))) + (setq zones (zz-zone-union zones)) + (mapcar (lambda (zone) (funcall function (car zone) (cadr zone))) zo= nes))) + +(defun zz-do-izones (function &optional izones) + "Like `zz-map-izones', but without returning the result of mapping. +The return value is undefined." + (when (functionp function) + (setq izones (zz-unite-zones izones)) + (dolist (izone izones) (funcall function (car izone) (cadr izone) (= caddr izone))))) + +(defun zz-map-izones (function &optional izones) + "Map FUNCTION over IZONES. +Apply FUNCTION to the first three elements of each izone, that is, the + identifier and the zone limits. +IZONES is a list like `zz-izones', that is, zones with identifiers. +By default, IZONES is the value of `zz-izones'." + (if (not (functionp function)) + (or izones zz-izones) + (setq izones (zz-unite-zones izones)) + (mapcar (lambda (izone) (funcall function (car izone) (cadr izone) (= caddr izone))) izones))) + (defun zz-zones-complement (zones &optional beg end) "Return a list of zones that is the complement of ZONES, from BEG to E= ND. ZONES is assumed to be a union, i.e., sorted by car, with no overlaps. @@ -975,14 +1022,29 @@ combined whenever zones are merged together." (sorted-zones (sort flipped-zones #'zz-car-<))) (zz-zone-union-1 sorted-zones))) =20 +;; Recursive version. +;; (defun zz-zone-union-1 (zones) +;; "Helper for `zz-zone-union'." +;; (if (null (cdr zones)) +;; zones +;; (let ((new (zz-two-zone-union (car zones) (cadr zones)))) +;; (if new +;; (zz-zone-union-1 (cons new (cddr zones))) +;; (cons (car zones) (zz-zone-union-1 (cdr zones))))))) + (defun zz-zone-union-1 (zones) "Helper for `zz-zone-union'." (if (null (cdr zones)) zones - (let ((new (zz-two-zone-union (car zones) (cadr zones)))) - (if new - (zz-zone-union-1 (cons new (cddr zones))) - (cons (car zones) (zz-zone-union-1 (cdr zones))))))) + (let ((acc ()) + new) + (while zones + (setq new (and (cdr zones) (zz-two-zone-union (car zones) (cad= r zones)))) + (if new + (setq zones (cons new (cddr zones))) + (setq acc (cons (car zones) acc) + zones (cdr zones)))) + (setq acc (nreverse acc))))) =20 (defun zz-car-< (zone1 zone2) "Return non-nil if car of ZONE1 < car of ZONE2. @@ -1779,7 +1841,9 @@ Non-interactively: (_IGNORE (unless (zz-izones-p val) (error "Not an izones va= riable: `%s', value: `%S'" var val))) (zone-union (zz-zone-union (zz-izone-limits val)))) (set var (zz-izones-from-zones zone-union)) - (when msgp (message "Restrictions united for `%s'" var)) + (when msgp + (let ((len (length (symbol-value var)))) + (message "Zones united for variable `%s': %d zone%s now" var len= (if (> len 1) "s" "")))) (symbol-value var))) =20 ;;;###autoload @@ -1819,6 +1883,7 @@ Non-interactively: (zz-unite-zones variable msgp) (symbol-value variable)) =20 +;;;###autoload (defun zz-add-zones-from-highlighting (&optional start end face only-hlt= -face overlay/text fonk-lock-p msgp) "Add highlighted areas as zones to izones variable. By default, the text used is that highlighted with `hlt-last-face'. @@ -1898,6 +1963,7 @@ When called from Lisp: (1 (message "1 zone added or updated")) (t (message "%s highlighted areas added or updated as zones" cou= nt)))))) =20 +;;;###autoload (defun zz-set-zones-from-highlighting (&optional start end face only-hlt= -face overlay/text fonk-lock-p msgp) "Replace value of izones variable with zones from the highlighted area= s. Like `zz-add-zones-from-highlighting' (which see), but it replaces any @@ -1913,6 +1979,34 @@ current zones instead of adding to them." (set zz-izones-var ()) (zz-add-zones-from-highlighting start end face only-hlt-face overlay/t= ext fonk-lock-p msgp)) =20 +;;;###autoload +(defun zz-create-face-zones (face &optional start end variable msgp) + "Set an izones variable to (united) zones of a face or background colo= r. +You are prompted for a face name or a color name. If you enter a +color, it is used for the face background. The face foreground is +determined by the value of `hlt-auto-face-foreground'. +The variable defaults to `zz-izones'. With a prefix arg you are + prompted for a different izones variable." + (interactive + (progn + (unless (require 'highlight nil t) + (error "You need library `highlight.el' for this command")) + (let ((fac (hlt-read-bg/face-name "Choose background color or face= : " + (and (symbolp hlt-last-face) (s= ymbol-name hlt-last-face)))) + (var (or (and current-prefix-arg (zz-read-any-variable "Var= iable: " zz-izones-var)) + zz-izones-var))) + (if (hlt-nonempty-region-p) + (if (< (point) (mark)) (list (point) (mark) var t) (list (mar= k) (point) var t)) + (list fac (point-min) (point-max) var t))))) + (unless (require 'highlight nil t) + (error "You need library `highlight.el' for this command")) + (unless (require 'isearch-prop nil t) + (error "You need library `isearch-prop.el' for this command")) + (unless (require 'zones nil t) + (error "You need library `zones' for this command")) + (font-lock-default-fontify-buffer) ; Fontify the whole buffer. + (zz-set-zones-from-highlighting start end face nil 'text-prop) + (zz-unite-zones variable t)) =20 ;;--------------------- =20 From MAILER-DAEMON Wed Nov 14 14:03:49 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gN0S5-0002mu-0h for mharc-emacs-elpa-diffs@gnu.org; Wed, 14 Nov 2018 14:03:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gN0S3-0002mb-5s for emacs-elpa-diffs@gnu.org; Wed, 14 Nov 2018 14:03:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gN0S1-0007NF-Bd for emacs-elpa-diffs@gnu.org; Wed, 14 Nov 2018 14:03:46 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:56945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gN0Rn-0007E9-QE for emacs-elpa-diffs@gnu.org; Wed, 14 Nov 2018 14:03:38 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 67131) id 96D4320427; Wed, 14 Nov 2018 14:03:31 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 170394c: * packages/ada-mode/ada-mode.el (ada-mode): emacs 26 vs hack-local-variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stephen Leake In-Reply-To: <20181114190330.16438.29407@vcs0.savannah.gnu.org> References: <20181114190330.16438.29407@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 170394cefd5bf4512337b1114c1d5f8a80a549e3 Auto-Submitted: auto-generated Message-Id: <20181114190331.96D4320427@vcs0.savannah.gnu.org> Date: Wed, 14 Nov 2018 14:03:31 -0500 (EST) From: stephen_leake@stephe-leake.org (Stephen Leake) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 19:03:48 -0000 branch: master commit 170394cefd5bf4512337b1114c1d5f8a80a549e3 Author: Stephen Leake Commit: Stephen Leake * packages/ada-mode/ada-mode.el (ada-mode): emacs 26 vs hack-local-va= riables --- packages/ada-mode/ada-mode.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/ada-mode/ada-mode.el b/packages/ada-mode/ada-mode.e= l index efd2c4f..5e86e14 100755 --- a/packages/ada-mode/ada-mode.el +++ b/packages/ada-mode/ada-mode.el @@ -1,12 +1,12 @@ ;;; ada-mode.el --- major-mode for editing Ada sources -*- lexical-bind= ing:t -*- ;; -;; Copyright (C) 1994, 1995, 1997 - 2017 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 1997 - 2018 Free Software Foundation, Inc. ;; ;; Author: Stephen Leake ;; Maintainer: Stephen Leake ;; Keywords: languages ;; ada -;; Version: 5.3.1 +;; Version: 5.3.2 ;; package-requires: ((wisi "1.1.6") (cl-lib "0.4") (emacs "24.3")) ;; url: http://www.nongnu.org/ada-mode/ ;; @@ -2933,7 +2933,11 @@ The paragraph is indented on the first line." =20 (when (< emacs-major-version 25) (syntax-propertize (point-max))) =20 - (add-hook 'hack-local-variables-hook 'ada-mode-post-local-vars nil t) + (if (<=3D emacs-major-version 25) + ;; run-mode-hooks does _not_ call hack-local-variables + (add-hook 'hack-local-variables-hook 'ada-mode-post-local-vars nil= t) + ;; >=3D 26; run-mode-hooks _does_ call hack-local-variables + (ada-mode-post-local-vars)) ) =20 (defun ada-mode-post-local-vars () From MAILER-DAEMON Fri Nov 16 17:26:19 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gNmZ9-000667-Nu for mharc-emacs-elpa-diffs@gnu.org; Fri, 16 Nov 2018 17:26:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNmZ7-00065t-3u for emacs-elpa-diffs@gnu.org; Fri, 16 Nov 2018 17:26:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNmZ5-0007gG-Ok for emacs-elpa-diffs@gnu.org; Fri, 16 Nov 2018 17:26:17 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:48616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNmZ5-0007g8-Lj for emacs-elpa-diffs@gnu.org; Fri, 16 Nov 2018 17:26:15 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 131183) id 6717020710; Fri, 16 Nov 2018 17:26:15 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 076e88d: [gnus-mock] Add Cyrillic group to the nnimap server, bump to 0.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Eric Abrahamsen In-Reply-To: <20181116222614.2145.61313@vcs0.savannah.gnu.org> References: <20181116222614.2145.61313@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 076e88debf6da08d25e043406d4492fc7dddfcc1 Auto-Submitted: auto-generated Message-Id: <20181116222615.6717020710@vcs0.savannah.gnu.org> Date: Fri, 16 Nov 2018 17:26:14 -0500 (EST) From: eric@ericabrahamsen.net (Eric Abrahamsen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 22:26:18 -0000 branch: master commit 076e88debf6da08d25e043406d4492fc7dddfcc1 Author: Eric Abrahamsen Commit: Eric Abrahamsen [gnus-mock] Add Cyrillic group to the nnimap server, bump to 0.3.0 =20 * packages/gnus-mock/gnus-mock.el (gnus-mock-start): For testing non-ASCII group names. --- .../1542406320.M313959P15239.clem,S=3D2997,W=3D3064:2, | 67 +++++++++++= ++++++++++ .../.&BB8EQAQ4BDIENQRCBDwEOARA-/dovecot-uidlist | 2 + .../dovecot.index.cache | Bin 0 -> 1972 bytes .../mail/.&BB8EQAQ4BDIENQRCBDwEOARA-/maildirfolder | 0 .../imapmail/mail/.emacs-devel/dovecot.index.cache | Bin 16392 -> 17704 = bytes .../data/imapmail/mail/dovecot-uidvalidity | 2 +- .../imapmail/mail/dovecot-uidvalidity.5bdb1f81 | 0 .../data/imapmail/mail/dovecot.index.cache | Bin 18408 -> 19780 = bytes packages/gnus-mock/gnus-mock.el | 8 ++- 9 files changed, 77 insertions(+), 2 deletions(-) diff --git a/packages/gnus-mock/data/imapmail/mail/.&BB8EQAQ4BDIENQRCBDwE= OARA-/cur/1542406320.M313959P15239.clem,S=3D2997,W=3D3064:2, b/packages/g= nus-mock/data/imapmail/mail/.&BB8EQAQ4BDIENQRCBDwEOARA-/cur/1542406320.M3= 13959P15239.clem,S=3D2997,W=3D3064:2, new file mode 100644 index 0000000..48d3268 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.&BB8EQAQ4BDIENQRCBDwEOARA-/c= ur/1542406320.M313959P15239.clem,S=3D2997,W=3D3064:2, @@ -0,0 +1,67 @@ +From MAILER-DAEMON Thu Jun 29 16:53:15 2017 +Received: from list by lists.gnu.org with archive (Exim 4.71) + id 1dQgR9-000168-Bo + for mharc-emacs-devel@gnu.org; Thu, 29 Jun 2017 16:53:15 -0400 +Received: from eggs.gnu.org ([2001:4830:134:3::10]:49168) + by lists.gnu.org with esmtp (Exim 4.71) + (envelope-from ) id 1dQgR7-00015z-IL + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:53:14 -0400 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) + (envelope-from ) id 1dQgR2-0002go-N9 + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:53:13 -0400 +Received: from [195.159.176.226] (port=3D41967 helo=3Dblaine.gmane.org) + by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.71) (envelope-from ) + id 1dQgR2-0002fs-GR + for emacs-devel@gnu.org; Thu, 29 Jun 2017 16:53:08 -0400 +Received: from list by blaine.gmane.org with local (Exim 4.84_2) + (envelope-from ) id 1dQgQt-0005Rx-MC + for emacs-devel@gnu.org; Thu, 29 Jun 2017 22:52:59 +0200 +X-Injected-Via-Gmane: http://gmane.org/ +To: emacs-devel@gnu.org +From: Stefan Monnier +Subject: Re: [Emacs-diffs] master c75eb10: Don't change + byte-compile-delete-errors at runtime (Bug#27340) +Date: Thu, 29 Jun 2017 16:52:59 -0400 +Lines: 11 +Message-ID: +References: <20170624141528.514.4459@vcs0.savannah.gnu.org> + <20170624141530.443C5210EB@vcs0.savannah.gnu.org> + + + <87r2y28ule.fsf@gnu.org> +Mime-Version: 1.0 +Content-Type: text/plain +X-Complaints-To: usenet@blaine.gmane.org +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) +Cancel-Lock: sha1:0ovUZbNlyU/S9RpSdcgnYnh9N94=3D +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [gener= ic] + [fuzzy] +X-Received-From: 195.159.176.226 +X-BeenThere: emacs-devel@gnu.org +X-Mailman-Version: 2.1.21 +Precedence: list +List-Id: "Emacs development discussions." +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Jun 2017 20:53:14 -0000 + +> This is wrong. declaim has run-time effects, just like defvar etc. + +If you put (defvar foo) in foo.el, then compile it, then load foo.elc, +you'll see that this defvar has no runtime effect. + +I think cl-declaim should basically behave the same: it holds +compilation directives which should basically only influence the +compilation of the current file. + + + Stefan + + + diff --git a/packages/gnus-mock/data/imapmail/mail/.&BB8EQAQ4BDIENQRCBDwE= OARA-/dovecot-uidlist b/packages/gnus-mock/data/imapmail/mail/.&BB8EQAQ4B= DIENQRCBDwEOARA-/dovecot-uidlist new file mode 100644 index 0000000..3947aa5 --- /dev/null +++ b/packages/gnus-mock/data/imapmail/mail/.&BB8EQAQ4BDIENQRCBDwEOARA-/d= ovecot-uidlist @@ -0,0 +1,2 @@ +3 V1541087105 N2 Gb00eab31a140ef5b873b0000ae73901d +1 :1542406320.M313959P15239.clem,S=3D2997,W=3D3064 diff --git a/packages/gnus-mock/data/imapmail/mail/.&BB8EQAQ4BDIENQRCBDwE= OARA-/dovecot.index.cache b/packages/gnus-mock/data/imapmail/mail/.&BB8EQ= AQ4BDIENQRCBDwEOARA-/dovecot.index.cache new file mode 100644 index 0000000..7bc9f73 Binary files /dev/null and b/packages/gnus-mock/data/imapmail/mail/.&BB8E= QAQ4BDIENQRCBDwEOARA-/dovecot.index.cache differ diff --git a/packages/gnus-mock/data/imapmail/mail/.&BB8EQAQ4BDIENQRCBDwE= OARA-/maildirfolder b/packages/gnus-mock/data/imapmail/mail/.&BB8EQAQ4BDI= ENQRCBDwEOARA-/maildirfolder new file mode 100644 index 0000000..e69de29 diff --git a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/dovecot.i= ndex.cache b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/dovecot.i= ndex.cache index 5bcc3b0..595ca0c 100644 Binary files a/packages/gnus-mock/data/imapmail/mail/.emacs-devel/dovecot= .index.cache and b/packages/gnus-mock/data/imapmail/mail/.emacs-devel/dov= ecot.index.cache differ diff --git a/packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity b/= packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity index 5543413..bd71b79 100644 --- a/packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity +++ b/packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity @@ -1 +1 @@ -5bdb1f80 \ No newline at end of file +5bdb1f81 \ No newline at end of file diff --git a/packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity.5b= db1f81 b/packages/gnus-mock/data/imapmail/mail/dovecot-uidvalidity.5bdb1f= 81 new file mode 100644 index 0000000..e69de29 diff --git a/packages/gnus-mock/data/imapmail/mail/dovecot.index.cache b/= packages/gnus-mock/data/imapmail/mail/dovecot.index.cache index 23dd25b..2dd4137 100644 Binary files a/packages/gnus-mock/data/imapmail/mail/dovecot.index.cache = and b/packages/gnus-mock/data/imapmail/mail/dovecot.index.cache differ diff --git a/packages/gnus-mock/gnus-mock.el b/packages/gnus-mock/gnus-mo= ck.el index 661559b..b11c15f 100644 --- a/packages/gnus-mock/gnus-mock.el +++ b/packages/gnus-mock/gnus-mock.el @@ -5,7 +5,7 @@ ;; Author: Eric Abrahamsen ;; Maintainer: Eric Abrahamsen ;; Package-Type: multi -;; Version: 0.2.1 +;; Version: 0.3.0 =20 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -246,6 +246,12 @@ will start a mock Gnus session." "nnimap:Mocky" ((modseq . "21") (uidvalidity . "1541087104") (active 0 . 20) (permanent-flags %Answered %Flagged %Deleted + %Seen %Draft %*))) + ("nnimap+Mocky:\320\237\321\200\320\270\320\262\320\265\321\202\32= 0\274\320\270\321\200" + 3 nil ((unexist) (seen 1)) + "nnimap:Mocky" ((modseq . "2") (uidvalidity . "1541087105") + (active 1 . 1) + (permanent-flags %Answered %Flagged %Deleted %Seen %Draft %*)))))) (current-buffer))) (basic-save-buffer)) From MAILER-DAEMON Sat Nov 17 01:40:03 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gNuGx-00043Z-KF for mharc-emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 01:40:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNuGo-00043M-W4 for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 01:40:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNuGh-0008L3-0p for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 01:39:54 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:55340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNuGg-0008Kx-Qi for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 01:39:46 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 88D8320512; Sat, 17 Nov 2018 01:39:46 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/dismal 569056c: Try and clean up the namespace a bit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181117063945.27305.91339@vcs0.savannah.gnu.org> References: <20181117063945.27305.91339@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/dismal X-Git-Reftype: branch X-Git-Rev: 569056c9b07a35c8a154f693138123a4ea365500 Auto-Submitted: auto-generated Message-Id: <20181117063946.88D8320512@vcs0.savannah.gnu.org> Date: Sat, 17 Nov 2018 01:39:46 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 06:40:03 -0000 branch: externals/dismal commit 569056c9b07a35c8a154f693138123a4ea365500 Author: Stefan Monnier Commit: Stefan Monnier Try and clean up the namespace a bit --- dismal-menu3.el | 162 ++++++------- dismal-mouse3.el | 249 ++++++++++---------- dismal-simple-menus.el | 8 +- dismal.el | 609 +++++++++++++++++++++++--------------------= ------ rmatrix.el | 76 +++--- semi-coder.el | 143 ++++++------ 6 files changed, 611 insertions(+), 636 deletions(-) diff --git a/dismal-menu3.el b/dismal-menu3.el index a04a8ea..d1bae83 100644 --- a/dismal-menu3.el +++ b/dismal-menu3.el @@ -1,6 +1,6 @@ ;;; dismal-menu3.el --- Menu system for using with Dismal spreadsheet =20 -;; Copyright (C) 1991, 2013 Free Software Foundation, Inc. +;; Copyright (C) 1991, 2013-2018 Free Software Foundation, Inc. =20 ;; Author: Nigel Jenkins, nej@cs.nott.ac.uk ;; lpyjnej@psyc.nott.ac.uk=20 @@ -24,8 +24,8 @@ ;; I. Set up of menu ready for use in Dismal-mode buffer =20 =20 -;; (define-key dismal-map [menu-bar edit] ()) -;; (define-key dismal-map [menu-bar file] ()) +;; (define-key dismal-mode-map [menu-bar edit] ()) +;; (define-key dismal-mode-map [menu-bar file] ()) =20 ;; now done with the local map ;; Check if already in dismal-mode to put the correct menu up @@ -35,18 +35,18 @@ =20 ;;; Code: =20 -(require 'dismal) ;For dismal-map. +(require 'dismal) ;For dismal-mode-map. =20 -(define-key dismal-map [menu-bar model] +(define-key dismal-mode-map [menu-bar model] (cons "dModel" (make-sparse-keymap "Model"))) =20 -(define-key dismal-map [menu-bar model Utils] +(define-key dismal-mode-map [menu-bar model Utils] '("Utils" . dis-utils-menu)) -(define-key dismal-map [menu-bar model Stats] +(define-key dismal-mode-map [menu-bar model Stats] '("Stats" . dis-stat)) -(define-key dismal-map [menu-bar model Codes] +(define-key dismal-mode-map [menu-bar model Codes] '("Codes" . dis-code)) -(define-key dismal-map [menu-bar model KLM] +(define-key dismal-mode-map [menu-bar model KLM] '("KL model" . dis-klm)) =20 =20 @@ -67,9 +67,9 @@ (fset 'dis-stat dis-stat-menu) =20 (define-key dis-stat-menu [stats] - '("Print Statistics (not defined yet)" . dis-no-op)) + '("Print Statistics (not defined yet)" . undefined)) (define-key dis-stat-menu [count] - '("Count Codes (not defined yet)" . dis-no-op)) + '("Count Codes (not defined yet)" . undefined)) =20 =20 ;; CODES pop-up-menu @@ -99,20 +99,20 @@ ;;; II.b OPTIONS item on menu-bar and all sub-menus ;;; =20 -(define-key dismal-map [menu-bar options] +(define-key dismal-mode-map [menu-bar options] (cons "dOpts" (make-sparse-keymap "Dis Options"))) =20 -(define-key dismal-map [menu-bar options zrange] +(define-key dismal-mode-map [menu-bar options zrange] '("Redraw Range" . dis-redraw-range)) -(define-key dismal-map [menu-bar options ruler-redraw] +(define-key dismal-mode-map [menu-bar options ruler-redraw] '("Ruler Redraw" . dis-update-ruler)) -(define-key dismal-map [menu-bar options row-redraw] +(define-key dismal-mode-map [menu-bar options row-redraw] '("Redraw Row" . dis-hard-redraw-row)) -(define-key dismal-map [menu-bar options column-redraw] +(define-key dismal-mode-map [menu-bar options column-redraw] '("Redraw Column" . dis-redraw-column)) -(define-key dismal-map [menu-bar options screen-redraw] +(define-key dismal-mode-map [menu-bar options screen-redraw] '("Redraw Screen" . dis-redraw)) -(define-key dismal-map [menu-bar options set-vari-menu] +(define-key dismal-mode-map [menu-bar options set-vari-menu] '("Set dismal Variables" . dis-setv)) =20 ;; SetV pop-up-menu @@ -139,12 +139,12 @@ ;;; II.c DOC item on menu-bar and all sub-menus ;;; =20 -(define-key dismal-map [menu-bar doc.] +(define-key dismal-mode-map [menu-bar doc.] (cons "dDoc" (make-sparse-keymap "Dis Doc"))) =20 -(define-key dismal-map [menu-bar doc. show] +(define-key dismal-mode-map [menu-bar doc. show] '("Full Dismal Documentation" . dis-open-dis-manual)) -(define-key dismal-map [menu-bar doc. about] +(define-key dismal-mode-map [menu-bar doc. about] '("About Dismal mode" . describe-mode)) =20 (defun dis-open-dis-manual () @@ -156,20 +156,20 @@ ;;; II.d FORMAT item on menu-bar and all sub-menus ;;; =20 -(define-key dismal-map [menu-bar format] +(define-key dismal-mode-map [menu-bar format] (cons "dFormat" (make-sparse-keymap "Dis Format"))) =20 -(define-key dismal-map [menu-bar format update-r] +(define-key dismal-mode-map [menu-bar format update-r] '("Update Ruler" . dis-update-ruler)) -(define-key dismal-map [menu-bar format fonts] +(define-key dismal-mode-map [menu-bar format fonts] '("Set Font" . mouse-set-font)) -(define-key dismal-map [menu-bar format auto-width] +(define-key dismal-mode-map [menu-bar format auto-width] '("Automatic Width" . dis-auto-column-width)) -(define-key dismal-map [menu-bar format width] +(define-key dismal-mode-map [menu-bar format width] '("Set Col Width" . dis-read-column-width)) -(define-key dismal-map [menu-bar format align] +(define-key dismal-mode-map [menu-bar format align] '("Alignment" . dis-set-alignment)) -(define-key dismal-map [menu-bar format number] +(define-key dismal-mode-map [menu-bar format number] '("Decimal width" . dis-set-column-decimal)) =20 =20 @@ -183,34 +183,34 @@ ;;; II.e COMMANDS item on menu-bar and all sub-menus ;;; =20 -(define-key dismal-map [menu-bar commands] +(define-key dismal-mode-map [menu-bar commands] (cons "dComms" (make-sparse-keymap "Dis Commands"))) =20 -(define-key dismal-map [menu-bar commands 0log] +(define-key dismal-mode-map [menu-bar commands 0log] '("Logging-Off" . log-quit)) -(define-key dismal-map [menu-bar commands 1log] +(define-key dismal-mode-map [menu-bar commands 1log] '("Logging-On" . log-session-mode)) -(define-key dismal-map [menu-bar commands deblnk] +(define-key dismal-mode-map [menu-bar commands deblnk] '("Del Blank Rows" . dis-delete-blank-rows)) -(define-key dismal-map [menu-bar commands qrep] +(define-key dismal-mode-map [menu-bar commands qrep] '("Query-Replace" . dis-query-replace)) -(define-key dismal-map [menu-bar commands hupdt] +(define-key dismal-mode-map [menu-bar commands hupdt] '("Hard-Update" . dis-recalculate-matrix)) -(define-key dismal-map [menu-bar commands updt] +(define-key dismal-mode-map [menu-bar commands updt] '("Update" . dis-update-matrix)) -(define-key dismal-map [menu-bar commands lisfns] +(define-key dismal-mode-map [menu-bar commands lisfns] '("List dismal user functions" . dis-show-functions)) -(define-key dismal-map [menu-bar commands filrng] +(define-key dismal-mode-map [menu-bar commands filrng] '("Fill Range" . dis-fill-range)) -(define-key dismal-map [menu-bar commands expand] +(define-key dismal-mode-map [menu-bar commands expand] '("Expand hidden cols in range" . dis-expand-cols-in-range)) -(define-key dismal-map [menu-bar commands redrw] +(define-key dismal-mode-map [menu-bar commands redrw] '("Redraw Display" . dis-redraw)) -;;(define-key dismal-map [menu-bar commands dep-clean] +;;(define-key dismal-mode-map [menu-bar commands dep-clean] ;; '("Dependencies-clean" . dis-fix-dependencies)) -(define-key dismal-map [menu-bar commands cp2dis] +(define-key dismal-mode-map [menu-bar commands cp2dis] '("Copy text into Dismal" . dis-copy-to-dismal)) -(define-key dismal-map [menu-bar commands align] +(define-key dismal-mode-map [menu-bar commands align] '("Align Metacolumns" . dis-align-metacolumns)) =20 =0C @@ -218,23 +218,23 @@ ;;; II.f GO item on menu-bar and all sub-menus ;;; =20 -(define-key dismal-map [menu-bar go] +(define-key dismal-mode-map [menu-bar go] (cons "dGo" (make-sparse-keymap "Dis Go"))) -(define-key dismal-map [menu-bar go Jump] +(define-key dismal-mode-map [menu-bar go Jump] '("Jump to cell>" . dis-jump)) -(define-key dismal-map [menu-bar go End] +(define-key dismal-mode-map [menu-bar go End] '("End of sheet" . dis-end-of-buffer)) -(define-key dismal-map [menu-bar go Begin] +(define-key dismal-mode-map [menu-bar go Begin] '("Beginning of sheet" . dis-beginning-of-buffer)) =20 ;; These either don't work and/or aren't necessary -;; (define-key dismal-map [menu-bar go Scroll-Right] +;; (define-key dismal-mode-map [menu-bar go Scroll-Right] ;; '("-->" . scroll-right)) -;; (define-key dismal-map [menu-bar go Scroll-Left] +;; (define-key dismal-mode-map [menu-bar go Scroll-Left] ;; '("<--" . scroll-left)) -(define-key dismal-map [menu-bar go Row] +(define-key dismal-mode-map [menu-bar go Row] '("Row" . dis-row)) -(define-key dismal-map [menu-bar go Column] +(define-key dismal-mode-map [menu-bar go Column] '("Column" . dis-column)) =20 =20 @@ -275,31 +275,31 @@ ;;; =20 ;; Remove other edit, since it contains dangerous commands. -(define-key dismal-map [menu-bar edit] 'undefined) -(define-key dismal-map [menu-bar search] 'undefined) -(define-key dismal-map [menu-bar files] 'undefined) +(define-key dismal-mode-map [menu-bar edit] 'undefined) +(define-key dismal-mode-map [menu-bar search] 'undefined) +(define-key dismal-mode-map [menu-bar files] 'undefined) =20 -(define-key dismal-map [menu-bar dedit] +(define-key dismal-mode-map [menu-bar dedit] (cons "dEdit" (make-sparse-keymap "Dis Edit"))) =20 -(define-key dismal-map [menu-bar dedit modify] +(define-key dismal-mode-map [menu-bar dedit modify] '("Modify cell justification" . dis-modify)) -(define-key dismal-map [menu-bar dedit delete] +(define-key dismal-mode-map [menu-bar dedit delete] '("Delete" . dis-delete)) -(define-key dismal-map [menu-bar dedit insert] +(define-key dismal-mode-map [menu-bar dedit insert] '("Insert" . dis-insert)) -(define-key dismal-map [menu-bar dedit set] +(define-key dismal-mode-map [menu-bar dedit set] '("Edit cell" . dis-edit-cell-plain)) -(define-key dismal-map [menu-bar dedit erase] +(define-key dismal-mode-map [menu-bar dedit erase] '("Erase range" . dis-erase-range)) -(define-key dismal-map [menu-bar dedit yank] +(define-key dismal-mode-map [menu-bar dedit yank] '("Yank" . dis-paste-range)) -(define-key dismal-map [menu-bar dedit copy] +(define-key dismal-mode-map [menu-bar dedit copy] '("Copy range" . dis-copy-range)) -(define-key dismal-map [menu-bar dedit kill] +(define-key dismal-mode-map [menu-bar dedit kill] '("Kill range" . dis-kill-range)) -;; (define-key dismal-map [menu-bar dedit undo] -;; '("Undo" . dis-no-op)) +;; (define-key dismal-mode-map [menu-bar dedit undo] +;; '("Undo" . undefined)) =20 =20 ;; MODIFY pop-up-menu @@ -371,44 +371,44 @@ ;;; ;;; These are pushed on, it appears. =20 -(define-key dismal-map [menu-bar Dfile] +(define-key dismal-mode-map [menu-bar Dfile] (cons "dFile" (make-sparse-keymap "Dis File"))) =20 -(define-key dismal-map [menu-bar Dfile Quit] +(define-key dismal-mode-map [menu-bar Dfile Quit] '("Kill current buffer" . kill-buffer)) -(define-key dismal-map [menu-bar Dfile Unpage] +(define-key dismal-mode-map [menu-bar Dfile Unpage] '("Unpaginate dismal report" . dis-unpaginate)) =20 -(define-key dismal-map [menu-bar Dfile TeXdump1] +(define-key dismal-mode-map [menu-bar Dfile TeXdump1] '("TeX Dump file (raw)" . dis-tex-dump-range)) -(define-key dismal-map [menu-bar Dfile TeXdump2] +(define-key dismal-mode-map [menu-bar Dfile TeXdump2] '("TeX Dump file (with TeX header)" . dis-tex-dump-range-file)) =20 -(define-key dismal-map [menu-bar Dfile htmldumprange] +(define-key dismal-mode-map [menu-bar Dfile htmldumprange] '("Dump range as HTML table" . dis-html-dump-range)) -(define-key dismal-map [menu-bar Dfile htmldumpfile] +(define-key dismal-mode-map [menu-bar Dfile htmldumpfile] '("Dump file as HTML table" . dis-html-dump-file)) =20 -(define-key dismal-map [menu-bar Dfile Rdump] +(define-key dismal-mode-map [menu-bar Dfile Rdump] '("Range-Dump (tabbed)" . dis-dump-range)) -(define-key dismal-map [menu-bar Dfile Tdump] +(define-key dismal-mode-map [menu-bar Dfile Tdump] '("Tabbed-Dump file" . dis-write-tabbed-file)) =20 -(define-key dismal-map [menu-bar Dfile PPrin] +(define-key dismal-mode-map [menu-bar Dfile PPrin] '("Paper-Print" . dis-print-report)) -(define-key dismal-map [menu-bar Dfile FPrin] +(define-key dismal-mode-map [menu-bar Dfile FPrin] '("File-Print" . dis-make-report)) -(define-key dismal-map [menu-bar Dfile 2Prin] +(define-key dismal-mode-map [menu-bar Dfile 2Prin] '("Print Setup" . dis-print-setup)) -(define-key dismal-map [menu-bar Dfile insert-file] +(define-key dismal-mode-map [menu-bar Dfile insert-file] '("Insert File..." . dis-insert-file)) -(define-key dismal-map [menu-bar Dfile Write] +(define-key dismal-mode-map [menu-bar Dfile Write] '("Save buffer as..." . dis-write-file)) -(define-key dismal-map [menu-bar Dfile Save] +(define-key dismal-mode-map [menu-bar Dfile Save] '("Save" . dis-save-file)) -(define-key dismal-map [menu-bar Dfile Open] +(define-key dismal-mode-map [menu-bar Dfile Open] '("Open file" . find-file)) -(define-key dismal-map [menu-bar Dfile New] +(define-key dismal-mode-map [menu-bar Dfile New] '("New sheet" . dis-find-file)) =20 (provide 'dismal-menu3) diff --git a/dismal-mouse3.el b/dismal-mouse3.el index 84c89b7..57420d1 100644 --- a/dismal-mouse3.el +++ b/dismal-mouse3.el @@ -1,6 +1,6 @@ ;;; dismal-mouse3.el --- Functionality for using a mouse inside of Disma= l =20 -;; Copyright (C) 1997, 2013 Free Software Foundation, Inc. +;; Copyright (C) 1997-2018 Free Software Foundation, Inc. =20 ;; Author: Nigel Jenkins, nej@cs.nott.ac.uk ;; lpyjnej@psyc.nott.ac.uk =20 @@ -30,34 +30,49 @@ =20 ;;; Code: =20 -;;;; i. Modify `dismal-map' to cope with new mouse controls +(defvar dismal-max-col) +(defvar dismal-max-row) +(defvar dismal-current-row) =20 -;; Keymap additions to dismal-map keymap, allowing the mouse to -;; be used with dismalfor selecting cells and ranges of cells. +;;;; i. Modify `dismal-mode-map' to cope with new mouse controls =20 -(define-key dismal-map [down-mouse-1] 'dis-mouse-highlight-cell-or-range= ) -(define-key dismal-map [double-mouse-1] 'ignore) -(define-key dismal-map [triple-mouse-1] 'ignore) +;; Keymap additions to dismal-mode-map keymap, allowing the mouse to +;; be used with dismal for selecting cells and ranges of cells. =20 -;; These are too slow, because of how the matrix is represented,=20 -;; so don't offer to user. -;; (define-key dismal-map [down-mouse-2] 'dis-mouse-highlight-column) -;; (define-key dismal-map [mouse-2] 'dis-mouse-highlight-column) -;; had been mouse-yank-at-point, which is a mess with plain text +(defvar dismal-mouse-map + (let ((map (make-sparse-keymap))) + (define-key map [down-mouse-1] 'dis-mouse-highlight-cell-or-range) + (define-key map [double-mouse-1] 'ignore) + (define-key map [triple-mouse-1] 'ignore) =20 -(define-key dismal-map [down-mouse-2] 'dis-mouse-highlight-cell-or-range= ) -(define-key dismal-map [mouse-2] 'dis-mouse-highlight-cell-or-range) -(define-key dismal-map [double-mouse-2] 'ignore) -(define-key dismal-map [triple-mouse-2] 'ignore) + ;; These areecause of how the matrix is represented,=20 + ;; so don't r. + ;; (define-kde-map [down-mouse-2] 'dis-mouse-highlight-column) + ;; (define-kde-map [mouse-2] 'dis-mouse-highlight-column) + ;; had been t-point, which is a mess with plain text =20 + (define-key map [down-mouse-2] 'dis-mouse-highlight-cell-or-range) + (define-key map [mouse-2] 'dis-mouse-highlight-cell-or-range) + (define-key map [double-mouse-2] 'ignore) + (define-key map [triple-mouse-2] 'ignore) =20 -(define-key dismal-map [down-mouse-3] 'dis-mouse-highlight-row) -(define-key dismal-map [mouse-3] 'dis-mouse-highlight-row) -(define-key dismal-map [double-mouse-3] 'ignore) -(define-key dismal-map [triple-mouse-3] 'ignore) =20 + (define-key map [down-mouse-3] 'dis-mouse-highlight-row) + (define-key map [mouse-3] 'dis-mouse-highlight-row) + (define-key map [double-mouse-3] 'ignore) + (define-key map [triple-mouse-3] 'ignore) + map)) =20 =0C +;; helper function + +(defsubst dismal-add-text-properties (start end props &optional object) + "Add properties while preserving the modified flag." + (let ((original-modified-p (buffer-modified-p))) + (add-text-properties start end props object) + ;; don't let highlighting a cell mark it as modified.23-May-96 -FER + (set-buffer-modified-p original-modified-p))) + ;;;; ii. dismal-find-cell function =20 ;; Used to set dismal point and mark based on mouse clicks. @@ -146,32 +161,30 @@ =20 (save-window-excursion =20 - ;; Store position of point and mouse-position - (setq x-pos (car (cdr (mouse-position))) - y-pos (cdr (cdr (mouse-position)))) - (setq click-pos (point)) + ;; Store position of point and mouse-position + (let ((x-pos (car (cdr (mouse-position))))) =20 - ;; Read the row from the front of the column. (!) - (beginning-of-line) - (setq row (read (current-buffer))) - - ;; Get the column width directly from y-pos of point - (setq col (dismal-raw-column-to-dismal-column x-pos)) + ;; Read the row from the front of the column. (!) + (beginning-of-line) + (let ((row (read (current-buffer))) + ;; Get the column width directly from y-pos of point + (col (dismal-raw-column-to-dismal-column x-pos))) =20 - ;; column and row of cell which mouse points to are now known=20 - ;; leave them as the return of the defun - ;; inserted a guard, for seems to get wacky values - (if (> col dismal-max-col) (setq col dismal-max-col)) - (if (> row dismal-max-row) (setq col dismal-max-row)) - (cons col row))) + ;; column and row of cell which mouse points to are now known=20 + ;; leave them as the return of the defun + ;; inserted a guard, for seems to get wacky values + (if (> col dismal-max-col) (setq col dismal-max-col)) + (if (> row dismal-max-row) (setq col dismal-max-row)) + (cons col row))))) =20 =0C ;;;; iii. dis-mouse-highlight-cell-or-range bound to [down-mouse-1] =20 -;; Function is bound to [down-mouse-1] in dismal-map keymap. +;; Function is bound to [down-mouse-1] in dismal-mode-map keymap. ;; It allows the user to select a single cell, or drag the mouse ;; and select a range of cells. ;; +(defvar dismal-current-column) =20 (defun dis-mouse-highlight-cell-or-range () "Highlight a cell or range of cells as choosen by the mouse." @@ -183,76 +196,77 @@ (mouse-set-point last-command-event) ;; First, clear out old highlight. (dismal-add-text-properties (point-min) (point-max) (list 'face 'defau= lt)) - (setq start-drag (dismal-find-cell)) + (let ((start-drag (dismal-find-cell)) + (last-drag) + (drag-on t)) =20 - (dismal-highlight-cell (car start-drag) (cdr start-drag)) + (dismal-highlight-cell (car start-drag) (cdr start-drag)) =20 - ;; now track the mouse to see if it either moves or the button is rele= ased - ;; set DRAG-ON variable to true so as to track the mouse movement. - (setq drag-on t) - (track-mouse - ;; optimization here from Mikio Nakajima - (while drag-on + ;; now track the mouse to see if it either moves or the button is re= leased + ;; set DRAG-ON variable to true so as to track the mouse movement. + (track-mouse + ;; optimization here from Mikio Nakajima + (while drag-on =20 - ;; read an event - (setq mouse-event (read-event)) + ;; read an event + (let ((mouse-event (read-event))) =20 - ;; work out what event was - (cond - - ;; mouse-movement is sensed move cursor and highlight the range - ((eq (car mouse-event) 'mouse-movement) -;; was (goto-char (car (cdr (car (cdr mouse-event))))) - (let ((mouse-char (car (cdr (car (cdr mouse-event)))))) - (if (not mouse-char) - (setq mouse-char (point-max))) - (goto-char mouse-char)) - (setq last-drag (dismal-find-cell)) - (message (format "Range from: %s to: %s"=20 - (dismal-cell-name (cdr start-drag)(car start-drag)) - (dismal-cell-name (cdr last-drag)(car last-drag)))) - - (dismal-highlight-range (car start-drag) (cdr start-drag) - (car last-drag) (cdr last-drag))) - - ;; Mouse button release at the same place it was pressed - ;; visit cell and stop tracking motion - ((eq (car mouse-event) 'mouse-1) - (dismal-jump-to-cell (cdr start-drag) - (car start-drag)) - (setq drag-on nil - dismal-current-row (cdr start-drag) - dismal-current-column (car start-drag))) - - ;; Drag motion of mouse has been completed turn tracking off and=20 - ;; highlight the selected range of cells - ((eq (car mouse-event) 'drag-mouse-1) - (setq drag-on nil) - (if (or (not (boundp 'last-drag)) last-drag) - (setq last-drag (dismal-find-cell))) - ;; make sure that start-drag is top-left corner of selection - ;; and that last-drag is the bottom-right corner of selection - (let ((t-start-drag (cons (min (car start-drag) (car last-drag)) - (min (cdr start-drag) (cdr last-drag)))) - (t-last-drag (cons (max (car start-drag) (car last-drag)) - (max (cdr start-drag) (cdr last-drag))))) - - ;; use temporary variables then reset start-drag and last-drag - (setq start-drag t-start-drag - last-drag t-last-drag)) - - ;; set dismal point and mark to the start and end of the range - (dismal-set-mark (cdr start-drag) (car start-drag)) - (setq dismal-current-row (cdr last-drag) - dismal-current-column (car last-drag)) - - (dismal-jump-to-cell dismal-current-row dismal-current-column) - - ;; leave message to say what the range limits are - (message (format "Range %s to %s has been selected." - (dismal-cell-name (cdr start-drag)(car start-drag)) - (dismal-cell-name (cdr last-drag)(car last-drag)) - ))))))) + ;; work out what event was + (cond + + ;; mouse-movement is sensed move cursor and highlight the ran= ge + ((eq (car mouse-event) 'mouse-movement) + ;; was (goto-char (car (cdr (car (cdr mouse-event))))) + (let ((mouse-char (car (cdr (car (cdr mouse-event)))))) + (if (not mouse-char) + (setq mouse-char (point-max))) + (goto-char mouse-char)) + (setq last-drag (dismal-find-cell)) + (message (format "Range from: %s to: %s"=20 + (dismal-cell-name (cdr start-drag)(car start-drag)) + (dismal-cell-name (cdr last-drag)(car last-drag)))) + + (dismal-highlight-range (car start-drag) (cdr start-drag) + (car last-drag) (cdr last-drag))) + + ;; Mouse button release at the same place it was pressed + ;; visit cell and stop tracking motion + ((eq (car mouse-event) 'mouse-1) + (dismal-jump-to-cell (cdr start-drag) + (car start-drag)) + (setq drag-on nil + dismal-current-row (cdr start-drag) + dismal-current-column (car start-drag))) + + ;; Drag motion of mouse has been completed turn tracking off = and=20 + ;; highlight the selected range of cells + ((eq (car mouse-event) 'drag-mouse-1) + (setq drag-on nil) + (if (not last-drag) + (setq last-drag (dismal-find-cell))) + ;; make sure that start-drag is top-left corner of selection + ;; and that last-drag is the bottom-right corner of selection + (let ((t-start-drag (cons (min (car start-drag) (car last-drag)) + (min (cdr start-drag) (cdr last-drag)))) + (t-last-drag (cons (max (car start-drag) (car last-drag)) + (max (cdr start-drag) (cdr last-drag))))) + + ;; use temporary variables then reset start-drag and last-drag + (setq start-drag t-start-drag + last-drag t-last-drag)) + + ;; set dismal point and mark to the start and end of the range + (dismal-set-mark (cdr start-drag) (car start-drag)) + (setq dismal-current-row (cdr last-drag) + dismal-current-column (car last-drag)) + + (dismal-jump-to-cell dismal-current-row dismal-current-column) + + ;; leave message to say what the range limits are + (message (format "Range %s to %s has been selected." + (dismal-cell-name (cdr start-drag)(car start-drag)) + (dismal-cell-name (cdr last-drag)(car last-drag)) + ))))))))) =20 =0C ;;;; I. dis-mouse-highlight-column bound to [down-mouse-2] @@ -273,7 +287,7 @@ ;; ;; find out what colum is to be highlighted and highlight it ;; (setq column (car (dismal-find-cell))) ;; (dis-highlight-range column 0 column dismal-max-row) -;; (dismal-goto-row 0 t) +;; (dismal-goto-row 0) ;; (dismal-goto-column column) ;; (message (format "Column %s has been selected." column))) =20 @@ -296,7 +310,7 @@ current range." ;; Find out what row is to be highlighted and highlight it. (setq row (cdr (dismal-find-cell))) (dismal-highlight-range 0 row dismal-max-col row) - (dismal-goto-row row t) + (dismal-goto-row row) (dismal-goto-column 0) ;; This sets up range (dismal-set-mark dismal-current-row dismal-max-col) @@ -311,7 +325,7 @@ current range." "Function highlights the cell inverting the colours on screen." (interactive "nX-pos:\nnY-pos:") ;; jump to the appropriate cell=20 - (dismal-goto-row y-cell t) + (dismal-goto-row y-cell) (dismal-goto-column x-cell) =20 ;; find start and end point of cell and highlight characters @@ -355,7 +369,7 @@ current range." (while (<=3D y-now y-end) =20 ;; Jump to left-most cell and find start-point of cell. - (dismal-goto-row y-now t) + (dismal-goto-row y-now) (dismal-goto-column x-start) (setq range-start (1+ (- (point) (dismal-column-width x-start)))) =20 @@ -370,7 +384,7 @@ current range." (setq y-now (1+ y-now))) =20 ;; now go back to where you were meant to end up - (dismal-goto-row oyend t) + (dismal-goto-row oyend) (dismal-goto-column oxend))) =20 =0C @@ -380,26 +394,17 @@ current range." ;; in `dismal.el', it highlights the selected cell that dismal-point ;; is currently pointing to. =20 -(defun dismal-goto-cell (row column interactivep) +(defun dismal-goto-cell (row column) ;; Move cursor to the end of the cell at ROW, COLUMN. ;; does not set dismal-current-row, etc. - (dismal-goto-row row interactivep) + (dismal-goto-row row) (dismal-goto-column column) (dismal-add-text-properties (point-min) (point-max) (list 'face 'defau= lt)) - (setq cell-end (point) - cell-start (1+ (- (point) (dismal-column-width column)))) - (dismal-add-text-properties cell-start cell-end (list 'face 'underline= ))) + (let ((cell-end (point)) + (cell-start (1+ (- (point) (dismal-column-width column))))) + (dismal-add-text-properties cell-start cell-end (list 'face 'underli= ne)))) ;;highlight =20 -;; helper function - -(defsubst dismal-add-text-properties (start end props &optional object) - "Add properties while preserving the modified flag." - (let ((original-modified-p (buffer-modified-p))) - (add-text-properties start end props object) - ;; don't let highlighting a cell mark it as modified.23-May-96 -FER - (set-buffer-modified-p original-modified-p))) - (provide 'dismal-mouse3) =20 ;;; dismal-mouse3.el ends here diff --git a/dismal-simple-menus.el b/dismal-simple-menus.el index 92fd298..5575d38 100644 --- a/dismal-simple-menus.el +++ b/dismal-simple-menus.el @@ -1,6 +1,6 @@ ;;; dismal-simple-menus.el --- Describe the simple-menus in dismal-mode =20 -;; Copyright (C) 1992, 2013 Free Software Foundation, Inc. +;; Copyright (C) 1992-2018 Free Software Foundation, Inc. =20 ;; Author: Frank Ritter ;; Created-On: Mon Jan 6 21:19:01 1992 @@ -100,7 +100,7 @@ (sm-def-menu 'dismal-edit-menu "Dis Edit" "" ;help prompt - '(("Undo* Undo the previous command." dis-no-op) + '(("Undo* Undo the previous command." undefined) ("XKill Kill (cut) a range." dis-kill-range) ("2Copy. Copy a range." dis-copy-range) ("Yank Yank (paste) the range kill buffer." dis-paste-range) @@ -331,8 +331,8 @@ (sm-def-menu 'dis-stats-menu "DisCode stats" "" ;help prompt - '(("Stats* Print out stats (not defined yet)." dis-no-op) - ("Count* Count codes in range (not defined yet)." dis-no-op) + '(("Stats* Print out stats (not defined yet)." undefined) + ("Count* Count codes in range (not defined yet)." undefined) )) =20 =0C diff --git a/dismal.el b/dismal.el index 41a5132..6fe6e25 100644 --- a/dismal.el +++ b/dismal.el @@ -1,6 +1,6 @@ ;;; dismal.el --- Dis Mode Ain't Lotus: Spreadsheet program Emacs =20 -;; Copyright (C) 1993, 2013 Free Software Foundation, Inc. +;; Copyright (C) 1993-2018 Free Software Foundation, Inc. =20 ;; Author: David Fox, fox@cs.nyu.edu ;; Frank E. Ritter, ritter@cs.cmu.edu @@ -98,6 +98,7 @@ ;;; Code: =20 (eval-when-compile (require 'cl-lib)) +(require 'dismal-mouse3) =20 ;;;; v. Global user visible variables =20 @@ -214,10 +215,6 @@ confirmed on entering.") =20 (defconst dismal-directory (file-name-directory load-file-name)) =20 -(defvar dis-codes-file (expand-file-name "example-codes.txt" dismal-dire= ctory) - "*Default file to get codes from.") - - ;; these variables increase the size of a file by about, say, 50% before ;; compression, and increasing loading speed by a factor of, say, 80. ;; Overall, a pretty good speed/space tradeoff. 8-17-94 - FER @@ -270,7 +267,7 @@ confirmed on entering.") =20 (define-obsolete-variable-alias 'dismal-map 'dismal-mode-map "Dismal-1.5= ") (defvar dismal-mode-map - (let ((map (make-keymap))) + (let ((map (make-composed-keymap dismal-mouse-map))) (suppress-keymap map) =20 ;; could del work appropriately? @@ -337,7 +334,7 @@ confirmed on entering.") (define-key map "\C-b" 'dis-backward-column) (define-key map "\C-c\C-m" 'dis-run-menu) ;; something binds it to insert mail buffer, which is dangerous - (define-key map "\C-cm" 'dis-no-op) + (define-key map "\C-cm" 'undefined) (define-key map "\C-d" 'dis-clear-cell) (define-key map "\C-e" 'dis-end-of-row) (define-key map "\C-f" 'dis-forward-column) @@ -350,7 +347,7 @@ confirmed on entering.") (define-key map "\C-p" 'dis-backward-row) (define-key map "\C-r" 'dis-isearch-backwards) (define-key map "\C-s" 'dis-isearch) - (define-key map "\C-t" 'dis-no-op) ; transpose-chars + (define-key map "\C-t" 'undefined) ; transpose-chars (define-key map "\C-q" 'dis-quoted-insert) (define-key map "\C-w" 'dis-kill-range) (define-key map "\C-xu" 'dis-undo) @@ -366,7 +363,7 @@ confirmed on entering.") (define-key map "\C-x\C-x" 'dis-exchange-point-and-mark) (define-key map "\C-x[" 'dis-start-of-col) (define-key map "\C-x]" 'dis-end-of-col) - (define-key map "\C-x>" 'dis-no-op) ; set-fill-prefix + (define-key map "\C-x>" 'undefined) ; set-fill-prefix (define-key map "\C-x\C-q" 'dis-toggle-read-only) (define-key map "\C-y" 'dis-paste-range) =20 @@ -382,20 +379,20 @@ confirmed on entering.") (define-key map "\M-\ " 'dis-backward-column) (define-key map "\M-<" 'dis-beginning-of-buffer) (define-key map "\M->" 'dis-end-of-buffer) - (define-key map "\M-[" 'dis-no-op) ; - (define-key map "\M-]" 'dis-no-op) ; not bound + (define-key map "\M-[" 'undefined) ; + (define-key map "\M-]" 'undefined) ; not bound (define-key map "\M-\t" 'dis-backward-column) - (define-key map "\M-a" 'dis-no-op) ; backward-sentence + (define-key map "\M-a" 'undefined) ; backward-sentence (define-key map "\M-b" 'dis-backward-filled-column) (define-key map "\M-c" 'dis-capitalize-cell) (define-key map "\M-d" 'dis-kill-cell) (define-key map "\M-e" 'dis-last-column) (define-key map "\M-f" 'dis-forward-filled-column) - (define-key map "\M-g" 'dis-no-op) ; fill-region - (define-key map "\M-h" 'dis-no-op) ; mark-paragraph - (define-key map "\M-i" 'dis-no-op) ; tab-to-tab-stop + (define-key map "\M-g" 'undefined) ; fill-region + (define-key map "\M-h" 'undefined) ; mark-paragraph + (define-key map "\M-i" 'undefined) ; tab-to-tab-stop (define-key map "\M-j" 'dis-align-metacolumns) ; fill-paragraph - (define-key map "\M-k" 'dis-no-op) ; kill-sent + (define-key map "\M-k" 'undefined) ; kill-sent (define-key map "\M-l" 'dis-downcase-cell) (define-key map "\M-n" 'dis-next-filled-row-cell) (define-key map "\M-o" 'dis-insert-range) @@ -409,10 +406,10 @@ confirmed on entering.") (define-key map "\M-w" 'dis-copy-range) (define-key map "\M-=3D" 'dis-debug-cell) (define-key map "\M-%" 'dis-query-replace) - (define-key map "\M-," 'dis-no-op) ; tags-loop-continue + (define-key map "\M-," 'undefined) ; tags-loop-continue =20 ;; C-M-b, f, a, & e should work appropriately - (define-key map "\M-\C-k" 'dis-no-op) ;kill-sexp + (define-key map "\M-\C-k" 'undefined) ;kill-sexp (define-key map "\M-\C-e" 'dis-erase-range) (define-key map "\M-\C-m" 'dis-backward-row) (define-key map "\M-\C-r" 'dis-redraw) @@ -524,9 +521,6 @@ with something in colA-1. Only counts stuff that is = in order." t) ;; 0 ;; (log10minus x)))) =20 -(defmacro signp (arg) - (list 'if (list '> arg 0) 1 -1)) - =0C ;;;; viii. System Constants =20 @@ -732,7 +726,7 @@ column labels.") ;; Is typically 2 for less than 10 rows (make-variable-buffer-local 'dismal-first-printed-column) =20 -(defvar dismal-number-p 'floatp) +(defvar dismal-number-p #'floatp) (defvar dismal-number-to-string 'prin1) =20 (defvar dismal-invalid-heap nil @@ -803,13 +797,13 @@ along with its size. Format: [rows-used cols-used = matrix].") (defsubst dismal-cell-name (row column) (concat (dismal-convert-number-to-colname column) (int-to-string row))= ) =20 -(defsubst dismal-get-create-column-format (colnum) +(defsubst dismal-get-create-column-format () (or (vector-ref dismal-column-formats dismal-current-col) (vector-set dismal-column-formats dismal-current-col (vec-copy-sequence-r dismal-default-column-format)))) =20 -(defsubst dismal-set-column-alignment (colnum style) - (aset (dismal-get-create-column-format colnum) +(defsubst dismal-set-column-alignment (style) + (aset (dismal-get-create-column-format) 2 style)) =20 ;; Get the value of a particular field in a cell @@ -899,7 +893,7 @@ along with its size. Format: [rows-used cols-used ma= trix].") (defsubst dismal-jump-to-cell-quietly (r c) "Jump to ROW, COLUMN but don't display the contents of the cell in the status line." - (dismal-goto-cell r c t) + (dismal-goto-cell r c) (setq dismal-current-row r) (setq dismal-current-col c)) =20 @@ -908,7 +902,7 @@ in the status line." (forward-line (1- n))) =20 ;; bummed by Mikio Nakajima , 3-Sep-97 -FER -(defsubst dismal-goto-row (row interactivep) +(defsubst dismal-goto-row (row) ;; Move the cursor to the requested ROW. (let ((rows-missing (dismal-goto-line (+ row dismal-first-data-line)))= ) (if (not (bolp)) (setq rows-missing (1+ rows-missing))) @@ -986,7 +980,7 @@ Flips the current cell and the one to its left." (insert "\n;; This file was produced for user " (user-login-name) " by dismal-mode (Vers " dismal-version ")" "\n;; This file written ") - (insert-current-time-string) + (dis--insert-current-time-string) (insert "\n;; dismal-mode Copyright since 1992, Free Software Foundati= on, Inc." "\n;; No user serviceable parts, but it is your data.\n\n\n")) =20 @@ -994,7 +988,7 @@ Flips the current cell and the one to its left." ;; Compute the width of the given COLUMN from dismal-column-formats. (aref (dismal-get-column-format column) 0)) =20 -(defsubst dismal-column-alignment (column) +(defsubst dismal-column-alignment () ;; may return nil (let ( (format (dismal-get-column-format dismal-current-col)) ) (if format @@ -1020,9 +1014,9 @@ Flips the current cell and the one to its left." ;; (dismal-flat-format-float 0.0 2) ;; (dismal-flat-format '(quote (4194304 . -21)) 8) ;; (setq value (car aa)) -;; (float-to-string 3e4) +;; (dis--float-to-string 3e4) =20 -(defsubst float-to-string (fnum &optional sci) +(defsubst dis--float-to-string (fnum &optional sci) "Convert the floating point number to a decimal string. Optional second argument non-nil means use scientific notation." (if sci @@ -1232,7 +1226,7 @@ and right mouse button is bound to `dis-mouse-highl= ight-row'. (setq dismal-write-file-version nil) (setq dismal-buffer-read-only buffer-read-only) (if buffer-read-only (setq buffer-read-only nil)) - (add-hook 'write-contents-functions 'dismal-write-file-hook nil = t) + (add-hook 'write-contents-functions #'dismal-write-file-hook nil= t) =20 ;; eval the stuff that makes sense, and then uncompress ;; 8-17-94 - FER @@ -1279,7 +1273,8 @@ and right mouse button is bound to `dis-mouse-highl= ight-row'. (run-mode-hooks 'dis-mode-hooks 'dismal-mode-hook) (when (and (not (get 'dismal-display-startup-message 'displayed)= ) (not dis-inhibit-startup-message)) - (add-hook 'post-command-hook 'dismal-display-startup-message-h= ook-fn)) + (add-hook 'post-command-hook + #'dismal-display-startup-message-hook-fn)) (setq dismal-setup t) ;; some convolutions here to get redraw to work in 19.34 (dismal-goto-line 2) @@ -1292,7 +1287,7 @@ and right mouse button is bound to `dis-mouse-highl= ight-row'. )) =20 ;; taken from Hucka's SDE mode -(defvar dismal-startup-post-command-function 'dismal-display-startup-mes= sage) +(defvar dismal-startup-post-command-function #'dismal-display-startup-me= ssage) =20 (defun dismal-display-startup-message-hook-fn () (when dismal-startup-post-command-function @@ -1399,7 +1394,8 @@ C-x C-q to change read-only."))) (dismal-column-width 0))) (dismal-display-current-cell-expr 0 0)))) =20 -(add-hook 'find-file-hook 'dismal-find-file-hook) +;; FIXME: Move this into dismal-mode! +(add-hook 'find-file-hook #'dismal-find-file-hook) =20 (defun dismal-set-first-printed-column () (let* ((width (truncate (log (max 1 dismal-max-row) 10))) @@ -1449,18 +1445,18 @@ C-x C-q to change read-only."))) ;; Uses expected-current-row, b/c it is draw before current-row is upd= ated (sit-for 0) ;this sit-for appears to be necssary, which is v. weird. (dismal-save-excursion - (let ((new-ruler-row (- expected-current-row (current-line-in-window)= )) + (let ((new-ruler-row (- expected-current-row (dis--current-line-in-wi= ndow))) (buffer-originally-clean (not (buffer-modified-p)))) (if (and dis-show-ruler (>=3D new-ruler-row -1)) (progn (save-excursion - (let ((current-line (current-line-in-window)) ) + (let ((current-line (dis--current-line-in-window)) ) (forward-line (- current-line)) (delete-region (point) (save-excursion (forward-line 1) (end-of-line) (poi= nt))) (insert dismal-ruler)) ) (setq dismal-current-first-ruler-row - (- expected-current-row (current-line-in-window))) )) + (- expected-current-row (dis--current-line-in-window)))= )) (if buffer-originally-clean (set-buffer-modified-p nil))))) =20 (defun dismal-undraw-ruler-rows () ;;(dismal-undraw-ruler-rows) @@ -1468,7 +1464,7 @@ C-x C-q to change read-only."))) (if (numberp dismal-current-first-ruler-row) (if (>=3D dismal-current-first-ruler-row 0) (dismal-save-excursion - (dismal-goto-row dismal-current-first-ruler-row nil) + (dismal-goto-row dismal-current-first-ruler-row) (delete-region (point) (save-excursion (end-of-line) (point= ))) (forward-line 1) (delete-region (point) (save-excursion (end-of-line) (point= ))) @@ -1477,9 +1473,9 @@ C-x C-q to change read-only."))) (setq dismal-current-first-ruler-row nil)) (if (>=3D dismal-current-first-ruler-row -1) (dismal-save-excursion - (dismal-goto-row dismal-current-first-ruler-row nil) + (dismal-goto-row dismal-current-first-ruler-row) (delete-region (point) (save-excursion (end-of-line) (poi= nt))) - (dismal-goto-row (1+ dismal-current-first-ruler-row) nil) + (dismal-goto-row (1+ dismal-current-first-ruler-row)) (delete-region (point) (save-excursion (end-of-line) (poi= nt))) (dismal-redraw-row (1+ dismal-current-first-ruler-row) ni= l) (setq dismal-current-first-ruler-row nil) @@ -1553,9 +1549,6 @@ C-x C-q to change read-only."))) =0C ;;;; III. Set up the keymaps =20 -(defvar dismal-keybinding-bug-holder nil - "Place to hold a potential bug report.") - ;; This is used outside of dismal, so must rebind. (cond ((not (key-binding dismal-copy-to-dismal-binding)) @@ -1564,12 +1557,7 @@ C-x C-q to change read-only."))) (t (message "Change value of dismal-copy-to-dismal-binding, %s already used as = %s" (key-description dismal-copy-to-dismal-binding) - (key-binding dismal-copy-to-dismal-binding)) - (setq dismal-keybinding-bug-holder - (cons (key-description dismal-copy-to-dismal-binding) - (key-binding dismal-copy-to-dismal-binding))) - (beep) - (sit-for 4))) + (key-binding dismal-copy-to-dismal-binding)))) =20 =20 (defvar dismal-minibuffer-local-map @@ -1586,25 +1574,25 @@ C-x C-q to change read-only."))) (defun dismal-exit-minibuffer-down () (interactive) (with-current-buffer dismal-buffer-using-minibuffer - (push '(dis-forward-row 1) dismal-delayed-commands)) + (push (lambda () (dis-forward-row 1)) dismal-delayed-commands)) (exit-minibuffer)) =20 (defun dismal-exit-minibuffer-up () (interactive) (with-current-buffer dismal-buffer-using-minibuffer - (push '(dis-forward-row -1) dismal-delayed-commands)) + (push (lambda () (dis-forward-row -1)) dismal-delayed-commands)) (exit-minibuffer)) =20 ;;(defun dismal-exit-minibuffer-right () ;; (interactive) ;; (with-current-buffer dismal-buffer-using-minibuffer -;; (push '(dis-forward-column 1) dismal-delayed-commands)) +;; (push (lambda () (dis-forward-column 1)) dismal-delayed-commands)) ;; (exit-minibuffer)) =20 ;;(defun dismal-exit-minibuffer-left () ;; (interactive) ;; (with-current-buffer dismal-buffer-using-minibuffer -;; (push '(dis-backward-column 1) dismal-delayed-commands)) +;; (push (lambda () (dis-backward-column 1)) dismal-delayed-commands)= ) ;; (exit-minibuffer)) =20 =0C @@ -1630,34 +1618,41 @@ C-x C-q to change read-only."))) (require 'info) (info (expand-file-name "dismal.info" dismal-directory))) =20 -(defun dis-bury-buffer (&optional buffer) +(defun dis-bury-buffer (&optional _buffer) "Bury the current buffer and notify user." (interactive) (message "Burying %s as a way of quiting dismal..." (buffer-name (current-buffer))) (bury-buffer nil)) =20 +(defvar dis--cell-value) +(defvar dis--done) +(defvar dis--to-string) +(defvar dis--from-string) + ;; old dismal-query-replace-guts by FER (defun dismal-query-replace-guts (i j prompt) - (when (cond ((and (stringp cell-value) - (string-match from-string cell-value))) - (t (equal cell-value from-string))) + (when (cond ((and (stringp dis--cell-value) + (string-match dis--from-string dis--cell-value))) + (t (equal dis--cell-value dis--from-string))) (dismal-jump-to-cell i j) ;; present match (message prompt) ;; query for action (dismal-save-excursion (pcase (downcase (read-char)) ((or `?\s `?y) - (setq match-start - (string-match from-string cell-value)) - (dismal-set-exp i j ;; need to be careful about - (dismal-set-val i j ;; need to be careful about - (if (stringp from-string) - (concat (substring cell-valu= e 0 match-start) - to-string - (if (> (match-end 0)= (length cell-value)) - "" - (substring cell-va= lue (match-end 0)))) - to-string))) + (let ((match-start + (string-match dis--from-string dis--cell-value))) + (dismal-set-exp + i j ;; need to be careful about + (dismal-set-val + i j ;; need to be careful about + (if (stringp dis--from-string) + (concat (substring dis--cell-value 0 match-start) + dis--to-string + (if (> (match-end 0) (length dis--cell-value)) + "" + (substring dis--cell-value (match-end 0)))) + dis--to-string)))) (dismal-redraw-cell i j t)) ;; skip on del (127) and n ((or `?n `127)) @@ -1666,7 +1661,7 @@ C-x C-q to change read-only."))) (with-output-to-temp-buffer "*Help*" (princ query-replace-help))) ;; quit on anything else - (_ (setq done t)))))) + (_ (setq dis--done t)))))) =20 (defun dis-query-replace (from-string to-string) "Replace some occurrences of FROM-STRING with TO-STRING. @@ -1699,17 +1694,19 @@ only matches surrounded by word boundaries." (dismal-set-mark dismal-current-row dismal-current-col) (let ((i dismal-current-row) (j dismal-current-col) - (done nil) cell-value match-start + (dis--to-string to-string) + (dis--from-string from-string) + (dis--done nil) dis--cell-value (prompt (format "Dismal query replacing %s with %s:" (dismal-convert-cellexpr-to-string from-string) (dismal-convert-cellexpr-to-string to-string)) )= ) - (while (and (not done) (<=3D i dismal-max-row)) - (while (and (not done) (<=3D j dismal-max-col)) - (setq cell-value (dismal-get-exp i j)) - ;;(message "Doing %s:%s with <<%s>> match: %s" i j cell-value - ;; (and (stringp cell-value) + (while (and (not dis--done) (<=3D i dismal-max-row)) + (while (and (not dis--done) (<=3D j dismal-max-col)) + (setq dis--cell-value (dismal-get-exp i j)) + ;;(message "Doing %s:%s with <<%s>> match: %s" i j dis--cell-val= ue + ;; (and (stringp dis--cell-value) ;; (setq match-start - ;; (string-match from-string cell-value))))(sit= -for 2) + ;; (string-match from-string dis--cell-value)))= )(sit-for 2) ;; search forward for a match (dismal-query-replace-guts i j prompt) (setq j (1+ j)) ) ; end while @@ -1719,11 +1716,16 @@ only matches surrounded by word boundaries." (sit-for 1))) =20 =20 -(defun dis-isearch-backwards (search-string) +(defun dis-isearch-backwards (_search-string) "Do incremental search backwards in dismal, sorta. Not started." (interactive "cDis I-search backward: ") (message "We don't do isearch-backwards yet.")) =20 +(defvar dis--prompt) +(defvar dis--search-string) +(defvar dis--i) +(defvar dis--j) + (defun dis-isearch (search-string) "Do incremental search forward in dismal, sorta. Not complete. As you type characters, they add to the search string and are found. @@ -1743,38 +1745,38 @@ C-g when search is successful aborts and moves po= int to starting point." (interactive "cDismal I-search: ") (if (not (stringp search-string)) (setq search-string (char-to-string search-string))) - (let ((i dismal-current-row) - (j dismal-current-col) + (let ((dis--i dismal-current-row) + (dis--j dismal-current-col) (saved-i dismal-current-row) (saved-j dismal-current-col) - (done nil) - result - (prompt (format "Dismal I-search: %s" search-string)) ) - (while (and (not (eq result 'aborted)) (not done) (<=3D i dismal-max= -row)) + (dis--done nil) + (dis--search-string search-string) + (dis--prompt (format "Dismal I-search: %s" search-string)) + result ) + (while (and (not (eq result 'aborted)) (not dis--done) (<=3D dis--i = dismal-max-row)) (while (and (not (eq result 'aborted)) - (not done) (<=3D j dismal-max-col)) + (not dis--done) (<=3D dis--j dismal-max-col)) ;; search forward for a match (setq result (dismal-isearch-guts)) - (setq j (1+ j)) ) ; end while - (setq j 0) - (setq i (1+ i)) ) ;end while + (setq dis--j (1+ dis--j)) ) ; end while + (setq dis--j 0) + (setq dis--i (1+ dis--i)) ) ;end while (cond ((eq result 'aborted) (dismal-jump-to-cell saved-i saved-j)) - ((not done) (beep) ;; leave this beep without a t - (message "Failing Dismal I-search: %s" search-string) + ((not dis--done) (beep) ;; leave this beep without a t + (message "Failing Dismal I-search: %s" dis--search-string) (dismal-isearch-queryer) - (if (not done) + (if (not dis--done) (dismal-jump-to-cell saved-i saved-j))) (t (dis-set-mark))) )) =20 (defun dismal-isearch-guts () - ;;(message "starting isearch-guts with %s at %s %s" search-string i j) - (let ( match-start - (cell-value (dismal-get-val i j))) - (if (and (stringp cell-value) - (setq match-start (string-match search-string cell-value))) - (progn (dismal-jump-to-cell i j) ;; present match - (message prompt) ;; query for action + ;;(message "starting isearch-guts with %s at %s %s" dis--search-string= i j) + (let ((dis--cell-value (dismal-get-val dis--i dis--j))) + (if (and (stringp dis--cell-value) + (string-match dis--search-string dis--cell-value)) + (progn (dismal-jump-to-cell dis--i dis--j) ;; present match + (message dis--prompt) ;; query for action (dismal-isearch-queryer))))) =20 ;; done is used across these functions as a flag @@ -1782,20 +1784,20 @@ C-g when search is successful aborts and moves po= int to starting point." (let ((next-char (char-to-string (read-char)))) ;; (message " in isearch-guts with next-char %s" next-char) ;; (setq aa next-char) - (cond ((string-match "[a-zA-Z0-9!@#\\-$%^&*-]" next-char) - (setq search-string (concat search-string next-char)) - (setq prompt (format "Dismal I-search: %s" search-string)) - ;;(message " in isearch-guts with %s match %s" search-string - ;; (string-match search-string cell-value)) - (if (string-match search-string cell-value) + (cond ((string-match "[[:alnum:]!@#\\-$%^&*-]" next-char) + (setq dis--search-string (concat dis--search-string next-char= )) + (setq dis--prompt (format "Dismal I-search: %s" dis--search-s= tring)) + ;;(message " in isearch-guts with %s match %s" dis--search-s= tring + ;; (string-match dis--search-string dis--cell-valu= e)) + (if (string-match dis--search-string dis--cell-value) (dismal-isearch-guts))) ((string-match "[=13]" next-char)) - ((string-match "[=1B]" next-char) (setq done t)) + ((string-match "[=1B]" next-char) (setq dis--done t)) ;; quit on anything else ((string-match "[=07]" next-char) 'aborted) (t (call-interactively (key-binding next-char)) ;;(my message "just did interactively call/") - (setq done t))))) + (setq dis--done t))))) =20 =20 ;; (dismal-search "comint-" 1) @@ -1809,19 +1811,17 @@ C-g when search is successful aborts and moves po= int to starting point." (j dismal-current-col) (saved-i dismal-current-row) (saved-j dismal-current-col) - (done nil) - cell-value - result ) + (done nil)) (while (and (not done) (<=3D i dismal-max-row) (> times 0)) (while (and (not done) (<=3D j dismal-max-col)) ;; search forward for a match - (setq cell-value (dismal-get-val i j)) - (if (and (stringp cell-value) - (string-match search-string cell-value)) - (progn (dismal-jump-to-cell i j) - (setq times (- times 1)) - (if (=3D 0 times) (setq done t)))) + (let ((cell-value (dismal-get-val i j))) + (if (and (stringp cell-value) + (string-match search-string cell-value)) + (progn (dismal-jump-to-cell i j) + (setq times (- times 1)) + (if (=3D 0 times) (setq done t))))) (setq j (1+ j)) ) ; end inner while (setq j 0) (setq i (1+ i)) ) ;end outer while @@ -1834,8 +1834,6 @@ C-g when search is successful aborts and moves poin= t to starting point." =0C ;;;; V. dismal-mark =20 -;; (defmacro dismal-mark-col () '(aref dismal-mark 1)) - (defun dis-set-mark () "Set mark in dismal buffers to cell where point is at." (interactive) @@ -1906,7 +1904,7 @@ C-g when search is successful aborts and moves poin= t to starting point." (aset dismal-range-buffer 0 (abs (- start-row end-row))) (aset dismal-range-buffer 1 (abs (- start-col end-col))) (matrix-funcall-rc - (lambda (r c dummy) + (lambda (r c _) (dismal-set-cell r c nil nil) (dismal-cleanup-long-string r c)) start-row start-col end-row end-col dismal-matrix) @@ -1929,7 +1927,7 @@ C-g when search is successful aborts and moves poin= t to starting point." (end-col (dismal-range-2nd-col dismal-cell-buffer)) ) (dismal-note-selected-range "Erasing range %s%d:%s%d") (matrix-funcall-rc - (lambda (r c dummy) (dismal-set-cell r c nil nil)) + (lambda (r c _) (dismal-set-cell r c nil nil)) start-row start-col end-row end-col dismal-matrix) (if dis-auto-update (dismal-private-update-matrix)) (aset dismal-range-buffer 0 old-range-buffer-r) @@ -1943,7 +1941,7 @@ C-g when search is successful aborts and moves poin= t to starting point." (let ((end-row (aref dismal-range-buffer 0)) (end-col (aref dismal-range-buffer 1))) (matrix-funcall-rc ;; do the actual copy - (lambda (r c cell) + (lambda (_r _c cell) (let ((expr (dismal-get-cell-exp cell))) (insert (if expr (format "%s" expr)) "\n"))) 0 0 @@ -1973,7 +1971,7 @@ C-g when search is successful aborts and moves poin= t to starting point." (range-first-col (dismal-range-1st-col dismal-cell-buffer))= ) ;; this attempts to clean up long strings (matrix-funcall-rc - (lambda (r c dummy) + (lambda (r c _) (dismal-set-exp r c "") ;or val should work here (dismal-set-val r c "") ;or val should work here (let ((old-mrk (dismal-get-mrk r c))) @@ -2015,7 +2013,7 @@ C-g when search is successful aborts and moves poin= t to starting point." (dismal-add-row-labels-at-end (1+ over-max-row)))) ;; cleanup if you are written on, or if you might have wrote on s= omeone (matrix-funcall-rc - (lambda (r c dummy) + (lambda (r c _) (let ((old-mrk (dismal-get-mrk r c))) (if (and (consp old-mrk) old-mrk) (dismal-cleanup-long-string (car old-mrk) (cdr old-mrk))= ) @@ -2101,7 +2099,7 @@ C-g when search is successful aborts and moves poin= t to starting point." ;;(defun dismal-range (fromcell tocell) ;; "Return a list of the values of a range of cells. FROMCELL and ;;TOCELL are cell references, in the form (dismal-r-c- row col)." -;; (mapcar 'dismal-evaluate-cellref +;; (mapcar #'dismal-evaluate-cellref ;; (dismal-generate-range fromcell tocell))) =20 (defun dismal-range-is-rows-or-columns () @@ -2156,14 +2154,14 @@ Replace the second item in each list to use it.") ;; -> "Wed Mar 6 10:31:12 1991" ;; 012345678901234567890123 =20 -(defun insert-time-string () - "Inserts an Al-like time-stamp after point." - (interactive) - (insert-before-markers - (format "%s%s" (substring (current-time-string) 11 13) - (substring (current-time-string) 14 16)))) +;; (defun insert-time-string () +;; "Inserts an Al-like time-stamp after point." +;; (interactive) +;; (insert-before-markers +;; (format "%s%s" (substring (current-time-string) 11 13) +;; (substring (current-time-string) 14 16)))) =20 -(defun insert-current-time-string () +(defun dis--insert-current-time-string () "Inserts a full time-stamp after point." (interactive) (insert-before-markers @@ -2187,7 +2185,6 @@ argument, inserts the month first." ;; moved down here so they would load, 19-Jun-96 -FER (when t ;; Don't do those `require' at compile-time. (provide 'dismal) - (require 'dismal-mouse3) (require 'dismal-menu3)) =20 ;; 2-8-93 - EMA: behaves just like move-to-window-line: @@ -2199,16 +2196,16 @@ negative means relative to bottom of window." (interactive "P") (let* ((distance-to-move (cond ((null arg) ; go to middle row - (- (/ (window-height) 2) (current-line-in-window))) + (- (/ (window-height) 2) (dis--current-line-in-window))= ) ((cl-minusp arg) ; displacement from bottom - (- (+ (1- (window-height)) arg) (current-line-in-window= ))) + (- (+ (1- (window-height)) arg) (dis--current-line-in-w= indow))) (t ; displacement from top - (- arg (current-line-in-window)))))) + (- arg (dis--current-line-in-window)))))) (dismal-jump-to-cell (max 0 (+ dismal-current-row distance-to-move)) dismal-current-col))) =20 (defun dismal-scroll-in-place (arg) - (let ((lines-from-top (current-line-in-window))) + (let ((lines-from-top (dis--current-line-in-window))) (dismal-undraw-ruler-rows) (let ((dis-show-ruler nil)) (dismal-visit-cell arg dismal-current-col) @@ -2231,11 +2228,11 @@ nil. Leaves point in same row and column of wind= ow [which seems wrong]." (message "End of buffer"))))) =20 ;; you could make the -2 here an arg for how much to bump up -(defun dis-scroll-down-in-place (arg) +(defun dis-scroll-down-in-place () "Scroll cells of dismal window down ARG lines or nearly a full screen = if no ARG. When calling from a program, supply a number as argument or nil. Leaves point in same row and column of window [which seems wrong].= " - (interactive "P") + (interactive) (dismal-scroll-in-place (max 0 (- dismal-current-row (window-height) -= 2)))) =20 (defun dis-forward-column (cols) @@ -2247,7 +2244,7 @@ nil. Leaves point in same row and column of window= [which seems wrong]." ;; moves over hidden columns (defun dismal-move-columns (arg) (let ((n (abs arg)) - (direction (signp arg))) + (direction (cl-signum arg))) (while (and (> n 0) (or (> dismal-current-col 0) (cl-plusp direction))) @@ -2294,7 +2291,7 @@ nil. Leaves point in same row and column of window= [which seems wrong]." (interactive "p") (let ((old-row dismal-current-row) (old-col dismal-current-col) - (direction (signp rows)) + (direction (cl-signum rows)) (number (abs rows)) ) (while (and (> number 0) (dismal-find-next-fill-row direction)) (setq number (1- number))) @@ -2339,7 +2336,7 @@ nil. Leaves point in same row and column of window= [which seems wrong]." (interactive "p") (let ((old-row dismal-current-row) (old-col dismal-current-col) - (direction (signp cols)) + (direction (cl-signum cols)) (number (abs cols)) ) (while (and (> number 0) (dismal-find-next-fill-column direction)) (setq number (1- number))) @@ -2379,7 +2376,7 @@ nil. Leaves point in same row and column of window= [which seems wrong]." "Move to first row in current column." (interactive) (setq dismal-current-row 0) - (dismal-goto-cell dismal-current-row dismal-current-col t) + (dismal-goto-cell dismal-current-row dismal-current-col) (dismal-display-current-cell-expr dismal-current-row dismal-current-co= l)) =20 (defun dis-end-of-col () @@ -2393,7 +2390,7 @@ nil. Leaves point in same row and column of window= [which seems wrong]." (while (and (not (dismal-get-exp dismal-current-row dismal-current-col= )) (> dismal-current-row 0)) (setq dismal-current-row (1- dismal-current-row))) - (dismal-goto-cell dismal-current-row dismal-current-col t)) + (dismal-goto-cell dismal-current-row dismal-current-col)) =20 (defun dis-backward-column (cols) "Move backward COLS columns." @@ -2416,7 +2413,7 @@ nil. Leaves point in same row and column of window= [which seems wrong]." ;; moves over hidden rows (none currently) (defun dismal-move-rows (arg) (let ((n (abs arg)) - (direction (signp arg))) + (direction (cl-signum arg))) (while (and (> n 0) (or (> dismal-current-row 0) (cl-plusp direction))) @@ -2430,7 +2427,7 @@ nil. Leaves point in same row and column of window= [which seems wrong]." (progn (setq dismal-auto-save-counter (1- dismal-auto-save-counter= )) (if (=3D dismal-auto-save-counter 1) (dismal-do-auto-save)))) - (dismal-goto-cell row column t) + (dismal-goto-cell row column) (if dismal-interactive-p (dismal-display-current-cell-expr row column))) =20 @@ -2462,10 +2459,10 @@ nil. Leaves point in same row and column of wind= ow [which seems wrong]." ;; Set number columns WINDOW is scrolled from l. margin to NCOL. (backward-char 1) )) =20 -(defun dismal-goto-cell (row column interactivep) +(defun dismal-goto-cell (row column) ;; Move cursor to the end of the cell at ROW, COLUMN. ;; does not set dismal-current-row, etc. - (dismal-goto-row row interactivep) + (dismal-goto-row row) (dismal-goto-column column)) =20 ;;(setq spot (list interactivep current-window-row row window-rows raw-= offset)) @@ -2547,14 +2544,13 @@ Mar 789 777" ;; Record current column (save-excursion (let ((start-col (current-column)) - col match-start) + match-start) ;; Go to beginning of column (if (re-search-backward dis-copy-column-separator ;; "\\(^\\w\\|[ \t\n]+\\)" (save-excursion (beginning-of-line) (poi= nt)) 'just-move-to-beginning-on-fail) (forward-char 1)) - (setq col (current-column)) (setq match-start (point)) (while (< (point) end) (let ((item (progn @@ -2570,8 +2566,8 @@ Mar 789 777" (dis-forward-row 1)) (forward-line 1) ;; Check if blank line - (if (looking-at "[ \t]*$") (next-line 1)) - ;; Stay within the correct colum + (if (looking-at "[ \t]*$") (forward-line 1)) + ;; Stay within the correct column. (move-to-column start-col) ;; Go to beginning of column (if (re-search-backward dis-copy-column-separator @@ -2579,7 +2575,6 @@ Mar 789 777" (save-excursion (beginning-of-line) = (point)) 'just-move-to-beginning-on-fail) (forward-char 1)) - (setq col (current-column)) (setq match-start (point)))))))) =20 ;; 14. Allow entering of numbers and strings not in quotes? @@ -2720,7 +2715,7 @@ current cell's value." =20 (defun dismal-execute-delayed-commands () (while dismal-delayed-commands - (eval (pop dismal-delayed-commands)))) + (funcall (pop dismal-delayed-commands)))) =20 ;; (dismal-read-minibuffer "gimme: " nil 34) ;; (dismal-read-minibuffer "gimme: " t "34") @@ -2768,7 +2763,7 @@ current cell's value." (if editable-default nil default)) - ((formula-string-p first-result) + ((dis--formula-string-p first-result) (car (read-from-string first-result))) ((dismal-number-stringp first-result) (car (read-from-string first-result))) @@ -2844,7 +2839,7 @@ This gives the cell(s) all lower case characters." (downcase cell-exp)))) (dismal-redraw-cell dismal-current-row dismal-current-col t) ;; if you have dependencies, should update them here... - (if (not (=3D arg 0)) (dis-forward-column (signp arg))) + (if (not (=3D arg 0)) (dis-forward-column (cl-signum arg))) (setq arg (1- arg)) ))) =20 (defun dis-upcase-cell (arg) @@ -2859,7 +2854,7 @@ This gives the cell(s) characters all in upper case= ." (upcase cell-exp)))) (dismal-redraw-cell dismal-current-row dismal-current-col t) ;; if you have dependencies, should update them here... - (if (not (=3D arg 0)) (dis-forward-column (signp arg))) + (if (not (=3D arg 0)) (dis-forward-column (cl-signum arg))) (setq arg (1- arg)) ))) =20 =0C @@ -2938,7 +2933,7 @@ This gives the cell(s) characters all in upper case= ." (interactive) ;; could use dismal-formula-cells if all are caught, which they aren't (matrix-map-rc - (lambda (cell dummy) + (lambda (cell _) ;; (message "doing %s %s %s" cell ;; (dismal-get-exp (car cell) (cadr cell)) ;; (dismal-possible-live-sexp (dismal-get-exp (car cell) (cadr ce= ll)))) @@ -3062,8 +3057,7 @@ If range is 2d, signal an error." ;; (message "with %s %s %s %s" start-row start-col end-row end-col) ;; 3-7-93 - EMA - removed a call to dismal-change-column-references, ;; because it duplicates the call in dis-insert-row - (let ((dismal-interactive-p nil) - (cols-to-insert (1+ (- end-col start-col)) )) + (let ((dismal-interactive-p nil)) (dismal-jump-to-cell-quietly start-row start-col) (cond ;; Insert just at a single spot ((and (=3D start-row end-row) (=3D start-col end-col)) @@ -3344,11 +3338,10 @@ If range is 2d, signal an error." =20 (defun dismal-insert-column-cells-graphical (nrow) (dismal-save-excursion-quietly - (let (cut-start saved-rect cc max-real-row) + (let (cut-start saved-rect cc) (forward-char (- 1 (dismal-column-width dismal-current-col))) (setq cut-start (point)) (dismal-end-of-col-non-interactive) - (setq max-real-row dismal-current-row) (if (not (> (point) cut-start)) nil (forward-char 1) @@ -3422,7 +3415,7 @@ With arg, inserts that many newlines." ;;(defun dismal-insert-blank-range (start-row start-col rows cols comput= e-width) ;; ;; compute-width means insert blanks based on the actual col width ;; (let ((i 0)) -;; (dismal-goto-cell start-row start-col nil) +;; (dismal-goto-cell start-row start-col) ;; (while (< i rows) ;; (forward-char (- 1 (dismal-column-width start-col))) ;; (dismal-insert-n-times " " @@ -3430,15 +3423,15 @@ With arg, inserts that many newlines." ;; (dismal-sum-column-widths start-col cols) ;; (* cols dis-default-column-width))) ;; (setq i (1+ i)) -;; (dismal-goto-cell (+ i start-row) start-col t)))) +;; (dismal-goto-cell (+ i start-row) start-col)))) =20 ;; if this works, take let out (defun dismal-insert-blank-range (start-row start-col rows cols compute-= width) ;; compute-width means insert blanks based on the actual col widths - (dismal-goto-cell start-row start-col nil) + (dismal-goto-cell start-row start-col) (string-rectangle (- (point) (dismal-column-width start-col)) (save-excursion (dismal-goto-cell (+ -1 rows start-r= ow) - start-col t) + start-col) ;; (beep) (sit-for 2) (point)) (make-string (if compute-width @@ -3456,7 +3449,7 @@ With arg, inserts that many newlines." ;; (dismal-sum-column-widths start-col cols) ;; (* cols dis-default-column-width))) ;; (setq i (1+ i)) -;; (dismal-goto-cell (+ i start-row) start-col t)) +;; (dismal-goto-cell (+ i start-row) start-col)) =20 =0C ;;;; XIIb. Deletion - of rows, columns & ranges @@ -3490,7 +3483,7 @@ With arg, inserts that many newlines." (dismal-interactive-p nil) block-start looking-for-block-end) ;; find next blank row - (dismal-goto-row end-row nil) + (dismal-goto-row end-row) (setq dismal-current-row end-row) (dis-end-of-row) (if (dismal-get-exp dismal-current-row dismal-current-col) @@ -3509,7 +3502,7 @@ With arg, inserts that many newlines." (setq looking-for-block-end nil))) (setq end-row (1+ end-row)) ;; go there - (dismal-goto-row end-row nil) + (dismal-goto-row end-row) (setq dismal-current-row end-row) ;; delete row(s) (and previous-interactive-p @@ -3603,17 +3596,16 @@ If direction is columns, move cells left to fill.= " start-row (+ i start-col) (1+ nrow)= ) (setq i (1+ i))) (matrix-funcall-rc - (lambda (r c dummy) (dismal-cleanup-long-string r c)) + (lambda (r c _) (dismal-cleanup-long-string r c)) start-row (max 0 (1- start-col)) end-row (min dismal-max-col (1+ end-col)) dismal-matrix))))) =20 (defun dismal-delete-row-cells (ncol) (dismal-save-excursion - (let (cut-start saved-rect cc) - (matrix-delete-row-cells dismal-matrix - dismal-current-row dismal-current-col ncol= ) - (dismal-redraw-row dismal-current-row t) - (dismal-display-current-cell-expr dismal-current-row dismal-current= -col)))) + (matrix-delete-row-cells dismal-matrix + dismal-current-row dismal-current-col ncol) + (dismal-redraw-row dismal-current-row t) + (dismal-display-current-cell-expr dismal-current-row dismal-current-c= ol))) =20 ;; doesn't redraw the changed cells if any (defun dis-delete-column (ncol) @@ -3633,11 +3625,10 @@ If direction is columns, move cells left to fill.= " (matrix-delete-cols dismal-matrix dismal-current-col ncol) (setq dismal-max-col (- dismal-max-col ncol)) (set-buffer-modified-p t) - (dismal-goto-cell -2 dismal-current-col nil) + (dismal-goto-cell -2 dismal-current-col) (forward-char (- 1 (dismal-column-width dismal-current-col))) (setq del-start (point)) - (dismal-goto-cell dismal-max-row (+ (1- ncol) - dismal-current-col) nil) + (dismal-goto-cell dismal-max-row (+ (1- ncol) dismal-current-col)) (forward-char 1) (kill-rectangle del-start (point)) (vector-delete dismal-column-formats dismal-current-col ncol) @@ -3792,7 +3783,7 @@ If direction is columns, move cells left to fill." (if (dismal-rangep sexp) (progn ;; (vector-push-unique dismal-formula-cells depaddr) - (dismal-do (lambda (row2 col2 dummy) + (dismal-do (lambda (row2 col2 _) (dismal-set-deps row2 col2 (cons depaddr (dismal-get-deps row2 co= l2)))) @@ -3815,7 +3806,7 @@ If direction is columns, move cells left to fill." (vector-remove dismal-formula-cells (cons row col)) (if (listp sexp) (if (eq (car sexp) 'dismal-range) - (dismal-do (lambda (row2 col2 dummy) + (dismal-do (lambda (row2 col2 _) (dismal-set-deps row2 col2 ;; used to be dismal-del (delete (dismal-make-address r= ow col) @@ -3857,9 +3848,7 @@ If direction is columns, move cells left to fill." (setq dismal-saving-file t) (let ((real-buffer (current-buffer)) (save-compression dismal-save-compression) - (backup-file-name (concat filename "~")) (require-final-newline nil) ) - ;; (if (file-exists-p filename) (rename-file filename backup-file-n= ame t)) =20 ;; Save your image (set-buffer (get-buffer-create "*Dismal-saving-buffer*")) @@ -3872,7 +3861,7 @@ If direction is columns, move cells left to fill." (dismal-file-header mode-name) (mapc (lambda (x) (let ((real-x (with-current-buffer real-buffer - (eval x)))) + (symbol-value x)))) (insert "(setq " (prin1-to-string x) " " (prin1-to-string real-x) ")\n"))) dismal-saved-variables) @@ -3912,11 +3901,23 @@ If direction is columns, move cells left to fill.= " (defvar dismal-compress-command "compress") (defvar dismal-uncompress-command "compress -d") =20 -(defconst compress-magic-regexp "\037\235\220" ;; may need to delete \= 220 +(defconst dis--compress-magic-regexp "\037\235\220" ;; may need to del= ete \220 "Regexp that matches the magic number at the beginning of files create= d by the compress(1) command.") =20 ;; stolen from crypt.el +(defmacro dis--save-point (&rest body) + "Save value of point, evalutes FORMS and restore value of point. +If the saved value of point is no longer valid go to (point-max). +This macro exists because, save-excursion loses track of point during +some types of deletions." + (declare (debug t)) + (let ((var (make-symbol "saved-point"))) + `(let ((,var (point))) + (unwind-protect + (progn ,@body) + (goto-char ,var))))) + (defun dismal-compress-region (start end &optional undo) "Compress the text in the region. From a program, this function takes three args: START, END and UNDO. @@ -3925,28 +3926,17 @@ When called interactively START and END default t= o point and mark Prefix arg (or optional second arg non-nil) UNDO means uncompress." (interactive "*r\nP") ;; (setq aa (cons start end)) - (save-point + (dis--save-point (call-process-region start end shell-file-name t t nil "-c" (if undo dismal-uncompress-command dismal-compre= ss-command)) (cond ((not undo) (goto-char start) (let (case-fold-search) - (if (not (looking-at compress-magic-regexp)) + (if (not (looking-at dis--compress-magic-regexp)) (error "%s failed!" (if undo "Uncompression" "Compression")))))))) =20 -(defmacro save-point (&rest body) - "Save value of point, evalutes FORMS and restore value of point. -If the saved value of point is no longer valid go to (point-max). -This macro exists because, save-excursion loses track of point during -some types of deletions." - (let ((var (make-symbol "saved-point"))) - (list 'let (list (list var '(point))) - (list 'unwind-protect - (cons 'progn body) - (list 'goto-char var))))) - ;; pre-DBL version 8-17-94 - FER ;; (defun dismal-write-buffer (filename) ;; ;; Save the current spreadsheet in file FILENAME. @@ -4199,7 +4189,7 @@ rows. Must be called from a dismal buffer." (if (not (eobp)) (insert "=0C" ruler "\n")))) =20 (defun dismal-report-header (forms-file) - (insert-current-time-string) + (dis--insert-current-time-string) (insert " - Dismal (" dismal-version ") report for user ") (insert (getenv "USER")) (insert "\nFor file " forms-file "\n\n") @@ -4390,7 +4380,7 @@ Writes an extra tab if last field is empty for use = in other programs, like S." (string-value (dismal-flat-format (if (and formulas-p expression - (formula-p expression)) + (dis--formula-p expression)) ;; (dismal-get-cell-exp cell) expression (dismal-evaluate-cell r c)) @@ -4457,7 +4447,7 @@ Writes an extra tab if last field is empty for use = in other programs, like S." ;; (string-value (dismal-flat-format ;; (if (and formulas-p ;; expression -;; (formula-p expression)) +;; (dis--formula-p expression)= ) ;; ;; (dismal-get-cell-exp cell) ;; expression ;; (dismal-evaluate-cell r c)) @@ -4530,21 +4520,17 @@ Writes an extra tab if last field is empty for us= e in other programs, like S." nil "-i") ;; could use make-local-hook, but thats a relatively new ;; function, so do it the hard way for now. - (make-local-variable 'dismal-gnuplot-finish) - (setq dismal-gnuplot-finish dis-gnuplot-kill-gplot) - (add-hook 'kill-buffer-hook 'dis-gnuplot-finished) + (setq (make-local-variable 'dismal-gnuplot-finish) + dis-gnuplot-kill-gplot) + (add-hook 'kill-buffer-hook #'dis-gnuplot-finished) ;;(shell) )) - (let ((shell-process (get-buffer-process dismal-gnuplot-shell-name)) - (beg) (end) (text-to-send)) + (let ((shell-process (get-buffer-process dismal-gnuplot-shell-name))= ) (beginning-of-line) - (setq beg (point)) (end-of-line 1) - (setq end (point)) ;;(switch-to-buffer send-buffer-name) (goto-char (point-max)) - (setq text-to-send (concat cmd "\n") ) - (process-send-string shell-process text-to-send) + (process-send-string shell-process (concat cmd "\n")) =20 ;; check to see if we want to make the send buffer visible ;; in another window? @@ -4558,7 +4544,7 @@ Writes an extra tab if last field is empty for use = in other programs, like S." This should be executed in the *dis-gnuplot* buffer either interactively or via the kill-buffer-hook for that buffer." (interactive) - (if (and (boundp dismal-gnuplot-finish) dismal-gnuplot-finish) + (if (and (boundp 'dismal-gnuplot-finish) dismal-gnuplot-finish) (progn (dismal-send-cmd-to-shell "gplot quit" t) ;; need a little delay to kill gplot @@ -4634,7 +4620,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." (message "Redrawing spreadsheet...") ;; if cleanup worked right, this could go. (matrix-funcall-rc - (lambda (r c dummy) + (lambda (r c _) (let ((mrk (dismal-get-mrk r c))) (if (and mrk (consp mrk)) (dismal-set-mrk r c nil)))) @@ -4756,7 +4742,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." (set-width (dismal-col-format-width format))) (if (=3D set-width 0) nil ;return - (dismal-goto-cell row column nil) + (dismal-goto-cell row column) ;; set up for doing the write (save-excursion (let* ((alignment (dismal-get-cell-alignment row column)) @@ -4882,13 +4868,13 @@ redraws with point in the center. Adjusts somewh= at for rulers." (let* ((rowno -2)) (if (> old-width width) ; getting smaller (while (<=3D rowno dismal-max-row) - (dismal-goto-cell rowno column nil) + (dismal-goto-cell rowno column) (backward-char (1- old-width)) ; Move to cell's left end (delete-char (- old-width width)) (setq rowno (1+ rowno))) (if (< old-width width) ; getting larger (while (<=3D rowno dismal-max-row) - (dismal-goto-cell rowno column nil) + (dismal-goto-cell rowno column) (if (=3D old-width 0) (forward-char 1)) (insert-char ?\040 (- width old-width)) (setq rowno (1+ rowno))))))) @@ -4900,7 +4886,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." =20 (defun dismal-draw-row-labels () ;; (message "Labeling rows...") - (dismal-goto-cell -1 0 nil) + (dismal-goto-cell -1 0) (dismal-set-first-printed-column) (beginning-of-line) (delete-char dismal-first-printed-column) @@ -4915,7 +4901,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." =20 (defun dismal-draw-row-label (row) ;; Draw the label for ROW and put a vertical bar to its right. - (dismal-goto-cell row 0 nil) + (dismal-goto-cell row 0) (beginning-of-line) (delete-char dismal-first-printed-column) (insert (format dismal-row-label-format row))) @@ -4927,7 +4913,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." =20 (defun dismal-remove-row-label (row) ;; Remove the label for line ROW, and the line itself - (dismal-goto-cell row 0 nil) + (dismal-goto-cell row 0) (beginning-of-line) ;;(delete-char dismal-first-printed-column) (delete-region (1- (point)) (save-excursion (end-of-line) (point)))) @@ -4945,7 +4931,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." (numcol dismal-max-col)) ;; used to be (matrix-width ;; dismal-matrix) -FER ;; put on leading + - (dismal-goto-cell -1 0 nil) + (dismal-goto-cell -1 0) (beginning-of-line) (delete-char dismal-first-printed-column) (insert-char ?\040 (1- dismal-first-printed-column)) @@ -4963,14 +4949,14 @@ redraws with point in the center. Adjusts somewh= at for rulers." (width (dismal-column-width column))) (if (=3D width 0) nil - (dismal-goto-cell -2 column nil) + (dismal-goto-cell -2 column) (backward-char (1- width)) ; Move to cell's left end (delete-char width) ; Delete what's there (insert-char ?\040 (/ (- width (length label)) 2)) (insert label) (insert-char ?\040 (- width (+ (length label) (/ (- width (length label)) 2)))) - (dismal-goto-cell -1 column nil) + (dismal-goto-cell -1 column) (backward-char (1- width)) (delete-char width) (insert-char ?- (1- width)) @@ -5007,7 +4993,6 @@ redraws with point in the center. Adjusts somewhat= for rulers." ;; expressions that access that cell. ;; If in a setq use variables as defined, otherwise use the ;; equivalent string - (setq aa sexp) (cond ((and sexp (listp sexp)) (if (eq (car sexp) 'setq) (nconc (list 'setq (cadr sexp)) @@ -5022,7 +5007,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." (symbolp sexp) ) (dismal-convert-input-symbol sexp)) ((dismal-number-stringp sexp) (dismal-convert-string-to-number s= exp)) - ((formula-string-p sexp) + ((dis--formula-string-p sexp) (dismal-convert-input-to-cellexpr (car (read-from-string sexp))= )) (t sexp))) =20 @@ -5035,15 +5020,15 @@ redraws with point in the center. Adjusts somewh= at for rulers." ; (dismal-percentager "aaaa%aaaa= a") (defun dismal-percentager (astring) ;; returns any %'s doubled - (setq match-start (string-match "%" astring)) - (if match-start - (concat (substring astring 0 (1+ match-start)) "%" - (dismal-percentager (substring astring (1+ match-start)))) - astring)) + (let ((match-start (string-match "%" astring))) + (if match-start + (concat (substring astring 0 (1+ match-start)) "%" + (dismal-percentager (substring astring (1+ match-start))= )) + astring))) =20 - ; (dismal-convert-cellexpr-to-st= ring (+ 2.3 3.4)) - ; (dismal-convert-cellexpr-to-st= ring '(1 . 4)) - ; (setq sexp (+ 2.3 3.4)) +;; (dismal-convert-cellexpr-to-string (+ 2.3 3.4)) +;; (dismal-convert-cellexpr-to-string '(1 . 4)) +;; (setq sexp (+ 2.3 3.4)) =20 (defun dismal-convert-cellexprlist-to-string (sexp) (mapconcat #'dismal-recursive-convert-cellexpr-to-string sexp " ")) @@ -5054,7 +5039,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." (cond ((null sexp) "") ((stringp sexp) (dismal-percentager sexp)) ; makes % printable ((numberp sexp) (int-to-string sexp)) - ;; ((apply dismal-number-p sexp nil) + ;; (apply dismal-number-p sexp nil) ;; (apply dismal-number-to-string sexp nil)) ;; trickyness here sets up printing ranges nicely?? ;; has leading quote @@ -5119,7 +5104,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." ;; (setq rightdigits (- rightend rightstart)) =20 (defun dismal-flat-format-float (anumber rightspace) - ;; Given the string returned by float-to-string of ANUMBER, + ;; Given the string returned by dis--float-to-string of ANUMBER, ;; return a string formatted according to the value of the decimal ;; in RIGHTSPACE. The SPACE locals refer to the space in the ;; formatted string, the START and END locals refer to positions in @@ -5140,16 +5125,16 @@ redraws with point in the center. Adjusts somewh= at for rulers." =20 ;; this should be dead code (29-Aug-95), but is still used in ;; some sheets somehow... -;;(dismal-flat-format-float-string (float-to-string _f1) 2) -;;(dismal-flat-format-float-string (float-to-string (float -1)) 2) -;; (setq string (float-to-string (float -1))) +;;(dismal-flat-format-float-string (dis--float-to-string _f1) 2) +;;(dismal-flat-format-float-string (dis--float-to-string (float -1)) 2) +;; (setq string (dis--float-to-string (float -1))) ;; (setq string " -1.0000") ;; (setq rightspace 2) =20 ;; not longer necessary, convereted to all native floats 2-Jan-97 -FER ;; but used by convervsion programs. (defun dismal-flat-format-float-string (string rightspace) - ;; Given the STRING returned by float-to-string, return a string forma= tted + ;; Given the STRING returned by dis--float-to-string, return a string = formatted ;; according to the value of the decimal in rightspace. ;; The SPACE locals refer to the space in the formatted string, the ;; START and END locals refer to positions in the argument STRING. @@ -5251,7 +5236,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." (message "Setting new alignment style...") (dismal-save-excursion (cond ((eq range-or-col 'column) - (dismal-set-column-alignment dismal-current-col alignment-styl= e) + (dismal-set-column-alignment alignment-style) (dismal-redraw-column dismal-current-col)) ((eq range-or-col 'range) (dismal-select-range) @@ -5261,7 +5246,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." (start-col (dismal-range-1st-col dismal-cell-buffer)) (end-row (dismal-range-2nd-row dismal-cell-buffer)) (end-col (dismal-range-2nd-col dismal-cell-buffer)) ) - (matrix-funcall-rc (lambda (r c dummy) + (matrix-funcall-rc (lambda (r c _) (dismal-set-fmt r c alignment-style)) start-row start-col end-row end-col disma= l-matrix) ;; redraw here -FER @@ -5287,7 +5272,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." (dismal-convert-number-to-colname dismal-current-col)) (dismal-set-column-format dismal-current-col width (dismal-column-decimal dismal-current-col) - (dismal-column-alignment dismal-current-col= )) + (dismal-column-alignment)) (dismal-make-ruler) (dismal-draw-ruler dismal-current-row) (message "Redrawing column %s...Done" @@ -5327,7 +5312,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." ;; (message "Redrawing column %s..." ;; (dismal-convert-number-to-colname dismal-current-col)) ;; (dismal-set-column-format dismal-current-col width decimal -;; (dismal-column-alignment dismal-current-col)) +;; (dismal-column-alignment)) ;; (dismal-make-ruler) ;; (dismal-draw-ruler dismal-current-row) ;; (message "Redrawing column %s...Done" @@ -5339,9 +5324,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." (interactive "p") (dismal-select-range) (dismal-save-excursion - (let ((start-row (dismal-range-1st-row dismal-cell-buffer)) - (start-col (dismal-range-1st-col dismal-cell-buffer)) - (end-row (dismal-range-2nd-row dismal-cell-buffer)) + (let ((start-col (dismal-range-1st-col dismal-cell-buffer)) (end-col (dismal-range-2nd-col dismal-cell-buffer)) (expanded-a-col nil) ) (message "Expanding columns between %s and %s ..." @@ -5370,7 +5353,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." ;; (dismal-set-column-format dismal-current-col ;; width ;; (dismal-column-decimal dismal-current-col) -;; (dismal-column-alignment dismal-current-co= l)))) +;; (dismal-column-alignment)))) =20 (defun dis-set-column-decimal (decimal) "Set the decimal format for the current column." @@ -5380,7 +5363,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." (dismal-set-column-format dismal-current-col (dismal-column-width dismal-current-col) decimal - (dismal-column-alignment dismal-current-col)= )) + (dismal-column-alignment))) =20 ;;(setq format (make-vector 5 nil)) ;; (setq decimal 0) @@ -5388,7 +5371,7 @@ redraws with point in the center. Adjusts somewhat= for rulers." =20 ;; Do resize b4 changing dismal-column-formats so dismal-goto-cell still= works (defun dismal-set-column-format (column width decimal align) - (let* ((format (dismal-get-create-column-format column)) + (let* ((format (dismal-get-create-column-format)) (old-width (aref format 0)) (old-decimal (aref format 1)) (old-align (aref format 2)) ) @@ -5457,10 +5440,9 @@ redraws with point in the center. Adjusts somewha= t for rulers." "This function computes the time for each command, as indicated by CRs= , in a file created by the log program." (interactive) - (let (initial-i initial-j final-i command-name) - - (setq initial-i dismal-current-row) - (setq initial-j dismal-current-col) + (let ((initial-i dismal-current-row) + (initial-j dismal-current-col) + final-i command-name time1 time2) =20 ;; starts at a good cell ;; copy time over @@ -5484,11 +5466,11 @@ in a file created by the log program." (setq command-name (dismal-get-val dismal-current-row dismal-current= -col)) (while (< dismal-current-row final-i) (dis-forward-row 1) - (setq val (dismal-get-val dismal-current-row dismal-current-col)) - (if (numberp val) (setq val (format "%s" val))) - ;; trim of the extra char - (setq val (substring val 0 1)) - (setq command-name (concat command-name val)) ) + (let ((val (dismal-get-val dismal-current-row dismal-current-col))= ) + (if (numberp val) (setq val (format "%s" val))) + ;; trim of the extra char + (setq val (substring val 0 1)) + (setq command-name (concat command-name val)))) =20 ;; Now insert it. (dis-end-of-row) @@ -5500,18 +5482,13 @@ in a file created by the log program." (dis-first-column) (dis-forward-column 1))) =20 -(defun current-line-in-window () +(defun dis--current-line-in-window () ;; taken from the gnu-emacs manual entry on count-lines, p. 377 ;; so not necc. to add dismal- to front (+ (count-lines (window-start) (point)) (if (=3D (current-column) 0) 1 0) -1)) =20 -(defun dis-no-op (arg) - (interactive "p") - (error "%s is not defined for dismal-mode." (this-command-keys))) - - ;; old way, changes inspired by Dan Nicolaescu ;; 17-Jun-97 -FER ;;(defun dismal-insert-blank-box (start-point rows cols text) @@ -5590,20 +5567,15 @@ in a file created by the log program." =20 ;; (dis-days-to-date (dis-date-to-days "10-feb-1980")) (defun dis-days-to-date (days &optional startdate) - "Returns the date that DAYS after from 1 Jan 1970." + "Return the date that DAYS after from 1 Jan 1970." ;; does not take account of leap year ;; inefficient algorithm (interactive) (let ((styear 1970) - (stday 1) - (stmonth 0) (month nil)) ; scratch var (if startdate (progn - (setq styear (string-to-number (substring startdate 7 nil))) - (setq stday (string-to-number (substring startdate 0 2))) - (setq stmonth - (dis-get-month-int (substring startdate 3 6))))) + (setq styear (string-to-number (substring startdate 7 nil))))) (while (> days 366) (cond ((=3D 0 (% styear 4)) ; leap year (setq days (- days 366)) @@ -5763,7 +5735,7 @@ Includes leap years." (defun dismal-map-apply (function list) (if (null list) () - (apply function (car list) nil) + (funcall function (car list)) (dismal-map-apply function (cdr list)))) =20 ;; (setq aa '(1 2 (1 . 2) 3 4)) @@ -5899,14 +5871,14 @@ Also see `dis-grader'." ; (dis-count '(dismal-range (dis= mal-r-c- 0 0) (dismal-r-c- 3 0))) ; (dis-count "a0:a3") =20 -(defvar dd-result nil "Where dismal-do stores its results.") +(defvar dis--dd-result nil "Where dismal-do stores its results.") =20 (defun dis-count (range) "Given a cell RANGE computes the count of filled cells." (interactive "P") (setq range (dismal-adjust-range range)) (dismal-do (lambda (row col old-result) - (setq dd-result + (setq dis--dd-result (dismal-safe-count old-result (dismal-get-val row c= ol)))) range 0)) =20 @@ -5920,17 +5892,17 @@ Also see `dis-grader'." "Given a cell RANGE computes the number of times REGEXP is matched." (interactive "P") (setq range (dismal-adjust-range range)) - (dismal-do (lambda (row col old-result) - ;; (my-message "Got old-result of %s" old-resul= t) - (setq dd-result - (+ dd-result - (count-regexp-in-string regexp (dismal= -get-val row col))))) + (dismal-do (lambda (row col _old-result) + ;; (my-message "Got old-result of %s" old-result) + (setq dis--dd-result + (+ dis--dd-result + (dis--count-regexp-in-string regexp (dismal-get-= val row col))))) range 0)) =20 - ; (count-regexp-in-string "\\(\\= w\\)+" "the odg-sat down." 0) - ; (count-regexp-in-string "\\(\\= w\\)+" "17-aug-92" 0) + ; (dis--count-regexp-in-string "= \\(\\w\\)+" "the odg-sat down." 0) + ; (dis--count-regexp-in-string "= \\(\\w\\)+" "17-aug-92" 0) =20 -(defun count-regexp-in-string (regexp string &optional start) +(defun dis--count-regexp-in-string (regexp string &optional start) (cond ((numberp string) 1) ((or (not string) (not (stringp string))) 0) (t (if (not (numberp start)) @@ -5940,7 +5912,7 @@ Also see `dis-grader'." (real-end (length string))) (cond ((not start) 0) ((>=3D end real-end) 1) - (t (1+ (count-regexp-in-string regexp + (t (1+ (dis--count-regexp-in-string regexp string (+ 1 end)))))))= )) =20 (defun dis-count-if-regexp-match (range regexp) @@ -5952,7 +5924,7 @@ Also see `dis-grader'." (let ((val (dismal-get-val row col))) (if (and (stringp val) (string-match regexp val)) - (setq dd-result (1+ old-val))))) + (setq dis--dd-result (1+ old-val))))) range 0)) =20 (defun dis-match-list (range regexps) @@ -5960,7 +5932,7 @@ Also see `dis-grader'." (interactive "P") (setq range (dismal-adjust-range range)) (let ((match-result nil)) - (dismal-do (lambda (row col old-val) + (dismal-do (lambda (row col _old-val) (let ((val (dismal-get-val row col))) (if (and (stringp val) (dis-string-match-regexps regexps val)) @@ -5985,12 +5957,12 @@ Also see `dis-grader'." "Given a cell RANGE computes the sum of filled cells." (interactive "P") (setq range (dismal-adjust-range range)) - (dismal-do (lambda (row col old-result) + (dismal-do (lambda (row col _old-result) (let ((val (dismal-get-val row col))) ;;(my-message "%s:%s Result is %s" row1 col1 - ;; (if (floatp result) (float-to-string resul= t) result)) + ;; (if (floatp result) (dis--float-to-string = result) result)) (if (numberp val) ;; (floatp val) - (setq dd-result (+ dd-result val))))) + (setq dis--dd-result (+ dis--dd-result val))))) range 0)) =20 (defun dis-mean (range) @@ -6002,13 +5974,13 @@ Also see `dis-grader'." (sum-it 0.0)) (setq sum-it (dismal-do - (lambda (row col old-result) + (lambda (row col _old-result) (let ((val (dismal-get-val row col))) ;;(my-message "%s:%s Result is %s" row1 col1 - ;; (if (floatp result) (float-to-string result)= result)) + ;; (if (floatp result) (dis--float-to-string re= sult) result)) (if (numberp val) (progn - (setq dd-result (+ dd-result val 0.0)) + (setq dis--dd-result (+ dis--dd-result val 0.0)) (setq num (+ num 1)) ) ) )) range 0) ) (/ sum-it num) )) @@ -6017,9 +5989,9 @@ Also see `dis-grader'." "Given a cell RANGE computes the product of filled cells." (interactive "P") (setq range (dismal-adjust-range range)) - (dismal-do (lambda (row col old-result) - (setq dd-result - (dismal-safe-* dd-result (dismal-get-val row col)))= ) + (dismal-do (lambda (row col _old-result) + (setq dis--dd-result + (dismal-safe-* dis--dd-result (dismal-get-val row c= ol)))) range 1)) =20 (defun dismal-map (function first-value list) @@ -6032,9 +6004,9 @@ Also see `dis-grader'." =20 (defun dismal-do (function arange initial-value) "Iteratively call FUNCTION on cells in ARANGE. We bind -result to INITIAL-VALUE for your use, and return DD-RESULT which functio= n +result to INITIAL-VALUE for your use, and return DIS--DD-RESULT which fu= nction can use." - ;; function can use dd-result + ;; function can use dis--dd-result ;; can't be a macro, unless you keep the guard of ;; dismal-max-row/col in somehow ;; changed all these variable names to avoid dynamic variables. @@ -6045,15 +6017,15 @@ can use." (dd-col1 (dismal-range-1st-col arange)) (dd-col2 (min dismal-max-col (dismal-range-2nd-col arange))) (dd-start-col dd-col1) - (dd-result initial-value)) + (dis--dd-result initial-value)) (while (<=3D dd-row1 dd-row2) (while (<=3D dd-col1 dd-col2) - (funcall function dd-row1 dd-col1 dd-result) - ;;(my-message "%s:%s Result is %s" dd-row1 dd-col1 dd-result) + (funcall function dd-row1 dd-col1 dis--dd-result) + ;;(my-message "%s:%s Result is %s" dd-row1 dd-col1 dis--dd-resul= t) (setq dd-col1 (1+ dd-col1))) (setq dd-row1 (1+ dd-row1)) (setq dd-col1 dd-start-col)) - dd-result)) + dis--dd-result)) =20 (defun dis-plus (&rest args) "A safe version of plus that knows about floats, ints, cells and range= s." @@ -6069,8 +6041,8 @@ can use." (dismal-address-col x)))) ((stringp x) result) ((and (numberp x) (numberp result)) (+ x result)) - ((and (boundp x) (numberp (eval x))) - (+ (eval x) result)) + ((and (boundp x) (numberp (symbol-value x))) + (+ (symbol-value x) result)) ((and (boundp x) (not x)) ;;; this traps nil as 0 result) (t (error "Tried to add together %s and %s" x result)= )))) @@ -6106,22 +6078,22 @@ can use." =20 ;; same as in simple-menu.el =20 -;; (formula-p '(dis-count)) -;; (formula-p '(34343 . 33)) -;; (formula-p '(quote (34343 . 33))) -(defun formula-p (item) - ;; (my-message "Calling formula-p on %s" item) +;; (dis--formula-p '(dis-count)) +;; (dis--formula-p '(34343 . 33)) +;; (dis--formula-p '(quote (34343 . 33))) +(defun dis--formula-p (item) + ;; (my-message "Calling dis--formula-p on %s" item) (and (listp item) (not (eq (car item) 'quote)) ;; (not (floatp item)) )) =20 - ; (formula-string-p "(dis-count-= if-regexp-match B1:B3 \"B\\+$\")") - ; (formula-string-p "(if t nil 4= )") - ; (formula-string-p "(if (> 3 4)= nil 4)") + ; (dis--formula-string-p "(dis-c= ount-if-regexp-match B1:B3 \"B\\+$\")") + ; (dis--formula-string-p "(if t = nil 4)") + ; (dis--formula-string-p "(if (>= 3 4) nil 4)") ; (setq item "(if (> 3 4) nil 4)= ") -(defun formula-string-p (item) ;;(formula-string-p "(* 34 34)") - (and (stringp item) ;;(formula-string-p "(/ (float 3) (float= 3))") +(defun dis--formula-string-p (item) ;;(dis--formula-string-p "(* 34 34)= ") + (and (stringp item) ;;(dis--formula-string-p "(/ (float 3) (= float 3))") (string-match "^([a-zA-Z .0-9:$---/^\"+=3D<>\\]*)$" item) (fboundp (car (car (read-from-string item)))))) =20 @@ -6157,7 +6129,7 @@ can use." (format "{%s..}" (substring exp 0 (min arg (length exp)= ))) exp) ;; (if (floatp val) - ;; (float-to-string val) (prin1-to-string val)) + ;; (dis--float-to-string val) (prin1-to-string val)) (prin1-to-string val) (dismal-get-cell-dep cell) (dismal-get-cell-mrk cell) @@ -6178,19 +6150,18 @@ can use." (defun dis-show-functions () "Show all the functions that dismal will let you use." (interactive) - (let ((old-buffer (current-buffer))) - (pop-to-buffer sm-help-buffer) - (erase-buffer) - (insert "Available dismal functions: + (pop-to-buffer sm-help-buffer) + (erase-buffer) + (insert "Available dismal functions: \(A RANGE takes the form like a23:e35) \(See Emacs help for regexp forms)\n\n") - (mapc (lambda (x) - (insert (prin1-to-string x)) - (dismal-force-move-to-column (max (+ 2 (current-column)) - 18)) - (insert (documentation x) "\n")) - dis-user-cell-functions) - (goto-char (point-min)) )) + (mapc (lambda (x) + (insert (prin1-to-string x)) + (dismal-force-move-to-column (max (+ 2 (current-column)) + 18)) + (insert (documentation x) "\n")) + dis-user-cell-functions) + (goto-char (point-min)) ) =20 =0C ;;;; XX. Testing functions diff --git a/rmatrix.el b/rmatrix.el index cf09ffa..58d8d83 100644 --- a/rmatrix.el +++ b/rmatrix.el @@ -1,6 +1,6 @@ ;;; rmatrix.el --- Matrices implemented as vector of vectors, gives rows= priority =20 -;; Copyright (C) 1992, 2013 Free Software Foundation, Inc. +;; Copyright (C) 1992-2018 Free Software Foundation, Inc. =20 ;; Author: David Fox, fox@cs.nyu.edu ;; Created-On: Mon Jan 6 14:17:56 1992 @@ -199,49 +199,49 @@ (setq don-start-r (1+ don-start-r)) (setq rec-start-r (1+ rec-start-r))))) =20 -;(matrix-copy 0 0 3 3 0 0 aa bb) -; (inspect bb) +;;(matrix-copy 0 0 3 3 0 0 aa bb) +;; (inspect bb) =20 =0C ;;;; IV. Useful test functions =20 ;; looks like matrixes are stored as a vector of columns =20 -;(defun create-aa () -; (setq aa (dismal-create-matrix)) -; (matrix-set aa 0 0 'r0c0) -; (matrix-set aa 0 1 'r0c1) -; (matrix-set aa 1 1 'r1c1) -; (matrix-set aa 3 3 'r3c3) -; (matrix-set aa 3 1 'r3c1) -; (matrix-set aa 0 2 'r0c2) -; (matrix-set aa 0 3 'r0c3)) -;; Note that these results are different from matrix.el -;; (which is column based). -; (inspect aa) [1 1 [[1 0 [nil] nil]] [1 0 [nil] nil]] -; (matrix-set aa 0 0 'r0c0) -; (inspect aa) [1 1 [[1 1 [r0c0] nil]] [1 0 [nil] nil]] -; (matrix-set aa 0 1 'r0c1) -; (inspect aa) [1 1 [[2 2 [r0c0 r0c1] nil]] [1 0 [nil] nil]] -; (matrix-set aa 1 1 'r1c1) -; (inspect aa) -; [2 2 [[2 2 [r0c0 r0c1] nil][2 2 [nil r1c1] nil]][1 0 [nil]= nil]] -; (matrix-set aa 3 3 'r3c3) -; (matrix-set aa 3 1 'r3c1) -; (matrix-set aa 0 2 'r0c2) -; (matrix-set aa 0 3 'r0c3) -; (inspect aa) -; [4 4 [[4 4 [r0c0 r0c1 r0c2 r0c3] nil] -; [2 2 [nil r1c1] nil] -; [1 0 [nil] nil] -; [4 4 [nil r3c1 nil r3c3] nil]] [1 0 [nil] nil]] -; (matrix-delete-column-cells aa 0 1 1) -; (matrix-width aa) -; (inspect aa) -; [4 4 [[4 4 [r0c0 r1c1 r0c2 r0c3] nil] -; [2 2 [nil nil] nil] -; [2 2 [nil r3c1] nil] -; [4 4 [nil nil nil r3c3] nil]] [1 0 [nil] nil]] +;;(defun create-aa () +;; (setq aa (dismal-create-matrix)) +;; (matrix-set aa 0 0 'r0c0) +;; (matrix-set aa 0 1 'r0c1) +;; (matrix-set aa 1 1 'r1c1) +;; (matrix-set aa 3 3 'r3c3) +;; (matrix-set aa 3 1 'r3c1) +;; (matrix-set aa 0 2 'r0c2) +;; (matrix-set aa 0 3 'r0c3)) +;; ;; Note that these results are different from matrix.el +;; ;; (which is column based). +;; (inspect aa) [1 1 [[1 0 [nil] nil]] [1 0 [nil] nil]] +;; (matrix-set aa 0 0 'r0c0) +;; (inspect aa) [1 1 [[1 1 [r0c0] nil]] [1 0 [nil] nil]] +;; (matrix-set aa 0 1 'r0c1) +;; (inspect aa) [1 1 [[2 2 [r0c0 r0c1] nil]] [1 0 [nil] nil]] +;; (matrix-set aa 1 1 'r1c1) +;; (inspect aa) +;; [2 2 [[2 2 [r0c0 r0c1] nil][2 2 [nil r1c1] nil]][1 0 [nil= ] nil]] +;; (matrix-set aa 3 3 'r3c3) +;; (matrix-set aa 3 1 'r3c1) +;; (matrix-set aa 0 2 'r0c2) +;; (matrix-set aa 0 3 'r0c3) +;; (inspect aa) +;; [4 4 [[4 4 [r0c0 r0c1 r0c2 r0c3] nil] +;; [2 2 [nil r1c1] nil] +;; [1 0 [nil] nil] +;; [4 4 [nil r3c1 nil r3c3] nil]] [1 0 [nil] nil]] +;; (matrix-delete-column-cells aa 0 1 1) +;; (matrix-width aa) +;; (inspect aa) +;; [4 4 [[4 4 [r0c0 r1c1 r0c2 r0c3] nil] +;; [2 2 [nil nil] nil] +;; [2 2 [nil r3c1] nil] +;; [4 4 [nil nil nil r3c3] nil]] [1 0 [nil] nil]] =20 (provide 'rmatrix) ;;; rmatrix.el ends here diff --git a/semi-coder.el b/semi-coder.el index ffbddee..ec9f24a 100644 --- a/semi-coder.el +++ b/semi-coder.el @@ -1,6 +1,6 @@ ;;; semi-coder.el --- Let users insert codes from model into Soar/PA she= ets. =20 -;; Copyright (C) 1992, 2013 Free Software Foundation, Inc. +;; Copyright (C) 1992-2018 Free Software Foundation, Inc. =20 ;; Author: Frank Ritter ;; Created-On: Sun Jul 19 02:04:03 1992 @@ -26,6 +26,7 @@ =20 (require 'dismal-data-structures) (require 'rmatrix) +(eval-when-compile (require 'cl-lib)) =20 =0C ;;;; i. Variables & constants @@ -33,6 +34,9 @@ (defvar dis-operator-codes nil "Operator names taken from Soar that can be used to code segments.") =20 +(defvar dis-codes-file (expand-file-name "example-codes.txt" dismal-dire= ctory) + "*Default file to get codes from.") + (defconst dis-op-code-insert-query "Operator code to insert (? for complete list): ") =20 @@ -48,66 +52,63 @@ ;; if not initialized, init (if (not dis-operator-codes) (dis-initialize-operator-codes)) - (let ((code nil)) =20 - (setq code - (completing-read dis-op-code-insert-query - dis-operator-codes - nil 'require-match)) - ;; insert into cell - (dismal-set-exp dismal-current-row dismal-current-col - (dismal-set-val dismal-current-row dismal-current-col - code)) - (dismal-save-excursion - (dismal-redraw-cell dismal-current-row dismal-current-col t)) )) + (let ((code + (completing-read dis-op-code-insert-query + dis-operator-codes + nil 'require-match))) + ;; insert into cell + (dismal-set-exp dismal-current-row dismal-current-col + (dismal-set-val dismal-current-row dismal-current-co= l + code)) + (dismal-save-excursion + (dismal-redraw-cell dismal-current-row dismal-current-col t)) )) =20 =0C ;;;; II. dis-save-op-codes =20 (defun dis-save-op-codes (file) "Write dismal operator codes out to a FILE." - (interactive (list (dismal-read-minibuffer "Dump op codes in: " - 'editable (expand-file-name dis-codes-file)))) + (interactive (list (dismal-read-minibuffer "Dump op codes in: " + 'editable (expand-file-name= dis-codes-file)))) ;; (interactive "FFile to dump operator codes into: ") (save-excursion - (let ((codes dis-operator-codes)) - (if (file-exists-p file) - (if (y-or-n-p (format "Delete %s? " 'file)) - (delete-file file) - (error "Can't overwrite file %s" file))) - (find-file file) - (mapc (function (lambda (x) (insert (car x) "\n"))) - codes) - (save-buffer) - (kill-buffer (current-buffer))))) + (let ((codes dis-operator-codes)) + (if (file-exists-p file) + (if (y-or-n-p (format "Delete %s? " 'file)) + (delete-file file) + (error "Can't overwrite file %s" file))) + (find-file file) + (mapc (function (lambda (x) (insert x "\n"))) + codes) + (save-buffer) + (kill-buffer (current-buffer))))) =20 =0C ;;;; III. dis-load-op-codes =20 (defun dis-load-op-codes (file &optional union-or-replace) - "Load operator codes into dismal. UNION-OR-REPLACE can be either." - (interactive (list (dismal-read-minibuffer "Load codes from: " - 'editable (expand-file-name dis-codes-file)))) - (let ((code-buffer (find-file-noselect file)) - (done nil) (completion-ignore-case t) - (code-word nil)) - ;; union or replace these codes? - (if (not (or (eq union-or-replace 'union) (eq union-or-replace 'replace= ))) - (setq union-or-replace - (completing-read "Use Union or Replace to incorporate these c= odes: " - '(("Union") ("Replace")) nil 'require-match)= )) - (if (string=3D "replace" union-or-replace) - (setq dis-operator-codes nil)) - (save-excursion (set-buffer code-buffer) (goto-char (point-min))) - (while (not done) - (save-excursion - (set-buffer code-buffer) - (setq code-word - (buffer-substring (point) (save-excursion (end-of-line) (point= )))) - (forward-line) - (if (eobp) (setq done t))) - (if (not (assoc code-word dis-operator-codes)) - (setq dis-operator-codes (cons (list code-word) dis-operator-code= s)))) - (kill-buffer code-buffer))) + "Load operator codes into dismal. UNION-OR-REPLACE can be either." + (interactive (list (dismal-read-minibuffer "Load codes from: " + 'editable (expand-file-name= dis-codes-file)))) + (let ((code-buffer (find-file-noselect file)) + (done nil) (completion-ignore-case t) + (code-word nil)) + ;; union or replace these codes? + (if (not (or (eq union-or-replace 'union) (eq union-or-replace 'repl= ace))) + (setq union-or-replace + (completing-read "Use Union or Replace to incorporate thes= e codes: " + '(("Union") ("Replace")) nil 'require-mat= ch))) + (if (string=3D "replace" union-or-replace) + (setq dis-operator-codes nil)) + (with-current-buffer code-buffer + (goto-char (point-min)) + (while (not done) + (setq code-word + (buffer-substring (point) (line-end-position))) + (forward-line) + (if (eobp) (setq done t)) + (cl-pushnew code-word dis-operator-codes :test #'equal))) + (kill-buffer code-buffer))) =20 =0C ;;;; IV. Utilities @@ -120,30 +121,28 @@ ;; both in the sx directory. (interactive) (let ((completion-ignore-case t)) - ;; look in process, or query user for a file - (cond ((comint-check-proc "*soar*") - (if (string=3D "DSI" - (completing-read dis-init-op-codes-prompt - '(("DSI") ("TAQL")) nil 'require-match)) - (setq dis-operator-codes - (car - (read-from-string - (downcase - (ilisp-send "(or #+sx(sx::list-pscm-operators) - #-sx(and nil))"))))) - (setq dis-operator-codes - (car - (read-from-string - (downcase - (ilisp-send "(or #+taql(user::list-taql-operators) - #-taql(and nil))")))))) - ;; if you got 'em, fix em up - (if (and dis-operator-codes (listp dis-operator-codes)) - (setq dis-operator-codes - (mapcar (function (lambda (x) (list (format "%s" x))= )) - dis-operator-codes)) - (call-interactively 'dis-load-op-codes)) ) - (t (call-interactively 'dis-load-op-codes))) )) + ;; look in process, or query user for a file + (cond + ((comint-check-proc "*soar*") + (let ((operator-codes + (car (read-from-string + (downcase + (ilisp-send + (if (string=3D "DSI" + (completing-read dis-init-op-codes-pro= mpt + '("DSI" "TAQL") + nil 'require-match)) + "(or #+sx(sx::list-pscm-operators) + #-sx(and nil))" + "(or #+taql(user::list-taql-operators) + #-taql(and nil))"))))))) + ;; if you got 'em, fix em up + (if (and operator-codes (listp operator-codes)) + (setq dis-operator-codes + (mapcar (lambda (x) (format "%s" x)) + operator-codes)) + (call-interactively 'dis-load-op-codes)) )) + (t (call-interactively 'dis-load-op-codes))) )) =20 (provide 'semi-coder) ;;; semi-coder.el ends here From MAILER-DAEMON Sat Nov 17 11:29:09 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gO3T3-0002Hh-Kj for mharc-emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO3T1-0002HI-Nn for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gO3Sz-0002KS-Pp for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:07 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO3Sy-0002JR-2t for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:05 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id 0CA8C209E7; Sat, 17 Nov 2018 11:29:04 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm updated (d650159 -> dc3b86d) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <20181117162902.6404.96014@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Oldrev: d650159648e88ec4a67c126834cd24fed6e3fc24 X-Git-Newrev: dc3b86d1b88c725fbba9685c38f09970dfe73d73 Auto-Submitted: auto-generated Date: Sat, 17 Nov 2018 11:29:03 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 16:29:08 -0000 ch11ng pushed a change to branch externals/exwm. from d650159 Fix wrong stacking order of tiling X windows new 5fde63c Avoid activating already active X windows new 882a628 Automatically refresh RandR settings new dc3b86d Add support for 'managed' per-application configura= tion Summary of changes: exwm-manage.el | 43 +++++++++++++++++++++++++---------------- exwm-randr.el | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++-= ------ exwm.el | 11 ++++++++--- 3 files changed, 88 insertions(+), 27 deletions(-) From MAILER-DAEMON Sat Nov 17 11:29:10 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gO3T3-0002I1-Ry for mharc-emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO3T1-0002HK-OD for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gO3Sz-0002KR-Pm for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:07 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO3Sy-0002Jo-N6 for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:05 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id A134920C53; Sat, 17 Nov 2018 11:29:04 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm dc3b86d 3/3: Add support for 'managed' per-application configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Chris Feng In-Reply-To: <20181117162902.6404.96014@vcs0.savannah.gnu.org> References: <20181117162902.6404.96014@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Rev: dc3b86d1b88c725fbba9685c38f09970dfe73d73 Auto-Submitted: auto-generated Message-Id: <20181117162904.A134920C53@vcs0.savannah.gnu.org> Date: Sat, 17 Nov 2018 11:29:04 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 16:29:08 -0000 branch: externals/exwm commit dc3b86d1b88c725fbba9685c38f09970dfe73d73 Author: Chris Feng Commit: Chris Feng Add support for 'managed' per-application configuration =20 * exwm-manage.el (exwm-manage-configurations): Add a new value type 'managed' to allow users to specify whether a certain X window should be managed or not. (exwm-manage--manage-window): Use it. --- exwm-manage.el | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/exwm-manage.el b/exwm-manage.el index d7b5c36..365b94d 100644 --- a/exwm-manage.el +++ b/exwm-manage.el @@ -70,6 +70,7 @@ You can still make the X windows floating afterwards." (const :tag "Prefix keys" prefix-keys) (const :tag "Simulation keys" simulation-keys) (const :tag "Workspace" workspace) + (const :tag "Managed" managed) ;; For forward compatibility. (other)) :value-type (sexp :tag "Value" nil)))) @@ -214,22 +215,31 @@ You can still make the X windows floating afterward= s." (exwm--update-hints id) (exwm-manage--update-geometry id) (exwm-manage--update-mwm-hints id) - ;; No need to manage (please check OverrideRedirect outside) - (when (or - (not - (or (not exwm-window-type) - (memq xcb:Atom:_NET_WM_WINDOW_TYPE_UTILITY exwm-window= -type) - (memq xcb:Atom:_NET_WM_WINDOW_TYPE_DIALOG exwm-window-= type) - (memq xcb:Atom:_NET_WM_WINDOW_TYPE_NORMAL exwm-window-= type))) - ;; Check the _MOTIF_WM_HINTS property. - (and (not exwm--mwm-hints-decorations) - (not exwm--hints-input) - ;; Floating windows only - (or exwm-transient-for exwm--fixed-size - (memq xcb:Atom:_NET_WM_WINDOW_TYPE_UTILITY - exwm-window-type) - (memq xcb:Atom:_NET_WM_WINDOW_TYPE_DIALOG - exwm-window-type)))) + (setq exwm--configurations (exwm-manage--get-configurations)) + ;; OverrideRedirect is not checked here. + (when (and + ;; The user has specified to manage it. + (not (plist-get exwm--configurations 'managed)) + (or + ;; The user has specified not to manage it. + (plist-member exwm--configurations 'managed) + ;; This is not a type of X window we can manage. + (and exwm-window-type + (not (cl-intersection + exwm-window-type + (list xcb:Atom:_NET_WM_WINDOW_TYPE_UTILITY + xcb:Atom:_NET_WM_WINDOW_TYPE_DIALOG + xcb:Atom:_NET_WM_WINDOW_TYPE_NORMAL)))) + ;; Check the _MOTIF_WM_HINTS property to not manage floati= ng X + ;; windows without decoration. + (and (not exwm--mwm-hints-decorations) + (not exwm--hints-input) + ;; Floating windows only + (or exwm-transient-for exwm--fixed-size + (memq xcb:Atom:_NET_WM_WINDOW_TYPE_UTILITY + exwm-window-type) + (memq xcb:Atom:_NET_WM_WINDOW_TYPE_DIALOG + exwm-window-type))))) (exwm--log "No need to manage #x%x" id) ;; Update struts. (when (memq xcb:Atom:_NET_WM_WINDOW_TYPE_DOCK exwm-window-type) @@ -277,7 +287,6 @@ You can still make the X windows floating afterwards.= " (let ((kill-buffer-query-functions nil)) (kill-buffer (current-buffer))) (throw 'return 'ignored)) - (setq exwm--configurations (exwm-manage--get-configurations)) (let ((index (plist-get exwm--configurations 'workspace))) (when (and index (< index (length exwm-workspace--list))) (setq exwm--frame (elt exwm-workspace--list index)))) From MAILER-DAEMON Sat Nov 17 11:29:14 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gO3T5-0002J0-0m for mharc-emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO3T1-0002HJ-O5 for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gO3Sz-0002KK-Ph for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:07 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO3Sy-0002Ja-B4 for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:05 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id 4595A209EB; Sat, 17 Nov 2018 11:29:04 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm 5fde63c 1/3: Avoid activating already active X windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Chris Feng In-Reply-To: <20181117162902.6404.96014@vcs0.savannah.gnu.org> References: <20181117162902.6404.96014@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Rev: 5fde63cc453b080f3436751a1912440664a09663 Auto-Submitted: auto-generated Message-Id: <20181117162904.4595A209EB@vcs0.savannah.gnu.org> Date: Sat, 17 Nov 2018 11:29:04 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 16:29:08 -0000 branch: externals/exwm commit 5fde63cc453b080f3436751a1912440664a09663 Author: Chris Feng Commit: Chris Feng Avoid activating already active X windows =20 * exwm.el (exwm--on-ClientMessage): On receiving `_NET_ACTIVE_WINDOW' events, check if the requested X windows are already active. --- exwm.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/exwm.el b/exwm.el index 6021f85..98b30f9 100644 --- a/exwm.el +++ b/exwm.el @@ -416,16 +416,21 @@ (exwm-workspace-switch (elt data 0))) ;; _NET_ACTIVE_WINDOW. ((=3D type xcb:Atom:_NET_ACTIVE_WINDOW) - (let ((buffer (exwm--id->buffer id))) + (let ((buffer (exwm--id->buffer id)) + iconic window) (when (buffer-live-p buffer) (with-current-buffer buffer (when (eq exwm--frame exwm-workspace--current) - (when (exwm-layout--iconic-state-p) + (setq iconic (exwm-layout--iconic-state-p)) + (when iconic ;; State change: iconic =3D> normal. (set-window-buffer (frame-selected-window exwm--frame) (current-buffer))) ;; Focus transfer. - (select-window (get-buffer-window nil t))))))) + (setq window (get-buffer-window nil t)) + (when (or iconic + (not (eq window (selected-window)))) + (select-window window))))))) ;; _NET_CLOSE_WINDOW. ((=3D type xcb:Atom:_NET_CLOSE_WINDOW) (let ((buffer (exwm--id->buffer id))) From MAILER-DAEMON Sat Nov 17 11:29:14 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gO3T7-0002JB-VQ for mharc-emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO3T1-0002HH-Nj for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gO3Sz-0002KU-Pt for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:07 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO3Sy-0002Je-Gw for emacs-elpa-diffs@gnu.org; Sat, 17 Nov 2018 11:29:05 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id 750DE209FD; Sat, 17 Nov 2018 11:29:04 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm 882a628 2/3: Automatically refresh RandR settings MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Chris Feng In-Reply-To: <20181117162902.6404.96014@vcs0.savannah.gnu.org> References: <20181117162902.6404.96014@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Rev: 882a628daad04e27fe19c03ceeb287ac9e6a8323 Auto-Submitted: auto-generated Message-Id: <20181117162904.750DE209FD@vcs0.savannah.gnu.org> Date: Sat, 17 Nov 2018 11:29:04 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 16:29:08 -0000 branch: externals/exwm commit 882a628daad04e27fe19c03ceeb287ac9e6a8323 Author: Chris Feng Commit: Chris Feng Automatically refresh RandR settings =20 * exwm-randr.el (exwm-randr--last-timestamp): New variable recording last seen timestamp after requesting `GetMonitors'. (exwm-randr--get-monitors): Use it. (exwm-randr--on-ScreenChangeNotify): Do not refresh any more. (exwm-randr--on-Notify): New function for handling `CrtcChangeNotify' and `OutputChangeNotify' events. (exwm-randr--on-ConfigureNotify): New function for handling `ConfigureNotify' event. (exwm-randr--init): Add listeners for additional events. --- exwm-randr.el | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++-= ------ 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/exwm-randr.el b/exwm-randr.el index 2ec4789..106ed6f 100644 --- a/exwm-randr.el +++ b/exwm-randr.el @@ -91,6 +91,8 @@ corresponding monitors whenever the monitors are active= . (define-obsolete-variable-alias 'exwm-randr-workspace-output-plist 'exwm-randr-workspace-monitor-plist "27.1")) =20 +(defvar exwm-randr--last-timestamp 0 "Used for debouncing events.") + (defvar exwm-workspace--fullscreen-frame-count) (defvar exwm-workspace--list) (declare-function exwm-workspace--count "exwm-workspace.el") @@ -103,12 +105,15 @@ corresponding monitors whenever the monitors are ac= tive. =20 (defun exwm-randr--get-monitors () "Get RandR monitors." + (exwm--log) (let (monitor-name geometry monitor-plist primary-monitor) - (with-slots (monitors) + (with-slots (timestamp monitors) (xcb:+request-unchecked+reply exwm--connection (make-instance 'xcb:randr:GetMonitors :window exwm--root :get-active 1)) + (when (> timestamp exwm-randr--last-timestamp) + (setq exwm-randr--last-timestamp timestamp)) (dolist (monitor monitors) (with-slots (name primary x y width height) monitor (setq monitor-name (x-get-atom-name name) @@ -129,6 +134,7 @@ corresponding monitors whenever the monitors are acti= ve. (defun exwm-randr-refresh () "Refresh workspaces according to the updated RandR info." (interactive) + (exwm--log) (let* ((result (exwm-randr--get-monitors)) (primary-monitor (elt result 0)) (monitor-plist (elt result 1)) @@ -187,9 +193,42 @@ corresponding monitors whenever the monitors are act= ive. "27.1") =20 (defun exwm-randr--on-ScreenChangeNotify (_data _synthetic) + "Handle `ScreenChangeNotify' event. + +Run `exwm-randr-screen-change-hook' (usually user scripts to configure R= andR)." + (exwm--log) + (run-hooks 'exwm-randr-screen-change-hook)) + +(defun exwm-randr--on-Notify (data _synthetic) + "Handle `CrtcChangeNotify' and `OutputChangeNotify' events. + +Refresh when any CRTC/output changes." + (exwm--log) + (let ((evt (make-instance 'xcb:randr:Notify)) + notify) + (xcb:unmarshal evt data) + (with-slots (subCode u) evt + (cl-case subCode + (xcb:randr:Notify:CrtcChange + (setq notify (slot-value u 'cc))) + (xcb:randr:Notify:OutputChange + (setq notify (slot-value u 'oc)))) + (when notify + (with-slots (timestamp) notify + (when (> timestamp exwm-randr--last-timestamp) + (exwm-randr-refresh) + (setq exwm-randr--last-timestamp timestamp))))))) + +(defun exwm-randr--on-ConfigureNotify (data _synthetic) + "Handle `ConfigureNotify' event. + +Refresh when any RandR 1.5 monitor changes." (exwm--log) - (run-hooks 'exwm-randr-screen-change-hook) - (exwm-randr--refresh)) + (let ((evt (make-instance 'xcb:ConfigureNotify))) + (xcb:unmarshal evt data) + (with-slots (window) evt + (when (eq window exwm--root) + (exwm-randr-refresh))))) =20 (defun exwm-randr--init () "Initialize RandR extension and EXWM RandR module." @@ -205,15 +244,23 @@ corresponding monitors whenever the monitors are ac= tive. major-version minor-version) ;; External monitor(s) may already be connected. (run-hooks 'exwm-randr-screen-change-hook) - (exwm-randr--refresh) + (exwm-randr-refresh) + ;; Listen for `ScreenChangeNotify' to notify external tools to + ;; configure RandR and `CrtcChangeNotify/OutputChangeNotify' to + ;; refresh the workspace layout. (xcb:+event exwm--connection 'xcb:randr:ScreenChangeNotify #'exwm-randr--on-ScreenChangeNotify) + (xcb:+event exwm--connection 'xcb:randr:Notify #'exwm-randr--on-= Notify) + (xcb:+event exwm--connection 'xcb:ConfigureNotify + #'exwm-randr--on-ConfigureNotify) (xcb:+request exwm--connection (make-instance 'xcb:randr:SelectInput :window exwm--root - :enable xcb:randr:NotifyMask:ScreenChange)) + :enable (logior xcb:randr:NotifyMask:ScreenCh= ange + xcb:randr:NotifyMask:CrtcChan= ge + xcb:randr:NotifyMask:OutputCh= ange))) (xcb:flush exwm--connection) - (add-hook 'exwm-workspace-list-change-hook #'exwm-randr--refresh= )))) + (add-hook 'exwm-workspace-list-change-hook #'exwm-randr-refresh)= ))) ;; Prevent frame parameters introduced by this module from being ;; saved/restored. (dolist (i '(exwm-randr-monitor)) @@ -222,7 +269,7 @@ corresponding monitors whenever the monitors are acti= ve. =20 (defun exwm-randr--exit () "Exit the RandR module." - (remove-hook 'exwm-workspace-list-change-hook #'exwm-randr--refresh)) + (remove-hook 'exwm-workspace-list-change-hook #'exwm-randr-refresh)) =20 (defun exwm-randr-enable () "Enable RandR support for EXWM." From MAILER-DAEMON Sun Nov 18 01:17:04 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gOGOG-0000Vb-BS for mharc-emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 01:17:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOGOE-0000UZ-Nh for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 01:17:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOGOE-0004qu-4c for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 01:17:02 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:45485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOGOE-0004qk-1g for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 01:17:02 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id 932C020543; Sun, 18 Nov 2018 01:17:01 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm 786c2b4: Fallback to the first monitor as the primary one MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Chris Feng In-Reply-To: <20181118061700.24514.72081@vcs0.savannah.gnu.org> References: <20181118061700.24514.72081@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Rev: 786c2b4f7d2e92f77746918b442419fa3b5794e5 Auto-Submitted: auto-generated Message-Id: <20181118061701.932C020543@vcs0.savannah.gnu.org> Date: Sun, 18 Nov 2018 01:17:01 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 06:17:03 -0000 branch: externals/exwm commit 786c2b4f7d2e92f77746918b442419fa3b5794e5 Author: Chris Feng Commit: Chris Feng Fallback to the first monitor as the primary one =20 * exwm-randr.el (exwm-randr--get-monitors): When no primary monitor i= s specified, pick the first one. --- exwm-randr.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exwm-randr.el b/exwm-randr.el index 106ed6f..f488bd9 100644 --- a/exwm-randr.el +++ b/exwm-randr.el @@ -123,8 +123,9 @@ corresponding monitors whenever the monitors are acti= ve. :width width :height height) monitor-plist (plist-put monitor-plist monitor-name geom= etry)) - ;; Save primary monitor when available. - (when (/=3D 0 primary) + ;; Save primary monitor when available (fallback to the first = one). + (when (or (/=3D 0 primary) + (not primary-monitor)) (setq primary-monitor monitor-name))))) (exwm--log "Primary monitor: %s" primary-monitor) (exwm--log "Monitors: %s" monitor-plist) From MAILER-DAEMON Sun Nov 18 12:34:00 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gOQxM-0007Ip-1y for mharc-emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 12:34:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOQxK-0007Ig-FI for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 12:33:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOQxJ-0000pq-Ip for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 12:33:58 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:55468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOQxJ-0000oy-FP for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 12:33:57 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 134376) id 373D0209DE; Sun, 18 Nov 2018 12:33:57 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 41a64ea: [el-search] Make r hit twice restore a replaced match MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Michael Heerdegen In-Reply-To: <20181118173356.21591.55294@vcs0.savannah.gnu.org> References: <20181118173356.21591.55294@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 41a64eaa5c45d7d6d946712ff7356ff23b6fddac Auto-Submitted: auto-generated Message-Id: <20181118173357.373D0209DE@vcs0.savannah.gnu.org> Date: Sun, 18 Nov 2018 12:33:56 -0500 (EST) From: michael_heerdegen@web.de (Michael Heerdegen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 17:33:59 -0000 branch: master commit 41a64eaa5c45d7d6d946712ff7356ff23b6fddac Author: Michael Heerdegen Commit: Michael Heerdegen [el-search] Make r hit twice restore a replaced match =20 Update commentary in header accordingly. =20 * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Make r hit after replacing a match restore that match using an undo change group. --- packages/el-search/el-search.el | 132 ++++++++++++++++++++++------------= ------ 1 file changed, 74 insertions(+), 58 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-sear= ch.el index d598a2b..c2347a3 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -298,9 +298,10 @@ ;; `(foo ,b ,a . ,rest) RET ;; ;; Type y to replace a match and go to the next one, r to replace -;; without moving, n to go to the next match without replacing and ! -;; to replace all remaining matches automatically. q quits. ? shows -;; a quick help summarizing all of these keys. +;; without moving (hitting r again restores that match), n to go to +;; the next match without replacing and ! to replace all remaining +;; matches automatically. q quits. ? shows a quick help summarizing +;; all of these keys. ;; ;; It is possible to replace a match with an arbitrary number of ;; expressions using "splicing mode". When it is active, the @@ -3717,8 +3718,10 @@ exactly you did? Thanks!")))) "Replace match and mov= e to the next")) (and (not replaced-this) '(?n "n" "Move to the nex= t match")) - (and (not replaced-this) - '(?r "r" "Replace match b= ut don't move")) + `(?r "r" + ,(if (not replaced-this) + "Replace match but d= on't move" + "Restore match")) '(?! "all" "Replace all remain= ing matches in this buffer") '(?b "skip buf" "Skip this buffer and any= remaining matches in it") @@ -3735,63 +3738,76 @@ Toggle splicing mode (\\[describe-function] el-se= arch-query-replace for details) '(?\r "quit")))))))) (if replace-all (funcall do-replace) - (while (not (pcase (funcall query) - (?r (funcall do-replace) - nil) - (?y - (unless replaced-this (funcall= do-replace)) - t) - (?n - (cl-incf nbr-skipped) - t) - (?! - (when (and use-current-search - (not (alist-get 'is= -single-buffer - (el= -search-object-properties - el= -search--current-search))) - (eq (car (read-mult= iple-choice - "Replace = in all following buffers?" - '((?! "On= ly this" - "\ + (let ((handle nil)) + (unwind-protect + (while (not (pcase (funcall query) + (?r + (if (not replaced-this) + (progn + (activate-change-g= roup + (setq handle (pre= pare-change-group))) + (funcall do-replac= e)) + (cancel-change-group h= andle) + (setq handle nil) + (setq replaced-this ni= l) + (cl-decf nbr-replaced) + (cl-decf nbr-replaced-= total)) + nil) + (?y + (unless replaced-this (f= uncall do-replace)) + t) + (?n + (cl-incf nbr-skipped) + t) + (?! + (when (and use-current-s= earch + (not (alist-g= et 'is-single-buffer + = (el-search-object-properties + = el-search--current-search))) + (eq (car (rea= d-multiple-choice + "Re= place in all following buffers?" + '((= ?! "Only this" + = "\ Replace only remaining matches in this buffer") - (?A "Al= l buffers" - "\ + (= ?A "All buffers" + = "\ Replace all matches in all buffers")))) - ?A)) - (setq replace-all-and-follow= ing t)) - (setq replace-all t) - (unless replaced-this (funcall= do-replace)) - t) - (?b (goto-char (point-max)) - (message "Skipping this buf= fer") - (sit-for 1) - ;; FIXME: add #skipped matc= hes to nbr-skipped? - t) - (?d (call-interactively #'el-se= arch-skip-directory) - t) - (?s - (setq splice (not splice) - to-insert (funcall get-r= eplacement-string)) - nil) - (?o - ;; FIXME: Should we allow to e= dit the replacement? - (let* ((buffer (get-buffer-cre= ate - (generate-new-= buffer-name "*Replacement*"))) - (window (display-buffer= buffer))) - (with-selected-window window - (emacs-lisp-mode) - (save-excursion - (insert - "\ + ?A)) + (setq replace-all-and-= following t)) + (setq replace-all t) + (unless replaced-this (f= uncall do-replace)) + t) + (?b (goto-char (point-max= )) + (message "Skipping th= is buffer") + (sit-for 1) + ;; FIXME: add #skippe= d matches to nbr-skipped? + t) + (?d (call-interactively #= 'el-search-skip-directory) + t) + (?s + (setq splice (not spl= ice) + to-insert (funcall= get-replacement-string)) + nil) + (?o + ;; FIXME: Should we allo= w to edit the replacement? + (let* ((buffer (get-buff= er-create + (generat= e-new-buffer-name "*Replacement*"))) + (window (display-= buffer buffer))) + (with-selected-window = window + (emacs-lisp-mode) + (save-excursion + (insert + "\ ;; This buffer shows the replacement for the current match. ;; Please hit any key to proceed.\n\n" - (funcall get-replacemen= t-string))) - (read-char " ")) - (delete-window window) - (kill-buffer buffer) - (el-search--after-scroll (se= lected-window) (window-start)) - nil)) - ((or ?q ?\C-g ?\r) (signal 'qui= t t)))))) + (funcall get-repl= acement-string))) + (read-char " ")) + (delete-window window) + (kill-buffer buffer) + (el-search--after-scro= ll (selected-window) (window-start)) + nil)) + ((or ?q ?\C-g ?\r) (signa= l 'quit t))))) + (when handle (accept-change-group handle)= )))) (unless (eobp) (let* ((replacement-end-pos (and replaced-this From MAILER-DAEMON Sun Nov 18 21:00:27 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gOYrT-0001By-QJ for mharc-emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 21:00:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOYrQ-0001AW-6I for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 21:00:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOYrP-0007yo-7l for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 21:00:23 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOYrP-0007yd-4o for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 21:00:23 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 1154A209DE; Sun, 18 Nov 2018 21:00:22 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master b039229: * xclip/xclip.el: Fix bug#33399 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181119020022.16480.5094@vcs0.savannah.gnu.org> References: <20181119020022.16480.5094@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: b03922935f6fe8fdc0d0a272e4844fdf57bb5321 Auto-Submitted: auto-generated Message-Id: <20181119020023.1154A209DE@vcs0.savannah.gnu.org> Date: Sun, 18 Nov 2018 21:00:22 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:00:25 -0000 branch: master commit b03922935f6fe8fdc0d0a272e4844fdf57bb5321 Author: Stefan Monnier Commit: Stefan Monnier * xclip/xclip.el: Fix bug#33399 =20 (xclip-set-selection): Don't use start-file-process. --- packages/xclip/xclip.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/xclip/xclip.el b/packages/xclip/xclip.el index 2b8f97c..f100e47 100644 --- a/packages/xclip/xclip.el +++ b/packages/xclip/xclip.el @@ -5,7 +5,7 @@ ;; Author: Leo Liu ;; Keywords: convenience, tools ;; Created: 2007-12-30 -;; Version: 1.4 +;; Version: 1.5 =20 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -86,26 +86,26 @@ See also `x-set-selection'." (pcase xclip-method ('pbpaste (when (memq type '(clipboard CLIPBOARD)) - (start-file-process + (start-process "pbcopy" nil (replace-regexp-in-string "\\(.*\\)pbpaste" "\\1pbcopy" xclip-program 'fixedcase)))) ('getclip (when (memq type '(clipboard CLIPBOARD)) - (start-file-process + (start-process "putclip" nil (replace-regexp-in-string "\\(.*\\)getclip" "\\1putclip" xclip-program 'fixedcase)))) ('xclip (when (getenv "DISPLAY") - (start-file-process "xclip" nil xclip-program - "-selection" (symbol-name type)))) + (start-process "xclip" nil xclip-program + "-selection" (symbol-name type)))) ('xsel (when (and (getenv "DISPLAY") (memq type '(clipboard CLIPBOARD primary PRIMARY secondary SECONDARY))) - (start-file-process + (start-process "xsel" nil xclip-program "-i" (concat "--" (downcase (symbol-name type)))))) (method (error "Unknown `xclip-method': %S" method))))) From MAILER-DAEMON Sun Nov 18 21:10:29 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gOZ1A-0003ko-0t for mharc-emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 21:10:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOZ17-0003jM-GZ for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 21:10:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOZ13-00060p-SF for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 21:10:25 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOZ12-0005zX-2T for emacs-elpa-diffs@gnu.org; Sun, 18 Nov 2018 21:10:21 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id A118F209DE; Sun, 18 Nov 2018 21:10:19 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 7cacd8a: * crisp/crisp.el (crisp-home, crisp-end): Obey shift-select-mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181119021018.20585.59641@vcs0.savannah.gnu.org> References: <20181119021018.20585.59641@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 7cacd8a7619db4cacbae3538d3ef50df338ffdd7 Auto-Submitted: auto-generated Message-Id: <20181119021019.A118F209DE@vcs0.savannah.gnu.org> Date: Sun, 18 Nov 2018 21:10:19 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:10:26 -0000 branch: master commit 7cacd8a7619db4cacbae3538d3ef50df338ffdd7 Author: Stefan Monnier Commit: Stefan Monnier * crisp/crisp.el (crisp-home, crisp-end): Obey shift-select-mode --- packages/crisp/crisp.el | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/crisp/crisp.el b/packages/crisp/crisp.el index f37affd..e7835f2 100644 --- a/packages/crisp/crisp.el +++ b/packages/crisp/crisp.el @@ -6,7 +6,7 @@ ;; Maintainer: Luke Lee ;; Keywords: emulations brief crisp ;; Package-Require: ((cl-lib "0.5")) -;; Version: 1.3.5 +;; Version: 1.3.6 =20 ;; This file is part of GNU Emacs. =20 @@ -318,7 +318,7 @@ the region." The first use moves point to beginning of the line. Second consecutive use moves point to beginning of the screen. Third consecutive use moves point to the beginning of the buffer." - (interactive nil) + (interactive "^") (cond ((and (eq last-command 'crisp-home) (eq crisp-last-last-command 'crisp-home)) @@ -334,7 +334,7 @@ consecutive use moves point to the beginning of the b= uffer." The first use moves point to end of the line. Second consecutive use moves point to the end of the screen. Third consecutive use moves point to the end of the buffer." - (interactive nil) + (interactive "^") (cond ((and (eq last-command 'crisp-end) (eq crisp-last-last-command 'crisp-end)) @@ -386,11 +386,6 @@ if ARG is omitted or nil." (t ;; not crisp-mode (cl-callf (lambda (binds) (delq crisp-mode-map binds)) (cdr global-m= ap))))) =20 -;; People might use Apropos on `brief'. -;; Interaction with other packages. -(put 'crisp-home 'CUA 'move) -(put 'crisp-end 'CUA 'move) - (run-hooks 'crisp-load-hook) (provide 'crisp) =20 From MAILER-DAEMON Tue Nov 20 17:10:14 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPEDm-0002cE-4W for mharc-emacs-elpa-diffs@gnu.org; Tue, 20 Nov 2018 17:10:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPEDf-0002Vi-9p for emacs-elpa-diffs@gnu.org; Tue, 20 Nov 2018 17:10:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPEDW-0004V8-2w for emacs-elpa-diffs@gnu.org; Tue, 20 Nov 2018 17:10:06 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:50583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPEDQ-0004N7-2i for emacs-elpa-diffs@gnu.org; Tue, 20 Nov 2018 17:09:54 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 7EBCB204E8; Tue, 20 Nov 2018 17:09:51 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/zones 4fb3967: * zones.el: Update to 2018.11.20 version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181120220949.12851.67103@vcs0.savannah.gnu.org> References: <20181120220949.12851.67103@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/zones X-Git-Reftype: branch X-Git-Rev: 4fb396790ef2cd158dcef257621f7244665a721a Auto-Submitted: auto-generated Message-Id: <20181120220951.7EBCB204E8@vcs0.savannah.gnu.org> Date: Tue, 20 Nov 2018 17:09:51 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 22:10:12 -0000 branch: externals/zones commit 4fb396790ef2cd158dcef257621f7244665a721a Author: Stefan Monnier Commit: Stefan Monnier * zones.el: Update to 2018.11.20 version =20 (zz--fringe-remapping): New var. (zz-set-fringe-for-narrowing): Use face-remapping. (zz-narrowing-use-fringe-flag): Change default to nil. (zz-izones): Remove function. (zz-izone-p): New function. (zz-izones-p): Use it. (zz-zone-abstract-function, zz-zone-abstract-limit): New vars. (zz-zone-abstract-function-default): New function. (zz-select-zone-by-id-and-text, zz-select-region-by-id-and-text): New functions. (zz-select-zone): Use highest available ID, if input is greater than = that. (zz-add-zone): Use string, not boolean 'msg' arg. (zz-delete-zone): Use completion to choose the zone. (zz-readable-marker) : Use buffer name, not buffer. (zz-(add|delete)-zone, zz-izones-from-zones): Use negative ID. (zz-izones-from-zones): Reverse BASIC-ZONES. Lessen identities stated in doc string. (zz-add-key-bindings-to-narrow-map): New function. (global-map): Use it to add the our bindings. (zz-repeat-command): Require repeat.el here rather than in callers. (zz-add-zone-and-unite): MSGP -> MSG (string, not Boolean). (zz-narrow-advice): New function. (narrow-* advice): Use it. --- zones.el | 594 ++++++++++++++++++++++++++++++++++-----------------------= ------ 1 file changed, 322 insertions(+), 272 deletions(-) diff --git a/zones.el b/zones.el index 3fd47a2..c965098 100644 --- a/zones.el +++ b/zones.el @@ -7,11 +7,11 @@ ;; Author: Drew Adams ;; Maintainer: Drew Adams ;; Created: Sun Apr 18 12:58:07 2010 (-0700) -;; Version: 2018.11.13 +;; Version: 2018.11.20 ;; Package-Requires: () -;; Last-Updated: Thu Nov 1 09:46:25 2018 (-0700) +;; Last-Updated: Tue Nov 20 08:04:44 2018 (-0800) ;; By: dradams -;; Update #: 2236 +;; Update #: 2538 ;; URL: https://elpa.gnu.org/packages/zones.html ;; URL: https://www.emacswiki.org/emacs/download/zones.el ;; Doc URL: https://www.emacswiki.org/emacs/Zones @@ -82,7 +82,9 @@ ;; `zz-delete-zone', `zz-narrow', `zz-narrow-repeat', ;; `zz-query-replace-zones' (Emacs 25+), ;; `zz-query-replace-regexp-zones' (Emacs 25+), `zz-select-region', -;; `zz-select-region-repeat', `zz-set-izones-var', +;; `zz-select-region-by-id-and-text', `zz-select-region-repeat', +;; `zz-select-zone', `zz-select-zone-by-id-and-text', +;; `zz-select-zone-repeat', `zz-set-izones-var', ;; `zz-set-zones-from-highlighting', `zz-unite-zones'. ;; ;; User options defined here: @@ -95,14 +97,15 @@ ;; ;; Non-interactive functions defined here: ;; -;; `zz-buffer-narrowed-p' (Emacs 22-23), `zz-buffer-of-markers', -;; `zz-car-<', `zz-do-izones', `zz-do-zones', `zz-dot-pairs', -;; `zz-every', `zz-izone-has-other-buffer-marker-p', -;; `zz-izone-limits', `zz-izone-limits-in-bufs', `zz-izones', -;; `zz-izones-from-noncontiguous-region' (Emacs 25+), -;; `zz-izones-from-zones', `zz-izones-p', `zz-izones-renumber', -;; `zz-map-izones', `zz-map-zones', `zz-marker-from-object', -;; `zz-markerize', `zz-max', `zz-min', `zz-narrowing-lighter', +;; `zz-add-key-bindings-to-narrow-map', `zz-buffer-narrowed-p' +;; (Emacs 22-23), `zz-buffer-of-markers', `zz-car-<', +;; `zz-do-izones', `zz-do-zones', `zz-dot-pairs', `zz-every', +;; `zz-izone-has-other-buffer-marker-p', `zz-izone-limits', +;; `zz-izone-limits-in-bufs', `zz-izones-from-noncontiguous-region' +;; (Emacs 25+), `zz-izones-from-zones', `zz-izone-p', `zz-izones-p', +;; `zz-izones-renumber', `zz-map-izones', `zz-map-zones', +;; `zz-marker-from-object', `zz-markerize', `zz-max', `zz-min', +;; `zz-narrow-advice', `zz-narrowing-lighter', ;; `zz-noncontiguous-region-from-izones', ;; `zz-noncontiguous-region-from-zones', `zz-number-or-marker-p', ;; `zz-overlays-to-zones', `zz-overlay-to-zone', @@ -114,18 +117,20 @@ ;; `zz-remove-zones-w-other-buffer-markers', `zz-repeat-command', ;; `zz-set-intersection', `zz-set-union', `zz-some', ;; `zz-string-match-p', `zz-two-zone-intersection', -;; `zz-two-zone-union', `zz-zone-buffer-name', -;; `zz-zone-has-other-buffer-marker-p', `zz-zone-intersection', -;; `zz-zone-intersection-1', `zz-zone-ordered', -;; `zz-zones-complement', `zz-zones-from-noncontiguous-region' -;; (Emacs 25+), `zz-zones-overlap-p', -;; `zz-zones-same-buffer-name-p', `zz-zones-to-overlays', -;; `zz-zone-to-overlay', `zz-zone-union', `zz-zone-union-1'. +;; `zz-two-zone-union', `zz-zone-abstract-function-default', +;; `zz-zone-buffer-name', `zz-zone-has-other-buffer-marker-p', +;; `zz-zone-intersection', `zz-zone-intersection-1', +;; `zz-zone-ordered', `zz-zones-complement', +;; `zz-zones-from-noncontiguous-region' (Emacs 25+), +;; `zz-zones-overlap-p', `zz-zones-same-buffer-name-p', +;; `zz-zones-to-overlays', `zz-zone-to-overlay', `zz-zone-union', +;; `zz-zone-union-1'. ;; ;; Internal variables defined here: ;; -;; `zz-izones', `zz-izones-var', `zz-lighter-narrowing-part', -;; `zz-add-zone-anyway-p'. +;; `zz--fringe-remapping', `zz-izones', `zz-izones-var', +;; `zz-lighter-narrowing-part', `zz-zone-abstract-function', +;; `zz-zone-abstract-limit', `zz-add-zone-anyway-p'. ;; ;; Macros defined here: ;; @@ -168,19 +173,23 @@ ;; A "basic zone" is a list of two buffer positions followed by a ;; possibly empty list of extra information: (POS1 POS2 . EXTRA). ;; -;; An "izone" is a list whose first element is an identifier that is -;; is a natural number (1, 2, 3,...) and whose cdr is a basic zone: -;; (ID POS1 POS2 . EXTRA). +;; An "izone" is a list whose first element is an identifier, ID, +;; which is a negative integer (-1, -2, -3,...), and whose cdr is a +;; basic zone. So an izone has the form (ID POS1 POS2 . EXTRA). ;; -;; The positions of a zone can be natural numbers (1, 2, 3,...), +;; The ID is negative just to distinguish a basic zone whose EXTRA +;; list starts with an integer from an izone. Interactively (e.g. in +;; prompts), references to the ID typically leave off the minus sign. +;; +;; The positions of a zone can be positive integers (1, 2, 3,...), ;; markers for the same buffer, or readable markers for the same -;; buffer. (Behavior is undefined if a zone has markers for +;; buffer. (Behavior is undefined if a single zone has markers for ;; different buffers.) Each position of a given zone can take any of ;; these forms. ;; ;; A "readable marker" is a list (marker BUFFER POSITION), where ;; BUFFER is a buffer name (string) and where POSITION is a buffer -;; position (number only). +;; position (as an integer, not as a marker). ;; ;; The content of a zone is any contiguous stretch of buffer text. ;; The positions of a zone can be in either numeric order. The @@ -311,7 +320,7 @@ ;; them in any order, and using completion against BEG-END range ;; names. ;; -;; * Select any of them as the active region. Cycle among regions. +;; * Select any of them as the active region. Cycle among them. ;; ;; * Search them (they are automatically coalesced first). For this ;; you need library `isearch-prop.el'. @@ -329,8 +338,8 @@ ;; ;; * Add the active region to a list of zones. ;; -;; * Add the region to a list of zones, and then unite (coalesce) the -;; zones. +;; * Add the active region to a list of zones, and then unite +;; (coalesce) the zones. ;; ;; * Delete an izone from a list of zones. ;; @@ -376,10 +385,10 @@ ;; ;; prefix arg buffer-local set `zz-izones-var' ;; ---------- ------------ ------------------- -;; Plain `C-u' yes yes -;; > 0 (e.g. `C-1') yes no -;; =3D 0 (e.g. `C-0') no yes -;; < 0 (e.g. `C--') no no +;; Plain `C-u' yes yes +;; > 0 (e.g. `C-1') yes no +;; =3D 0 (e.g. `C-0') no yes +;; < 0 (e.g. `C--') no no ;; ;; For example, `C-u C-x n a' (`zz-add-zone') prompts you for a ;; different variable to use, in place of the current value of @@ -400,10 +409,11 @@ ;; ** Keys ** ;; ;; Many of the commands that manipulate izones are bound on keymap -;; `narrow-map'. They are available on prefix key `C-x n', along -;; with the narrowing/widening keys `C-x n d', `C-x n n', `C-x n p', -;; and `C-x n w'. (If you use Emacs 22 then there is no -;; `narrow-map', so the same keys are bound on keymap `ctl-x-map'.) +;; `narrow-map'. So they are available on prefix key `C-x n' (by +;; default), along with the narrowing/widening keys `C-x n d', `C-x n +;; n', `C-x n p', and `C-x n w'. (If you use Emacs 22 then there is +;; no `narrow-map', so the same `n ...' keys are bound on keymap +;; `ctl-x-map'.) ;; ;; If you have already bound one of these keys then `zones.el' does ;; not rebind that key; your bindings are respected. @@ -420,7 +430,7 @@ ;; C-x n L `zz-set-zones-from-highlighting' - Set to highlighted ;; C-x n n `narrow-to-region' ;; C-x n p `narrow-to-page' -;; C-x n r `zz-select-region-repeat' - Cycle as active regions +;; C-x n r `zz-select-zone-repeat' - Cycle as active regions ;; C-x n u `zz-unite-zones' - Unite (coalesce) izones ;; C-x n v `zz-set-izones-var' - Set `zz-izones-var' to a variable ;; C-x n w `widen' @@ -431,10 +441,10 @@ ;; ** Command `zz-narrow-repeat' ** ;; ;; Library `zones.el' modifies commands `narrow-to-region', -;; `narrow-to-defun', and `narrow-to-page' (`C-x n n', `C-x n d', -;; and `C-x n p') so that the current buffer restriction -;; (narrowing) is added to the izone list the current buffer (by -;; default, buffer-local variable `zz-izones'). +;; `narrow-to-defun', and `narrow-to-page' (`C-x n n', `C-x n d', and +;; `C-x n p') so that the current buffer restriction (narrowing) is +;; added to the izone list of the current buffer (by default, +;; buffer-local variable `zz-izones'). ;; ;; You can then use `C-x n x' to cycle among previous buffer ;; narrowings. Repeating `x' repeats the action: `C-x n x x x x' @@ -472,11 +482,10 @@ ;; `-NUM' part uses `zz-narrow-repeat' to cycle to the next ;; narrowing. ;; -;; If option `zz-narrowing-use-fringe-flag' is non-nil, which it is -;; by default, then the face of the selected frame's fringe is set to -;; `zz-fringe-for-narrowing' whenever the buffer is narrowed. This -;; shows you that the current buffer is narrowed even if the -;; mode-line does not. +;; If option `zz-narrowing-use-fringe-flag' is non-nil then the face +;; of the selected frame's fringe is set to `zz-fringe-for-narrowing' +;; whenever the buffer is narrowed. This shows you that the current +;; buffer is narrowed even if the mode-line does not. ;; ;; ;;(@* "Define Your Own Commands") @@ -491,7 +500,8 @@ ;; You can define your own commands that iterate over a list of ;; izones in a given buffer, or over such lists in a set of buffers. ;; Utility functions `zz-izone-limits', `zz-izone-limits-in-bufs', -;; and `zz-read-bufs' can help with this. +;; and `zz-read-bufs', `zz-do-zones', `zz-do-izones', `zz-map-zones', +;; and `zz-map-izones' can help with this. ;; ;; As examples of such commands, if you use library `highlight.el' ;; then you can use `C-x n h' (command `hlt-highlight-regions') to @@ -499,16 +509,16 @@ ;; `C-x n H' (command `hlt-highlight-regions-in-buffers') to do the ;; same across a set of buffers that you specify (or across all ;; visible buffers). If option `hlt-auto-faces-flag' is non-nil then -;; each region gets a different face. Otherwise, all of the regions -;; are highlighted with the same face. Complementary (unbound) -;; commands `hlt-unhighlight-regions' and -;; `hlt-unhighlight-regions-in-buffers' unhighlight. +;; each zone gets a different face. Otherwise, all of the zones are +;; highlighted with the same face. Complementary (unbound) commands +;; `hlt-unhighlight-regions' and `hlt-unhighlight-regions-in-buffers' +;; unhighlight. ;; ;; Defining your own command can be simple or somewhat complex, ;; depending on how the region is used in the code for the ;; corresponding region-action Emacs command. The definition of ;; `hlt-highlight-regions' just calls existing function -;; `hlt-highlight-region' once for each recorded region: +;; `hlt-highlight-region' once for each recorded zone: ;; ;; (defun hlt-highlight-regions (&optional regions face msgp mousep ;; buffers) @@ -519,7 +529,7 @@ ;; face msgp mousep buffers))) ;; ;; That's it - just iterate over `zz-izones' with a function that -;; takes the region as an argument. What `zones.el' offers in this +;; takes a zone as an argument. What `zones.el' offers in this ;; regard is a way to easily define a set of buffer zones. =0C ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -528,6 +538,32 @@ ;; ;;(@* "Change log") ;; +;; 2018/11/20 dadams +;; Added: zz-izone-p. +;; zz-izones-p: Use zz-izone-p. +;; zz-delete-zone: Fixed typo. +;; zz-readable-marker, marker case: Use buffer name, not buffer. +;; zz-delete-zone: Use completion to choose the zone. +;; 2018/11/19 dadams +;; Added: zz-zone-abstract-function, zz-zone-abstract-function-defau= lt, zz-zone-abstract-limit. +;; Removed: function zz-izones. +;; zz-narrowing-use-fringe-flag: Changed default value to nil. +;; zz-select-zone-by-id-and-text: +;; Corrected missing VARIABLE default to zz-izones-var and missing= VARIABLE from interactive spec. +;; Use zz-zone-abstract-function. Use negative ID. +;; zz-select-zone: Use highest available ID, if input is greater tha= n that. +;; zz-(add|delete)-zone, zz-izones-from-zones: Use negative ID. +;; zz-izones-from-zones: Reverse BASIC-ZONES. Lessen identities sta= ted in doc string. +;; 2018/11/18 dadams +;; Added: zz-select-zone-by-id-and-text, zz-select-region-by-id-and-= text. +;; Switched which is main and which is alias: zz-select-(zone|region= )(-repeat): makes zone active. +;; Suggestions from Stefan Monnier: +;; Added: zz--fringe-remapping, zz-add-key-bindings-to-narrow-map. +;; zz-set-fringe-for-narrowing: Remap fringe face (relative) inste= ad of (re)setting it. +;; zz-add-zone: Use string, not Boolean MSG arg. +;; Require repeat.el in zz-repeat-command, not in zz-*-repeat. +;; zz-add-zone-and-unite: MSGP -> MSG (string, not Boolean). +;; Advice for narrow-*: Use zz-narrow-advice. ;; 2018/11/13 dadams ;; Added: zz-do-izones, zz-do-zones, zz-map-izones, zz-map-zones. ;; 2018/11/12 dadams @@ -566,11 +602,11 @@ ;; zz-zone-ordered: Handle also readable markers. ;; Require cl.el at compile time, for case macro. ;; 2018/04/19 dadams -;; Added zz-map-query-replace-regexp-zones, zz-replace-string-zones,= and zz-replace-regexp-zones, after fix -;; of Emacs bug #27897. +;; Added zz-map-query-replace-regexp-zones, zz-replace-string-zones,= and zz-replace-regexp-zones, after +;; fix of Emacs bug #27897. ;; 2018/01/09 dadams ;; zz-readable-marker: -;; If arg is already a readable marker just return it (idempotent)= . If it is a marker then use its buffer. +;; If arg is already a readable marker just return it (idempotent)= . If a marker then use its buffer. ;; If it is a number then use it as is, using BUFFER arg or curren= t buffer name. ;; 2017/08/02 dadams ;; Added: zz-izones-from-noncontiguous-region, zz-zones-from-noncont= iguous-region, @@ -589,7 +625,7 @@ ;; 2015/08/23 dadams ;; Added: zz-clone-zones, zz-clone-and-unite-zones, zz-clone-and-coa= lesce-zones (alias). ;; Bind zz-clone-zones to C-x n c, zz-clone-and-unite-zones to C-x n= C. -;; Added: zz-add-zone-and-unite, zz-unite-zones. Alias zz-add-zone-= and-coalesce, zz-coalesce-zones to them. +;; Added: zz-add-zone-and-unite, zz-unite-zones. Alias zz-add-zone-= and-coalesce, zz-coalesce-zones. ;; Bind zz-unite-zones to C-x n u, not C-x n c. ;; zz-set-izones-var: Corrected interactive spec. ;; zz-remove-zones-w-other-buffer-markers: Typo: RESTR -> ZONE. @@ -685,7 +721,8 @@ ;; wide-n-add-to-union, narrow-to-(region|defun|page): ;; Add nil args for NOT-BUF-LOCAL-P, SET-VAR-P in call to wide-n-p= ush. ;; wide-n-restrictions-p: Test identifier with numberp, not wide-n-n= umber-or-marker-p. -;; wide-n-limits: Added optional args BUFFER, ONLY-ONE-BUFFER-P. Use= wide-n-remove-if-other-buffer-markers. +;; wide-n-limits: Added optional args BUFFER, ONLY-ONE-BUFFER-P. +;; Use wide-n-remove-if-other-buffer-markers. ;; wide-n-limits-in-bufs: ;; Changed optional arg from RESTRICTIONS to VARIABLE (default: wi= de-n-restrictions-var). ;; Corrected case when BUFFERS is nil. @@ -698,8 +735,9 @@ ;; wide-n-push, wide-n-add-to-union, interactive spec: VARIABLE defa= ults to wide-n-restrictions-var value. ;; wide-n-add-to-union: VARIABLE defaults to wide-n-restrictions-var= value non-interactively too. ;; 2015/08/12 dadams -;; wide-n-restrictions, wide-n-select-region, wide-n, wide-n-markeri= ze, wide-n-push, wide-n-restrictions-p, -;; wide-n-delete, wide-n-renumber, wide-n-limits, wide-n-restricti= ons-from-zones, wide-n-unite: +;; wide-n-restrictions, wide-n-select-region, wide-n, wide-n-markeri= ze, wide-n-push, +;; wide-n-restrictions-p, wide-n-delete, wide-n-renumber, wide-n-l= imits, wide-n-restrictions-from-zones, +;; wide-n-unite: ;; INCOMPATIBLE CHANGE: wide-n-restrictions no longer has an "al= l" entry. ;; 2015/08/10 dadams ;; wide-n-markerize: Corrected for format change - second marker is = caddr, not cddr. @@ -721,7 +759,7 @@ ;; wide-n-restrictions (function): Now returns the value of the curr= ent wide-n-restrictions-var variable. ;; wide-n: Use wide-n-restrictions-var, not wide-n-restrictions. ;; wide-n-push, wide-n-delete: -;; Added optional arg VARIABLE. Prefix arg reads it. Use it and = maybe set wide-n-restrictions-var to it. +;; Added optional arg VARIABLE. Prefix arg reads it. Use and may= be set wide-n-restrictions-var to it. ;; Raise error if var is not wide-n-restrictions-p. ;; wide-n-renumber: Added optional arg VARIABLE. ;; wide-n-limits(-in-bufs): Added optional arg RESTRICTIONS. @@ -824,8 +862,8 @@ Don't forget to mention your Emacs and library versio= ns.")) :link '(url-link :tag "Description" "https://www.emacswiki.org/emacs/Z= ones") :link '(emacs-commentary-link :tag "Commentary" "zones")) =20 -(when (or (> emacs-major-version 24) ; Emacs 24.4+ - (and (=3D emacs-major-version 24) (> emacs-minor-version 3)))= ; `reset' arg to `face-spec-set'. +(when (>=3D emacs-major-version 23) ; Emacs 23.1+ + ;; NOTE: Buffer-local face-remapping of fringe is not handled correctl= y until Emacs-27 (Emacs bug#33244). =20 (defface zz-fringe-for-narrowing '((((background dark)) (:background "#FFFF2429FC15")) ; a dark mag= enta @@ -833,7 +871,8 @@ Don't forget to mention your Emacs and library versio= ns.")) "Face used for fringe when buffer is narrowed." :group 'zones :group 'faces) =20 - (defcustom zz-narrowing-use-fringe-flag t + ;; FIXME?: This is really orthogonal to zones. + (defcustom zz-narrowing-use-fringe-flag nil "Non-nil means use fringe face `zz-fringe-for-narrowing' when narrow= ed." :type 'boolean :group 'zones :set (lambda (sym defs) @@ -842,11 +881,24 @@ Don't forget to mention your Emacs and library vers= ions.")) (add-hook 'post-command-hook #'zz-set-fringe-for-narrowin= g) (remove-hook 'post-command-hook #'zz-set-fringe-for-narrowi= ng)))) =20 + (defvar zz--fringe-remapping nil + "Cookie from remapping face `fringe' to `zz-fringe-for-narrowing'. +Deleted by `face-remap-remove-relative' when buffer is widened.") + (with-no-warnings (make-variable-buffer-local 'zz--fringe-remapping)) + (defun zz-set-fringe-for-narrowing () - "Set fringe face if buffer is narrowed." + "Remap face `fringe' to `zz-fringe-for-narrowing' if buffer is narro= wed. +Remove remapping if not narrowed." (if (zz-buffer-narrowed-p) - (copy-face 'zz-fringe-for-narrowing 'fringe (selected-frame)) - (face-spec-set 'fringe (get 'fringe 'face-defface-spec) 'reset))) + (unless zz--fringe-remapping + (setq zz--fringe-remapping (face-remap-add-relative 'fringe '= zz-fringe-for-narrowing)) + ;; FIXME: For some reason, the display is not always redrawn f= ully. + (redraw-frame)) + (when zz--fringe-remapping + (face-remap-remove-relative zz--fringe-remapping) + ;; FIXME: For some reason, the display is not redrawn fully. + (redraw-frame) + (setq zz--fringe-remapping nil)))) =20 ) =20 @@ -856,29 +908,17 @@ Don't forget to mention your Emacs and library vers= ions.")) =20 (defvar zz-izones-var 'zz-izones "The izones variable currently being used. -The variable can be buffer-local or not. If not, then its value can -include markers from multiple buffers. -See also variable `zz-izones'.") +The variable can be buffer-local or not. If it is not then its value +can include markers from multiple buffers. See also variable +`zz-izones'.") =20 (defvar zz-izones () "List of izones. -Each entry is a list (NUM START END), where NUM is a counter -identifying this izone, and START and END are its limits. -This is the default value of variable `zz-izones-var'.") +Each entry is a list (ID START END), where ID is a negative integer +identifying this izone, and START and END are its limits. This is the +default value of variable `zz-izones-var'.") (make-variable-buffer-local 'zz-izones) =20 -;; Not used. Could use this if really needed. -(defun zz-izones () - "Value of current `zz-izones-var' variable, in latest format. -If the value has elements of old format, (NUM START . END), it is -converted to use the new format, with elements (NUM START END). - -This is a destructive operation. The value of the variable is updated -to use the new format, and that value is returned." - (let ((oldval (symbol-value zz-izones-var))) - (dolist (elt oldval) (unless (consp (cddr elt)) (setcdr (cdr elt) (= list (cddr elt))))) - (symbol-value zz-izones-var))) - (defvar zz-add-zone-anyway-p nil "Non-nil means narrowing always updates current `zz-izones-var'. Normally, if a narrowing command is called non-interactively then the @@ -887,6 +927,25 @@ of `zz-izones-var'. A non-nil value here overrides = the push inhibition. You can bind this to non-nil in Lisp code to populate the current `zz-izones-var' during narrowing.") =20 +(defvar zz-zone-abstract-function #'zz-zone-abstract-function-default + "Function used to create an abstract (description) of a zone. +It must accept an izone as its first argument, and it should return a +cons whose care is the abstract (a string).") + +(defvar zz-zone-abstract-limit 68 + "Max number of chars of zone text to include in default zone abstract.= ") + +(defun zz-zone-abstract-function-default (izone) + "Default value of `zz-zone-abstract-function'. +The abstract it produces for IZONE is (the absolute value of) the zone +ID, followed by the first `zz-zone-abstract-limit' chars of the zone +text. The return value of the function is a cons, (ABSTRACT . IZONE), +whose car is the abstract and whose cdr is the izone." + (let ((id (abs (car izone))) + (beg (cadr izone)) + (end (caddr izone))) + (cons (format "%d %s" id (buffer-substring beg (min (+ beg zz-zone-a= bstract-limit) end))) izone))) + ;;;;;;;;;;;;;;;;;;;;;;;;;; =20 (defun zz-zone-ordered (zone) @@ -921,10 +980,12 @@ If the two ZONE positions specify different buffers= , or if either is a marker that points nowhere, then raise an error." (let* ((lim1 (car zone)) (lim2 (cadr zone)) - (buf1 (cond ((markerp lim1) (and (marker-buffer = lim1) (buffer-name (marker-buffer lim1)))) + (buf1 (cond ((markerp lim1) (and (marker-buffer = lim1) + (buffer-name (m= arker-buffer lim1)))) ((zz-readable-marker-p lim1) (cadr lim1)) (t (buffer-name (curren= t-buffer))))) - (buf2 (cond ((markerp lim2) (and (marker-buffer = lim2) (buffer-name (marker-buffer lim2)))) + (buf2 (cond ((markerp lim2) (and (marker-buffer = lim2) + (buffer-name (m= arker-buffer lim2)))) ((zz-readable-marker-p lim2) (cadr lim2)) (t (buffer-name (curren= t-buffer)))))) (unless (and buf1 buf2) (error "Zone has marker(s) that point nowhe= re: %S" zone)) @@ -935,8 +996,7 @@ marker that points nowhere, then raise an error." "Like `zz-map-zones', but without returning the result of mapping. The return value is undefined." (when (functionp function) - (when (zz-izones-p zones) - (setq zones (zz-izone-limits zones nil 'ONLY-THIS-BUFFER))) + (when (zz-izones-p zones) (setq zones (zz-izone-limits zones nil 'O= NLY-THIS-BUFFER))) (setq zones (zz-zone-union zones)) (dolist (zone zones) (funcall function (car zone) (cadr zone))))) =20 @@ -947,8 +1007,7 @@ is, zones that have identifiers. By default, ZONES = is the value of `zz-izones'." (if (not (functionp function)) (or zones zz-izones) - (when (zz-izones-p zones) - (setq zones (zz-izone-limits zones nil 'ONLY-THIS-BUFFER))) + (when (zz-izones-p zones) (setq zones (zz-izone-limits zones nil 'O= NLY-THIS-BUFFER))) (setq zones (zz-zone-union zones)) (mapcar (lambda (zone) (funcall function (car zone) (cadr zone))) zo= nes))) =20 @@ -1063,9 +1122,7 @@ Each car can be a number or a marker. (b1 (and m1 (marker-buffer p1))) (b2 (and m2 (marker-buffer p2)))) (cond ((and (not m1) (not m2)) (< p1 p2)) - ((and m1 m2) (if (eq b1 b2) - (< p1 p2) - (string< (buffer-name b1) (buffer-name b2)))= ) + ((and m1 m2) (if (eq b1 b2) (< p1 p2) (string< (buffer-name= b1) (buffer-name b2)))) (m1 (and (eq (current-buffer) b1) (< p1 p2))) (m2 (or (not (eq (current-buffer) b2)) (< p1 p2))= )))) =20 @@ -1198,19 +1255,52 @@ PREDICATE applied to ELEMENT." ;;;;;;;;;;;;;;;;;;;;;;;;;; =20 ;;;###autoload -(defun zz-select-region (arg &optional msgp) ; Not bound. - "Select a region from among the current set of zones. -The zones are those in the current `zz-izones-var'. -With no prefix arg, select the previous recorded zone. -With a numeric prefix arg N, select the Nth previous zone. +(defalias 'zz-select-region-by-id-and-text #'zz-select-zone-by-id-and-te= xt) +;;;###autoload +(defun zz-select-zone-by-id-and-text (id &optional variable msgp) + "Select a zone by completing against its ID and its text (content). +The text of the chosen zone is made the active region. + +The zones to choose from are those of VARIABLE that are in the current +buffer. VARIABLE defaults to the value of `zz-izones-var'. With a +prefix arg you are prompted for a different variable to use. + +Non-interactively: +* VARIABLE is the optional izones variable to use. +* Non-nil MSGP means show a status message." + (interactive + (let* ((var (or (and current-prefix-arg (zz-read-any-variable "V= ariable: " zz-izones-var t)) + zz-izones-var)) + (izones (zz-remove-izones-w-other-buffer-markers (symbol-valu= e var))) + (num (string-to-number (completing-read "Zone: " + (mapcar zz-zone-ab= stract-function izones) nil t)))) + (list num var t))) + (let* ((izone (assq (- id) (zz-remove-izones-w-other-buffer-markers (= symbol-value variable)))) + (beg (cadr izone)) + (end (caddr izone))) + (goto-char beg) + (push-mark end nil t) + (when msgp (message "Izone #%d selected" (car izone))))) + +;;;###autoload +(defalias 'zz-select-region #'zz-select-zone) +;;;###autoload +(defun zz-select-zone (arg &optional msgp) ; Not bound. + "Select a zone in `zz-izones-var', and make it the active region. +With no prefix arg, select the last-recorded zone. +With a numeric prefix arg N, select the Nth last-recorded zone. =20 Note that if the value of `zz-izones-var' is not buffer-local then you -can use this command to cycle among regions in multiple buffers." +can use this command to cycle among zones in multiple buffers." (interactive "p\np") (let* ((var zz-izones-var) (val (symbol-value var)) - (cntr (abs arg))) + (cntr (abs arg)) + (len (length val))) (unless (cadr val) (error "No zone to select")) + (when (> cntr len) + (when msgp (message "Only %d zones available. Using zone #%d" len= len) (sit-for 1)) + (setq cntr (min cntr len))) (let ((latest ())) (while (> cntr 0) (push (nth (1- cntr) val) latest) @@ -1230,7 +1320,8 @@ can use this command to cycle among regions in mult= iple buffers." (goto-char beg) (push-mark end nil t) (when msgp - (message "Region #%d restored%s" (caar val) (if other-buf (for= mat " in `%s'" other-buf) ""))))))) + (message "Selected zone #%d (in zone-creation order)%s" + (caar val) (if other-buf (format " in `%s'" other-buf= ) ""))))))) =20 ;; This is a non-destructive operation. ;; @@ -1321,7 +1412,7 @@ Put `zz-narrow' on `mouse-2' for the lighter suffix= ." (zz-regexp-car-member regexp (cdr xs))))) =20 ;;;###autoload -(defun zz-add-zone (start end &optional variable not-buf-local-p set-var= -p msgp) ; Bound to `C-x n a'. +(defun zz-add-zone (start end &optional variable not-buf-local-p set-var= -p msg) ; Bound to `C-x n a'. "Add an izone for the text from START to END to the izones of VARIABLE= . Return the new value of VARIABLE. =20 @@ -1338,16 +1429,16 @@ and whether `zz-izones-var' is set to the variabl= e symbol: =20 prefix arg buffer-local set `zz-izones-var' ---------- ------------ ------------------- - Plain `C-u' yes yes - > 0 (e.g. `C-1') yes no - =3D 0 (e.g. `C-0') no yes - < 0 (e.g. `C--') no no + Plain `C-u' yes yes + > 0 (e.g. `C-1') yes no + =3D 0 (e.g. `C-0') no yes + < 0 (e.g. `C--') no no =20 Non-interactively: * VARIABLE is the optional izones variable to use. * Non-nil NOT-BUF-LOCAL-P means do not make VARIABLE buffer-local. * Non-nil SET-VAR-P means set `zz-izones-var' to VARIABLE. -* Non-nil MSGP means echo the region size." +* Non-nil MSG means echo the zone limits, preceded by string MSG." (interactive (let* ((beg (region-beginning)) (end (region-end)) (var (or (and current-prefix-arg (zz-read-any-= variable "Variable: " zz-izones-var)) @@ -1355,7 +1446,7 @@ Non-interactively: (npref (prefix-numeric-value current-prefix-arg)) (nloc (and current-prefix-arg (<=3D npref 0) (= not (boundp var)))) (setv (and current-prefix-arg (or (consp curren= t-prefix-arg) (=3D npref 0))))) - (list beg end var nloc setv t))) + (list beg end var nloc setv "Recorded zone: "))) (let* ((mrk1 (make-marker)) (mrk2 (make-marker)) (var (or variable zz-izones-var)) @@ -1369,66 +1460,45 @@ Non-interactively: (move-marker mrk2 end) (setq sans-id (list mrk1 mrk2) id-cons (rassoc sans-id val) - id (if id-cons (car id-cons) (1+ (length val))) ; 1-base= d, not 0-based. + id (if id-cons (car id-cons) (- (1+ (length val)))) ; 1-= based, not 0-based. val (set var (zz-rassoc-delete-all sans-id val))) ; Destr= uctive operation. (unless (and (=3D mrk1 1) (=3D mrk2 (1+ (buffer-size)))) (set var `= ((,id ,mrk1 ,mrk2) ,@val))) - (when msgp (message "%s region: %d to %d" (if (interactive-p) "Recor= ded" "Narrowed") - (marker-position mrk1) (marker-position mrk2))) + (when msg (message "%s%d to %d" msg (marker-position mrk1) (marker-p= osition mrk2))) (symbol-value var))) =20 ;;;###autoload -(defun zz-delete-zone (n &optional variable not-buf-local-p set-var-p ms= gp) ; Bound to `C-x n C-d'. - "Delete the zone numbered N from VARIABLE, and renumber those remainin= g. +(defun zz-delete-zone (id &optional variable msgp) ; Bound to `C-x n C-d= '. + "Delete a zone by completing against its ID and its text (content). +Delete the zone from VARIABLE, and renumber those remaining. Return the new value of VARIABLE. =20 This is a destructive operation: The list structure of the variable value can be modified. =20 -You are prompted for the number N. -VARIABLE defaults to the value of `zz-izones-var'. - -With a prefix arg you are prompted for a different variable to use, in -place of the current value of `zz-izones-var'. The -particular prefix arg determines whether the variable, if unbound, is -made buffer-local, and whether `zz-izones-var' is set to the -variable symbol: - - prefix arg buffer-local set `zz-izones-var' - ---------- ------------ ------------------- - Plain `C-u' yes yes - > 0 (e.g. `C-1') yes no - =3D 0 (e.g. `C-0') no yes - < 0 (e.g. `C--') no no +VARIABLE defaults to the value of `zz-izones-var'. With a prefix arg +you are prompted for a different variable to use. =20 Non-nil optional arg NOMSG means do not display a status message." (interactive - (let* ((var (or (and current-prefix-arg (zz-read-any-variable "= Variable: " zz-izones-var)) + (let* ((var (or (and current-prefix-arg (zz-read-any-variable "V= ariable: " zz-izones-var t)) zz-izones-var)) - (npref (prefix-numeric-value current-prefix-arg)) - (nloc (and current-prefix-arg (<=3D npref 0) (not (bound= p var)))) - (setv (and current-prefix-arg (or (consp current-prefix-a= rg) (=3D npref 0)))) - ;; Repeat all of the variable tests and actions, since we need= to have the value, for its length. - (_IGNORE (unless nloc (make-local-variable var))) - (_IGNORE (when setv (setq zz-izones-var var))) - (_IGNORE (unless (boundp var) (set var ()))) - (val (symbol-value var)) - (_IGNORE (unless (zz-izones-p val) - (error "Not an izones variable: `%s', value: `%S'"= var val))) - (_IGNORE (unless val (error "No zones - variable `%s' is empt= y" var))) - (len (length val)) - (num (if (=3D len 1) 1 (read-number (format "Delete zone = numbered (1 to %d): " len))))) - (while (or (< num 1) (> num len)) - (setq num (read-number (format "Number must be between 1 and %d:= " len)))) - (list num var nloc setv t))) + (izones (symbol-value var)) + (_IGNORE (unless (zz-izones-p izones) + (error "Not an izones variable: `%s', value: `%S'"= var izones))) + (_IGNORE (unless izones (error "No zones - variable `%s' is e= mpty" var))) + (len (length izones)) + (num (if (=3D len 1) + 1 + (string-to-number (completing-read (format "Delete= zone with ID (1 to %d): " len) + (mapcar zz-zone= -abstract-function izones) nil t))))) + (list num var t))) (unless variable (setq variable zz-izones-var)) - (unless (or not-buf-local-p (boundp variable)) (make-local-variable v= ariable)) - (when set-var-p (setq zz-izones-var variable)) - (let ((val (symbol-value variable))) - (unless (zz-izones-p val) (error "Not an izones variable: `%s', valu= e: `%S'" variable val)) - (unless val (error "No zones - variable `%s' is empty" variable)) - (set variable (assq-delete-all n val))) + (let ((izones (symbol-value variable))) + (unless (zz-izones-p izones) (error "Not an izones variable: `%s', v= alue: `%S'" variable izones)) + (unless izones (error "No zones - variable `%s' is empty" variable)) + (set variable (assq-delete-all (- id) izones))) (zz-izones-renumber variable) - (when msgp (message "Deleted zone numbered %d" n)) + (when msgp (message "Deleted zone with ID %d" id)) (symbol-value variable)) =20 (defun zz-markerize (izone) @@ -1442,7 +1512,7 @@ This is a non-destructive operation: it returns a n= ew list." posn) (while (< ii 3) (setq posn (nth ii izone)) - (when (and (not (markerp posn)) (or (numberp posn) (zz-readable-= marker-p posn))) + (when (and (not (markerp posn)) (or (natnump posn) (zz-readable-= marker-p posn))) (setcar (nthcdr ii izone) (zz-marker-from-object posn))) (setq ii (1+ ii)))) izone) @@ -1467,15 +1537,16 @@ BUFFER is a buffer name (string) and POSITION is = a buffer position =20 (defun zz-number-or-marker-p (position) "Return non-nil if POSITION is a number, marker, or readable-marker ob= ject." + ;; Just like `number-or-marker-p', We don't check that a number arg is= a positive integer. (or (number-or-marker-p position) (zz-readable-marker-p position))) =20 (defun zz-readable-marker-p (object) "Return non-nil if OBJECT is a readable marker. That is, it has form (marker BUFFER POSITION), where BUFFER is a -buffer name (string) and POSITION is a buffer position (number). +buffer name (string), and POSITION is a buffer position (integer). OBJECT is returned." (and (consp object) (consp (cdr object)) (consp (cddr object)) - (eq 'marker (nth 0 object)) (stringp (nth 1 object)) (numberp (= nth 2 object)) + (eq 'marker (nth 0 object)) (stringp (nth 1 object)) (integerp = (nth 2 object)) object)) =20 (defun zz-readable-marker (number-or-marker &optional num-buffer) @@ -1489,16 +1560,17 @@ POSITION is a buffer position (number). =20 If NUMBER-OR-MARKER is itself a readable marker then return it. =20 -If NUMBER-OR-MARKER is a marker then its buffer is used as BUFFER. +If NUMBER-OR-MARKER is a marker then use its buffer name as BUFFER. =20 If NUMBER-OR-MARKER is a number then: - If NUM-BUFFER names an existing buffer then it is used as BUFFER. - Else the name of the current buffer is used as BUFFER. + If NUM-BUFFER names an existing buffer then use it as BUFFER. + Else use the name of the current buffer as BUFFER. =20 This is a non-destructive operation." + ;; Just like `number-or-marker-p', We don't check that a number arg is= a positive integer. (cond ((zz-readable-marker-p number-or-marker) number-or-marker) ((markerp number-or-marker) - `(marker ,(marker-buffer number-or-marker) ,(marker-position nu= mber-or-marker))) + `(marker ,(buffer-name (marker-buffer number-or-marker)) ,(mark= er-position number-or-marker))) ((numberp number-or-marker) `(marker ,(buffer-name (or (and (stringp num-buffer) (get-buffer num-= buffer)) (current-buffer))) @@ -1511,15 +1583,22 @@ That is, non-nil means that VALUE has the form of= `zz-izones'." (and (listp value) (listp (cdr (last value))) ; Proper list. (let ((res t)) (catch 'zz-izones-p - (dolist (nn value) - (unless (setq res (and (consp nn) (condition-case nil - (and (numberp (nth = 0 nn)) - (zz-number-or-= marker-p (nth 1 nn)) - (zz-number-or-= marker-p (nth 2 nn))) - (error nil)))) - (throw 'zz-izones-p nil)))) + (dolist (xx value) + (unless (setq res (zz-izone-p xx)) (throw 'zz-izones-p nil= )))) res))) =20 +(defun zz-izone-p (value) + "Return non-nil if VALUE is an izone. +That is, non-nil means it has the form (ID POS1 POS2 . EXTRA), +where ID is a negative integer, and each POS is a buffer-position +representation (`zz-number-or-marker-p')." + (and (consp value) (condition-case nil + (and (integerp (nth 0 value)) + (< (nth 0 value) 0) + (zz-number-or-marker-p (nth 1 value)) + (zz-number-or-marker-p (nth 2 value))) + (error nil)))) + (defun zz-rassoc-delete-all (value alist) "Delete from ALIST all elements whose cdr is `equal' to VALUE. Elements of ALIST that are not conses are ignored. @@ -1542,7 +1621,7 @@ value can be modified." (let* ((var (or variable zz-izones-var)) (orig (symbol-value var))) (set var ()) - (dolist (nn orig) (zz-add-zone (cadr nn) (car (cddr nn)) var)))) + (dolist (iz orig) (zz-add-zone (cadr iz) (car (cddr iz)) var)))) =20 ;; Non-destructive version. ;; @@ -1562,8 +1641,8 @@ value can be modified." ;; (dolist (buf (or (reverse buffers) (list (current-buffer)))) ; = Reverse so we keep the order. ;; (with-current-buffer buf ;; (setq limits (append (zz-izone-limits (symbol-value (or vari= able zz-izones-var)) -;; buf -;; 'ONLY-THIS-BUFFER) +;; buf +;; 'ONLY-THIS-BUFFER) ;; limits)))) ;; limits)) =20 @@ -1587,7 +1666,7 @@ buffer (or in the current buffer, if BUFFERS is nil= )." =20 (defun zz-izone-limits (&optional izones buffer only-one-buffer-p) "Return a list like IZONES, but with no identifiers. -That is, return a list of zones, (LIMIT1 LIMIT2). +That is, return a list of zones, (LIMIT1 LIMIT2 . EXTRA). =20 This is a non-destructive operation: A new list is returned. =20 @@ -1606,7 +1685,7 @@ contain markers for a buffer other than BUFFER." (when only-one-buffer-p (setq restrs (zz-remove-izones-w-other-buff= er-markers restrs))) (delq nil (mapcar #'cdr restrs)))) =20 -;; Useful for commands that want to act on regions in multiple buffers. +;; Useful for commands that want to act on zones in multiple buffers. (defun zz-read-bufs () "Read names of buffers, one at a time. `C-g' ends reading." (let ((bufs ()) @@ -1660,7 +1739,7 @@ BUFFER is the buffer to compare with (default: curr= ent buffer)." (dolist (x xs) (unless (funcall pred x) (push x result))) (nreverse result))) =20 -;; Useful for commands that want to act on regions in multiple buffers = (e.g., visible buffers only). +;; Useful for commands that want to act on zones in multiple buffers (e.= g., visible buffers only). ;; ;; Same as `icicle-remove-if-not' etc. (defun zz-remove-if-not (pred xs) @@ -1706,10 +1785,11 @@ reads any symbol, but it provides completion agai= nst variable names." =20 (defun zz-repeat-command (command) "Repeat COMMAND." - (let ((repeat-previous-repeated-command command) - (repeat-message-function #'ignore) - (last-repeatable-command 'repeat)) - (repeat nil))) + (require 'repeat) ;Define its vars before we let-bin= d them! + (let ((repeat-previous-repeated-command command) + (repeat-message-function #'ignore) + (last-repeatable-command 'repeat)) + (repeat nil))) =20 ;;;###autoload (defun zz-narrow-repeat () ; Bound to `C-x n x'. @@ -1717,32 +1797,35 @@ reads any symbol, but it provides completion agai= nst variable names." This is a repeatable version of `zz-narrow'. =20 Note that if the value of `zz-izones-var' is not buffer-local then you -can use this command to cycle among regions in multiple buffers." +can use this command to cycle among zones in multiple buffers." (interactive) - (require 'repeat) (zz-repeat-command 'zz-narrow)) =20 ;;;###autoload -(defun zz-select-region-repeat () ; Bound to `C-x n r'. - "Cycle to the next region. -This is a repeatable version of `zz-select-region'." +(defalias 'zz-select-region-repeat #'zz-select-zone-repeat) +;;;###autoload +(defun zz-select-zone-repeat () ; Bound to `C-x n r'. + "Cycle to the next zone, and make it the active region. +Zones are cycled in chronological order of their recording. +This is a repeatable version of `zz-select-zone'." (interactive) - (require 'repeat) - (zz-repeat-command 'zz-select-region)) + (zz-repeat-command 'zz-select-zone)) =20 (defun zz-izones-from-zones (basic-zones) - "Return a list of regions like `zz-izones', based on BASIC-ZONES. + "Return a list of zones like `zz-izones', based on BASIC-ZONES. Each zone in the list BASIC-ZONES has form (LIMIT1 LIMIT2 . EXTRA), where each of the limits is a buffer position (a number or marker) and EXTRA is a list. =20 This is a non-destructive operation. A new list is returned. =20 -\(zz-izones-from-zones (zz-izone-limits)) =3D zz-izones -and -\(zz-izone-limits (zz-izones-from-zones BASIC-ZONES)) =3D BASIC-ZONES" +\(zz-izone-limits (zz-izones-from-zones BASIC-ZONES)) =3D BASIC-ZONES + +Also, (zz-izones-from-zones (zz-izone-limits)) returns the same set of +izones as `zz-izones', but possibly with different IDs associated with +the basic zones." (let ((ii 0)) - (nreverse (mapcar (lambda (zz) (cons (setq ii (1+ ii)) zz)) basic-z= ones)))) + (nreverse (mapcar (lambda (zz) (cons (- (setq ii (1+ ii))) zz)) (re= verse basic-zones))))) =20 ;;;###autoload (defun zz-set-izones-var (variable &optional localp) ; Bound to `C-x n v= ' @@ -1771,7 +1854,7 @@ FROM-VARIABLE defaults to the value of `zz-izones-v= ar'. =20 Non-interactively: Non-nil MSGP means show a status message." (interactive - (let ((from-var (zz-read-any-variable "Copy variable: " zz-izones-va= r)) + (let ((from-var (zz-read-any-variable "Copy variable: " zz-izones-va= r t)) (to-var (zz-read-any-variable "To variable: ")) (npref (and current-prefix-arg (prefix-numeric-value curre= nt-prefix-arg)))) (when (and npref (>=3D npref 0)) (make-local-variable to-var)) @@ -1788,6 +1871,11 @@ Non-interactively: Non-nil MSGP means show a statu= s message." That is, use`zz-clone-zones' to fill TO-VARIABLE, then use `zz-unite-zones' on TO-VARIABLE. =20 +Just as for `zz-clone-zones': + With a non-negative (>=3D 0) prefix arg, make TO-VARIABLE buffer-local. + With a non-positive (<=3D 0) prefix arg, set `zz-izones-var' to the + TO-VARIABLE symbol. (Zero: do both.) + United zones are in ascending order of their cars. Return the new value of TO-VARIABLE. =20 @@ -1800,7 +1888,7 @@ FROM-VARIABLE defaults to the value of `zz-izones-v= ar'. =20 Non-interactively: Non-nil MSGP means show a status message." (interactive - (let ((from-var (zz-read-any-variable "Copy variable: " zz-izones-va= r)) + (let ((from-var (zz-read-any-variable "Copy variable: " zz-izones-va= r t)) (to-var (zz-read-any-variable "To variable: ")) (npref (and current-prefix-arg (prefix-numeric-value curre= nt-prefix-arg)))) (when (and npref (>=3D npref 0)) (make-local-variable to-var)) @@ -1830,7 +1918,7 @@ variable symbol. (Zero: do both.) Non-interactively: * VARIABLE is the optional izones variable to use. * Non-nil MSGP means show a status message." - (interactive (let* ((var (and current-prefix-arg (zz-read-any-vari= able "Variable: " zz-izones-var))) + (interactive (let* ((var (and current-prefix-arg (zz-read-any-vari= able "Variable: " zz-izones-var t))) (npref (prefix-numeric-value current-prefix-arg))= ) (when (and current-prefix-arg (>=3D npref 0)) (make-lo= cal-variable var)) (when (and current-prefix-arg (<=3D npref 0)) (setq zz= -izones-var var)) @@ -1849,7 +1937,7 @@ Non-interactively: ;;;###autoload (defalias 'zz-add-zone-and-coalesce #'zz-add-zone-and-unite) ;;;###autoload -(defun zz-add-zone-and-unite (start end &optional variable msgp) ; Bound= to `C-x n A'. +(defun zz-add-zone-and-unite (start end &optional variable msg) ; Bound = to `C-x n A'. "Add an izone from START to END to those of VARIABLE, and coalesce. Use `zz-add-zone', then apply `zz-unite-zones'. United zones are in ascending order of their cars. @@ -1869,7 +1957,8 @@ variable symbol. (Zero: do both.) =20 Non-interactively: * VARIABLE is the optional izones variable to use. -* Non-nil MSGP means echo the size of the added zone." +* Non-nil MSG means echo messages for adding the zone and uniting + zones. In this case MSG is the message prefix for `zz-add-zone'." (interactive (let ((beg (region-beginning)) (end (region-end)) (var (or (and current-prefix-arg (zz-read-any-v= ariable "Variable: " zz-izones-var)) @@ -1877,10 +1966,10 @@ Non-interactively: (npref (prefix-numeric-value current-prefix-arg))) (when (and current-prefix-arg (>=3D npref 0)) (make-lo= cal-variable var)) (when (and current-prefix-arg (<=3D npref 0)) (setq zz= -izones-var var)) - (list beg end var t))) + (list beg end var "Zone recorded: "))) (unless variable (setq variable zz-izones-var)) - (zz-add-zone start end variable nil nil msgp) - (zz-unite-zones variable msgp) + (zz-add-zone start end variable nil nil msg) + (zz-unite-zones variable msg) (symbol-value variable)) =20 ;;;###autoload @@ -1980,7 +2069,7 @@ current zones instead of adding to them." (zz-add-zones-from-highlighting start end face only-hlt-face overlay/t= ext fonk-lock-p msgp)) =20 ;;;###autoload -(defun zz-create-face-zones (face &optional start end variable msgp) +(defun zz-create-face-zones (face &optional start end variable) "Set an izones variable to (united) zones of a face or background colo= r. You are prompted for a face name or a color name. If you enter a color, it is used for the face background. The face foreground is @@ -1997,7 +2086,7 @@ The variable defaults to `zz-izones'. With a prefi= x arg you are zz-izones-var))) (if (hlt-nonempty-region-p) (if (< (point) (mark)) (list (point) (mark) var t) (list (mar= k) (point) var t)) - (list fac (point-min) (point-max) var t))))) + (list fac (point-min) (point-max) var))))) (unless (require 'highlight nil t) (error "You need library `highlight.el' for this command")) (unless (require 'isearch-prop nil t) @@ -2009,82 +2098,45 @@ The variable defaults to `zz-izones'. With a pre= fix arg you are (zz-unite-zones variable t)) =20 ;;--------------------- - -(cond ((boundp 'narrow-map) ; Emacs 23+ - (unless (lookup-key narrow-map "a") - (define-key narrow-map "a" 'zz-add-zone)) - (unless (lookup-key narrow-map "A") - (define-key narrow-map "A" 'zz-add-zone-and-unite)) - (unless (lookup-key narrow-map "c") - (define-key narrow-map "c" 'zz-clone-zones)) - (unless (lookup-key narrow-map "C") - (define-key narrow-map "C" 'zz-clone-and-unite-zones)) - (unless (lookup-key narrow-map "\C-d") - (define-key narrow-map "\C-d" 'zz-delete-zone)) - (unless (lookup-key narrow-map "r") - (define-key narrow-map "r" (if (> emacs-major-version 21) 'z= z-select-region-repeat 'zz-select-region))) - (unless (lookup-key narrow-map "u") - (define-key narrow-map "u" 'zz-unite-zones)) - (unless (lookup-key narrow-map "v") - (define-key narrow-map "v" 'zz-set-izones-var)) - (unless (lookup-key narrow-map "x") - (define-key narrow-map "x" 'zz-narrow-repeat))) - (t - (unless (lookup-key ctl-x-map "na") - (define-key ctl-x-map "na" 'zz-add-zone)) - (unless (lookup-key ctl-x-map "nA") - (define-key ctl-x-map "nA" 'zz-add-zone-and-unite)) - (unless (lookup-key ctl-x-map "nc") - (define-key ctl-x-map "nc" 'zz-clone-zones)) - (unless (lookup-key ctl-x-map "nC") - (define-key ctl-x-map "nC" 'zz-clone-and-unite-zones)) - (unless (lookup-key ctl-x-map "n\C-d") - (define-key ctl-x-map "n\C-d" 'zz-delete-zone)) - (unless (lookup-key ctl-x-map "nr") - (define-key ctl-x-map "nr" (if (> emacs-major-version 21) 'z= z-select-region-repeat 'zz-select-region))) - (unless (lookup-key ctl-x-map "nu") - (define-key ctl-x-map "nu" 'zz-unite-zones)) - (unless (lookup-key ctl-x-map "nv") - (define-key ctl-x-map "nv" 'zz-set-izones-var)) - (unless (lookup-key ctl-x-map "nx") - (define-key ctl-x-map "nx" (if (> emacs-major-version 21) 'z= z-narrow-repeat 'zz-narrow))))) +(defun zz-add-key-bindings-to-narrow-map (bindings) + "Add BINDINGS to `narrow-map'. +\(For Emacs prior to Emacs 24, add bindings to prefix key `C-x n'.)" + (let ((map (if (boundp 'narrow-map) narrow-map (lookup-key ctl-x-map = "n")))) + (when (keymapp map) + (dolist (binding bindings) + (let ((kseq (car binding)) + (cmd (cdr binding))) + (unless (lookup-key map kseq) (define-key map kseq cmd))))))) + +(zz-add-key-bindings-to-narrow-map '(("a" . zz-add-zone) + ("A" . zz-add-zone-and-unite) + ("c" . zz-clone-zones) + ("C" . zz-clone-and-unite-zones) + ("\C-d" . zz-delete-zone) + ("r" . zz-select-zone-repeat) + ("u" . zz-unite-zones) + ("v" . zz-set-izones-var) + ("x" . zz-narrow-repeat))) =20 (eval-after-load "highlight" - '(cond - ((boundp 'narrow-map) ; Emacs 23+ - (unless (lookup-key narrow-map "h") - (define-key narrow-map "h" 'hlt-highlight-regions)) - (unless (lookup-key narrow-map "H") - (define-key narrow-map "H" 'hlt-highlight-regions-in-buffers)) - (unless (lookup-key narrow-map "l") - (define-key narrow-map "l" 'zz-add-zones-from-highlighting)) - (unless (lookup-key narrow-map "L") - (define-key narrow-map "L" 'zz-set-zones-from-highlighting))) - (t - (unless (lookup-key ctl-x-map "nh") - (define-key ctl-x-map "nh" 'hlt-highlight-regions)) - (unless (lookup-key ctl-x-map "nH") - (define-key ctl-x-map "nH" 'hlt-highlight-regions-in-buffers)) - (unless (lookup-key ctl-x-map "nl") - (define-key ctl-x-map "nl" 'zz-add-zones-from-highlighting)) - (unless (lookup-key ctl-x-map "nL") - (define-key ctl-x-map "nL" 'zz-set-zones-from-highlighting))))) - + '(zz-add-key-bindings-to-narrow-map '(("h" . hlt-highlight-regions) + ("H" . hlt-highlight-regions-in-= buffers) + ("l" . zz-add-zones-from-highlig= hting) + ("L" . zz-set-zones-from-highlig= hting)))) =20 ;; Call `zz-add-zone' if interactive or if `zz-add-zone-anyway-p'. -;; -(defadvice narrow-to-region (before zz-add-zone--region activate) + +(defun zz-narrow-advice (interactive-p) + (when (or interactive-p zz-add-zone-anyway-p) + (zz-add-zone (point-min) (point-max) nil nil nil "Narrowed, and reco= rded zone: "))) + +(defadvice narrow-to-region (after zz-add-zone--region activate) "Push the region limits to the current `zz-izones-var'. You can use `C-x n x' to widen to a previous buffer restriction. =20 This is a destructive operation. The list structure of the variable value can be modified." - (when (or (interactive-p) zz-add-zone-anyway-p) - (let ((start (ad-get-arg 0)) - (end (ad-get-arg 1))) - (unless start (setq start (region-beginning))) ; Needed? (was nee= ded for Emacs 20). - (unless end (setq end (region-end))) - (zz-add-zone start end nil nil nil 'MSG)))) + (zz-narrow-advice (interactive-p))) =20 (defadvice narrow-to-defun (after zz-add-zone--defun activate) "Push the defun limits to the current `zz-izones-var'. @@ -2092,8 +2144,7 @@ You can use `C-x n x' to widen to a previous buffer= restriction. =20 This is a destructive operation. The list structure of the variable value can be modified." - (when (or (interactive-p) zz-add-zone-anyway-p) - (zz-add-zone (point-min) (point-max) nil nil nil 'MSG))) + (zz-narrow-advice (interactive-p))) =20 ;; Call `zz-add-zone' if interactive or `zz-add-zone-anyway-p'. ;; @@ -2103,8 +2154,7 @@ You can use `C-x n x' to widen to a previous buffer= restriction. =20 This is a destructive operation. The list structure of the variable value can be modified." - (when (or (interactive-p) zz-add-zone-anyway-p) - (zz-add-zone (point-min) (point-max) nil nil nil 'MSG))) + (zz-narrow-advice (interactive-p))) =20 (when (> emacs-major-version 24) =20 From MAILER-DAEMON Thu Nov 22 19:15:29 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz85-0005A4-4O for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz83-00058y-G6 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz82-000206-My for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:27 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz82-0001yu-Ht for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:26 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 78F81209A2; Thu, 22 Nov 2018 19:15:26 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 489080b 02/45: eglot-ignored-server-capabilites: Prefer all choices over "Other" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 489080bd2058005c081c2e20125d0a128fb66883 Auto-Submitted: auto-generated Message-Id: <20181123001526.78F81209A2@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:26 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:28 -0000 branch: externals/eglot commit 489080bd2058005c081c2e20125d0a128fb66883 Author: Micha=C5=82 Krzywkowski Commit: Micha=C5=82 Krzywkowski eglot-ignored-server-capabilites: Prefer all choices over "Other" =20 Previously the "Other" choice matched every value, so it was always shown in the customize buffer. =20 * eglot.el (eglot-ignored-server-capabilites): Make the "Other" choic= e the last possible option. --- eglot.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eglot.el b/eglot.el index 8014024..b660683 100644 --- a/eglot.el +++ b/eglot.el @@ -747,7 +747,6 @@ You could add, for instance, the symbol under cursor." :type '(repeat (choice - (symbol :tag "Other") (const :tag "Documentation on hover" :hoverProvider) (const :tag "Code completion" :completionProvider) (const :tag "Function signature help" :signatureHelpProvider) @@ -767,7 +766,8 @@ under cursor." (const :tag "Highlight links in document" :documentLinkProvid= er) (const :tag "Decorate color references" :colorProvider) (const :tag "Fold regions of buffer" :foldingRangeProvider) - (const :tag "Execute custom commands" :executeCommandProvider= )))) + (const :tag "Execute custom commands" :executeCommandProvider= ) + (symbol :tag "Other")))) =20 (defun eglot--server-capable (&rest feats) "Determine if current server is capable of FEATS." From MAILER-DAEMON Thu Nov 22 19:15:30 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz86-0005CL-FN for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz83-00058x-Ep for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz82-0001zN-Jv for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:27 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz82-0001xq-FA for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:26 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 520A420950; Thu, 22 Nov 2018 19:15:26 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 69b8428 01/45: Make eglot-ignored-server-capabilites more user-friendly (#126) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, mkcms In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 69b8428a86344bc913b5ada491b34e2e6e3a17fb Auto-Submitted: auto-generated Message-Id: <20181123001526.520A420950@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:26 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:29 -0000 branch: externals/eglot commit 69b8428a86344bc913b5ada491b34e2e6e3a17fb Author: mkcms Commit: Jo=C3=A3o T=C3=A1vora Make eglot-ignored-server-capabilites more user-friendly (#126) =20 * eglot.el (eglot-ignored-server-capabilites): Add list of possible choices to :type, along with a user-friendly description. --- eglot.el | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index d2ec929..8014024 100644 --- a/eglot.el +++ b/eglot.el @@ -745,7 +745,29 @@ Doubles as an indicator of snippet support." You could add, for instance, the symbol `:documentHighlightProvider' to prevent automatic highlighting under cursor." - :type '(repeat symbol)) + :type '(repeat + (choice + (symbol :tag "Other") + (const :tag "Documentation on hover" :hoverProvider) + (const :tag "Code completion" :completionProvider) + (const :tag "Function signature help" :signatureHelpProvider) + (const :tag "Go to definition" :definitionProvider) + (const :tag "Go to type definition" :typeDefinitionProvider) + (const :tag "Go to implementation" :implementationProvider) + (const :tag "Find references" :referencesProvider) + (const :tag "Highlight symbols automatically" :documentHighli= ghtProvider) + (const :tag "List symbols in buffer" :documentSymbolProvider) + (const :tag "List symbols in workspace" :workspaceSymbolProvi= der) + (const :tag "Execute code actions" :codeActionProvider) + (const :tag "Code lens" :codeLensProvider) + (const :tag "Format buffer" :documentFormattingProvider) + (const :tag "Format portion of buffer" :documentRangeFormatti= ngProvider) + (const :tag "On-type formatting" :documentOnTypeFormattingPro= vider) + (const :tag "Rename symbol" :renameProvider) + (const :tag "Highlight links in document" :documentLinkProvid= er) + (const :tag "Decorate color references" :colorProvider) + (const :tag "Fold regions of buffer" :foldingRangeProvider) + (const :tag "Execute custom commands" :executeCommandProvider= )))) =20 (defun eglot--server-capable (&rest feats) "Determine if current server is capable of FEATS." From MAILER-DAEMON Thu Nov 22 19:15:30 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz86-0005Cn-Jx for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz84-000591-5w for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz82-00020f-QA for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:28 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz82-00020C-Mj for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:26 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id A3DA4204D7; Thu, 22 Nov 2018 19:15:26 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 31fcd91 03/45: Handle case when diagnostic :character is out of range MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?TWljaGHFgiBL?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 31fcd91f4f056f7d46e5ca5e168b9ec94023d324 Auto-Submitted: auto-generated Message-Id: <20181123001526.A3DA4204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:26 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:29 -0000 branch: externals/eglot commit 31fcd91f4f056f7d46e5ca5e168b9ec94023d324 Author: Micha=C5=82 K Commit: Micha=C5=82 Krzywkowski Handle case when diagnostic :character is out of range =20 * eglot.el (eglot-handle-notification): Don't error out when flymake-diag-region returns nil. --- eglot.el | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/eglot.el b/eglot.el index 8014024..b25d8b9 100644 --- a/eglot.el +++ b/eglot.el @@ -1080,14 +1080,21 @@ COMMAND is a symbol naming the command." ((`(,beg . ,end) (eglot--range-region range))) ;; Fallback to `flymake-diag-region' if server ;; botched the range - (if (=3D beg end) - (let* ((st (plist-get range :start)) - (diag-region - (flymake-diag-region - (current-buffer) (1+ (plist-get st :li= ne)) - (plist-get st :character)))) - (setq beg (car diag-region) - end (cdr diag-region)))) + (when (=3D beg end) + (if-let* ((st (plist-get range :start)) + (diag-region + (flymake-diag-region + (current-buffer) (1+ (plist-get st :l= ine)) + (plist-get st :character)))) + (setq beg (car diag-region) end (cdr diag-reg= ion)) + (eglot--widening + (goto-char (point-min)) + (setq beg + (point-at-bol + (1+ (plist-get (plist-get range :start)= :line)))) + (setq end + (point-at-eol + (1+ (plist-get (plist-get range :end) := line))))))) (eglot--make-diag (current-buffer) beg end (cond ((<=3D sev 1) 'eglot-error) ((=3D sev 2) 'eglot-warnin= g) From MAILER-DAEMON Thu Nov 22 19:15:31 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz87-0005Dn-9B for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz83-00058z-QT for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz82-0001zh-LG for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:27 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz82-0001x2-FA for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:26 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 1D63F204D7; Thu, 22 Nov 2018 19:15:26 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot updated (821b498 -> f291816) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Oldrev: 821b4980caa0cc3379f0890c66cf05897229b0d5 X-Git-Newrev: f2918166de7229e6e09096ba4d11c574e504dee5 Auto-Submitted: auto-generated Date: Thu, 22 Nov 2018 19:15:25 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:30 -0000 capitaomorte pushed a change to branch externals/eglot. from 821b498 Correctly map DocumentSymbol's :kind to its name (#= 121) new 69b8428 Make eglot-ignored-server-capabilites more user-fri= endly (#126) new 489080b eglot-ignored-server-capabilites: Prefer all choice= s over "Other" new 31fcd91 Handle case when diagnostic :character is out of ra= nge new 9585b74 Merge pull request #104 from mkcms/fix-diagnostics-= wrong-type-argument new 5571f10 Sort references and definitions by line number new ff04bc0 Improve signature help new a406190 Per #63: Allow function contacts to be interactive new f0b5367 Per #63: Add support for eclipse.jdt.ls server new c795e3e Override eglot-execute-command for eclipse.jdt.ls s= erver new f250784 Handle case when project was not found in eclipse.j= dt.ls contact new 6ebbd36 Add tests for eclipse.jdt.ls connection new 5b043fb * .travis.yml (install): Download eclipse.jdt.ls se= rver. new faf93ad * eglot-tests.el: Disable eclipse connection tests. new 504fd25 Fix misspelling of "outstanding" (#74) new d9c3696 Fix #138: accept deprecated field in SymbolInformat= ion new 5ee05f9 Require subr-x at compile time (#139) new 19aded0 Remove duplicates from imenu new 22e5c57 Don't ignore unknown SymbolKinds in imenu new 3c180c0 Rework test macros for hopefully more stable testin= g new aefa498 Larger margin for printing test failure backtraces new 82ae4f6 Re-enable eclipse-jdt tests new ee41f06 Slightly robustify test engine new 27696d6 Use the container name of a symbol in imenu new 31bfe21 Add support for code action literals new f2ccb77 Simplify eglot-code-action. Fix compilation warning new 118f966 Fix a bug when response to definitions request is a= single location new f74a80f Make imenu hierarchical new c664f40 * eglot.el (eglot-client-capabilities): Mention sup= ported SymbolKinds. new 11cd074 Support ocaml-language-server out of the box (#149) new 2a410e9 Move constants to top instead of forward-declaring new d6e0ba3 * eglot-tests.el (eclipse-connect): Increase connec= t timeout to 20. new edc6538 Fix a bug introduced by previous bugfix new 7b4ed97 Fix #124: add ability to move to LSP-precise column= s new b9e9cf3 Fix #148: complex completions work when chosen from= *completions* new b31ba80 Tweak solution to #125 with a hint from Fangrui Son= g new fdb1941 Add support for TextEdits in completion new 0a18dca Fix #125: add ability to report LSP-compliant colum= ns new 604c1b0 Per #144: Format documentation of signature paramet= ers new d66f2eb Treat tab characters as 1 column wide in position c= onversion functions new fc03d7c Fix #160: Properly delete inserted text after compl= etion new b731db5 Add support for R's languageserver (#161) new 894fe5a Fix #154: fix potential security issue fontifying L= SP doc new ee7f9c6 Fix #167: correctly insert TextEdit-less snippets new de1728c * eglot.el (eglot-completion-at-point): Less chatte= r. new f291816 * eglot.el (Version): Bump to 1.2 Summary of changes: .travis.yml | 7 +- Makefile | 1 + README.md | 7 +- eglot-tests.el | 196 +++++++++++++------ eglot.el | 590 ++++++++++++++++++++++++++++++++++++++++++---------= ------ 5 files changed, 585 insertions(+), 216 deletions(-) From MAILER-DAEMON Thu Nov 22 19:15:31 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz87-0005EC-Da for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz84-000590-2o for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz82-00021L-Vw for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:27 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz82-00020r-Rl for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:26 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id C9CCC204D7; Thu, 22 Nov 2018 19:15:26 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 9585b74 04/45: Merge pull request #104 from mkcms/fix-diagnostics-wrong-type-argument MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, mkcms In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 9585b74a7173c8a3b3d5957e2eb15edf16d154f7 Auto-Submitted: auto-generated Message-Id: <20181123001526.C9CCC204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:26 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:30 -0000 branch: externals/eglot commit 9585b74a7173c8a3b3d5957e2eb15edf16d154f7 Merge: 489080b 31fcd91 Author: mkcms Commit: GitHub Merge pull request #104 from mkcms/fix-diagnostics-wrong-type-argumen= t =20 Handle case when diagnostic :character is out of range --- eglot.el | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/eglot.el b/eglot.el index b660683..41863cc 100644 --- a/eglot.el +++ b/eglot.el @@ -1080,14 +1080,21 @@ COMMAND is a symbol naming the command." ((`(,beg . ,end) (eglot--range-region range))) ;; Fallback to `flymake-diag-region' if server ;; botched the range - (if (=3D beg end) - (let* ((st (plist-get range :start)) - (diag-region - (flymake-diag-region - (current-buffer) (1+ (plist-get st :li= ne)) - (plist-get st :character)))) - (setq beg (car diag-region) - end (cdr diag-region)))) + (when (=3D beg end) + (if-let* ((st (plist-get range :start)) + (diag-region + (flymake-diag-region + (current-buffer) (1+ (plist-get st :l= ine)) + (plist-get st :character)))) + (setq beg (car diag-region) end (cdr diag-reg= ion)) + (eglot--widening + (goto-char (point-min)) + (setq beg + (point-at-bol + (1+ (plist-get (plist-get range :start)= :line)))) + (setq end + (point-at-eol + (1+ (plist-get (plist-get range :end) := line))))))) (eglot--make-diag (current-buffer) beg end (cond ((<=3D sev 1) 'eglot-error) ((=3D sev 2) 'eglot-warnin= g) From MAILER-DAEMON Thu Nov 22 19:15:36 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8C-0005Hp-3M for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz85-0005Al-D9 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz83-00022Z-BV for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz83-00021q-71 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:27 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 2CD8320950; Thu, 22 Nov 2018 19:15:27 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot ff04bc0 06/45: Improve signature help MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: ff04bc0eb1e5526fe01bdec3158b6f43cff3355e Auto-Submitted: auto-generated Message-Id: <20181123001527.2CD8320950@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:27 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:32 -0000 branch: externals/eglot commit ff04bc0eb1e5526fe01bdec3158b6f43cff3355e Author: Micha=C5=82 Krzywkowski Commit: Micha=C5=82 Krzywkowski Improve signature help =20 * eglot.el (eglot--sig-info): Don't lose existing information. Attempt to highlight the active parameter by searching for it's :label in signature's :label. Append to the result first sentence of signature's :documentation, if present. --- eglot.el | 52 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/eglot.el b/eglot.el index 7e79b16..57d19b3 100644 --- a/eglot.el +++ b/eglot.el @@ -1537,23 +1537,41 @@ is not active." (defun eglot--sig-info (sigs active-sig active-param) (cl-loop for (sig . moresigs) on (append sigs nil) for i from 0 - concat (cl-destructuring-bind (&key label _documentation parameters) = sig - (let (active-doc) - (concat - (propertize (replace-regexp-in-string "(.*$" "(" label) - 'face 'font-lock-function-name-face) - (cl-loop - for (param . moreparams) on (append parameters nil) for = j from 0 - concat (cl-destructuring-bind (&key label documentation)= param - (when (and (eql j active-param) (eql i active-s= ig)) - (setq label (propertize - label - 'face 'eldoc-highlight-function-= argument)) - (when documentation - (setq active-doc (concat label ": " documen= tation)))) - label) - if moreparams concat ", " else concat ")") - (when active-doc (concat "\n" active-doc))))) + concat (cl-destructuring-bind (&key label documentation parameters) s= ig + (with-temp-buffer + (save-excursion (insert label)) + (when (looking-at "\\([^(]+\\)(") + (add-face-text-property (match-beginning 1) (match-end 1= ) + 'font-lock-function-name-face)) + + (when (and (stringp documentation) (eql i active-sig) + (string-match "[[:space:]]*\\([^.\r\n]+[.]?\\)" + documentation)) + (setq documentation (match-string 1 documentation)) + (unless (string-prefix-p (string-trim documentation) lab= el) + (goto-char (point-max)) + (insert ": " documentation))) + (when (and (eql i active-sig) active-param + (< -1 active-param (length parameters))) + (cl-destructuring-bind (&key label documentation) + (aref parameters active-param) + (goto-char (point-min)) + (let ((case-fold-search nil)) + (cl-loop for nmatches from 0 + while (and (not (string-empty-p label)) + (search-forward label nil t)) + finally do + (when (=3D 1 nmatches) + (add-face-text-property + (- (point) (length label)) (point) + 'eldoc-highlight-function-argument)))) + (when documentation + (goto-char (point-max)) + (insert "\n" + (propertize + label 'face 'eldoc-highlight-function-argum= ent) + ": " documentation)))) + (buffer-string))) when moresigs concat "\n")) =20 (defun eglot-help-at-point () From MAILER-DAEMON Thu Nov 22 19:15:37 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8C-0005JT-TU for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz85-0005B0-ND for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz84-00028D-57 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz83-00027P-Vj for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:28 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id DDD8E20950; Thu, 22 Nov 2018 19:15:27 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot f250784 10/45: Handle case when project was not found in eclipse.jdt.ls contact MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?TWljaGHFgiBL?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: f250784723dc8617c739196656f0532ae1143c28 Auto-Submitted: auto-generated Message-Id: <20181123001527.DDD8E20950@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:27 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:31 -0000 branch: externals/eglot commit f250784723dc8617c739196656f0532ae1143c28 Author: Micha=C5=82 K Commit: mkcms Handle case when project was not found in eclipse.jdt.ls contact --- eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index a23e73d..75d3857 100644 --- a/eglot.el +++ b/eglot.el @@ -1959,8 +1959,9 @@ If SKIP-SIGNATURE, don't try to send textDocument/s= ignatureHelp." ((string=3D system-type "darwin") "config_mac") ((string=3D system-type "windows-nt") "config_win") (t "config_linux")))) + (project (or (project-current) `(transient . ,default-directo= ry))) (workspace - (expand-file-name (md5 (car (project-roots (project-current)= ))) + (expand-file-name (md5 (car (project-roots project))) (concat user-emacs-directory "eglot-eclipse-jdt-cache")))) (unless jar From MAILER-DAEMON Thu Nov 22 19:15:37 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8D-0005Jc-2o for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz85-0005BQ-TQ for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz84-00027i-36 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz83-00025x-Pg for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:27 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id B0BCE204D7; Thu, 22 Nov 2018 19:15:27 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot c795e3e 09/45: Override eglot-execute-command for eclipse.jdt.ls server MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?TWljaGHFgiBL?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: c795e3eb76988c5c1a43136464f58d9e5ffc0794 Auto-Submitted: auto-generated Message-Id: <20181123001527.B0BCE204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:27 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:31 -0000 branch: externals/eglot commit c795e3eb76988c5c1a43136464f58d9e5ffc0794 Author: Micha=C5=82 K Commit: mkcms Override eglot-execute-command for eclipse.jdt.ls server =20 * eglot.el (eglot-execute-command eglot-eclipse-jdt): New defmethod. --- eglot.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eglot.el b/eglot.el index daae454..a23e73d 100644 --- a/eglot.el +++ b/eglot.el @@ -1984,6 +1984,11 @@ If SKIP-SIGNATURE, don't try to send textDocument/= signatureHelp." "-configuration" config "-data" workspace))))) =20 +(cl-defmethod eglot-execute-command + ((_server eglot-eclipse-jdt) (_cmd (eql java.apply.workspaceEdit)) arg= uments) + "Eclipse JDT breaks spec and replies with edits as arguments." + (mapc #'eglot--apply-workspace-edit arguments)) + =0C ;; FIXME: A horrible hack of Flymake's insufficient API that must go ;; into Emacs master, or better, 26.2 From MAILER-DAEMON Thu Nov 22 19:15:37 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8D-0005K2-7m for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz85-0005Am-Dm for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz83-000222-8U for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz83-00021Z-1N for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:27 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 021BC204D7; Thu, 22 Nov 2018 19:15:26 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 5571f10 05/45: Sort references and definitions by line number MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?TWljaGHFgiBL?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 5571f102517509e8731c7aa6f1d3ba8dcff84666 Auto-Submitted: auto-generated Message-Id: <20181123001527.021BC204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:26 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:32 -0000 branch: externals/eglot commit 5571f102517509e8731c7aa6f1d3ba8dcff84666 Author: Micha=C5=82 K Commit: Micha=C5=82 Krzywkowski Sort references and definitions by line number =20 * eglot.el (eglot--sort-xrefs): New function. (xref-backend-definitions): (xref-backend-references): (xref-backend-apropos): Use it. --- eglot.el | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/eglot.el b/eglot.el index 41863cc..7e79b16 100644 --- a/eglot.el +++ b/eglot.el @@ -1323,6 +1323,12 @@ DUMMY is ignored." ;; F!@(#*&#$)CKING OFF-BY-ONE again (1+ line) character)))) =20 +(defun eglot--sort-xrefs (xrefs) + (sort xrefs + (lambda (a b) + (< (xref-location-line (xref-item-location a)) + (xref-location-line (xref-item-location b)))))) + (cl-defmethod xref-backend-identifier-completion-table ((_backend (eql e= glot))) (when (eglot--server-capable :documentSymbolProvider) (let ((server (eglot--current-server-or-lose)) @@ -1363,9 +1369,10 @@ DUMMY is ignored." :textDocument/definition (get-text-property 0 :textDocumentPositionParams identifier))= ))) - (mapcar (jsonrpc-lambda (&key uri range) - (eglot--xref-make identifier uri (plist-get range :start))= ) - location-or-locations))) + (eglot--sort-xrefs + (mapcar (jsonrpc-lambda (&key uri range) + (eglot--xref-make identifier uri (plist-get range :start)= )) + location-or-locations)))) =20 (cl-defmethod xref-backend-references ((_backend (eql eglot)) identifier= ) (unless (eglot--server-capable :referencesProvider) @@ -1376,25 +1383,27 @@ DUMMY is ignored." (and rich (get-text-property 0 :textDocumentPositionParam= s rich)))))) (unless params (eglot--error "Don' know where %s is in the workspace!" identifier= )) - (mapcar - (jsonrpc-lambda (&key uri range) - (eglot--xref-make identifier uri (plist-get range :start))) - (jsonrpc-request (eglot--current-server-or-lose) - :textDocument/references - (append - params - (list :context - (list :includeDeclaration t))))))) + (eglot--sort-xrefs + (mapcar + (jsonrpc-lambda (&key uri range) + (eglot--xref-make identifier uri (plist-get range :start))) + (jsonrpc-request (eglot--current-server-or-lose) + :textDocument/references + (append + params + (list :context + (list :includeDeclaration t)))))))) =20 (cl-defmethod xref-backend-apropos ((_backend (eql eglot)) pattern) (when (eglot--server-capable :workspaceSymbolProvider) - (mapcar - (jsonrpc-lambda (&key name location &allow-other-keys) - (cl-destructuring-bind (&key uri range) location - (eglot--xref-make name uri (plist-get range :start)))) - (jsonrpc-request (eglot--current-server-or-lose) - :workspace/symbol - `(:query ,pattern))))) + (eglot--sort-xrefs + (mapcar + (jsonrpc-lambda (&key name location &allow-other-keys) + (cl-destructuring-bind (&key uri range) location + (eglot--xref-make name uri (plist-get range :start)))) + (jsonrpc-request (eglot--current-server-or-lose) + :workspace/symbol + `(:query ,pattern)))))) =20 (defun eglot-format-buffer () "Format contents of current buffer." From MAILER-DAEMON Thu Nov 22 19:15:37 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8D-0005KL-Eh for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0005GK-6o for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz83-00026v-TS for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz83-00024V-Ip for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:27 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 8183420950; Thu, 22 Nov 2018 19:15:27 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot f0b5367 08/45: Per #63: Add support for eclipse.jdt.ls server MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?TWljaGHFgiBL?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: f0b5367ab36e1c5010a0ddc18c41a7d115ca87be Auto-Submitted: auto-generated Message-Id: <20181123001527.8183420950@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:27 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit f0b5367ab36e1c5010a0ddc18c41a7d115ca87be Author: Micha=C5=82 K Commit: mkcms Per #63: Add support for eclipse.jdt.ls server =20 * eglot.el (eglot-server-programs): Add java-mode entry. (eglot-eclipse-jdt): New class. (eglot-initialization-options): Override for eglot-eclipse-jdt. (eglot--eclipse-jdt-contact): New function. --- README.md | 2 ++ eglot.el | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fc06d52..38698dd 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ for the language of your choice. Otherwise, it prompts = you to enter one: * Rust's [rls][rls] * Python's [pyls][pyls] * Ruby's [solargraph][solargraph] +* Java's [Eclipse JDT Language Server][eclipse-jdt] * Bash's [bash-language-server][bash-language-server] * PHP's [php-language-server][php-language-server] * C/C++'s [ccls][ccls] ([cquery][cquery] and [clangd][clangd] also work= ) @@ -301,4 +302,5 @@ Under the hood: [haskell-ide-engine]: https://github.com/haskell/haskell-ide-engine [kotlin-language-server]: https://github.com/fwcd/KotlinLanguageServer [go-langserver]: https://github.com/sourcegraph/go-langserver +[eclipse-jdt]: https://github.com/eclipse/eclipse.jdt.ls =20 diff --git a/eglot.el b/eglot.el index 4376d3a..daae454 100644 --- a/eglot.el +++ b/eglot.el @@ -91,7 +91,9 @@ language-server/bin/php-language-server.php")) (haskell-mode . ("hie-wrapper")) (kotlin-mode . ("kotlin-language-server"= )) - (go-mode . ("go-langserver" "-mode=3Dstd= io" "-gocodecompletion"))) + (go-mode . ("go-langserver" "-mode=3Dstd= io" + "-gocodecompletion")) + (java-mode . eglot--eclipse-jdt-contact)= ) "How the command `eglot' guesses the server to start. An association list of (MAJOR-MODE . CONTACT) pairs. MAJOR-MODE is a mode symbol, or a list of mode symbols. The associated @@ -1893,6 +1895,96 @@ If SKIP-SIGNATURE, don't try to send textDocument/= signatureHelp." :progressReportFrequencyMs -1))) =20 =0C +;;; eclipse-jdt-specific +;;; +(defclass eglot-eclipse-jdt (eglot-lsp-server) () + :documentation "Eclipse's Java Development Tools Language Server.") + +(cl-defmethod eglot-initialization-options ((server eglot-eclipse-jdt)) + "Passes through required jdt initialization options" + `(:workspaceFolders + [,@(cl-delete-duplicates + (mapcar #'eglot--path-to-uri + (let* ((roots (project-roots (eglot--project server))) + (root (car roots))) + (append + roots + (mapcar + #'file-name-directory + (append + (file-expand-wildcards (concat root "*/pom.xml")) + (file-expand-wildcards (concat root "*/build.gradle= ")) + (file-expand-wildcards (concat root "*/.project")))= )))) + :test #'string=3D)] + ,@(if-let ((home (or (getenv "JAVA_HOME") + (ignore-errors + (expand-file-name + ".." + (file-name-directory + (file-chase-links (executable-find "javac")= ))))))) + `(:settings (:java (:home ,home))) + (ignore (eglot--warn "JAVA_HOME env var not set"))))) + +(defun eglot--eclipse-jdt-contact (interactive) + "Return a contact for connecting to eclipse.jdt.ls server, as a cons c= ell." + (cl-labels + ((is-the-jar + (path) + (and (string-match-p + "org\\.eclipse\\.equinox\\.launcher_.*\\.jar$" + (file-name-nondirectory path)) + (file-exists-p path)))) + (let* ((classpath (or (getenv "CLASSPATH") ":")) + (cp-jar (cl-find-if #'is-the-jar (split-string classpath ":")= )) + (jar cp-jar) + (dir + (cond + (jar (file-name-as-directory + (expand-file-name ".." (file-name-directory jar)))) + (interactive + (expand-file-name + (read-directory-name + (concat "Path to eclipse.jdt.ls directory (could not" + " find it in CLASSPATH): ") + nil nil t))) + (t (error "Could not find eclipse.jdt.ls jar in CLASSPATH")= ))) + (repodir + (concat dir + "org.eclipse.jdt.ls.product/target/repository/")) + (repodir (if (file-directory-p repodir) repodir dir)) + (config + (concat + repodir + (cond + ((string=3D system-type "darwin") "config_mac") + ((string=3D system-type "windows-nt") "config_win") + (t "config_linux")))) + (workspace + (expand-file-name (md5 (car (project-roots (project-current)= ))) + (concat user-emacs-directory + "eglot-eclipse-jdt-cache")))) + (unless jar + (setq jar + (cl-find-if #'is-the-jar + (directory-files (concat repodir "plugins") t)= ))) + (unless (and jar (file-exists-p jar) (file-directory-p config)) + (error "Could not find required eclipse.jdt.ls files (build requ= ired?)")) + (when (and interactive (not cp-jar) + (y-or-n-p (concat "Add path to the server program " + "to CLASSPATH environment variable?")= )) + (setenv "CLASSPATH" (concat (getenv "CLASSPATH") ":" jar))) + (unless (file-directory-p workspace) + (make-directory workspace t)) + (cons 'eglot-eclipse-jdt + (list (executable-find "java") + "-Declipse.application=3Dorg.eclipse.jdt.ls.core.id1" + "-Dosgi.bundles.defaultStartLevel=3D4" + "-Declipse.product=3Dorg.eclipse.jdt.ls.core.product" + "-jar" jar + "-configuration" config + "-data" workspace))))) + +=0C ;; FIXME: A horrible hack of Flymake's insufficient API that must go ;; into Emacs master, or better, 26.2 (when (version< emacs-version "27.0") From MAILER-DAEMON Thu Nov 22 19:15:38 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8E-0005LV-Jv for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz86-0005DR-Uh for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz84-0002Ae-IY for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:30 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz84-00029V-Ce for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:28 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 44F3F204D7; Thu, 22 Nov 2018 19:15:28 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 5b043fb 12/45: * .travis.yml (install): Download eclipse.jdt.ls server. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 5b043fb1bd080d231151e272d1d5d2e8e4cc921b Auto-Submitted: auto-generated Message-Id: <20181123001528.44F3F204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:28 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:35 -0000 branch: externals/eglot commit 5b043fb1bd080d231151e272d1d5d2e8e4cc921b Author: Micha=C5=82 Krzywkowski Commit: mkcms * .travis.yml (install): Download eclipse.jdt.ls server. --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 812d301..731220f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,12 @@ install: - virtualenv . - . ./bin/activate - pip install 'python-language-server[all]' - =20 + # Install eclipse.jdt.ls + - curl -fSL http://download.eclipse.org/jdtls/snapshots/jdt-language-s= erver-latest.tar.gz -o eclipse.tar.gz + - mkdir eclipse.jdt.ls + - tar -C eclipse.jdt.ls -xzf eclipse.tar.gz + - export CLASSPATH=3D$(pwd)/$(find eclipse.jdt.ls/ -regex eclipse.jdt.= ls/plugins/org.eclipse.equinox.launcher_.*.jar):${CLASSPATH} + script: - make check =20 From MAILER-DAEMON Thu Nov 22 19:15:39 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8E-0005Lg-QX for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0005GH-5Z for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz86-0002JV-Am for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz85-00027P-SL for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:30 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id CF50E204D7; Thu, 22 Nov 2018 19:15:29 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot aefa498 20/45: Larger margin for printing test failure backtraces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: aefa498bdb180ca89b282f9f501f5031d4c15433 Auto-Submitted: auto-generated Message-Id: <20181123001529.CF50E204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:29 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit aefa498bdb180ca89b282f9f501f5031d4c15433 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Larger margin for printing test failure backtraces =20 * Makefile (eglot-check): set ert-batch-backtrace-right-margin. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index ae77e29..fcff632 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ eglot-check: compile $(JSONRPC) \ -l eglot \ -l eglot-tests \ + --eval '(setq ert-batch-backtrace-right-margin 200)' \ --eval '(ert-run-tests-batch-and-exit (quote $(SELECTOR)))' =20 check: eglot-check From MAILER-DAEMON Thu Nov 22 19:15:39 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8F-0005M0-1a for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0005GZ-AQ for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz85-0002GL-Gu for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz85-0002Fb-Ag for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 4312120950; Thu, 22 Nov 2018 19:15:29 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 19aded0 17/45: Remove duplicates from imenu MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 19aded0a1ad496ca79d636ea6e9f5d79eaf629bf Auto-Submitted: auto-generated Message-Id: <20181123001529.4312120950@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:29 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit 19aded0a1ad496ca79d636ea6e9f5d79eaf629bf Author: Micha=C5=82 Krzywkowski Commit: Micha=C5=82 Krzywkowski Remove duplicates from imenu =20 * eglot.el (eglot-imenu): Don't append the result list to itself, which causes duplicates. --- eglot.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/eglot.el b/eglot.el index a234e17..2b39849 100644 --- a/eglot.el +++ b/eglot.el @@ -1664,12 +1664,10 @@ If SKIP-SIGNATURE, don't try to send textDocument= /signatureHelp." (jsonrpc-request (eglot--current-server-or-lose) :textDocument/documentSymbol `(:textDocument ,(eglot--TextDocumentIden= tifier)))))) - (append - (cl-remove nil - (seq-group-by (lambda (e) (get-text-property 0 :kind= (car e))) - entries) - :key #'car) - entries)) + (cl-remove nil + (seq-group-by (lambda (e) (get-text-property 0 :kind = (car e))) + entries) + :key #'car)) (funcall oldfun))) =20 (defun eglot--apply-text-edits (edits &optional version) From MAILER-DAEMON Thu Nov 22 19:15:39 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8F-0005ML-7u for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0005Ga-Aa for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz85-0002ES-2i for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz84-0002CZ-Nf for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:28 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id A6A40204D7; Thu, 22 Nov 2018 19:15:28 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 504fd25 14/45: Fix misspelling of "outstanding" (#74) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Dale Sedivec In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 504fd25c50932cafbc5117a8556f7a4e7c9cfd19 Auto-Submitted: auto-generated Message-Id: <20181123001528.A6A40204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:28 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit 504fd25c50932cafbc5117a8556f7a4e7c9cfd19 Author: Dale Sedivec Commit: Micha=C5=82 Krzywkowski Fix misspelling of "outstanding" (#74) =20 Copyright-paperwork-exempt: yes =20 * eglot.el (eglot--mode-line-format): Fix a typo. --- eglot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index 75d3857..3d77a4f 100644 --- a/eglot.el +++ b/eglot.el @@ -1000,7 +1000,7 @@ Uses THING, FACE, DEFS and PREPEND." 'compilation-mode-line-run '()))) ,@(when (cl-plusp pending) `("/" ,(eglot--mode-line-props - (format "%d oustanding requests" pending) 'warning + (format "%d outstanding requests" pending) 'warning '((mouse-3 eglot-forget-pending-continuations "fahgettaboudit")))))))))) =20 From MAILER-DAEMON Thu Nov 22 19:15:40 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8F-0005N8-Up for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz85-0005Ap-Fa for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz83-00024O-IK for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz83-00022k-Ch for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:27 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 5342F204D7; Thu, 22 Nov 2018 19:15:27 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot a406190 07/45: Per #63: Allow function contacts to be interactive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?TWljaGHFgiBL?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: a40619053fac04eec5f0909a168b4addd1973d47 Auto-Submitted: auto-generated Message-Id: <20181123001527.5342F204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:27 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:31 -0000 branch: externals/eglot commit a40619053fac04eec5f0909a168b4addd1973d47 Author: Micha=C5=82 K Commit: mkcms Per #63: Allow function contacts to be interactive =20 * eglot.el (eglot-server-programs): Mention that the function must accept one argument. (eglot--guess-contact): Pass to functional contacts the interactive value. --- eglot.el | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/eglot.el b/eglot.el index 57d19b3..4376d3a 100644 --- a/eglot.el +++ b/eglot.el @@ -124,8 +124,14 @@ of those modes. CONTACT can be: `jsonrpc-process-connection', which you should see for the semantics of the mandatory :PROCESS argument. =20 -* A function of no arguments producing any of the above values - for CONTACT.") +* A function of a single argument producing any of the above + values for CONTACT. The argument's value is non-nil if the + connection was requested interactively (e.g. from the `eglot' + command), and nil if it wasn't (e.g. from `eglot-ensure'). If + the call is interactive, the function can ask the user for + hints on finding the required programs, etc. Otherwise, it + should not ask the user for any input, and return nil or signal + an error if it can't produce a valid CONTACT.") =20 (defface eglot-mode-line '((t (:inherit font-lock-constant-face :weight bold))) @@ -353,7 +359,9 @@ be guessed." (lambda (m1 m2) (or (eq m1 m2) (and (listp m1) (memq m2 m1))))))) - (guess (if (functionp guess) (funcall guess) guess)) + (guess (if (functionp guess) + (funcall guess interactive) + guess)) (class (or (and (consp guess) (symbolp (car guess)) (prog1 (car guess) (setq guess (cdr guess)))) 'eglot-lsp-server)) From MAILER-DAEMON Thu Nov 22 19:15:40 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8G-0005NL-50 for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-0005HQ-5g for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz88-0002Pf-6i for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:33 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz86-00027P-DG for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:30 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 5D554204D7; Thu, 22 Nov 2018 19:15:30 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 27696d6 23/45: Use the container name of a symbol in imenu MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 27696d69c81c9e23ec917d846379ac0527a7e667 Auto-Submitted: auto-generated Message-Id: <20181123001530.5D554204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:30 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit 27696d69c81c9e23ec917d846379ac0527a7e667 Author: Micha=C5=82 Krzywkowski Commit: mkcms Use the container name of a symbol in imenu =20 * eglot.el (eglot-imenu): Prepend :containerName to each symbol, when provided. --- eglot.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/eglot.el b/eglot.el index 26ee814..e151704 100644 --- a/eglot.el +++ b/eglot.el @@ -1657,10 +1657,15 @@ If SKIP-SIGNATURE, don't try to send textDocument= /signatureHelp." (let ((entries (mapcar (jsonrpc-lambda - (&key name kind location _containerName _deprecated) + (&key name kind location containerName _deprecated) (cons (propertize - name :kind (alist-get kind eglot--symbol-kind-nam= es - "(Unknown)")) + (concat + (and (stringp containerName) + (not (string-empty-p containerName)) + (concat containerName "::")) + name) + :kind (alist-get kind eglot--symbol-kind-names + "(Unknown)")) (eglot--lsp-position-to-point (plist-get (plist-get location :range) :start)))) (jsonrpc-request (eglot--current-server-or-lose) From MAILER-DAEMON Thu Nov 22 19:15:40 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8G-0005Nh-BO for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0005GX-9Q for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz84-00029D-BH for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz84-000287-4t for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:28 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 18FEB204D7; Thu, 22 Nov 2018 19:15:28 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 6ebbd36 11/45: Add tests for eclipse.jdt.ls connection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 6ebbd36e18a4da792090c6f7eec349d02f1f9ddc Auto-Submitted: auto-generated Message-Id: <20181123001528.18FEB204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:28 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit 6ebbd36e18a4da792090c6f7eec349d02f1f9ddc Author: Micha=C5=82 Krzywkowski Commit: mkcms Add tests for eclipse.jdt.ls connection =20 * eglot-tests.el (eglot--have-eclipse-jdt-ls-p): New helper. (eclipse-connect): (eclipse-workspace-folders): New tests. --- eglot-tests.el | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/eglot-tests.el b/eglot-tests.el index 47a3b34..1b77ad1 100644 --- a/eglot-tests.el +++ b/eglot-tests.el @@ -32,6 +32,13 @@ =20 ;; Helpers =20 +(defun eglot--have-eclipse-jdt-ls-p () + (and (getenv "CLASSPATH") + (cl-some + (lambda (x) + (string-match-p "org\\.eclipse\\.equinox\\.launcher_.*\\.jar$"= x)) + (split-string (getenv "CLASSPATH") ":")))) + (defmacro eglot--with-dirs-and-files (dirs &rest body) (declare (indent 1) (debug t)) `(eglot--call-with-dirs-and-files @@ -197,6 +204,49 @@ Pass TIMEOUT to `eglot--with-timeout'." (eglot--with-timeout (or timeout 2) (apply #'eglot--connect (eglot--guess-contact)))) =20 +(ert-deftest eclipse-connect () + "Connect to eclipse.jdt.ls server." + (skip-unless (eglot--have-eclipse-jdt-ls-p)) + (eglot--with-dirs-and-files + '(("project/src/main/java/foo" . (("Main.java" . ""))) + ("project/.git/" . nil)) + (with-current-buffer + (eglot--find-file-noselect "project/src/main/java/foo/Main.java") + (eglot--sniffing (:server-notifications s-notifs) + (should (eglot--tests-connect 10)) + (eglot--wait-for (s-notifs 10) + (&key _id method &allow-other-keys) + (string=3D method "language/status")) + (ignore-errors (eglot-shutdown (eglot--current-server) nil 10))))= )) + +(ert-deftest eclipse-workspace-folders () + "Check eclipse connection with multi-root projects." + (skip-unless (eglot--have-eclipse-jdt-ls-p)) + (eglot--with-dirs-and-files + '(("project/main/src/main/java/foo" . (("Main.java" . ""))) + ("project/sub1/" . (("pom.xml" . ""))) + ("project/sub2/" . (("build.gradle" . ""))) + ("project/sub3/" . (("a.txt" . ""))) + ("project/.git/" . nil)) + (let ((root (file-name-as-directory default-directory))) + (with-current-buffer + (eglot--find-file-noselect "project/main/src/main/java/foo/Main= .java") + (eglot--sniffing (:client-requests c-reqs) + (should (eglot--tests-connect 10)) + (eglot--wait-for (c-reqs 10) + (&key _id method params &allow-other-keys) + (when (string=3D method "initialize") + (let ((folders (plist-get + (plist-get params :initializationOptions) + :workspaceFolders)) + (default-directory root)) + (and + (seq-contains folders (eglot--path-to-uri "project/")) + (seq-contains folders (eglot--path-to-uri "project/sub1/= ")) + (seq-contains folders (eglot--path-to-uri "project/sub2/= ")) + (=3D 3 (length folders)))))) + (ignore-errors (eglot-shutdown (eglot--current-server) nil 10))= ))))) + (ert-deftest auto-detect-running-server () "Visit a file and M-x eglot, then visit a neighbour. " (skip-unless (executable-find "rls")) From MAILER-DAEMON Thu Nov 22 19:15:40 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8G-0005O0-Fh for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0005GI-6C for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz85-0002I3-SE for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz85-0002GT-HV for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 7212E204D7; Thu, 22 Nov 2018 19:15:29 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 22e5c57 18/45: Don't ignore unknown SymbolKinds in imenu MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 22e5c579a2177f887a27029d83e0d8f78094f33a Auto-Submitted: auto-generated Message-Id: <20181123001529.7212E204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:29 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit 22e5c579a2177f887a27029d83e0d8f78094f33a Author: Micha=C5=82 Krzywkowski Commit: Micha=C5=82 Krzywkowski Don't ignore unknown SymbolKinds in imenu =20 Some servers provide custom SymbolKinds. For example, ccls says that symbols defined with #define are of kind 255. =20 * eglot.el (eglot-imenu): Don't delete elements with unknown symbol kind from the return list, instead put them in `(Unknown)` group. --- eglot.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eglot.el b/eglot.el index 2b39849..26ee814 100644 --- a/eglot.el +++ b/eglot.el @@ -1658,16 +1658,16 @@ If SKIP-SIGNATURE, don't try to send textDocument= /signatureHelp." (mapcar (jsonrpc-lambda (&key name kind location _containerName _deprecated) - (cons (propertize name :kind (cdr (assoc kind eglot--sym= bol-kind-names))) + (cons (propertize + name :kind (alist-get kind eglot--symbol-kind-nam= es + "(Unknown)")) (eglot--lsp-position-to-point (plist-get (plist-get location :range) :start)))) (jsonrpc-request (eglot--current-server-or-lose) :textDocument/documentSymbol `(:textDocument ,(eglot--TextDocumentIden= tifier)))))) - (cl-remove nil - (seq-group-by (lambda (e) (get-text-property 0 :kind = (car e))) - entries) - :key #'car)) + (seq-group-by (lambda (e) (get-text-property 0 :kind (car e))) + entries)) (funcall oldfun))) =20 (defun eglot--apply-text-edits (edits &optional version) From MAILER-DAEMON Thu Nov 22 19:15:40 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8G-0005OK-Lt for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0005GV-8I for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz85-0002Fz-E5 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz85-0002Ey-4p for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 1547F204D7; Thu, 22 Nov 2018 19:15:29 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 5ee05f9 16/45: Require subr-x at compile time (#139) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Alex Branham In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 5ee05f9c5947c11f72e6812e0bea695c9187b8b1 Auto-Submitted: auto-generated Message-Id: <20181123001529.1547F204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:29 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit 5ee05f9c5947c11f72e6812e0bea695c9187b8b1 Author: Alex Branham Commit: Jo=C3=A3o T=C3=A1vora Require subr-x at compile time (#139) =20 if-let and when-let are macros that the byte compiler can expand at compile time. No need to require subr-x at run time. =20 * eglot.el (subr-x): Require only when compiling. --- eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index 297d6f4..a234e17 100644 --- a/eglot.el +++ b/eglot.el @@ -65,7 +65,8 @@ (require 'warnings) (require 'flymake) (require 'xref) -(require 'subr-x) +(eval-when-compile + (require 'subr-x)) (require 'jsonrpc) (require 'filenotify) (require 'ert) From MAILER-DAEMON Thu Nov 22 19:15:41 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8G-0005Ob-Qj for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0005GW-8I for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz85-0002F6-5w for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz84-00027P-Tb for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:28 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id D78BA20950; Thu, 22 Nov 2018 19:15:28 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot d9c3696 15/45: Fix #138: accept deprecated field in SymbolInformation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: d9c3696d6bb1fb1c9d3dff6907c302ad4dd1eaaa Auto-Submitted: auto-generated Message-Id: <20181123001528.D78BA20950@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:28 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit d9c3696d6bb1fb1c9d3dff6907c302ad4dd1eaaa Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Fix #138: accept deprecated field in SymbolInformation =20 * eglot.el (xref-backend-identifier-completion-table) (eglot-imenu): Accept and ignore "deprecated" --- eglot.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eglot.el b/eglot.el index 3d77a4f..297d6f4 100644 --- a/eglot.el +++ b/eglot.el @@ -1348,7 +1348,7 @@ DUMMY is ignored." (setq eglot--xref-known-symbols (mapcar (jsonrpc-lambda - (&key name kind location containerName) + (&key name kind location containerName _deprecated) (propertize name :textDocumentPositionParams (list :textDocument text-id @@ -1656,7 +1656,7 @@ If SKIP-SIGNATURE, don't try to send textDocument/s= ignatureHelp." (let ((entries (mapcar (jsonrpc-lambda - (&key name kind location _containerName) + (&key name kind location _containerName _deprecated) (cons (propertize name :kind (cdr (assoc kind eglot--sym= bol-kind-names))) (eglot--lsp-position-to-point (plist-get (plist-get location :range) :start)))) From MAILER-DAEMON Thu Nov 22 19:15:41 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8H-0005Ox-2y for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-0005HS-6H for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz86-0002Js-Cg for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:33 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz86-0002Iz-3n for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:30 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 0ACF9209A2; Thu, 22 Nov 2018 19:15:30 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 82ae4f6 21/45: Re-enable eclipse-jdt tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 82ae4f6bb60dedee61afb25f7a48229aad2d892f Auto-Submitted: auto-generated Message-Id: <20181123001530.0ACF9209A2@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:29 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit 82ae4f6bb60dedee61afb25f7a48229aad2d892f Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Re-enable eclipse-jdt tests =20 * eglot-tests.el (eglot--have-eclipse-jdt-ls-p): Reenable. (eclipse-connect, eclipse-workspace-folders): Don't eglot-shutdown explicitly. Fix indentation. (eglot--call-with-fixture): Increase shutdown timeout to 10 seconds. --- eglot-tests.el | 69 ++++++++++++++++++++++++++++------------------------= ------ 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/eglot-tests.el b/eglot-tests.el index 306614b..7bd457b 100644 --- a/eglot-tests.el +++ b/eglot-tests.el @@ -33,8 +33,7 @@ ;; Helpers =20 (defun eglot--have-eclipse-jdt-ls-p () - (and nil - (getenv "CLASSPATH") + (and (getenv "CLASSPATH") (cl-some (lambda (x) (string-match-p "org\\.eclipse\\.equinox\\.launcher_.*\\.jar$"= x)) @@ -93,7 +92,7 @@ then restored." (let ((eglot-autoreconnect nil)) (mapc (lambda (server) (eglot-shutdown - server nil nil (not cleanup-events-et-cetera-p))) + server nil 10 (not cleanup-events-et-cetera-p))) (cl-remove-if-not #'jsonrpc-running-p new-servers))) (setq buffers-to-delete (delete nil (mapcar #'find-buffer-visiting created-files))= ) @@ -230,44 +229,42 @@ Pass TIMEOUT to `eglot--with-timeout'." "Connect to eclipse.jdt.ls server." (skip-unless (eglot--have-eclipse-jdt-ls-p)) (eglot--with-fixture - '(("project/src/main/java/foo" . (("Main.java" . ""))) - ("project/.git/" . nil)) - (with-current-buffer - (eglot--find-file-noselect "project/src/main/java/foo/Main.java") - (eglot--sniffing (:server-notifications s-notifs) - (should (eglot--tests-connect 10)) - (eglot--wait-for (s-notifs 10) - (&key _id method &allow-other-keys) - (string=3D method "language/status")) - (ignore-errors (eglot-shutdown (eglot--current-server) nil 10))))= )) + '(("project/src/main/java/foo" . (("Main.java" . ""))) + ("project/.git/" . nil)) + (with-current-buffer + (eglot--find-file-noselect "project/src/main/java/foo/Main.java"= ) + (eglot--sniffing (:server-notifications s-notifs) + (should (eglot--tests-connect 10)) + (eglot--wait-for (s-notifs 10) + (&key _id method &allow-other-keys) + (string=3D method "language/status")))))) =20 (ert-deftest eclipse-workspace-folders () "Check eclipse connection with multi-root projects." (skip-unless (eglot--have-eclipse-jdt-ls-p)) (eglot--with-fixture - '(("project/main/src/main/java/foo" . (("Main.java" . ""))) - ("project/sub1/" . (("pom.xml" . ""))) - ("project/sub2/" . (("build.gradle" . ""))) - ("project/sub3/" . (("a.txt" . ""))) - ("project/.git/" . nil)) - (let ((root (file-name-as-directory default-directory))) - (with-current-buffer - (eglot--find-file-noselect "project/main/src/main/java/foo/Main= .java") - (eglot--sniffing (:client-requests c-reqs) - (should (eglot--tests-connect 10)) - (eglot--wait-for (c-reqs 10) - (&key _id method params &allow-other-keys) - (when (string=3D method "initialize") - (let ((folders (plist-get - (plist-get params :initializationOptions) - :workspaceFolders)) - (default-directory root)) - (and - (seq-contains folders (eglot--path-to-uri "project/")) - (seq-contains folders (eglot--path-to-uri "project/sub1/= ")) - (seq-contains folders (eglot--path-to-uri "project/sub2/= ")) - (=3D 3 (length folders)))))) - (ignore-errors (eglot-shutdown (eglot--current-server) nil 10))= ))))) + '(("project/main/src/main/java/foo" . (("Main.java" . ""))) + ("project/sub1/" . (("pom.xml" . ""))) + ("project/sub2/" . (("build.gradle" . ""))) + ("project/sub3/" . (("a.txt" . ""))) + ("project/.git/" . nil)) + (let ((root (file-name-as-directory default-directory))) + (with-current-buffer + (eglot--find-file-noselect "project/main/src/main/java/foo/Mai= n.java") + (eglot--sniffing (:client-requests c-reqs) + (should (eglot--tests-connect 10)) + (eglot--wait-for (c-reqs 10) + (&key _id method params &allow-other-keys) + (when (string=3D method "initialize") + (let ((folders (plist-get + (plist-get params :initializationOptions) + :workspaceFolders)) + (default-directory root)) + (and + (seq-contains folders (eglot--path-to-uri "project/")) + (seq-contains folders (eglot--path-to-uri "project/sub1= /")) + (seq-contains folders (eglot--path-to-uri "project/sub2= /")) + (=3D 3 (length folders))))))))))) =20 (ert-deftest auto-detect-running-server () "Visit a file and M-x eglot, then visit a neighbour. " From MAILER-DAEMON Thu Nov 22 19:15:41 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8H-0005PI-7S for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-0005HR-61 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz88-0002PE-2x for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:34 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz86-0002JO-95 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:30 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 33A01209B2; Thu, 22 Nov 2018 19:15:30 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot ee41f06 22/45: Slightly robustify test engine MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: ee41f06e15151160513932e94c1d654d2474c9a3 Auto-Submitted: auto-generated Message-Id: <20181123001530.33A01209B2@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:30 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit ee41f06e15151160513932e94c1d654d2474c9a3 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Slightly robustify test engine =20 No longer do tests break because of servers take a long time to shutdown, or even fail to do so properly. This is common in "slow" servers such as eclipse-jdt in slow systems (such as mine). =20 * eglot-tests.el (eglot--call-with-fixture): Rework. Shutdown server after tests but demoting errors. (eglot--tests-connect): Always sync-connect here. --- eglot-tests.el | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/eglot-tests.el b/eglot-tests.el index 7bd457b..74c0eac 100644 --- a/eglot-tests.el +++ b/eglot-tests.el @@ -72,8 +72,8 @@ then restored." (default-directory fixture-directory) file-specs created-files syms-to-restore - buffers-to-delete new-servers - cleanup-events-et-cetera-p) + new-servers + test-body-successful-p) (dolist (spec fixture) (cond ((symbolp spec) (push (cons spec (symbol-value spec)) syms-to-restore) @@ -86,27 +86,31 @@ then restored." (let ((eglot-connect-hook (lambda (server) (push server new-servers)))) (setq created-files (mapcan #'eglot--make-file-or-dir file-spe= cs)) - (funcall fn) - (setq cleanup-events-et-cetera-p t)) + (prog1 (funcall fn) + (setq test-body-successful-p t))) + (eglot--message + "Test body was %s" (if test-body-successful-p "OK" "A FAILURE")) (unwind-protect (let ((eglot-autoreconnect nil)) (mapc (lambda (server) - (eglot-shutdown - server nil 10 (not cleanup-events-et-cetera-p))) + (condition-case oops + (eglot-shutdown + server nil 3 (not test-body-successful-p)) + (error + (message "[eglot] Non-critical shutdown error aft= er test: %S" + oops)))) (cl-remove-if-not #'jsonrpc-running-p new-servers))) - (setq buffers-to-delete - (delete nil (mapcar #'find-buffer-visiting created-files))= ) - (cl-loop for (sym . val) in syms-to-restore - do (set sym val)) - (eglot--message - "Killing project buffers %s, deleting %s, restoring %s, killing= server %s" - (mapconcat #'buffer-name buffers-to-delete ", ") - default-directory - (mapcar #'car syms-to-restore) - (mapcar #'jsonrpc-name new-servers)) - (dolist (buf buffers-to-delete) ;; have to save otherwise will g= et prompted - (with-current-buffer buf (save-buffer) (kill-buffer))) - (delete-directory fixture-directory 'recursive))))) + (let ((buffers-to-delete + (delete nil (mapcar #'find-buffer-visiting created-files)= ))) + (eglot--message "Killing %s, wiping %s, restoring %s" + buffers-to-delete + default-directory + (mapcar #'car syms-to-restore)) + (cl-loop for (sym . val) in syms-to-restore + do (set sym val)) + (dolist (buf buffers-to-delete) ;; have to save otherwise will= get prompted + (with-current-buffer buf (save-buffer) (kill-buffer))) + (delete-directory fixture-directory 'recursive)))))) =20 (cl-defmacro eglot--with-timeout (timeout &body body) (declare (indent 1) (debug t)) @@ -222,7 +226,9 @@ Pass TIMEOUT to `eglot--with-timeout'." (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode)) =20 (defun eglot--tests-connect (&optional timeout) - (eglot--with-timeout (or timeout 2) + (let* ((timeout (or timeout 2)) + (eglot-sync-connect t) + (eglot-connect-timeout timeout)) (apply #'eglot--connect (eglot--guess-contact)))) =20 (ert-deftest eclipse-connect () From MAILER-DAEMON Thu Nov 22 19:15:44 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8K-0005Qy-Fz for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0005GS-7c for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz84-0002Dg-UK for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz84-0002Ar-Il for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:28 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 7A40E20950; Thu, 22 Nov 2018 19:15:28 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot faf93ad 13/45: * eglot-tests.el: Disable eclipse connection tests. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: faf93ad6d8ef4a8b479cf68e5955cf4ecbf92735 Auto-Submitted: auto-generated Message-Id: <20181123001528.7A40E20950@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:28 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:36 -0000 branch: externals/eglot commit faf93ad6d8ef4a8b479cf68e5955cf4ecbf92735 Author: Micha=C5=82 Krzywkowski Commit: Micha=C5=82 Krzywkowski * eglot-tests.el: Disable eclipse connection tests. --- eglot-tests.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eglot-tests.el b/eglot-tests.el index 1b77ad1..a16bd52 100644 --- a/eglot-tests.el +++ b/eglot-tests.el @@ -33,7 +33,8 @@ ;; Helpers =20 (defun eglot--have-eclipse-jdt-ls-p () - (and (getenv "CLASSPATH") + (and nil + (getenv "CLASSPATH") (cl-some (lambda (x) (string-match-p "org\\.eclipse\\.equinox\\.launcher_.*\\.jar$"= x)) From MAILER-DAEMON Thu Nov 22 19:15:45 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8L-0005SQ-Nk for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8K-0005Qf-6E for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8A-0002W2-2H for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz87-0002No-Dz for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 52DD5209F6; Thu, 22 Nov 2018 19:15:31 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot c664f40 28/45: * eglot.el (eglot-client-capabilities): Mention supported SymbolKinds. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: c664f40a35aaa0470d42c9f481153f70aff196ec Auto-Submitted: auto-generated Message-Id: <20181123001531.52DD5209F6@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:31 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:45 -0000 branch: externals/eglot commit c664f40a35aaa0470d42c9f481153f70aff196ec Author: Micha=C5=82 Krzywkowski Commit: mkcms * eglot.el (eglot-client-capabilities): Mention supported SymbolKinds= . --- eglot.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index 22f509b..0a78970 100644 --- a/eglot.el +++ b/eglot.el @@ -196,6 +196,8 @@ let the buffer grow forever." "JSON object to send under `initializationOptions'" (:method (_s) nil)) ; blank default =20 +(defvar eglot--symbol-kind-names) + (cl-defgeneric eglot-client-capabilities (server) "What the EGLOT LSP client supports for SERVER." (:method (_s) @@ -221,7 +223,11 @@ let the buffer grow forever." :signatureHelp `(:dynamicRegistration :json-false) :references `(:dynamicRegistration :json-false) :definition `(:dynamicRegistration :json-false) - :documentSymbol `(:dynamicRegistration :json-false) + :documentSymbol (list + :dynamicRegistration :json-false + :symbolKind `(:valueSet + [,@(mapcar + #'car eglot--symbol-= kind-names)])) :documentHighlight `(:dynamicRegistration :json-false) :codeAction (list :dynamicRegistration :json-false From MAILER-DAEMON Thu Nov 22 19:15:47 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8M-0005U3-TO for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8K-0005Qi-6t for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8A-0002Wu-6d for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-00027P-2q for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 0B2C3209B2; Thu, 22 Nov 2018 19:15:32 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot edc6538 32/45: Fix a bug introduced by previous bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: edc6538629282f116631854ad3b991248413b2cf Auto-Submitted: auto-generated Message-Id: <20181123001532.0B2C3209B2@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:31 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:45 -0000 branch: externals/eglot commit edc6538629282f116631854ad3b991248413b2cf Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Fix a bug introduced by previous bugfix =20 This commit fixes a bug but introduced another when completing a symbol in xref-find-definitions. =20 commit 118f9668e45ea424d8090013392ace154538f1e4 Author: Micha=C5=82 Krzywkowski Date: Sun Nov 4 16:59:05 2018 +0100 =20 * eglot.el (xref-backend-identifier-completion-table): Use vector. --- eglot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index e177174..576d7f3 100644 --- a/eglot.el +++ b/eglot.el @@ -1374,7 +1374,7 @@ DUMMY is ignored." :position (plist-get (plist-get location :rang= e) :start)) - :locations (list location) + :locations (vector location) :kind kind :containerName containerName)) (jsonrpc-request server From MAILER-DAEMON Thu Nov 22 19:15:47 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8N-0005UC-1Q for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8K-0005Qg-6L for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8A-0002WA-8A for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0002P8-1Z for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id D1DCE20A26; Thu, 22 Nov 2018 19:15:31 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot d6e0ba3 31/45: * eglot-tests.el (eclipse-connect): Increase connect timeout to 20. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: d6e0ba3b883c95361482377a50d62a8373081ec5 Auto-Submitted: auto-generated Message-Id: <20181123001531.D1DCE20A26@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:31 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:45 -0000 branch: externals/eglot commit d6e0ba3b883c95361482377a50d62a8373081ec5 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora * eglot-tests.el (eclipse-connect): Increase connect timeout to 20. --- eglot-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eglot-tests.el b/eglot-tests.el index 74c0eac..6cea929 100644 --- a/eglot-tests.el +++ b/eglot-tests.el @@ -240,7 +240,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (with-current-buffer (eglot--find-file-noselect "project/src/main/java/foo/Main.java"= ) (eglot--sniffing (:server-notifications s-notifs) - (should (eglot--tests-connect 10)) + (should (eglot--tests-connect 20)) (eglot--wait-for (s-notifs 10) (&key _id method &allow-other-keys) (string=3D method "language/status")))))) From MAILER-DAEMON Thu Nov 22 19:15:48 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8O-0005Vw-Dv for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8K-0005Qh-6S for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8A-0002WQ-4w for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz86-0002Iz-JS for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 8D03F20950; Thu, 22 Nov 2018 19:15:30 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 31bfe21 24/45: Add support for code action literals MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 31bfe21567c29f02b9ad3690f53aff13a22974dd Auto-Submitted: auto-generated Message-Id: <20181123001530.8D03F20950@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:30 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:45 -0000 branch: externals/eglot commit 31bfe21567c29f02b9ad3690f53aff13a22974dd Author: Micha=C5=82 Krzywkowski Commit: mkcms Add support for code action literals =20 Code action literals allow the server to simply return a WorkspaceEdi= t for a code action, so the client does not have to execute a command. =20 * eglot.el (eglot-client-capabilities): Add :codeActionLiteralSupport= . (eglot--code-action-kinds): New variable. (eglot-code-actions): Apply provided WorkspaceEdit. --- eglot.el | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/eglot.el b/eglot.el index e151704..b2e88d8 100644 --- a/eglot.el +++ b/eglot.el @@ -223,7 +223,12 @@ let the buffer grow forever." :definition `(:dynamicRegistration :json-false) :documentSymbol `(:dynamicRegistration :json-false) :documentHighlight `(:dynamicRegistration :json-false) - :codeAction `(:dynamicRegistration :json-false) + :codeAction (list + :dynamicRegistration :json-false + :codeActionLiteralSupport + `(:codeActionKind + (:valueSet + [,@eglot--code-action-kinds]))) :formatting `(:dynamicRegistration :json-false) :rangeFormatting `(:dynamicRegistration :json-false) :rename `(:dynamicRegistration :json-false) @@ -740,6 +745,11 @@ Doubles as an indicator of snippet support." (21 . "Null") (22 . "EnumMember") (23 . "Struct") (24 . "Event") (25 . "Operator") (26 . "TypeParameter"))) =20 +(defconst eglot--code-action-kinds + '("quickfix" "refactor" "refactor.extract" + "refactor.inline" "refactor.rewrite" + "source" "source.organizeImports")) + (defun eglot--format-markup (markup) "Format MARKUP according to LSP's spec." (pcase-let ((`(,string ,mode) @@ -1788,8 +1798,10 @@ If SKIP-SIGNATURE, don't try to send textDocument/= signatureHelp." (cdr (assoc 'eglot-lsp-diag (eglot--diag-data di= ag)))) (flymake-diagnostics beg end))])))= ) - (menu-items (mapcar (jsonrpc-lambda (&key title command argumen= ts) - `(,title . (:command ,command :arguments = ,arguments))) + (menu-items (mapcar (jsonrpc-lambda (&key title command argumen= ts + edit _kind _diagnosti= cs) + `(,title . (:command ,command :arguments = ,arguments + :edit ,edit))) actions)) (menu (and menu-items `("Eglot code actions:" ("dummy" ,@menu-i= tems)))) (command-and-args @@ -1802,10 +1814,13 @@ If SKIP-SIGNATURE, don't try to send textDocument= /signatureHelp." (if (eq (setq retval (tmm-prompt menu)) never-mind) (keyboard-quit) retval)))))) - (cl-destructuring-bind (&key _title command arguments) command-and-a= rgs + (cl-destructuring-bind (&key _title command arguments edit) command-= and-args + (when edit + (eglot--apply-workspace-edit edit)) (if command (eglot-execute-command server (intern command) arguments) - (eglot--message "No code actions here"))))) + (unless edit + (eglot--message "No code actions here")))))) =20 =20 =0C From MAILER-DAEMON Thu Nov 22 19:15:48 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8O-0005WG-KV for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8K-0005RS-TG for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8A-0002Wh-8r for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:40 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz87-0002OB-Jv for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 7DAE120A06; Thu, 22 Nov 2018 19:15:31 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 11cd074 29/45: Support ocaml-language-server out of the box (#149) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Mario Rodas In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 11cd0740f4af92cfc1c0f52433fcf9476e702ceb Auto-Submitted: auto-generated Message-Id: <20181123001531.7DAE120A06@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:31 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:46 -0000 branch: externals/eglot commit 11cd0740f4af92cfc1c0f52433fcf9476e702ceb Author: Mario Rodas Commit: Jo=C3=A3o T=C3=A1vora Support ocaml-language-server out of the box (#149) =20 Copyright-paperwork-exempt: yes =20 * eglot.el (eglot-server-programs): Add ocaml-language-server. =20 * README.md (Installation and usage): Mention ocaml-language-server --- README.md | 3 ++- eglot.el | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 38698dd..0d73d37 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ for the language of your choice. Otherwise, it prompts = you to enter one: * Haskell's [IDE engine][haskell-ide-engine] * Kotlin's [kotlin-language-server][kotlin-language-server] * Golang's [go-langserver][go-langserver] +* Ocaml's [ocaml-language-server][ocaml-language-server] =20 I'll add to this list as I test more servers. In the meantime you can customize `eglot-server-programs`: @@ -303,4 +304,4 @@ Under the hood: [kotlin-language-server]: https://github.com/fwcd/KotlinLanguageServer [go-langserver]: https://github.com/sourcegraph/go-langserver [eclipse-jdt]: https://github.com/eclipse/eclipse.jdt.ls - +[ocaml-language-server]: https://github.com/freebroccolo/ocaml-language-= server diff --git a/eglot.el b/eglot.el index 0a78970..2ce9d08 100644 --- a/eglot.el +++ b/eglot.el @@ -85,6 +85,8 @@ rjsx-mode) . ("javascript-typescript-s= tdio")) (sh-mode . ("bash-language-server" "star= t")) ((c++-mode c-mode) . ("ccls")) + ((caml-mode tuareg-mode reason-mode) + . ("ocaml-language-server" "--stdio")) (ruby-mode . ("solargraph" "socket" "--port" :autoport)) From MAILER-DAEMON Thu Nov 22 19:15:49 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8O-0005WZ-SB for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8K-0005RQ-Sa for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8A-0002X8-7Q for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:40 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0002QM-9m for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:33 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 30E58204D7; Thu, 22 Nov 2018 19:15:32 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 7b4ed97 33/45: Fix #124: add ability to move to LSP-precise columns MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 7b4ed9736f8ab21adeee0205546d160313ab8b8f Auto-Submitted: auto-generated Message-Id: <20181123001532.30E58204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:32 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:46 -0000 branch: externals/eglot commit 7b4ed9736f8ab21adeee0205546d160313ab8b8f Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Fix #124: add ability to move to LSP-precise columns =20 Also close #125. =20 Idea and much of design contributed by Micha=C5=82 Krzywkowski =20 This introduces the variable eglot-move-to-column-function. =20 According to the standard, LSP column/character offsets are based on a count of UTF-16 code units, not actual visual columns. So when LSP says position 3 of a line containing just \"aXbc\", where X is a multi-byte character, it actually means `b', not `c'. This is what the function `eglot-move-to-lsp-abiding-column' does. =20 However, many servers don't follow the spec this closely, and thus this variable should be set to `move-to-column' in buffers managed by those servers. =20 * eglot.el (eglot-move-to-column-function): New variable. (eglot-move-to-lsp-abiding-column): New function. (eglot--lsp-position-to-point): Use eglot-move-to-column-function. --- eglot.el | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/eglot.el b/eglot.el index 576d7f3..f7b9c86 100644 --- a/eglot.el +++ b/eglot.el @@ -728,16 +728,43 @@ CONNECT-ARGS are passed as additional arguments to :character (- (goto-char (or pos (point))) (line-beginning-position))))) =20 +(defvar eglot-move-to-column-function #'move-to-column + "How to move to a column reported by the LSP server. + +According to the standard, LSP column/character offsets are based +on a count of UTF-16 code units, not actual visual columns. So +when LSP says position 3 of a line containing just \"aXbc\", +where X is a multi-byte character, it actually means `b', not +`c'. This is what the function +`eglot-move-to-lsp-abiding-column' does. + +However, many servers don't follow the spec this closely, and +thus this variable should be set to `move-to-column' in buffers +managed by those servers.") + +(defun eglot-move-to-lsp-abiding-column (column) + "Move to COLUMN abiding by the LSP spec." + (cl-loop + initially (move-to-column column) + with lbp =3D (line-beginning-position) + for diff =3D (- column + (/ (- (length (encode-coding-region lbp (point) 'utf-16= t)) + 2) + 2)) + until (zerop diff) + for offset =3D (max 1 (abs (/ diff 2))) + do (if (> diff 0) (forward-char offset) (backward-char offset)))) + (defun eglot--lsp-position-to-point (pos-plist &optional marker) "Convert LSP position POS-PLIST to Emacs point. If optional MARKER, return a marker instead" - (save-excursion (goto-char (point-min)) - (forward-line (min most-positive-fixnum - (plist-get pos-plist :line))) - (forward-char (min (plist-get pos-plist :character) - (- (line-end-position) - (line-beginning-position)))) - (if marker (copy-marker (point-marker)) (point)))) + (save-excursion + (goto-char (point-min)) + (forward-line (min most-positive-fixnum + (plist-get pos-plist :line))) + (unless (eobp) ;; if line was excessive leave point at eob + (funcall eglot-move-to-column-function (plist-get pos-plist :chara= cter))) + (if marker (copy-marker (point-marker)) (point)))) =20 (defun eglot--path-to-uri (path) "URIfy PATH." @@ -1040,7 +1067,7 @@ Uses THING, FACE, DEFS and PREPEND." (priority . ,(+ 50 i)) (keymap . ,(let ((map (make-sparse-keymap))) (define-key map [mouse-1] - (eglot--mouse-call 'eglot-code-actions= )) + (eglot--mouse-call 'eglot-co= de-actions)) map))))) =20 =0C From MAILER-DAEMON Thu Nov 22 19:15:49 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8P-0005Wp-4r for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8K-0005RR-Sb for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8A-0002XE-83 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:40 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz86-0002LQ-RS for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id BD05D209A2; Thu, 22 Nov 2018 19:15:30 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot f2ccb77 25/45: Simplify eglot-code-action. Fix compilation warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: f2ccb7773e40aedc8c5e8f985dfbeaa80ab2f5fc Auto-Submitted: auto-generated Message-Id: <20181123001530.BD05D209A2@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:30 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:46 -0000 branch: externals/eglot commit f2ccb7773e40aedc8c5e8f985dfbeaa80ab2f5fc Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Simplify eglot-code-action. Fix compilation warning =20 * eglot.el (eglot-code-actions): Simplify. (eglot-client-capabilities): Mention supported codeActionKind's directly. (eglot--code-action-kinds): Remove. --- eglot.el | 77 +++++++++++++++++++++++++++++++---------------------------= ------ 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/eglot.el b/eglot.el index b2e88d8..2b683f8 100644 --- a/eglot.el +++ b/eglot.el @@ -226,9 +226,12 @@ let the buffer grow forever." :codeAction (list :dynamicRegistration :json-false :codeActionLiteralSupport - `(:codeActionKind + '(:codeActionKind (:valueSet - [,@eglot--code-action-kinds]))) + ["quickfix" + "refactor" "refactor.extract" + "refactor.inline" "refactor.rewrit= e" + "source" "source.organizeImports"]= ))) :formatting `(:dynamicRegistration :json-false) :rangeFormatting `(:dynamicRegistration :json-false) :rename `(:dynamicRegistration :json-false) @@ -745,11 +748,6 @@ Doubles as an indicator of snippet support." (21 . "Null") (22 . "EnumMember") (23 . "Struct") (24 . "Event") (25 . "Operator") (26 . "TypeParameter"))) =20 -(defconst eglot--code-action-kinds - '("quickfix" "refactor" "refactor.extract" - "refactor.inline" "refactor.rewrite" - "source" "source.organizeImports")) - (defun eglot--format-markup (markup) "Format MARKUP according to LSP's spec." (pcase-let ((`(,string ,mode) @@ -1786,41 +1784,40 @@ If SKIP-SIGNATURE, don't try to send textDocument= /signatureHelp." (unless (eglot--server-capable :codeActionProvider) (eglot--error "Server can't execute code actions!")) (let* ((server (eglot--current-server-or-lose)) - (actions (jsonrpc-request - server - :textDocument/codeAction - (list :textDocument (eglot--TextDocumentIdentifier) - :range (list :start (eglot--pos-to-lsp-position= beg) - :end (eglot--pos-to-lsp-position e= nd)) - :context - `(:diagnostics - [,@(mapcar (lambda (diag) - (cdr (assoc 'eglot-lsp-diag - (eglot--diag-data di= ag)))) - (flymake-diagnostics beg end))])))= ) - (menu-items (mapcar (jsonrpc-lambda (&key title command argumen= ts - edit _kind _diagnosti= cs) - `(,title . (:command ,command :arguments = ,arguments - :edit ,edit))) - actions)) - (menu (and menu-items `("Eglot code actions:" ("dummy" ,@menu-i= tems)))) - (command-and-args - (and menu - (if (listp last-nonmenu-event) - (x-popup-menu last-nonmenu-event menu) - (let ((never-mind (gensym)) retval) - (setcdr (cadr menu) - (cons `("never mind..." . ,never-mind) (cdadr= menu))) - (if (eq (setq retval (tmm-prompt menu)) never-mind) - (keyboard-quit) - retval)))))) - (cl-destructuring-bind (&key _title command arguments edit) command-= and-args + (actions + (jsonrpc-request + server + :textDocument/codeAction + (list :textDocument (eglot--TextDocumentIdentifier) + :range (list :start (eglot--pos-to-lsp-position beg) + :end (eglot--pos-to-lsp-position end)) + :context + `(:diagnostics + [,@(mapcar (lambda (diag) + (cdr (assoc 'eglot-lsp-diag + (eglot--diag-data diag)))) + (flymake-diagnostics beg end))])))) + (menu-items + (or (mapcar (jsonrpc-lambda (&key title command arguments + edit _kind _diagnostics) + `(,title . (:command ,command :arguments ,argume= nts + :edit ,edit))) + actions) + (eglot--error "No code actions here"))) + (menu `("Eglot code actions:" ("dummy" ,@menu-items))) + (action (if (listp last-nonmenu-event) + (x-popup-menu last-nonmenu-event menu) + (let ((never-mind (gensym)) retval) + (setcdr (cadr menu) + (cons `("never mind..." . ,never-mind) (cda= dr menu))) + (if (eq (setq retval (tmm-prompt menu)) never-mind) + (keyboard-quit) + retval))))) + (cl-destructuring-bind (&key _title command arguments edit) action (when edit (eglot--apply-workspace-edit edit)) - (if command - (eglot-execute-command server (intern command) arguments) - (unless edit - (eglot--message "No code actions here")))))) + (when command + (eglot-execute-command server (intern command) arguments))))) =20 =20 =0C From MAILER-DAEMON Thu Nov 22 19:15:49 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8P-0005X2-8s for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8M-0005T8-5P for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8A-0002WP-7P for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:43 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz88-0002JO-0C for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id A7D9820A11; Thu, 22 Nov 2018 19:15:31 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 2a410e9 30/45: Move constants to top instead of forward-declaring MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 2a410e9cd1ebe917074ebc69aac8d42697da7416 Auto-Submitted: auto-generated Message-Id: <20181123001531.A7D9820A11@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:31 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:47 -0000 branch: externals/eglot commit 2a410e9cd1ebe917074ebc69aac8d42697da7416 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Move constants to top instead of forward-declaring =20 * eglot.el (eglot--symbol-kind-names, eglot--kind-names): Move to top of file. --- eglot.el | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/eglot.el b/eglot.el index 2ce9d08..e177174 100644 --- a/eglot.el +++ b/eglot.el @@ -174,6 +174,28 @@ let the buffer grow forever." :type '(choice (const :tag "No limit" nil) (integer :tag "Number of characters"))) =20 +=0C +;;; Constants +;;; +(defconst eglot--symbol-kind-names + `((1 . "File") (2 . "Module") + (3 . "Namespace") (4 . "Package") (5 . "Class") + (6 . "Method") (7 . "Property") (8 . "Field") + (9 . "Constructor") (10 . "Enum") (11 . "Interface") + (12 . "Function") (13 . "Variable") (14 . "Constant") + (15 . "String") (16 . "Number") (17 . "Boolean") + (18 . "Array") (19 . "Object") (20 . "Key") + (21 . "Null") (22 . "EnumMember") (23 . "Struct") + (24 . "Event") (25 . "Operator") (26 . "TypeParameter"))) + +(defconst eglot--kind-names + `((1 . "Text") (2 . "Method") (3 . "Function") (4 . "Constructor") + (5 . "Field") (6 . "Variable") (7 . "Class") (8 . "Interface") + (9 . "Module") (10 . "Property") (11 . "Unit") (12 . "Value") + (13 . "Enum") (14 . "Keyword") (15 . "Snippet") (16 . "Color") + (17 . "File") (18 . "Reference"))) + +=0C ;;; API (WORK-IN-PROGRESS!) ;;; (cl-defmacro eglot--with-live-buffer (buf &rest body) @@ -198,8 +220,6 @@ let the buffer grow forever." "JSON object to send under `initializationOptions'" (:method (_s) nil)) ; blank default =20 -(defvar eglot--symbol-kind-names) - (cl-defgeneric eglot-client-capabilities (server) "What the EGLOT LSP client supports for SERVER." (:method (_s) @@ -738,24 +758,6 @@ Doubles as an indicator of snippet support." (symbol-value 'yas-minor-mode) 'yas-expand-snippet)) =20 -(defconst eglot--kind-names - `((1 . "Text") (2 . "Method") (3 . "Function") (4 . "Constructor") - (5 . "Field") (6 . "Variable") (7 . "Class") (8 . "Interface") - (9 . "Module") (10 . "Property") (11 . "Unit") (12 . "Value") - (13 . "Enum") (14 . "Keyword") (15 . "Snippet") (16 . "Color") - (17 . "File") (18 . "Reference"))) - -(defconst eglot--symbol-kind-names - `((1 . "File") (2 . "Module") - (3 . "Namespace") (4 . "Package") (5 . "Class") - (6 . "Method") (7 . "Property") (8 . "Field") - (9 . "Constructor") (10 . "Enum") (11 . "Interface") - (12 . "Function") (13 . "Variable") (14 . "Constant") - (15 . "String") (16 . "Number") (17 . "Boolean") - (18 . "Array") (19 . "Object") (20 . "Key") - (21 . "Null") (22 . "EnumMember") (23 . "Struct") - (24 . "Event") (25 . "Operator") (26 . "TypeParameter"))) - (defun eglot--format-markup (markup) "Format MARKUP according to LSP's spec." (pcase-let ((`(,string ,mode) From MAILER-DAEMON Thu Nov 22 19:15:54 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8U-0005Zt-5M for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8K-0005RP-QU for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8A-0002Wm-4L for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:40 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz87-0002NJ-7x for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 256AF209EB; Thu, 22 Nov 2018 19:15:31 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot f74a80f 27/45: Make imenu hierarchical MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: f74a80fd7138ab948fdb2bb0950cd31a7dba2fba Auto-Submitted: auto-generated Message-Id: <20181123001531.256AF209EB@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:31 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:46 -0000 branch: externals/eglot commit f74a80fd7138ab948fdb2bb0950cd31a7dba2fba Author: Micha=C5=82 Krzywkowski Commit: mkcms Make imenu hierarchical =20 * eglot.el (eglot-imenu): Use :containerName to build a nested imenu index alist. --- eglot.el | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/eglot.el b/eglot.el index f11a14e..22f509b 100644 --- a/eglot.el +++ b/eglot.el @@ -1670,20 +1670,29 @@ If SKIP-SIGNATURE, don't try to send textDocument= /signatureHelp." (jsonrpc-lambda (&key name kind location containerName _deprecated) (cons (propertize - (concat - (and (stringp containerName) - (not (string-empty-p containerName)) - (concat containerName "::")) - name) + name :kind (alist-get kind eglot--symbol-kind-names - "(Unknown)")) + "Unknown") + :containerName (and (stringp containerName) + (not (string-empty-p containe= rName)) + containerName)) (eglot--lsp-position-to-point (plist-get (plist-get location :range) :start)))) (jsonrpc-request (eglot--current-server-or-lose) :textDocument/documentSymbol `(:textDocument ,(eglot--TextDocumentIden= tifier)))))) - (seq-group-by (lambda (e) (get-text-property 0 :kind (car e))) - entries)) + (mapcar + (pcase-lambda (`(,kind . ,syms)) + (let ((syms-by-scope (seq-group-by + (lambda (e) + (get-text-property 0 :containerName (= car e))) + syms))) + (cons kind (cl-loop for (scope . elems) in syms-by-scope + append (if scope + (list (cons scope elems)) + elems))))) + (seq-group-by (lambda (e) (get-text-property 0 :kind (car e))) + entries))) (funcall oldfun))) =20 (defun eglot--apply-text-edits (edits &optional version) From MAILER-DAEMON Thu Nov 22 19:15:54 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8U-0005a4-Bs for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8K-0005RU-TV for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8A-0002XQ-7H for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:40 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz87-0002MU-2G for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:32 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id EC242209D7; Thu, 22 Nov 2018 19:15:30 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 118f966 26/45: Fix a bug when response to definitions request is a single location MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 118f9668e45ea424d8090013392ace154538f1e4 Auto-Submitted: auto-generated Message-Id: <20181123001530.EC242209D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:30 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:46 -0000 branch: externals/eglot commit 118f9668e45ea424d8090013392ace154538f1e4 Author: Micha=C5=82 Krzywkowski Commit: Micha=C5=82 Krzywkowski Fix a bug when response to definitions request is a single location =20 It's valid to return just a single Location for a definitions request= . =20 * eglot.el (xref-backend-definitions): Coerce response to a vector. --- eglot.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eglot.el b/eglot.el index 2b683f8..f11a14e 100644 --- a/eglot.el +++ b/eglot.el @@ -1381,17 +1381,20 @@ DUMMY is ignored." (cl-defmethod xref-backend-definitions ((_backend (eql eglot)) identifie= r) (let* ((rich-identifier (car (member identifier eglot--xref-known-symbols))) - (location-or-locations + (definitions (if rich-identifier (get-text-property 0 :locations rich-identifier) (jsonrpc-request (eglot--current-server-or-lose) :textDocument/definition (get-text-property - 0 :textDocumentPositionParams identifier))= ))) + 0 :textDocumentPositionParams identifier))= )) + (locations + (and definitions + (if (vectorp definitions) definitions (vector definitions= ))))) (eglot--sort-xrefs (mapcar (jsonrpc-lambda (&key uri range) (eglot--xref-make identifier uri (plist-get range :start)= )) - location-or-locations)))) + locations)))) =20 (cl-defmethod xref-backend-references ((_backend (eql eglot)) identifier= ) (unless (eglot--server-capable :referencesProvider) From MAILER-DAEMON Thu Nov 22 19:15:54 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8U-0005aQ-Lu for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8K-0005Qe-6B for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz86-0002Jg-B0 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz85-0002HQ-O7 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:29 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id A113E20950; Thu, 22 Nov 2018 19:15:29 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 3c180c0 19/45: Rework test macros for hopefully more stable testing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 3c180c05c0d45321848cb40c6da72c1582511ce4 Auto-Submitted: auto-generated Message-Id: <20181123001529.A113E20950@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:29 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:46 -0000 branch: externals/eglot commit 3c180c05c0d45321848cb40c6da72c1582511ce4 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Rework test macros for hopefully more stable testing =20 Among other changes, discovered that the zzz-eglot-ensure test that could only misteriously be run last was victom of a malfunctioning python-flymake backend in for python-mode buffers. =20 * eglot-tests.el (eglot--with-fixture): Redesign macro. (eglot--call-with-fixture): Redesign. (eclipse-connect, eclipse-workspace-folders) (auto-detect-running-server, auto-reconnect, rls-watches-files) (rls-basic-diagnostics, rls-hover-after-edit, rls-rename) (basic-completions, hover-after-completions, formatting) (slow-sync-connection-wait, slow-sync-connection-intime) (slow-async-connection, slow-sync-timeout) (javascript-basic): Use eglot--with-fixture (eglot-ensure): Rename from zzz-eglot-ensure. Remove python-flymake from flymake-diagnostic-functions. --- eglot-tests.el | 124 +++++++++++++++++++++++++++++++++------------------= ------ 1 file changed, 72 insertions(+), 52 deletions(-) diff --git a/eglot-tests.el b/eglot-tests.el index a16bd52..306614b 100644 --- a/eglot-tests.el +++ b/eglot-tests.el @@ -40,37 +40,53 @@ (string-match-p "org\\.eclipse\\.equinox\\.launcher_.*\\.jar$"= x)) (split-string (getenv "CLASSPATH") ":")))) =20 -(defmacro eglot--with-dirs-and-files (dirs &rest body) +(defmacro eglot--with-fixture (fixture &rest body) + "Setup FIXTURE, call BODY, teardown FIXTURE. +FIXTURE is a list. Its elements are of the form (FILE . CONTENT) +to create a readable FILE with CONTENT. FILE may be a directory +name and CONTENT another (FILE . CONTENT) list to specify a +directory hierarchy. FIXTURE's elements can also be (SYMBOL +VALUE) meaning SYMBOL should be bound to VALUE during BODY and +then restored." (declare (indent 1) (debug t)) - `(eglot--call-with-dirs-and-files - ,dirs #'(lambda () ,@body))) + `(eglot--call-with-fixture + ,fixture #'(lambda () ,@body))) =20 -(defun eglot--make-file-or-dirs (ass) +(defun eglot--make-file-or-dir (ass) (let ((file-or-dir-name (car ass)) (content (cdr ass))) (cond ((listp content) (make-directory file-or-dir-name 'parents) (let ((default-directory (concat default-directory "/" file-o= r-dir-name))) - (mapc #'eglot--make-file-or-dirs content))) + (mapcan #'eglot--make-file-or-dir content))) ((stringp content) (with-temp-buffer (insert content) - (write-region nil nil file-or-dir-name nil 'nomessage))) + (write-region nil nil file-or-dir-name nil 'nomessage)) + (list file-or-dir-name)) (t - (message "[yas] oops don't know this content"))))) + (eglot--error "Expected a string or a directory spec"))))) =20 -(defun eglot--call-with-dirs-and-files (dirs fn) +(defun eglot--call-with-fixture (fixture fn) + "Helper for `eglot--with-fixture'. Run FN under FIXTURE." (let* ((fixture-directory (make-temp-file "eglot--fixture" t)) (default-directory fixture-directory) - new-buffers new-servers + file-specs created-files + syms-to-restore + buffers-to-delete new-servers cleanup-events-et-cetera-p) + (dolist (spec fixture) + (cond ((symbolp spec) + (push (cons spec (symbol-value spec)) syms-to-restore) + (set spec nil)) + ((symbolp (car spec)) + (push (cons (car spec) (symbol-value (car spec))) syms-to-r= estore) + (set (car spec) (cadr spec))) + ((stringp (car spec)) (push spec file-specs)))) (unwind-protect - (let ((find-file-hook - (cons (lambda () (push (current-buffer) new-buffers)) - find-file-hook)) - (eglot-connect-hook + (let ((eglot-connect-hook (lambda (server) (push server new-servers)))) - (mapc #'eglot--make-file-or-dirs dirs) + (setq created-files (mapcan #'eglot--make-file-or-dir file-spe= cs)) (funcall fn) (setq cleanup-events-et-cetera-p t)) (unwind-protect @@ -79,12 +95,17 @@ (eglot-shutdown server nil nil (not cleanup-events-et-cetera-p))) (cl-remove-if-not #'jsonrpc-running-p new-servers))) + (setq buffers-to-delete + (delete nil (mapcar #'find-buffer-visiting created-files))= ) + (cl-loop for (sym . val) in syms-to-restore + do (set sym val)) (eglot--message - "Killing project buffers %s, deleting %s, killing server %s" - (mapconcat #'buffer-name new-buffers ", ") + "Killing project buffers %s, deleting %s, restoring %s, killing= server %s" + (mapconcat #'buffer-name buffers-to-delete ", ") default-directory + (mapcar #'car syms-to-restore) (mapcar #'jsonrpc-name new-servers)) - (dolist (buf new-buffers) ;; have to save otherwise will get pro= mpted + (dolist (buf buffers-to-delete) ;; have to save otherwise will g= et prompted (with-current-buffer buf (save-buffer) (kill-buffer))) (delete-directory fixture-directory 'recursive))))) =20 @@ -208,7 +229,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (ert-deftest eclipse-connect () "Connect to eclipse.jdt.ls server." (skip-unless (eglot--have-eclipse-jdt-ls-p)) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project/src/main/java/foo" . (("Main.java" . ""))) ("project/.git/" . nil)) (with-current-buffer @@ -223,7 +244,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (ert-deftest eclipse-workspace-folders () "Check eclipse connection with multi-root projects." (skip-unless (eglot--have-eclipse-jdt-ls-p)) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project/main/src/main/java/foo" . (("Main.java" . ""))) ("project/sub1/" . (("pom.xml" . ""))) ("project/sub2/" . (("build.gradle" . ""))) @@ -252,7 +273,7 @@ Pass TIMEOUT to `eglot--with-timeout'." "Visit a file and M-x eglot, then visit a neighbour. " (skip-unless (executable-find "rls")) (let (server) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("coiso.rs" . "bla") ("merdix.rs" . "bla"))) ("anotherproject" . (("cena.rs" . "bla")))) @@ -272,7 +293,7 @@ Pass TIMEOUT to `eglot--with-timeout'." "Start a server. Kill it. Watch it reconnect." (skip-unless (executable-find "rls")) (let (server (eglot-autoreconnect 1)) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("coiso.rs" . "bla") ("merdix.rs" . "bla")))) (with-current-buffer @@ -297,7 +318,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (skip-unless (executable-find "cargo")) (skip-unless (null (getenv "TRAVIS_TESTING"))) (let ((eglot-autoreconnect 1)) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("watch-project" . (("coiso.rs" . "bla") ("merdix.rs" . "bla")))) (with-current-buffer @@ -331,7 +352,7 @@ Pass TIMEOUT to `eglot--with-timeout'." "Test basic diagnostics in RLS." (skip-unless (executable-find "rls")) (skip-unless (executable-find "cargo")) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("diag-project" . (("main.rs" . "fn main() {\nprintfoo!(\"Hello,= world!\");\n}")))) (with-current-buffer (eglot--find-file-noselect "diag-project/main.rs") @@ -351,7 +372,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (skip-unless (executable-find "rls")) (skip-unless (executable-find "cargo")) (skip-unless (null (getenv "TRAVIS_TESTING"))) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("hover-project" . (("main.rs" . "fn test() -> i32 { let test=3D3; return te; }")))) @@ -384,7 +405,7 @@ Pass TIMEOUT to `eglot--with-timeout'." "Test renaming in RLS." (skip-unless (executable-find "rls")) (skip-unless (executable-find "cargo")) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("rename-project" . (("main.rs" . "fn test() -> i32 { let test=3D3; return test; }")))) @@ -399,7 +420,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (ert-deftest basic-completions () "Test basic autocompletion in a python LSP" (skip-unless (executable-find "pyls")) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("something.py" . "import sys\nsys.exi")))) (with-current-buffer (eglot--find-file-noselect "project/something.py") @@ -411,7 +432,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (ert-deftest hover-after-completions () "Test basic autocompletion in a python LSP" (skip-unless (executable-find "pyls")) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("something.py" . "import sys\nsys.exi")))) (with-current-buffer (eglot--find-file-noselect "project/something.py") @@ -428,7 +449,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (skip-unless (and (executable-find "pyls") (or (executable-find "yapf") (executable-find "autopep8")))) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("something.py" . "def a():pass\ndef b():pass")))) (with-current-buffer (eglot--find-file-noselect "project/something.py") @@ -453,7 +474,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (ert-deftest javascript-basic () "Test basic autocompletion in a python LSP" (skip-unless (executable-find "~/.yarn/bin/javascript-typescript-stdio= ")) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("hello.js" . "console.log('Hello world!');")))) (with-current-buffer (eglot--find-file-noselect "project/hello.js") @@ -479,33 +500,32 @@ Pass TIMEOUT to `eglot--with-timeout'." (=3D severity 1)) diagnostics))))))))) =20 -(ert-deftest zzz-eglot-ensure () +(ert-deftest eglot-ensure () "Test basic `eglot-ensure' functionality" (skip-unless (executable-find "pyls")) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("foo.py" . "import sys\nsys.exi") - ("bar.py" . "import sys\nsys.exi")))) - (let ((saved-python-mode-hook python-mode-hook) - server) - (unwind-protect - (progn - (add-hook 'python-mode-hook 'eglot-ensure) - ;; need `ert-simulate-command' because `eglot-ensure' - ;; relies on `post-command-hook'. - (with-current-buffer - (ert-simulate-command - '(find-file "project/foo.py")) - (should (setq server (eglot--current-server)))) - (with-current-buffer - (ert-simulate-command - '(find-file "project/bar.py")) - (should (eq server (eglot--current-server))))) - (setq python-mode-hook saved-python-mode-hook))))) + ("bar.py" . "import sys\nsys.exi"))) + (python-mode-hook + (eglot-ensure + (lambda () + (remove-hook 'flymake-diagnostic-functions 'python-flymake))= ))) + (let (server) + ;; need `ert-simulate-command' because `eglot-ensure' + ;; relies on `post-command-hook'. + (with-current-buffer + (ert-simulate-command + '(find-file "project/foo.py")) + (should (setq server (eglot--current-server)))) + (with-current-buffer + (ert-simulate-command + '(find-file "project/bar.py")) + (should (eq server (eglot--current-server))))))) =20 (ert-deftest slow-sync-connection-wait () "Connect with `eglot-sync-connect' set to t." (skip-unless (executable-find "pyls")) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("something.py" . "import sys\nsys.exi")))) (with-current-buffer (eglot--find-file-noselect "project/something.py") @@ -517,7 +537,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (ert-deftest slow-sync-connection-intime () "Connect synchronously with `eglot-sync-connect' set to 2." (skip-unless (executable-find "pyls")) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("something.py" . "import sys\nsys.exi")))) (with-current-buffer (eglot--find-file-noselect "project/something.py") @@ -529,7 +549,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (ert-deftest slow-async-connection () "Connect asynchronously with `eglot-sync-connect' set to 2." (skip-unless (executable-find "pyls")) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("something.py" . "import sys\nsys.exi")))) (with-current-buffer (eglot--find-file-noselect "project/something.py") @@ -545,7 +565,7 @@ Pass TIMEOUT to `eglot--with-timeout'." (ert-deftest slow-sync-timeout () "Failed attempt at connection synchronously." (skip-unless (executable-find "pyls")) - (eglot--with-dirs-and-files + (eglot--with-fixture '(("project" . (("something.py" . "import sys\nsys.exi")))) (with-current-buffer (eglot--find-file-noselect "project/something.py") From MAILER-DAEMON Thu Nov 22 19:15:55 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8U-0005aj-S9 for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8M-0005Sz-3N for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8F-0002ei-LJ for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:42 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-0002OB-02 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:34 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 8B9A420A5A; Thu, 22 Nov 2018 19:15:32 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot b31ba80 35/45: Tweak solution to #125 with a hint from Fangrui Song MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: b31ba809cd824ce05b0131844d7216ae2d276a14 Auto-Submitted: auto-generated Message-Id: <20181123001532.8B9A420A5A@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:32 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:47 -0000 branch: externals/eglot commit b31ba809cd824ce05b0131844d7216ae2d276a14 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Tweak solution to #125 with a hint from Fangrui Song =20 * eglot.el (eglot-move-to-lsp-abiding-column): Simplify slightly. --- eglot.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eglot.el b/eglot.el index 512e9a6..24f8c97 100644 --- a/eglot.el +++ b/eglot.el @@ -752,8 +752,7 @@ managed by those servers.") 2) 2)) until (zerop diff) - for offset =3D (max 1 (abs (/ diff 2))) - do (if (> diff 0) (forward-char offset) (backward-char offset)))) + do (forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2)))) =20 (defun eglot--lsp-position-to-point (pos-plist &optional marker) "Convert LSP position POS-PLIST to Emacs point. From MAILER-DAEMON Thu Nov 22 19:15:55 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8V-0005az-0z for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005VK-07 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8I-0002nP-GI for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:44 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-0002MU-03 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:34 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id B85FD20AC1; Thu, 22 Nov 2018 19:15:32 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot fdb1941 36/45: Add support for TextEdits in completion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: fdb1941fb01d590ad67092fb83fdbbd474e3d6f1 Auto-Submitted: auto-generated Message-Id: <20181123001532.B85FD20AC1@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:32 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:49 -0000 branch: externals/eglot commit fdb1941fb01d590ad67092fb83fdbbd474e3d6f1 Author: Micha=C5=82 Krzywkowski Commit: mkcms Add support for TextEdits in completion =20 * eglot.el (eglot-completion-at-point): Apply the CompletionItem's :textEdit and :additionalTextEdits when they're present. --- eglot.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/eglot.el b/eglot.el index 24f8c97..d4a8b6f 100644 --- a/eglot.el +++ b/eglot.el @@ -1584,12 +1584,23 @@ is not active." (cl-find comp strings :test #'string=3D)))) (cl-destructuring-bind (&key insertTextFormat insertText + textEdit + additionalTextEdits &allow-other-keys) (text-properties-at 0 comp) - (when-let ((fn (and (eql insertTextFormat 2) - (eglot--snippet-expansion-fn)))) - (delete-region (- (point) (length comp)) (point)) - (funcall fn insertText)) + (let ((fn (and (eql insertTextFormat 2) + (eglot--snippet-expansion-fn)))) + (when (or fn textEdit) + ;; Undo the completion + (delete-region (- (point) (length comp)) (point))) + (cond (textEdit + (cl-destructuring-bind (&key range newText) textEd= it + (pcase-let ((`(,beg . ,end) (eglot--range-region= range))) + (delete-region beg end) + (goto-char beg) + (funcall (or fn #'insert) newText))) + (eglot--apply-text-edits additionalTextEdits)) + (fn (funcall fn insertText)))) (eglot--signal-textDocument/didChange) (eglot-eldoc-function)))))))) =20 From MAILER-DAEMON Thu Nov 22 19:15:55 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8V-0005bQ-52 for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005VJ-00 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8I-0002nK-Gm for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:44 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-0002LQ-0A for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:34 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id BA65820BBE; Thu, 22 Nov 2018 19:15:33 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot d66f2eb 39/45: Treat tab characters as 1 column wide in position conversion functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: d66f2eb1d85c40291b55106d8d694d0298b3fddb Auto-Submitted: auto-generated Message-Id: <20181123001533.BA65820BBE@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:33 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:49 -0000 branch: externals/eglot commit d66f2eb1d85c40291b55106d8d694d0298b3fddb Author: Micha=C5=82 Krzywkowski Commit: Micha=C5=82 Krzywkowski Treat tab characters as 1 column wide in position conversion function= s =20 Fixes #158. =20 * eglot.el (eglot--pos-to-lsp-position): Call eglot-current-column-function with tab-width bound to 1. (eglot--lsp-position-to-point): Call eglot-move-to-column-function with tab-width bound to 1. --- eglot.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eglot.el b/eglot.el index 3ba1b87..d9c1c3a 100644 --- a/eglot.el +++ b/eglot.el @@ -743,7 +743,8 @@ for all others.") (eglot--widening (list :line (1- (line-number-at-pos pos t)) ; F!@&#$CKING OFF-BY-ONE :character (progn (when pos (goto-char pos)) - (funcall eglot-current-column-function))))) + (let ((tab-width 1)) + (funcall eglot-current-column-function)))))= ) =20 (defvar eglot-move-to-column-function #'move-to-column "Function to move to a column reported by the LSP server. @@ -778,7 +779,8 @@ If optional MARKER, return a marker instead" (forward-line (min most-positive-fixnum (plist-get pos-plist :line))) (unless (eobp) ;; if line was excessive leave point at eob - (funcall eglot-move-to-column-function (plist-get pos-plist :chara= cter))) + (let ((tab-width 1)) + (funcall eglot-move-to-column-function (plist-get pos-plist :cha= racter)))) (if marker (copy-marker (point-marker)) (point)))) =20 (defun eglot--path-to-uri (path) From MAILER-DAEMON Thu Nov 22 19:15:55 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8V-0005bf-DK for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005VL-0r for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8J-0002qR-2l for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:44 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-00027P-5M for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:35 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 209E8204D7; Thu, 22 Nov 2018 19:15:34 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot b731db5 41/45: Add support for R's languageserver (#161) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Alex Branham In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: b731db56883f6de36600b735758c9067431ca54c Auto-Submitted: auto-generated Message-Id: <20181123001534.209E8204D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:34 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:49 -0000 branch: externals/eglot commit b731db56883f6de36600b735758c9067431ca54c Author: Alex Branham Commit: Micha=C5=82 Krzywkowski Add support for R's languageserver (#161) =20 Copyright-paperwork-exempt: yes =20 * eglot.el (eglot-server-programs): Add R language server. * README.md (Installation and usage): Mention it. --- README.md | 2 ++ eglot.el | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 0d73d37..ad6730c 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ for the language of your choice. Otherwise, it prompts = you to enter one: * Kotlin's [kotlin-language-server][kotlin-language-server] * Golang's [go-langserver][go-langserver] * Ocaml's [ocaml-language-server][ocaml-language-server] +* R's [languageserver][r-languageserver] =20 I'll add to this list as I test more servers. In the meantime you can customize `eglot-server-programs`: @@ -305,3 +306,4 @@ Under the hood: [go-langserver]: https://github.com/sourcegraph/go-langserver [eclipse-jdt]: https://github.com/eclipse/eclipse.jdt.ls [ocaml-language-server]: https://github.com/freebroccolo/ocaml-language-= server +[r-languageserver]: https://cran.r-project.org/package=3Dlanguageserver diff --git a/eglot.el b/eglot.el index c65d908..c382c67 100644 --- a/eglot.el +++ b/eglot.el @@ -96,6 +96,8 @@ language-server/bin/php-language-server.php")) (kotlin-mode . ("kotlin-language-server"= )) (go-mode . ("go-langserver" "-mode=3Dstd= io" "-gocodecompletion")) + ((R-mode ess-r-mode) . ("R" "--slave" "-= e" + "languageserver:= :run()")) (java-mode . eglot--eclipse-jdt-contact)= ) "How the command `eglot' guesses the server to start. An association list of (MAJOR-MODE . CONTACT) pairs. MAJOR-MODE From MAILER-DAEMON Thu Nov 22 19:15:55 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8V-0005c3-NO for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005VW-3a for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8K-0002vC-7x for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:46 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8B-0002aJ-At for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 45425209D7; Thu, 22 Nov 2018 19:15:35 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot de1728c 44/45: * eglot.el (eglot-completion-at-point): Less chatter. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: de1728c39f69231da0a04450d02950937b096201 Auto-Submitted: auto-generated Message-Id: <20181123001535.45425209D7@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:35 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:49 -0000 branch: externals/eglot commit de1728c39f69231da0a04450d02950937b096201 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora * eglot.el (eglot-completion-at-point): Less chatter. --- eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index 9ff9cdf..b408e59 100644 --- a/eglot.el +++ b/eglot.el @@ -1629,7 +1629,8 @@ is not active." (delete-region beg end) (goto-char beg) (funcall (or snippet-fn #'insert) newText))) - (eglot--apply-text-edits additionalTextEdits)) + (when (cl-plusp (length additionalTextEdits)) + (eglot--apply-text-edits additionalTextEdits))) (snippet-fn ;; A snippet should be inserted, but using plain ;; `insertText'. This requires us to delete the From MAILER-DAEMON Thu Nov 22 19:15:56 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8W-0005dE-NZ for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005VQ-1e for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8I-0002nW-Gi for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:44 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-0002JO-08 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:34 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id E48462045F; Thu, 22 Nov 2018 19:15:33 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot fc03d7c 40/45: Fix #160: Properly delete inserted text after completion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: fc03d7c642739e548d36cb8467ac9a235a3fb1c8 Auto-Submitted: auto-generated Message-Id: <20181123001533.E48462045F@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:33 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:49 -0000 branch: externals/eglot commit fc03d7c642739e548d36cb8467ac9a235a3fb1c8 Author: Micha=C5=82 Krzywkowski Commit: mkcms Fix #160: Properly delete inserted text after completion =20 * eglot.el (eglot-completion-at-point): In :exit-function, delete onl= y the region of buffer that was inserted by completion. --- eglot.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eglot.el b/eglot.el index d9c1c3a..c65d908 100644 --- a/eglot.el +++ b/eglot.el @@ -1543,6 +1543,7 @@ is not active." (string-trim-left label)) (t (or insertText (string-trim-left label))))= )) + (setq all (append all `(:bounds ,bounds))) (add-text-properties 0 1 all completion) (put-text-property 0 1 'eglot--lsp-completion all comp= letion) completion)) @@ -1604,13 +1605,19 @@ is not active." insertText textEdit additionalTextEdits + bounds &allow-other-keys) (text-properties-at 0 comp) (let ((fn (and (eql insertTextFormat 2) (eglot--snippet-expansion-fn)))) (when (or fn textEdit) - ;; Undo the completion - (delete-region (- (point) (length comp)) (point))) + ;; Undo the completion. If before completion the buffe= r was + ;; "foo.b" and now is "foo.bar", `comp' will be "bar". = We + ;; want to delete only "ar" (`comp' minus the symbol wh= ose + ;; bounds we've calculated before) (github#160). + (delete-region (+ (- (point) (length comp)) + (if bounds (- (cdr bounds) (car bound= s)) 0)) + (point))) (cond (textEdit (cl-destructuring-bind (&key range newText) textEd= it (pcase-let ((`(,beg . ,end) (eglot--range-region= range))) From MAILER-DAEMON Thu Nov 22 19:15:57 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8W-0005dY-TH for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005VU-2x for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8I-0002n8-Fz for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:44 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-0002NJ-04 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:34 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 2251D20B32; Thu, 22 Nov 2018 19:15:33 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 604c1b0 38/45: Per #144: Format documentation of signature parameters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?q?Micha=C5=82_Krzywkowski?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 604c1b0c31f7202f83373dd97f620dbc2dddfa52 Auto-Submitted: auto-generated Message-Id: <20181123001533.2251D20B32@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:33 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:49 -0000 branch: externals/eglot commit 604c1b0c31f7202f83373dd97f620dbc2dddfa52 Author: Micha=C5=82 Krzywkowski Commit: Micha=C5=82 Krzywkowski Per #144: Format documentation of signature parameters =20 * eglot.el (eglot--sig-info): Call `eglot--format-markup` on paramete= r :documentation. --- eglot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index 2c0b22e..3ba1b87 100644 --- a/eglot.el +++ b/eglot.el @@ -1665,7 +1665,7 @@ is not active." (insert "\n" (propertize label 'face 'eldoc-highlight-function-argum= ent) - ": " documentation)))) + ": " (eglot--format-markup documentation))))= ) (buffer-string))) when moresigs concat "\n")) =20 From MAILER-DAEMON Thu Nov 22 19:15:57 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8X-0005dj-3Q for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005VX-3y for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8K-0002vN-8F for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:46 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-0002Iz-Bw for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 51FF0209A2; Thu, 22 Nov 2018 19:15:34 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 894fe5a 42/45: Fix #154: fix potential security issue fontifying LSP doc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 894fe5a9da9354c5dba826ecbd15562dadbc9fe3 Auto-Submitted: auto-generated Message-Id: <20181123001534.51FF0209A2@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:34 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:49 -0000 branch: externals/eglot commit 894fe5a9da9354c5dba826ecbd15562dadbc9fe3 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Fix #154: fix potential security issue fontifying LSP doc =20 Previously, a server could mistankely or maliciously call *-mode functions by in the response to a completion or hover request, specifically in the :documentation field of the response. =20 Although there are plenty of similar avenues of attack in Emacs, it's probably a good idea not to let LSP servers decide which functions to call in an Emacs session running Eglot. =20 * eglot.el (eglot--format-markup): Call major-mode to fontify buffer, not some dynamically constructed function name. (eglot-completion-at-point): Ensure eglot--format-markup runs in source buffer. --- eglot.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/eglot.el b/eglot.el index c382c67..f4a02ac 100644 --- a/eglot.el +++ b/eglot.el @@ -810,7 +810,7 @@ Doubles as an indicator of snippet support." (if (stringp markup) (list (string-trim markup) (intern "gfm-mode")) (list (plist-get markup :value) - (intern (concat (plist-get markup :language) "-mo= de" )))))) + major-mode)))) (with-temp-buffer (ignore-errors (funcall mode)) (insert string) (font-lock-ensure) (buffer-string)))) @@ -1585,11 +1585,13 @@ is not active." (get-text-property 0 'eglot--lsp-completion ob= j) :cancel-on-input t) - :documentation))))) - (when documentation + :documentation)))) + (formatted (and documentation + (eglot--format-markup documentation)))) + (when formatted (with-current-buffer (get-buffer-create " *eglot doc*") (erase-buffer) - (insert (eglot--format-markup documentation)) + (insert formatted) (current-buffer))))) :company-prefix-length (cl-some #'looking-back From MAILER-DAEMON Thu Nov 22 19:15:58 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8Y-0005f8-6d for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005VO-17 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8I-0002n1-GF for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:44 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz89-0002P8-Vz for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:34 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 5CD1C20A2E; Thu, 22 Nov 2018 19:15:32 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot b9e9cf3 34/45: Fix #148: complex completions work when chosen from *completions* MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: b9e9cf35f5e4b1809f45cba563dd421b58cdee38 Auto-Submitted: auto-generated Message-Id: <20181123001532.5CD1C20A2E@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:32 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:49 -0000 branch: externals/eglot commit b9e9cf35f5e4b1809f45cba563dd421b58cdee38 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Fix #148: complex completions work when chosen from *completions* =20 * eglot.el (eglot-completion-at-point): Make exit-function work even if its arguments was stripped of its properties. --- eglot.el | 60 +++++++++++++++++++++++++++++++++++-----------------------= -- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/eglot.el b/eglot.el index f7b9c86..512e9a6 100644 --- a/eglot.el +++ b/eglot.el @@ -1501,7 +1501,8 @@ is not active." "EGLOT's `completion-at-point' function." (let ((bounds (bounds-of-thing-at-point 'symbol)) (server (eglot--current-server-or-lose)) - (completion-capability (eglot--server-capable :completionProvide= r))) + (completion-capability (eglot--server-capable :completionProvide= r)) + strings) (when completion-capability (list (or (car bounds) (point)) @@ -1514,19 +1515,21 @@ is not active." :deferred :textDocument/completi= on :cancel-on-input t)) (items (if (vectorp resp) resp (plist-get resp :items))= )) - (mapcar - (jsonrpc-lambda (&rest all &key label insertText insertText= Format - &allow-other-keys) - (let ((completion - (cond ((and (eql insertTextFormat 2) - (eglot--snippet-expansion-fn)) - (string-trim-left label)) - (t - (or insertText (string-trim-left label)))))= ) - (add-text-properties 0 1 all completion) - (put-text-property 0 1 'eglot--lsp-completion all compl= etion) - completion)) - items)))) + (setq + strings + (mapcar + (jsonrpc-lambda (&rest all &key label insertText insertTex= tFormat + &allow-other-keys) + (let ((completion + (cond ((and (eql insertTextFormat 2) + (eglot--snippet-expansion-fn)) + (string-trim-left label)) + (t + (or insertText (string-trim-left label))))= )) + (add-text-properties 0 1 all completion) + (put-text-property 0 1 'eglot--lsp-completion all comp= letion) + completion)) + items))))) :annotation-function (lambda (obj) (cl-destructuring-bind (&key detail kind insertTextFormat @@ -1572,17 +1575,24 @@ is not active." (cl-some #'looking-back (mapcar #'regexp-quote (plist-get completion-capability :triggerCharact= ers))) - :exit-function (lambda (obj _status) - (cl-destructuring-bind (&key insertTextFormat - insertText - &allow-other-keys) - (text-properties-at 0 obj) - (when-let ((fn (and (eql insertTextFormat 2) - (eglot--snippet-expansion-= fn)))) - (delete-region (- (point) (length obj)) (poi= nt)) - (funcall fn insertText)) - (eglot--signal-textDocument/didChange) - (eglot-eldoc-function))))))) + :exit-function + (lambda (comp _status) + (let ((comp (if (get-text-property 0 'eglot--lsp-completion com= p) + comp + ;; When selecting from the *Completions* + ;; buffer, `comp' won't have any properties. A + ;; lookup should fix that (github#148) + (cl-find comp strings :test #'string=3D)))) + (cl-destructuring-bind (&key insertTextFormat + insertText + &allow-other-keys) + (text-properties-at 0 comp) + (when-let ((fn (and (eql insertTextFormat 2) + (eglot--snippet-expansion-fn)))) + (delete-region (- (point) (length comp)) (point)) + (funcall fn insertText)) + (eglot--signal-textDocument/didChange) + (eglot-eldoc-function)))))))) =20 (defvar eglot--highlights nil "Overlays for textDocument/documentHighlig= ht.") =20 From MAILER-DAEMON Thu Nov 22 19:15:58 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8Y-0005fL-Ec for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005VN-0z for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8I-0002nF-Fx for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:44 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8A-0002No-04 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:34 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id E57EF20B2A; Thu, 22 Nov 2018 19:15:32 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot 0a18dca 37/45: Fix #125: add ability to report LSP-compliant columns MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: 0a18dca4cafa9c95f2f7341d7eab39e702c173e3 Auto-Submitted: auto-generated Message-Id: <20181123001532.E57EF20B2A@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:32 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:49 -0000 branch: externals/eglot commit 0a18dca4cafa9c95f2f7341d7eab39e702c173e3 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Fix #125: add ability to report LSP-compliant columns =20 * eglot.el (eglot-current-column-function): New variable. (eglot-lsp-abiding-column): New helper. (eglot--pos-to-lsp-position): Use eglot-current-column-function. (eglot-move-to-column-function): Tweak docstring. --- eglot.el | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/eglot.el b/eglot.el index d4a8b6f..2c0b22e 100644 --- a/eglot.el +++ b/eglot.el @@ -721,26 +721,42 @@ CONNECT-ARGS are passed as additional arguments to (let ((warning-minimum-level :error)) (display-warning 'eglot (apply #'format format args) :warning))) =20 +(defvar eglot-current-column-function #'current-column + "Function to calculate the current column. + +This is the inverse operation of +`eglot-move-to-column-function' (which see). It is a function of +no arguments returning a column number. For buffers managed by +fully LSP-compliant servers, this should be set to +`eglot-lsp-abiding-column', and `current-column' (the default) +for all others.") + +(defun eglot-lsp-abiding-column () + "Calculate current COLUMN as defined by the LSP spec." + (/ (- (length (encode-coding-region (line-beginning-position) + (point) 'utf-16 t)) + 2) + 2)) + (defun eglot--pos-to-lsp-position (&optional pos) "Convert point POS to LSP position." (eglot--widening (list :line (1- (line-number-at-pos pos t)) ; F!@&#$CKING OFF-BY-ONE - :character (- (goto-char (or pos (point))) - (line-beginning-position))))) + :character (progn (when pos (goto-char pos)) + (funcall eglot-current-column-function))))) =20 (defvar eglot-move-to-column-function #'move-to-column - "How to move to a column reported by the LSP server. + "Function to move to a column reported by the LSP server. =20 According to the standard, LSP column/character offsets are based on a count of UTF-16 code units, not actual visual columns. So when LSP says position 3 of a line containing just \"aXbc\", where X is a multi-byte character, it actually means `b', not -`c'. This is what the function -`eglot-move-to-lsp-abiding-column' does. +`c'. However, many servers don't follow the spec this closely. =20 -However, many servers don't follow the spec this closely, and -thus this variable should be set to `move-to-column' in buffers -managed by those servers.") +For buffers managed by fully LSP-compliant servers, this should +be set to `eglot-move-to-lsp-abiding-column', and +`move-to-column' (the default) for all others.") =20 (defun eglot-move-to-lsp-abiding-column (column) "Move to COLUMN abiding by the LSP spec." From MAILER-DAEMON Thu Nov 22 19:15:58 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8Y-0005fg-MV for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005Vb-4s for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8K-0002v4-7Z for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:46 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8B-0002aw-H0 for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 73DFD209EB; Thu, 22 Nov 2018 19:15:35 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot f291816 45/45: * eglot.el (Version): Bump to 1.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: f2918166de7229e6e09096ba4d11c574e504dee5 Auto-Submitted: auto-generated Message-Id: <20181123001535.73DFD209EB@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:35 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:50 -0000 branch: externals/eglot commit f2918166de7229e6e09096ba4d11c574e504dee5 Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora * eglot.el (Version): Bump to 1.2 --- eglot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index b408e59..365b5d2 100644 --- a/eglot.el +++ b/eglot.el @@ -2,7 +2,7 @@ =20 ;; Copyright (C) 2018 Free Software Foundation, Inc. =20 -;; Version: 1.1 +;; Version: 1.2 ;; Author: Jo=C3=A3o T=C3=A1vora ;; Maintainer: Jo=C3=A3o T=C3=A1vora ;; URL: https://github.com/joaotavora/eglot From MAILER-DAEMON Thu Nov 22 19:15:59 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8Y-0005fy-SS for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005Vj-7z for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8M-000334-5a for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:48 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8H-0002md-UT for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:43 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id DA397209F6; Thu, 22 Nov 2018 19:15:41 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] tag 1.2 created (now f291816) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <20181123001525.29572.64759@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/tags/1.2 X-Git-Reftype: tag X-Git-Oldrev: 0000000000000000000000000000000000000000 X-Git-Newrev: f2918166de7229e6e09096ba4d11c574e504dee5 Auto-Submitted: auto-generated Date: Thu, 22 Nov 2018 19:15:35 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:50 -0000 capitaomorte pushed a change to tag 1.2. at f291816 (commit) This tag includes the following new commits: new 69b8428 Make eglot-ignored-server-capabilites more user-fri= endly (#126) new 489080b eglot-ignored-server-capabilites: Prefer all choice= s over "Other" new 31fcd91 Handle case when diagnostic :character is out of ra= nge new 9585b74 Merge pull request #104 from mkcms/fix-diagnostics-= wrong-type-argument new 5571f10 Sort references and definitions by line number new ff04bc0 Improve signature help new a406190 Per #63: Allow function contacts to be interactive new f0b5367 Per #63: Add support for eclipse.jdt.ls server new c795e3e Override eglot-execute-command for eclipse.jdt.ls s= erver new f250784 Handle case when project was not found in eclipse.j= dt.ls contact new 6ebbd36 Add tests for eclipse.jdt.ls connection new 5b043fb * .travis.yml (install): Download eclipse.jdt.ls se= rver. new faf93ad * eglot-tests.el: Disable eclipse connection tests. new 504fd25 Fix misspelling of "outstanding" (#74) new d9c3696 Fix #138: accept deprecated field in SymbolInformat= ion new 5ee05f9 Require subr-x at compile time (#139) new 19aded0 Remove duplicates from imenu new 22e5c57 Don't ignore unknown SymbolKinds in imenu new 3c180c0 Rework test macros for hopefully more stable testin= g new aefa498 Larger margin for printing test failure backtraces new 82ae4f6 Re-enable eclipse-jdt tests new ee41f06 Slightly robustify test engine new 27696d6 Use the container name of a symbol in imenu new 31bfe21 Add support for code action literals new f2ccb77 Simplify eglot-code-action. Fix compilation warning new 118f966 Fix a bug when response to definitions request is a= single location new f74a80f Make imenu hierarchical new c664f40 * eglot.el (eglot-client-capabilities): Mention sup= ported SymbolKinds. new 11cd074 Support ocaml-language-server out of the box (#149) new 2a410e9 Move constants to top instead of forward-declaring new d6e0ba3 * eglot-tests.el (eclipse-connect): Increase connec= t timeout to 20. new edc6538 Fix a bug introduced by previous bugfix new 7b4ed97 Fix #124: add ability to move to LSP-precise column= s new b9e9cf3 Fix #148: complex completions work when chosen from= *completions* new b31ba80 Tweak solution to #125 with a hint from Fangrui Son= g new fdb1941 Add support for TextEdits in completion new 0a18dca Fix #125: add ability to report LSP-compliant colum= ns new 604c1b0 Per #144: Format documentation of signature paramet= ers new d66f2eb Treat tab characters as 1 column wide in position c= onversion functions new fc03d7c Fix #160: Properly delete inserted text after compl= etion new b731db5 Add support for R's languageserver (#161) new 894fe5a Fix #154: fix potential security issue fontifying L= SP doc new ee7f9c6 Fix #167: correctly insert TextEdit-less snippets new de1728c * eglot.el (eglot-completion-at-point): Less chatte= r. new f291816 * eglot.el (Version): Bump to 1.2 From MAILER-DAEMON Thu Nov 22 19:15:59 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gPz8Z-0005gI-1N for mharc-emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8O-0005Va-4d for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPz8K-0002vc-8R for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:46 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:34214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPz8B-0002QM-5L for emacs-elpa-diffs@gnu.org; Thu, 22 Nov 2018 19:15:38 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 129818) id 16B4D209B2; Thu, 22 Nov 2018 19:15:34 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/eglot ee7f9c6 43/45: Fix #167: correctly insert TextEdit-less snippets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <20181123001525.29572.42606@vcs0.savannah.gnu.org> References: <20181123001525.29572.42606@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/eglot X-Git-Reftype: branch X-Git-Rev: ee7f9c657f1b9f4ecdb5212cc4c50e30be83560a Auto-Submitted: auto-generated Message-Id: <20181123001535.16B4D209B2@vcs0.savannah.gnu.org> Date: Thu, 22 Nov 2018 19:15:34 -0500 (EST) From: joaotavora@gmail.com (João Távora) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:15:50 -0000 branch: externals/eglot commit ee7f9c657f1b9f4ecdb5212cc4c50e30be83560a Author: Jo=C3=A3o T=C3=A1vora Commit: Jo=C3=A3o T=C3=A1vora Fix #167: correctly insert TextEdit-less snippets =20 Fixes a slight regression from #160. =20 * eglot.el (eglot-completion-at-point): When there is plain `insertText' snippet, delete the full completion text. --- eglot.el | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/eglot.el b/eglot.el index f4a02ac..9ff9cdf 100644 --- a/eglot.el +++ b/eglot.el @@ -1612,24 +1612,31 @@ is not active." bounds &allow-other-keys) (text-properties-at 0 comp) - (let ((fn (and (eql insertTextFormat 2) - (eglot--snippet-expansion-fn)))) - (when (or fn textEdit) - ;; Undo the completion. If before completion the buffe= r was - ;; "foo.b" and now is "foo.bar", `comp' will be "bar". = We - ;; want to delete only "ar" (`comp' minus the symbol wh= ose - ;; bounds we've calculated before) (github#160). - (delete-region (+ (- (point) (length comp)) - (if bounds (- (cdr bounds) (car bound= s)) 0)) - (point))) + (let ((snippet-fn (and (eql insertTextFormat 2) + (eglot--snippet-expansion-fn)))) (cond (textEdit + ;; Undo the just the completed bit. If before + ;; completion the buffer was "foo.b" and now is + ;; "foo.bar", `comp' will be "bar". We want to + ;; delete only "ar" (`comp' minus the symbol + ;; whose bounds we've calculated before) + ;; (github#160). + (delete-region (+ (- (point) (length comp)) + (if bounds (- (cdr bounds) (car = bounds)) 0)) + (point)) (cl-destructuring-bind (&key range newText) textEd= it (pcase-let ((`(,beg . ,end) (eglot--range-region= range))) (delete-region beg end) (goto-char beg) - (funcall (or fn #'insert) newText))) + (funcall (or snippet-fn #'insert) newText))) (eglot--apply-text-edits additionalTextEdits)) - (fn (funcall fn insertText)))) + (snippet-fn + ;; A snippet should be inserted, but using plain + ;; `insertText'. This requires us to delete the + ;; whole completion, since `insertText' is the ful= l + ;; completion's text. + (delete-region (- (point) (length comp)) (point)) + (funcall snippet-fn insertText)))) (eglot--signal-textDocument/didChange) (eglot-eldoc-function)))))))) =20 From MAILER-DAEMON Sun Nov 25 02:58:05 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQpIr-0003ZO-RQ for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 02:58:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQpIq-0003ZG-2v for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 02:58:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQpIo-0007kI-7P for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 02:58:03 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:54095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQpIo-0007kC-1M for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 02:58:02 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 136091) id E43EA2030C; Sun, 25 Nov 2018 02:58:01 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/exwm 38e343f: Avoid unnecessary keyboard grab/ungrab in char-mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Chris Feng In-Reply-To: <20181125075801.2912.39296@vcs0.savannah.gnu.org> References: <20181125075801.2912.39296@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/exwm X-Git-Reftype: branch X-Git-Rev: 38e343ff076e1a00826986b302e389e3f2873cbd Auto-Submitted: auto-generated Message-Id: <20181125075801.E43EA2030C@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 02:58:01 -0500 (EST) From: chris.w.feng@gmail.com (Chris Feng) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 07:58:04 -0000 branch: externals/exwm commit 38e343ff076e1a00826986b302e389e3f2873cbd Author: Chris Feng Commit: Chris Feng Avoid unnecessary keyboard grab/ungrab in char-mode =20 * exwm-input.el (exwm-input--cache-event): Optimize the handling of single event global key by not grabbing/ungrabbing the keyboard. --- exwm-input.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exwm-input.el b/exwm-input.el index c757b09..e184b39 100644 --- a/exwm-input.el +++ b/exwm-input.el @@ -565,7 +565,7 @@ instead." (cl-return-from exwm-input--translate translation))))) key) =20 -(defun exwm-input--cache-event (event) +(defun exwm-input--cache-event (event &optional temp-line-mode) "Cache EVENT." (setq exwm-input--line-mode-cache (vconcat exwm-input--line-mode-cache (vector event))) @@ -575,8 +575,12 @@ instead." ;; When the key sequence is complete (not a keymap). ;; Note that `exwm-input--line-mode-cache' might get translated to nil= , for ;; example 'mouse--down-1-maybe-follows-link' does this. - (unless (and exwm-input--line-mode-cache - (keymapp (key-binding exwm-input--line-mode-cache))) + (if (and exwm-input--line-mode-cache + (keymapp (key-binding exwm-input--line-mode-cache))) + ;; Grab keyboard temporarily to intercept the complete key sequenc= e. + (when temp-line-mode + (setq exwm-input--temp-line-mode t) + (exwm-input--grab-keyboard)) (setq exwm-input--line-mode-cache nil) (when exwm-input--temp-line-mode (setq exwm-input--temp-line-mode nil) @@ -652,10 +656,7 @@ Current buffer must be an `exwm-mode' buffer." (setq event (exwm-input--mimic-read-event raw-event))) (if (not (derived-mode-p 'exwm-mode)) (exwm-input--unread-event raw-event) - ;; Grab keyboard temporarily. - (setq exwm-input--temp-line-mode t) - (exwm-input--grab-keyboard) - (exwm-input--cache-event event) + (exwm-input--cache-event event t) (exwm-input--unread-event raw-event))))) (xcb:+request exwm--connection (make-instance 'xcb:AllowEvents From MAILER-DAEMON Sun Nov 25 14:09:48 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQzmu-0007M0-Ql for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmt-0007Lq-N1 for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzms-0002h3-W0 for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:47 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzms-0002gw-Sf for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:46 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id C40E0209C2; Sun, 25 Nov 2018 14:09:46 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master updated (7cacd8a -> 76ef9bf) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 7cacd8a7619db4cacbae3538d3ef50df338ffdd7 X-Git-Newrev: 76ef9bf5f892c4c4f5145dcdfec84f922f906892 Auto-Submitted: auto-generated Date: Sun, 25 Nov 2018 14:09:46 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:09:48 -0000 skolar42 pushed a change to branch master. from 7cacd8a * crisp/crisp.el (crisp-home, crisp-end): Obey shif= t-select-mode new 0194996 Added org-edna-describe-keyword function new 9dea42d Added note about naming conventions. new a7286e6 Mention consider in opening of Consideration sectio= n new 85b5f4e Modified cache to only work for specific finders new 45310da Various fixes from testing new 58be309 Fixed up description of set-effort!. new c6b3234 Additional tests and minor cleanup new 1bb1fed Added timestamp sorting to relatives finder new 98651a0 Inverted definition of consideration new cb98c0f Removed remnants of old build system new 26d2a0d Added has-tags? and matches? conditions new 2c5ac0c Bumped version new 76ef9bf Merge commit '2c5ac0cb808ae6953fbc74cc497245dafb510= 51f' Summary of changes: packages/org-edna/defaults.mk | 26 - packages/org-edna/org-edna-tests.el | 1416 ++++++++++++++++++++++++----= ------ packages/org-edna/org-edna-tests.org | 217 +++++- packages/org-edna/org-edna.el | 219 +++++- packages/org-edna/org-edna.info | 527 +++++++++---- packages/org-edna/org-edna.org | 300 +++++-- packages/org-edna/test.mk | 1 + 7 files changed, 2026 insertions(+), 680 deletions(-) delete mode 100644 packages/org-edna/defaults.mk From MAILER-DAEMON Sun Nov 25 14:09:50 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQzmw-0007NX-NN for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmu-0007Lr-6u for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmt-0002hb-JW for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:48 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmt-0002hV-Ei for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:47 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 6516A209C2; Sun, 25 Nov 2018 14:09:47 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master a7286e6 03/13: Mention consider in opening of Consideration section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: a7286e6cdb46cc1fca046c60906a2a86ccba420a Auto-Submitted: auto-generated Message-Id: <20181125190947.6516A209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:47 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:09:49 -0000 branch: master commit a7286e6cdb46cc1fca046c60906a2a86ccba420a Author: Ian Dunn Commit: Ian Dunn Mention consider in opening of Consideration section =20 * org-edna.org (Consideration): Mention consider. --- org-edna.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org-edna.org b/org-edna.org index 2a58b5c..65d1832 100644 --- a/org-edna.org +++ b/org-edna.org @@ -1015,7 +1015,8 @@ tagged "test" does *not* have the property PROP set= to "1". :DESCRIPTION: Only some of them :END: =20 -"Consideration" is a special keyword that's only valid for blockers. +"Consideration" and "consider" are special keywords that are only valid = for +blockers. =20 This says "Allow a task to complete if CONSIDERATION of its targets pass= the given condition". From MAILER-DAEMON Sun Nov 25 14:09:51 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQzmw-0007Ne-SR for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmu-0007Ly-Ho for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmt-0002hn-QJ for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:48 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmt-0002hf-Lp for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:47 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 999DF209C2; Sun, 25 Nov 2018 14:09:47 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 85b5f4e 04/13: Modified cache to only work for specific finders MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 85b5f4e1ed1c5cb75e3c67c3b9e204cc22b1b906 Auto-Submitted: auto-generated Message-Id: <20181125190947.999DF209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:47 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:09:49 -0000 branch: master commit 85b5f4e1ed1c5cb75e3c67c3b9e204cc22b1b906 Author: Ian Dunn Commit: Ian Dunn Modified cache to only work for specific finders =20 * org-edna.el (org-edna-finder-cache-enabled-finders): List of finder= functions for which cache is enabled. (org-edna--cache-is-enabled-for-finder): New function. (org-edna--handle-finder): Use it. --- org-edna.el | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/org-edna.el b/org-edna.el index ee10b17..dcb3157 100644 --- a/org-edna.el +++ b/org-edna.el @@ -505,6 +505,24 @@ adding unrelated headlines, will be taken into accou= nt." :group 'org-edna :type 'number) =20 +(defvar org-edna-finder-cache-enabled-finders + '(org-edna-finder/match + org-edna-finder/ids + org-edna-finder/olp + org-edna-finder/file + org-edna-finder/org-file) + "List of finders for which cache is enabled. + +Only edit this list if you've added custom finders. Many +finders, specifically relative finders, rely on the context in +which they're called. For these finders, cache will not work +properly. + +The default state of this list contains the built-in finders for +which context is irrelevant. + +Each entry is the function symbol for the finder.") + (defun org-edna--add-to-finder-cache (func-sym args) (let* ((results (apply func-sym args)) (input (make-org-edna--finder-input :func-sym func-sym @@ -548,8 +566,12 @@ following reasons: ;; We have an entry created within the allowed interval. (t entry)))) =20 +(defun org-edna--cache-is-enabled-for-finder (func-sym) + (memq func-sym org-edna-finder-cache-enabled-finders)) + (defun org-edna--handle-finder (func-sym args) - (if (not org-edna-finder-use-cache) + (if (or (not org-edna-finder-use-cache) + (not (org-edna--cache-is-enabled-for-finder func-sym))) ;; Not using cache, so use the function directly. (apply func-sym args) (let* ((entry (org-edna--get-cache-entry func-sym args))) From MAILER-DAEMON Sun Nov 25 14:09:54 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQzmx-0007Ob-Oj for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmu-0007Lx-FU for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmt-0002hQ-C6 for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:48 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmt-0002hM-96 for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:47 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 39F18209C2; Sun, 25 Nov 2018 14:09:47 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 9dea42d 02/13: Added note about naming conventions. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 9dea42d4355e663cda8d866ba757970c67b39e28 Auto-Submitted: auto-generated Message-Id: <20181125190947.39F18209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:47 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:09:49 -0000 branch: master commit 9dea42d4355e663cda8d866ba757970c67b39e28 Author: Ian Dunn Commit: Ian Dunn Added note about naming conventions. =20 * org-edna.org (Naming Conventions): Added note about reserved charac= ters. --- org-edna.info | 44 +++++++++++++++++++++++++------------------- org-edna.org | 6 ++++++ 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/org-edna.info b/org-edna.info index 07c97ff..d1f6a35 100644 --- a/org-edna.info +++ b/org-edna.info @@ -1403,6 +1403,12 @@ predicates with =E2=80=99?=E2=80=99. Thus, one can have an action that files a target, and a finder that finds a file. =20 + We recommend that you don=E2=80=99t name a finder with a special char= acter at +the end of its name. As we devise new ideas, we consider using special +characters for additional categories of keywords. Thus, to avoid +complications in the future, it=E2=80=99s best if everyone avoids using +characters that may become reserved in the future. + =1F File: org-edna.info, Node: Finders 1, Next: Actions 1, Prev: Naming C= onventions, Up: Extending Edna =20 @@ -1830,25 +1836,25 @@ Node: Conditional Forms=7F38485 Node: Setting the Properties=7F41141 Node: Extending Edna=7F42225 Node: Naming Conventions=7F42715 -Node: Finders 1=7F43176 -Node: Actions 1=7F43538 -Node: Conditions 1=7F43997 -Node: Contributing=7F44883 -Node: Bugs=7F45749 -Node: Working with EDE=7F46106 -Node: Compiling Edna=7F47190 -Node: Testing Edna=7F48059 -Node: Before Sending Changes=7F49040 -Node: Developing with Bazaar=7F49727 -Node: Documentation=7F50468 -Node: Changelog=7F50924 -Node: 10beta8=7F51174 -Node: 10beta7=7F51286 -Node: 10beta6=7F51580 -Node: 10beta5=7F51856 -Node: 10beta4=7F52243 -Node: 10beta3=7F52496 -Node: 10beta2=7F52935 +Node: Finders 1=7F43507 +Node: Actions 1=7F43869 +Node: Conditions 1=7F44328 +Node: Contributing=7F45214 +Node: Bugs=7F46080 +Node: Working with EDE=7F46437 +Node: Compiling Edna=7F47521 +Node: Testing Edna=7F48390 +Node: Before Sending Changes=7F49371 +Node: Developing with Bazaar=7F50058 +Node: Documentation=7F50799 +Node: Changelog=7F51255 +Node: 10beta8=7F51505 +Node: 10beta7=7F51617 +Node: 10beta6=7F51911 +Node: 10beta5=7F52187 +Node: 10beta4=7F52574 +Node: 10beta3=7F52827 +Node: 10beta2=7F53266 =1F End Tag Table =20 diff --git a/org-edna.org b/org-edna.org index c0612e2..2a58b5c 100644 --- a/org-edna.org +++ b/org-edna.org @@ -1187,6 +1187,12 @@ Scheme to suffix destructive functions with '!' an= d predicates with '?'. Thus, one can have an action that files a target, and a finder that find= s a file. =20 +We recommend that you don't name a finder with a special character at th= e end of +its name. As we devise new ideas, we consider using special characters = for +additional categories of keywords. Thus, to avoid complications in the = future, +it's best if everyone avoids using characters that may become reserved i= n the +future. + ** Finders :PROPERTIES: :DESCRIPTION: Making a new finder From MAILER-DAEMON Sun Nov 25 14:09:54 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQzn0-0007P3-OA for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmu-0007Lw-FS for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmt-0002hG-5d for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:48 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmt-0002h8-2U for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:47 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 094B5209C2; Sun, 25 Nov 2018 14:09:47 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 0194996 01/13: Added org-edna-describe-keyword function MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 0194996377c32f0bc36e5bf500e70b0b9dc3bf7f Auto-Submitted: auto-generated Message-Id: <20181125190947.094B5209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:46 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:09:50 -0000 branch: master commit 0194996377c32f0bc36e5bf500e70b0b9dc3bf7f Author: Ian Dunn Commit: Ian Dunn Added org-edna-describe-keyword function =20 * org-edna.el (org-edna--function-for-key): Return `org-edna-handle-consideration' for consideration and consider keyw= ords. (org-edna-describe-keyword): New function. =20 * org-edna.org (Getting Help): New section. --- org-edna.el | 29 ++++++++++- org-edna.info | 164 ++++++++++++++++++++++++++++++++--------------------= ------ org-edna.org | 13 +++++ 3 files changed, 130 insertions(+), 76 deletions(-) diff --git a/org-edna.el b/org-edna.el index e271cb0..ee10b17 100644 --- a/org-edna.el +++ b/org-edna.el @@ -129,8 +129,9 @@ If KEY is an invalid Edna keyword, then return nil." ((or (not key) (not (symbolp key)))) ((memq key '(consideration consider)) - ;; Function is ignored here - (cons 'consideration 'identity)) + ;; Function is ignored here, but `org-edna-describe-keyword' needs t= his + ;; function. + (cons 'consideration 'org-edna-handle-consideration)) ((string-suffix-p "!" (symbol-name key)) ;; Action (let ((func-sym (intern (format "org-edna-action/%s" key)))) @@ -2221,6 +2222,30 @@ PRED, and ACTION." (when-let* ((bounds (bounds-of-thing-at-point 'symbol))) (list (car bounds) (cdr bounds) 'org-edna-completion-table-function)= )) =20 +(defun org-edna-describe-keyword (keyword) + "Describe the Org Edna keyword KEYWORD. + +KEYWORD should be a string for a keyword recognized by edna. + +Displays help for KEYWORD in the Help buffer." + (interactive + (list + (completing-read + "Keyword: " + `(,@(org-edna--collect-finders) + ,@(org-edna--collect-actions) + ,@(org-edna--collect-conditions) + "consideration" "consider") + nil ;; No filter predicate + t))) ;; require match + ;; help-split-fundoc splits the usage info from the rest of the docume= ntation. + ;; This avoids having another usage line in the keyword documentation = that has + ;; nothing to do with how edna expects the function. + (pcase-let* ((`(,_type . ,func) (org-edna--function-for-key (intern ke= yword))) + (`(,_usage . ,doc) (help-split-fundoc (documentation func= t) func))) + (with-help-window (help-buffer) + (princ doc)))) + =0C =20 (declare-function lm-report-bug "lisp-mnt" (topic)) diff --git a/org-edna.info b/org-edna.info index 4f29ebe..07c97ff 100644 --- a/org-edna.info +++ b/org-edna.info @@ -36,6 +36,7 @@ Basic Features =20 * Finders:: How to find targets * Actions:: Next steps +* Getting Help:: Getting some help =20 Finders =20 @@ -314,6 +315,7 @@ The most basic features of Edna are *finders* and *ac= tions*. =20 * Finders:: How to find targets * Actions:: Next steps +* Getting Help:: Getting some help =20 =1F File: org-edna.info, Node: Finders, Next: Actions, Up: Basic Features @@ -758,7 +760,7 @@ when it reaches the end. Identical to the *note rest-of-siblings-wrap:: finder. =20 =1F -File: org-edna.info, Node: Actions, Prev: Finders, Up: Basic Features +File: org-edna.info, Node: Actions, Next: Getting Help, Prev: Finders= , Up: Basic Features =20 Actions =3D=3D=3D=3D=3D=3D=3D @@ -1055,6 +1057,19 @@ Effort =E2=80=A2 If VALUE is the symbol =E2=80=99increment, increment effort =20 =1F +File: org-edna.info, Node: Getting Help, Prev: Actions, Up: Basic Fea= tures + +Getting Help +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Edna provides help for any keyword with =E2=80=98M-x org-edna-describe-k= eyword=E2=80=99. +When invoked, a list of keywords (finders, actions, etc.) known to Edna +will be provided. Select any one to get its description. + + This description includes the syntax and an explanation of what the +keyword does. Some descriptions also contain examples. + +=1F File: org-edna.info, Node: Advanced Features, Next: Extending Edna, P= rev: Basic Features, Up: Top =20 Advanced Features @@ -1760,79 +1775,80 @@ Big release here, with three new features. =1F Tag Table: Node: Top=7F225 -Node: Copying=7F4114 -Node: Introduction=7F4936 -Node: Installation and Setup=7F5884 -Node: Basic Operation=7F6608 -Node: Blockers=7F8459 -Node: Triggers=7F8745 -Node: Syntax=7F9007 -Node: Basic Features=7F9697 -Node: Finders=7F10000 -Node: ancestors=7F11765 -Node: children=7F12359 -Node: descendants=7F12769 -Node: file=7F13291 -Node: first-child=7F14040 -Node: ids=7F14300 -Node: match=7F14961 -Node: next-sibling=7F15599 -Node: next-sibling-wrap=7F15856 -Node: olp=7F16170 -Node: org-file=7F16582 -Node: parent=7F17227 -Node: previous-sibling=7F17425 -Node: previous-sibling-wrap=7F17686 -Node: relatives=7F17965 -Node: rest-of-siblings=7F21586 -Node: rest-of-siblings-wrap=7F21871 -Node: self=7F22220 -Node: siblings=7F22381 -Node: siblings-wrap=7F22618 -Node: Actions=7F22922 -Node: Scheduled/Deadline=7F23664 -Node: TODO State=7F27239 -Node: Archive=7F27607 -Node: Chain Property=7F27927 -Node: Clocking=7F28210 -Node: Property=7F28622 -Node: Priority=7F30809 -Node: Tag=7F31378 -Node: Effort=7F31595 -Node: Advanced Features=7F31984 -Node: Finder Cache=7F32432 -Node: Conditions=7F33471 -Node: done=7F34107 -Node: headings=7F34271 -Node: todo-state=7F34647 -Node: variable-set=7F34903 -Node: has-property=7F35332 -Node: re-search=7F35601 -Node: Negating Conditions=7F35961 -Node: Consideration=7F36348 -Node: Conditional Forms=7F37917 -Node: Setting the Properties=7F40573 -Node: Extending Edna=7F41657 -Node: Naming Conventions=7F42147 -Node: Finders 1=7F42608 -Node: Actions 1=7F42970 -Node: Conditions 1=7F43429 -Node: Contributing=7F44315 -Node: Bugs=7F45181 -Node: Working with EDE=7F45538 -Node: Compiling Edna=7F46622 -Node: Testing Edna=7F47491 -Node: Before Sending Changes=7F48472 -Node: Developing with Bazaar=7F49159 -Node: Documentation=7F49900 -Node: Changelog=7F50356 -Node: 10beta8=7F50606 -Node: 10beta7=7F50718 -Node: 10beta6=7F51012 -Node: 10beta5=7F51288 -Node: 10beta4=7F51675 -Node: 10beta3=7F51928 -Node: 10beta2=7F52367 +Node: Copying=7F4165 +Node: Introduction=7F4987 +Node: Installation and Setup=7F5935 +Node: Basic Operation=7F6659 +Node: Blockers=7F8510 +Node: Triggers=7F8796 +Node: Syntax=7F9058 +Node: Basic Features=7F9748 +Node: Finders=7F10102 +Node: ancestors=7F11867 +Node: children=7F12461 +Node: descendants=7F12871 +Node: file=7F13393 +Node: first-child=7F14142 +Node: ids=7F14402 +Node: match=7F15063 +Node: next-sibling=7F15701 +Node: next-sibling-wrap=7F15958 +Node: olp=7F16272 +Node: org-file=7F16684 +Node: parent=7F17329 +Node: previous-sibling=7F17527 +Node: previous-sibling-wrap=7F17788 +Node: relatives=7F18067 +Node: rest-of-siblings=7F21688 +Node: rest-of-siblings-wrap=7F21973 +Node: self=7F22322 +Node: siblings=7F22483 +Node: siblings-wrap=7F22720 +Node: Actions=7F23024 +Node: Scheduled/Deadline=7F23787 +Node: TODO State=7F27362 +Node: Archive=7F27730 +Node: Chain Property=7F28050 +Node: Clocking=7F28333 +Node: Property=7F28745 +Node: Priority=7F30932 +Node: Tag=7F31501 +Node: Effort=7F31718 +Node: Getting Help=7F32107 +Node: Advanced Features=7F32552 +Node: Finder Cache=7F33000 +Node: Conditions=7F34039 +Node: done=7F34675 +Node: headings=7F34839 +Node: todo-state=7F35215 +Node: variable-set=7F35471 +Node: has-property=7F35900 +Node: re-search=7F36169 +Node: Negating Conditions=7F36529 +Node: Consideration=7F36916 +Node: Conditional Forms=7F38485 +Node: Setting the Properties=7F41141 +Node: Extending Edna=7F42225 +Node: Naming Conventions=7F42715 +Node: Finders 1=7F43176 +Node: Actions 1=7F43538 +Node: Conditions 1=7F43997 +Node: Contributing=7F44883 +Node: Bugs=7F45749 +Node: Working with EDE=7F46106 +Node: Compiling Edna=7F47190 +Node: Testing Edna=7F48059 +Node: Before Sending Changes=7F49040 +Node: Developing with Bazaar=7F49727 +Node: Documentation=7F50468 +Node: Changelog=7F50924 +Node: 10beta8=7F51174 +Node: 10beta7=7F51286 +Node: 10beta6=7F51580 +Node: 10beta5=7F51856 +Node: 10beta4=7F52243 +Node: 10beta3=7F52496 +Node: 10beta2=7F52935 =1F End Tag Table =20 diff --git a/org-edna.org b/org-edna.org index 1f01709..c0612e2 100644 --- a/org-edna.org +++ b/org-edna.org @@ -869,6 +869,19 @@ Sets the effort of all targets according to VALUE: - If VALUE is an integer, then set the value to the VALUE'th allowed eff= ort property - If VALUE is the symbol 'increment, increment effort =20 +** Getting Help +:PROPERTIES: +:CUSTOM_ID: help +:DESCRIPTION: Getting some help +:END: + +Edna provides help for any keyword with ~M-x org-edna-describe-keyword~.= When +invoked, a list of keywords (finders, actions, etc.) known to Edna will = be +provided. Select any one to get its description. + +This description includes the syntax and an explanation of what the keyw= ord +does. Some descriptions also contain examples. + * Advanced Features :PROPERTIES: :CUSTOM_ID: advanced From MAILER-DAEMON Sun Nov 25 14:09:56 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQzn1-0007QQ-UX for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmx-0007Oc-Pq for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmu-0002iy-O5 for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:51 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmu-0002io-Jg for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:48 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 87010209C2; Sun, 25 Nov 2018 14:09:48 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 1bb1fed 08/13: Added timestamp sorting to relatives finder MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 1bb1fed0f914bea8fe27435fd832723fddd2795e Auto-Submitted: auto-generated Message-Id: <20181125190948.87010209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:48 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:09:54 -0000 branch: master commit 1bb1fed0f914bea8fe27435fd832723fddd2795e Author: Ian Dunn Commit: Ian Dunn Added timestamp sorting to relatives finder =20 * org-edna.el (org-edna--get-timestamp-time): New helper function. (org-edna-finder/relatives): Use it for timestamp-up and timestamp-= down forms. =20 * org-edna-tests.el (org-edna-relatives/sort-timestamp): New test. (org-edna-action-deadline/wkdy): (org-edna-action-deadline/cp): (org-edna-action-deadline/inc): (org-edna-action-deadline/landing): (org-edna-action-deadline/landing-no-hour): (org-edna-action-deadline/float): New tests for deadline. --- org-edna-tests.el | 208 +++++++++++++++++++++++++++++++++++++++++++++++= ++++++ org-edna-tests.org | 15 +++- org-edna.el | 35 ++++++++- org-edna.org | 10 +++ 4 files changed, 262 insertions(+), 6 deletions(-) diff --git a/org-edna-tests.el b/org-edna-tests.el index 5b0b1e0..6f5fa5e 100644 --- a/org-edna-tests.el +++ b/org-edna-tests.el @@ -1102,6 +1102,28 @@ This avoids org-id digging into its internal datab= ase." (org-with-point-at current (org-edna-finder/relatives arg 'deadline-down size)= ))))) =20 +(ert-deftest org-edna-relatives/sort-timestamp () + (let* ((start-marker org-edna-test-relative-parent-one) + (target-list `(,org-edna-test-relative-child-with-todo + ,org-edna-test-relative-child-with-done + ,org-edna-test-relative-commented-child + ,org-edna-test-relative-child-with-children + ,org-edna-test-relative-standard-child + ,org-edna-test-relative-archived-child)) + (arg 'step-down) + (size (length target-list)) + (org-agenda-files `(,org-edna-test-file)) + (current (org-edna-find-test-heading start-marker)) + (siblings (mapcar + (lambda (uuid) (org-edna-find-test-heading uuid)) + target-list))) + (should (equal siblings + (org-with-point-at current + (org-edna-finder/relatives arg 'timestamp-up size))= )) + (should (equal (nreverse siblings) + (org-with-point-at current + (org-edna-finder/relatives arg 'timestamp-down size= )))))) + (ert-deftest org-edna-cache/no-entry () (let* ((org-edna-finder-use-cache t) (org-edna--finder-cache (make-hash-table :test 'equal))) @@ -1175,6 +1197,8 @@ This avoids org-id digging into its internal databa= se." (should (string-equal (org-entry-get nil "TODO") "TODO"))) (org-edna-test-restore-test-file)))) =20 +;; Scheduled + (ert-deftest org-edna-action-scheduled/wkdy () ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) @@ -1358,6 +1382,189 @@ This avoids org-id digging into its internal data= base." "<2000-01-15 Sat 00:00>"))) (org-edna-test-restore-test-file)))) =20 +(ert-deftest org-edna-action-deadline/wkdy () + ;; Override `current-time' so we can get a deterministic value + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (org-agenda-files `(,org-edna-test-file)) + (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51= a-87fbd34f79f7"))) + (unwind-protect + (org-with-point-at target + (org-edna-action/deadline! nil "Mon") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-17 Mon>")) + (org-edna-action/deadline! nil 'rm) + (should (not (org-entry-get nil "DEADLINE"))) + (org-edna-action/deadline! nil "Mon 9:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-17 Mon 09:00>")) + (org-edna-action/deadline! nil 'rm) + (should (not (org-entry-get nil "DEADLINE")))) + (org-edna-test-restore-test-file)))) + +(ert-deftest org-edna-action-deadline/cp () + (let* ((org-agenda-files `(,org-edna-test-file)) + (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51a-87= fbd34f79f7")) + (source (org-edna-find-test-heading "97e6b0f0-40c4-464f-b760-6e= 5ca9744eb5")) + (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "rem= ove")))) + (unwind-protect + (org-with-point-at target + (dolist (pair pairs) + (org-edna-action/deadline! source (car pair)) + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + (org-edna-action/deadline! source (cdr pair)) + (should (not (org-entry-get nil "DEADLINE"))))) + (org-edna-test-restore-test-file)))) + +(ert-deftest org-edna-action-deadline/inc () + ;; Override `current-time' so we can get a deterministic value + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (org-agenda-files `(,org-edna-test-file)) + (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) + (unwind-protect + (org-with-point-at target + ;; Time starts at Jan 15, 2000 + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; Increment 1 minute + (org-edna-action/deadline! nil "+1M") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:01>")) + ;; Decrement 1 minute + (org-edna-action/deadline! nil "-1M") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; +1 day + (org-edna-action/deadline! nil "+1d") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-16 Sun 00:00>")) + ;; +1 hour from current time + (org-edna-action/deadline! nil "++1h") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 01:00>")) + ;; Back to Saturday + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; -1 day to Friday + (org-edna-action/deadline! nil "-1d") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-14 Fri 00:00>")) + ;; Increment two days to the next weekday + (org-edna-action/deadline! nil "+2wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-17 Mon 00:00>")) + ;; Increment one day, expected to land on a weekday + (org-edna-action/deadline! nil "+1wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-18 Tue 00:00>")) + ;; Move forward 8 days, then backward until we find a weekend + (org-edna-action/deadline! nil "+8d -wknd") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + ;; (org-edna-action/deadline! nil "+1w +wkdy") + ;; (should (string-equal (org-entry-get nil "DEADLINE") + ;; "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>"))) + (org-edna-test-restore-test-file)))) + +(ert-deftest org-edna-action-deadline/landing () + "Test landing arguments to deadline increment." + ;; Override `current-time' so we can get a deterministic value + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (org-agenda-files `(,org-edna-test-file)) + (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) + (unwind-protect + (org-with-point-at target + ;; Time starts at Jan 15, 2000 + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/deadline! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/deadline! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>"))) + (org-edna-test-restore-test-file)))) + +(ert-deftest org-edna-action-deadline/landing-no-hour () + "Test landing arguments to deadline increment, without hour." + ;; Override `current-time' so we can get a deterministic value + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (org-agenda-files `(,org-edna-test-file)) + (target (org-edna-find-test-heading "caf27724-0887-4565-976= 5-ed2f1edcfb16"))) + (unwind-protect + (org-with-point-at target + ;; Time starts at Jan 1, 2017 + (org-edna-action/deadline! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-01 Sun>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/deadline! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-08 Sun>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/deadline! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-16 Mon>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-01 Sun>"))) + (org-edna-test-restore-test-file)))) + +(ert-deftest org-edna-action-deadline/float () + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (org-agenda-files `(,org-edna-test-file)) + (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) + (unwind-protect + (org-with-point-at target + ;; Time starts at Jan 15, 2000 + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; The third Tuesday of next month (Feb 15th) + (org-edna-action/deadline! nil "float 3 Tue") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-02-15 Tue 00:00>")) + ;; The second Friday of the following May (May 12th) + (org-edna-action/deadline! nil "float 2 5 May") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-05-12 Fri 00:00>")) + ;; Move forward to the second Wednesday of the next month (Jun= e 14th) + (org-edna-action/deadline! nil "float 2 Wednesday") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-06-14 Wed 00:00>")) + ;; Move forward to the first Thursday in the following Jan (Ja= n 4th, 2001) + (org-edna-action/deadline! nil "float 1 4 Jan") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2001-01-04 Thu 00:00>")) + ;; The fourth Monday in Feb, 2000 (Feb 28th) + (org-edna-action/deadline! nil "float ++4 monday") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-02-28 Mon 00:00>")) + ;; The second Monday after Mar 12th, 2000 (Mar 20th) + (org-edna-action/deadline! nil "float 2 monday Mar 12") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-03-20 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>"))) + (org-edna-test-restore-test-file)))) + (ert-deftest org-edna-action-tag () (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) (unwind-protect @@ -2039,6 +2246,7 @@ the relative finders all still work while cache is = enabled." (should (string-equal (org-entry-get shower-pom "COUNT") "= 0"))) ;; Change the test file back to its original state. (org-edna-test-restore-test-file)))))) + (provide 'org-edna-tests) =20 ;;; org-edna-tests.el ends here diff --git a/org-edna-tests.org b/org-edna-tests.org index 9eb8756..4d9aa9d 100644 --- a/org-edna-tests.org +++ b/org-edna-tests.org @@ -34,25 +34,28 @@ along with this program. If not, see . :LOGGING: nil :END: ** TODO ID Heading 3 -SCHEDULED: <2000-01-15 Sat 00:00> +DEADLINE: <2000-01-15 Sat 00:00> SCHEDULED: <2000-01-15 Sat 00:00> :PROPERTIES: :ID: 97e6b0f0-40c4-464f-b760-6e5ca9744eb5 :END: +<2000-01-15 Sat 00:00> ** DONE ID Heading 4 :PROPERTIES: :ID: 7d4d564b-18b2-445c-a0c8-b1b3fb9ad29e :END: ** Scheduled Headings *** TODO Scheduled Heading 1 -SCHEDULED: <2017-01-01 Sun> +DEADLINE: <2017-01-01 Sun> SCHEDULED: <2017-01-01 Sun> :PROPERTIES: :ID: caf27724-0887-4565-9765-ed2f1edcfb16 :END: +<2017-01-01 Sun> *** TODO Scheduled Heading 2 -SCHEDULED: <2017-01-01 Sun> +DEADLINE: <2017-01-01 Sun> SCHEDULED: <2017-01-01 Sun> :PROPERTIES: :ID: 5594d4f1-b1bb-400f-9f3d-e2f9b43e82c3 :END: +<2017-01-01 Sun> ** Sibling Headings :PROPERTIES: :ID: 21b8f1f5-14e8-4677-873d-69e0389fdc9e @@ -96,12 +99,14 @@ DEADLINE: <2017-01-07 Sat> SCHEDULED: <2017-01-02 Mon= > :ID: 7c542695-8165-4c8b-b44d-4c12fa009548 :Effort: 0:01 :END: +<2017-01-02 Mon> *** [#B] Child Heading with Children DEADLINE: <2017-01-03 Tue> SCHEDULED: <2017-01-03 Tue> :PROPERTIES: :ID: c7a986df-8d89-4509-b086-6db429b5607b :Effort: 0:03 :END: +<2017-01-03 Tue> **** Child Heading One :PROPERTIES: :ID: 588bbd29-2e07-437f-b74d-f72459b545a1 @@ -116,24 +121,28 @@ DEADLINE: <2017-01-01 Sun> SCHEDULED: <2017-01-06 F= ri> :ID: 8c0b31a1-af49-473c-92ea-a5c1c3bace33 :Effort: 0:02 :END: +<2017-01-06 Fri> *** [#B] COMMENT Commented Child Heading DEADLINE: <2017-01-08 Sun> SCHEDULED: <2017-01-04 Wed> :PROPERTIES: :ID: 0a1b9508-17ce-49c5-8ff3-28a0076374f5 :Effort: 0:06 :END: +<2017-01-04 Wed> *** [#A] Archived Child Heading :ARCHI= VE: DEADLINE: <2017-01-02 Mon> SCHEDULED: <2017-01-01 Sun> :PROPERTIES: :ID: a4b6131e-0560-4201-86d5-f32b36363431 :Effort: 0:05 :END: +<2017-01-01 Sun> *** DONE [#C] Child Heading with DONE DEADLINE: <2017-01-05 Thu> SCHEDULED: <2017-01-05 Thu> :PROPERTIES: :ID: 4a1d74a2-b032-47da-a823-b32f5cab0aae :Effort: 0:08 :END: +<2017-01-05 Thu> ** Parent Sub Heading #2 :PROPERTIES: :ID: 4fe67f03-2b35-4708-8c38-54d2c4dfab81 diff --git a/org-edna.el b/org-edna.el index 102dd06..36f3afa 100644 --- a/org-edna.el +++ b/org-edna.el @@ -810,6 +810,14 @@ Return a list of markers for the descendants." (when-let* ((entry-tags (org-get-tags-at))) (seq-intersection tags entry-tags))) =20 +(defun org-edna--get-timestamp-time (pom &optional inherit) + "Get the timestamp time as a time tuple, of a format suitable +for calling org-schedule with, or if there is no timestamp, +returns nil." + (let ((time (org-entry-get pom "TIMESTAMP" inherit))) + (when time + (apply 'encode-time (org-parse-time-string time))))) + (defun org-edna-finder/relatives (&rest options) "Find some relative of the current heading. =20 @@ -875,7 +883,9 @@ All arguments are symbols, unless noted otherwise. - scheduled-up: Scheduled time, farthest first - scheduled-down: Scheduled time, closest first - deadline-up: Deadline time, farthest first -- deadline-down: Deadline time, closest first" +- deadline-down: Deadline time, closest first +- timestamp-up: Timestamp time, farthest first +- timestamp-down: Timestamp time, closest first" (let (targets sortfun reverse-sort @@ -1028,6 +1038,18 @@ All arguments are symbols, unless noted otherwise. (lambda (lhs rhs) (let ((time-lhs (org-get-deadline-time lhs)) (time-rhs (org-get-deadline-time rhs))) + (time-less-p time-lhs time-rhs))))) + ('timestamp-up + (setq sortfun + (lambda (lhs rhs) + (let ((time-lhs (org-edna--get-timestamp-time lhs)) + (time-rhs (org-edna--get-timestamp-time rhs))) + (not (time-less-p time-lhs time-rhs)))))) + ('timestamp-down + (setq sortfun + (lambda (lhs rhs) + (let ((time-lhs (org-edna--get-timestamp-time lhs)) + (time-rhs (org-edna--get-timestamp-time rhs))) (time-less-p time-lhs time-rhs))))))) (setq filterfuns (nreverse filterfuns)) (when (and targets sortfun) @@ -1285,11 +1307,18 @@ N is an integer. WHAT can be `day', `month', `ye= ar', `minute', (org-timestamp-change n what) (buffer-string))) =20 +(defun org-edna--property-for-planning-type (type) + (pcase type + ('scheduled "SCHEDULED") + ('deadline "DEADLINE") + ('timestamp "TIMESTAMP") + (_ ""))) + (defun org-edna--get-planning-info (what) "Get the planning info for WHAT. =20 -WHAT is either 'scheduled or 'deadline." - (org-entry-get nil (if (eq what 'scheduled) "SCHEDULED" "DEADLINE"))) +WHAT is one of 'scheduled, 'deadline, or 'timestamp." + (org-entry-get nil (org-edna--property-for-planning-type what))) =20 ;; Silence the byte-compiler (defvar parse-time-weekdays) diff --git a/org-edna.org b/org-edna.org index d18828e..38fe539 100644 --- a/org-edna.org +++ b/org-edna.org @@ -526,6 +526,8 @@ All arguments are symbols, unless noted otherwise. - scheduled-down: Scheduled time, closest first - deadline-up: Deadline time, farthest first - deadline-down: Deadline time, closest first +- timestamp-up: Timestamp time, farthest first +- timestamp-down: Timestamp time, closest first =20 Many of the other finders are shorthand for argument combinations of rel= ative: =20 @@ -1503,6 +1505,14 @@ making any changes: :PROPERTIES: :DESCRIPTION: List of changes by version :END: +** 1.0 + +- Various bugs fixes + - Fixed parsing of consideration + - Limited cache to just the finders that don't depend on current posit= ion +- Added "buffer" option for match finder +- Added timestamp sorting to relatives finder + ** 1.0beta8 Quick fix for beta7. ** 1.0beta7 From MAILER-DAEMON Sun Nov 25 14:09:57 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQzn3-0007RZ-46 for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmw-0007NM-IS for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmv-0002k2-QI for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:50 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmv-0002jn-MC for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:49 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 9702E209DD; Sun, 25 Nov 2018 14:09:49 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 2c5ac0c 12/13: Bumped version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 2c5ac0cb808ae6953fbc74cc497245dafb51051f Auto-Submitted: auto-generated Message-Id: <20181125190949.9702E209DD@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:49 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:09:54 -0000 branch: master commit 2c5ac0cb808ae6953fbc74cc497245dafb51051f Author: Ian Dunn Commit: Ian Dunn Bumped version --- org-edna.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-edna.el b/org-edna.el index f804dba..486cd88 100644 --- a/org-edna.el +++ b/org-edna.el @@ -7,7 +7,7 @@ ;; Keywords: convenience, text, org ;; URL: https://savannah.nongnu.org/projects/org-edna-el/ ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5")) -;; Version: 1.0beta8 +;; Version: 1.0 =20 ;; This file is part of GNU Emacs. =20 From MAILER-DAEMON Sun Nov 25 14:09:57 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQzn3-0007Rz-El for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmw-0007Mt-2s for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmu-0002iE-8W for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:50 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmu-0002i2-4c for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:48 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 18E1E209C2; Sun, 25 Nov 2018 14:09:48 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 58be309 06/13: Fixed up description of set-effort!. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 58be309a7f805918f633a964edb4c7a6dd1715d1 Auto-Submitted: auto-generated Message-Id: <20181125190948.18E1E209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:47 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:09:54 -0000 branch: master commit 58be309a7f805918f633a964edb4c7a6dd1715d1 Author: Ian Dunn Commit: Ian Dunn Fixed up description of set-effort!. =20 * org-edna.org (Effort): Changed layout of syntax variations. --- org-edna.info | 227 ++++++++++++++++++++++++++++++----------------------= ------ org-edna.org | 16 +++-- 2 files changed, 127 insertions(+), 116 deletions(-) diff --git a/org-edna.info b/org-edna.info index 2bc5847..de1c087 100644 --- a/org-edna.info +++ b/org-edna.info @@ -85,12 +85,12 @@ Advanced Features =20 Conditions =20 -* done:: -* headings:: -* todo-state:: -* variable-set:: -* has-property:: -* re-search:: Search for a regular expression +* Heading is DONE:: +* File Has Headings:: +* Heading TODO State:: +* Lisp Variable Set:: +* Heading Has Property:: +* Regexp Search:: Search for a regular expression * Negating Conditions:: =20 =20 @@ -1091,14 +1091,19 @@ File: org-edna.info, Node: Effort, Prev: Tag, = Up: Actions Effort ------ =20 - =E2=80=A2 Syntax: set-effort!(VALUE) +Modifies the effort of all targets. =20 - Sets the effort of all targets according to VALUE: + =E2=80=A2 Syntax: set-effort!(=E2=80=9CVALUE=E2=80=9D) =20 - =E2=80=A2 If VALUE is a string, then the effort is set to VALUE - =E2=80=A2 If VALUE is an integer, then set the value to the VALUE=E2=80= =99th allowed - effort property - =E2=80=A2 If VALUE is the symbol =E2=80=99increment, increment effort + Set the effort of all targets to =E2=80=9CVALUE=E2=80=9D. + + =E2=80=A2 Syntax: set-effort!(NUMBER) + + Sets the effort to the NUMBER=E2=80=99th allowed effort property. + + =E2=80=A2 Syntax: set-effort!(increment) + + Increment the effort value. =20 =1F File: org-edna.info, Node: Getting Help, Prev: Actions, Up: Basic Fea= tures @@ -1168,29 +1173,29 @@ means block if any target heading isn=E2=80=99t d= one. =20 * Menu: =20 -* done:: -* headings:: -* todo-state:: -* variable-set:: -* has-property:: -* re-search:: Search for a regular expression +* Heading is DONE:: +* File Has Headings:: +* Heading TODO State:: +* Lisp Variable Set:: +* Heading Has Property:: +* Regexp Search:: Search for a regular expression * Negating Conditions:: =20 =1F -File: org-edna.info, Node: done, Next: headings, Up: Conditions +File: org-edna.info, Node: Heading is DONE, Next: File Has Headings, = Up: Conditions =20 -done ----- +Heading is DONE +--------------- =20 =E2=80=A2 Syntax: done? =20 Blocks the source heading if any target heading is DONE. =20 =1F -File: org-edna.info, Node: headings, Next: todo-state, Prev: done, U= p: Conditions +File: org-edna.info, Node: File Has Headings, Next: Heading TODO State= , Prev: Heading is DONE, Up: Conditions =20 -headings --------- +File Has Headings +----------------- =20 =E2=80=A2 Syntax: headings? =20 @@ -1202,10 +1207,10 @@ Org heading. This means that target does not hav= e to be a heading. The above example blocks if refile.org has any headings. =20 =1F -File: org-edna.info, Node: todo-state, Next: variable-set, Prev: head= ings, Up: Conditions +File: org-edna.info, Node: Heading TODO State, Next: Lisp Variable Set= , Prev: File Has Headings, Up: Conditions =20 -todo-state ----------- +Heading TODO State +------------------ =20 =E2=80=A2 Syntax: todo-state?(STATE) =20 @@ -1214,10 +1219,10 @@ todo-state STATE may be a string or a symbol. =20 =1F -File: org-edna.info, Node: variable-set, Next: has-property, Prev: to= do-state, Up: Conditions +File: org-edna.info, Node: Lisp Variable Set, Next: Heading Has Proper= ty, Prev: Heading TODO State, Up: Conditions =20 -variable-set ------------- +Lisp Variable Set +----------------- =20 =E2=80=A2 Syntax: variable-set?(VARIABLE VALUE) =20 @@ -1234,10 +1239,10 @@ self variable-set?(buffer-file-name =E2=80=9Corg-= edna.org=E2=80=9D) Blocks if the variable =E2=80=98buffer-file-name=E2=80=99 is set to= =E2=80=9Corg-edna.org=E2=80=9D. =20 =1F -File: org-edna.info, Node: has-property, Next: re-search, Prev: varia= ble-set, Up: Conditions +File: org-edna.info, Node: Heading Has Property, Next: Regexp Search, = Prev: Lisp Variable Set, Up: Conditions =20 -has-property ------------- +Heading Has Property +-------------------- =20 =E2=80=A2 Syntax: has-property?(=E2=80=9CPROPERTY=E2=80=9D =E2=80=9CV= ALUE=E2=80=9D) =20 @@ -1261,10 +1266,10 @@ to VALUE. showered at least three times. =20 =1F -File: org-edna.info, Node: re-search, Next: Negating Conditions, Prev= : has-property, Up: Conditions +File: org-edna.info, Node: Regexp Search, Next: Negating Conditions, = Prev: Heading Has Property, Up: Conditions =20 -re-search ---------- +Regexp Search +------------- =20 =E2=80=A2 Syntax: re-search?(=E2=80=9CREGEXP=E2=80=9D) =20 @@ -1275,7 +1280,7 @@ in any of the targets. other targets as well. =20 =1F -File: org-edna.info, Node: Negating Conditions, Prev: re-search, Up: = Conditions +File: org-edna.info, Node: Negating Conditions, Prev: Regexp Search, = Up: Conditions =20 Negating Conditions ------------------- @@ -1847,80 +1852,80 @@ Big release here, with three new features. =1F Tag Table: Node: Top=7F225 -Node: Copying=7F4165 -Node: Introduction=7F4987 -Node: Installation and Setup=7F5935 -Node: Basic Operation=7F6659 -Node: Blockers=7F8510 -Node: Triggers=7F8796 -Node: Syntax=7F9058 -Node: Basic Features=7F9748 -Node: Finders=7F10102 -Node: ancestors=7F11867 -Node: children=7F12461 -Node: descendants=7F12871 -Node: file=7F13393 -Node: first-child=7F14142 -Node: ids=7F14402 -Node: match=7F15063 -Node: next-sibling=7F15701 -Node: next-sibling-wrap=7F15958 -Node: olp=7F16272 -Node: org-file=7F16684 -Node: parent=7F17329 -Node: previous-sibling=7F17527 -Node: previous-sibling-wrap=7F17788 -Node: relatives=7F18067 -Node: rest-of-siblings=7F21688 -Node: rest-of-siblings-wrap=7F21973 -Node: self=7F22322 -Node: siblings=7F22483 -Node: siblings-wrap=7F22720 -Node: Actions=7F23024 -Node: Scheduled/Deadline=7F23787 -Node: TODO State=7F27302 -Node: Archive=7F28027 -Node: Chain Property=7F28347 -Node: Clocking=7F29100 -Node: Property=7F29512 -Node: Priority=7F31685 -Node: Tag=7F32254 -Node: Effort=7F32471 -Node: Getting Help=7F32860 -Node: Advanced Features=7F33305 -Node: Finder Cache=7F33753 -Node: Conditions=7F34792 -Node: done=7F35428 -Node: headings=7F35592 -Node: todo-state=7F35968 -Node: variable-set=7F36224 -Node: has-property=7F36861 -Node: re-search=7F37574 -Node: Negating Conditions=7F37934 -Node: Consideration=7F38321 -Node: Conditional Forms=7F39909 -Node: Setting the Properties=7F42565 -Node: Extending Edna=7F43649 -Node: Naming Conventions=7F44139 -Node: Finders 1=7F44931 -Node: Actions 1=7F45293 -Node: Conditions 1=7F45752 -Node: Contributing=7F46638 -Node: Bugs=7F47504 -Node: Working with EDE=7F47861 -Node: Compiling Edna=7F48945 -Node: Testing Edna=7F49814 -Node: Before Sending Changes=7F50795 -Node: Developing with Bazaar=7F51482 -Node: Documentation=7F52223 -Node: Changelog=7F52679 -Node: 10beta8=7F52929 -Node: 10beta7=7F53041 -Node: 10beta6=7F53335 -Node: 10beta5=7F53611 -Node: 10beta4=7F53998 -Node: 10beta3=7F54251 -Node: 10beta2=7F54690 +Node: Copying=7F4206 +Node: Introduction=7F5028 +Node: Installation and Setup=7F5976 +Node: Basic Operation=7F6700 +Node: Blockers=7F8551 +Node: Triggers=7F8837 +Node: Syntax=7F9099 +Node: Basic Features=7F9789 +Node: Finders=7F10143 +Node: ancestors=7F11908 +Node: children=7F12502 +Node: descendants=7F12912 +Node: file=7F13434 +Node: first-child=7F14183 +Node: ids=7F14443 +Node: match=7F15104 +Node: next-sibling=7F15742 +Node: next-sibling-wrap=7F15999 +Node: olp=7F16313 +Node: org-file=7F16725 +Node: parent=7F17370 +Node: previous-sibling=7F17568 +Node: previous-sibling-wrap=7F17829 +Node: relatives=7F18108 +Node: rest-of-siblings=7F21729 +Node: rest-of-siblings-wrap=7F22014 +Node: self=7F22363 +Node: siblings=7F22524 +Node: siblings-wrap=7F22761 +Node: Actions=7F23065 +Node: Scheduled/Deadline=7F23828 +Node: TODO State=7F27343 +Node: Archive=7F28068 +Node: Chain Property=7F28388 +Node: Clocking=7F29141 +Node: Property=7F29553 +Node: Priority=7F31726 +Node: Tag=7F32295 +Node: Effort=7F32512 +Node: Getting Help=7F32896 +Node: Advanced Features=7F33341 +Node: Finder Cache=7F33789 +Node: Conditions=7F34828 +Node: Heading is DONE=7F35505 +Node: File Has Headings=7F35711 +Node: Heading TODO State=7F36133 +Node: Lisp Variable Set=7F36427 +Node: Heading Has Property=7F37095 +Node: Regexp Search=7F37841 +Node: Negating Conditions=7F38221 +Node: Consideration=7F38612 +Node: Conditional Forms=7F40200 +Node: Setting the Properties=7F42856 +Node: Extending Edna=7F43940 +Node: Naming Conventions=7F44430 +Node: Finders 1=7F45222 +Node: Actions 1=7F45584 +Node: Conditions 1=7F46043 +Node: Contributing=7F46929 +Node: Bugs=7F47795 +Node: Working with EDE=7F48152 +Node: Compiling Edna=7F49236 +Node: Testing Edna=7F50105 +Node: Before Sending Changes=7F51086 +Node: Developing with Bazaar=7F51773 +Node: Documentation=7F52514 +Node: Changelog=7F52970 +Node: 10beta8=7F53220 +Node: 10beta7=7F53332 +Node: 10beta6=7F53626 +Node: 10beta5=7F53902 +Node: 10beta4=7F54289 +Node: 10beta3=7F54542 +Node: 10beta2=7F54981 =1F End Tag Table =20 diff --git a/org-edna.org b/org-edna.org index 5fd4cf4..d18828e 100644 --- a/org-edna.org +++ b/org-edna.org @@ -909,13 +909,19 @@ e.g. tag1:tag2 :DESCRIPTION: So much effort! :END: =20 -- Syntax: set-effort!(VALUE) +Modifies the effort of all targets. =20 -Sets the effort of all targets according to VALUE: +- Syntax: set-effort!("VALUE") =20 -- If VALUE is a string, then the effort is set to VALUE -- If VALUE is an integer, then set the value to the VALUE'th allowed eff= ort property -- If VALUE is the symbol 'increment, increment effort + Set the effort of all targets to "VALUE". + +- Syntax: set-effort!(NUMBER) + + Sets the effort to the NUMBER'th allowed effort property. + +- Syntax: set-effort!(increment) + + Increment the effort value. =20 ** Getting Help :PROPERTIES: From MAILER-DAEMON Sun Nov 25 14:09:57 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQzn3-0007S7-K4 for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmx-0007OO-Aj for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmu-0002iX-Gj for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:51 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmu-0002iQ-BS for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:48 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 4BBCC209C2; Sun, 25 Nov 2018 14:09:48 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master c6b3234 07/13: Additional tests and minor cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: c6b32343ad22ce4b83ee1dd6dd68516fa04e02c1 Auto-Submitted: auto-generated Message-Id: <20181125190948.4BBCC209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:48 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:09:54 -0000 branch: master commit c6b32343ad22ce4b83ee1dd6dd68516fa04e02c1 Author: Ian Dunn Commit: Ian Dunn Additional tests and minor cleanup =20 * org-edna.el: Added some section headers. =20 * org-edna-tests.el (org-edna-doc-test/ancestors-cache): (org-edna-doc-test/descendants-cache): (org-edna-doc-test/laundry-cache): (org-edna-doc-test/nightly-cache): Added tests for run-through with= cache. --- org-edna-tests.el | 171 ++++++++++++++++++++++++++++++++++++++++++++++++= +++++- org-edna.el | 7 ++- 2 files changed, 174 insertions(+), 4 deletions(-) diff --git a/org-edna-tests.el b/org-edna-tests.el index da8e437..5b0b1e0 100644 --- a/org-edna-tests.el +++ b/org-edna-tests.el @@ -3,9 +3,6 @@ ;; Copyright (C) 2017-2018 Free Software Foundation, Inc. =20 ;; Author: Ian Dunn -;; Keywords: convenience, text, org -;; Version: 1.0 -;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "8.0")) =20 ;; This file is NOT part of GNU Emacs. =20 @@ -1646,6 +1643,39 @@ This avoids org-id digging into its internal datab= ase." (org-edna-test-mark-todo heading1-pom heading3-pom heading= 4-pom heading5-pom)))) (org-edna-test-restore-test-file)))) =20 +(ert-deftest org-edna-doc-test/ancestors-cache () + (let* ((start-heading (org-edna-find-test-heading "24a0c3bb-7e69-4e9e-= bb98-5aba2ff17bb1")) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Enable cache + (org-edna-finder-use-cache t)) + (unwind-protect + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading5-pom (progn (org-next-visible-heading 1) (po= int-marker)))) + ;; Verify that we can't change the TODO state to DONE + (should (org-edna-test-check-block heading5-pom "Initial s= tate of heading 5")) + ;; Change the state at 4 to DONE + (org-edna-test-change-todo-state heading4-pom "DONE") + ;; Verify that ALL ancestors need to be changed + (should (org-edna-test-check-block heading5-pom "Heading 5= after parent changed")) + (org-edna-test-mark-done heading1-pom heading3-pom) + ;; Only need 1, 3, and 4 to change 5 + (should (not (org-edna-test-check-block heading5-pom + "Heading 5 after all= parents changed"))) + ;; Change the state back to TODO on all of them + (org-edna-test-mark-todo heading1-pom heading3-pom heading= 4-pom heading5-pom)))) + (org-edna-test-restore-test-file)))) + (ert-deftest org-edna-doc-test/descendants () (let* ((start-heading (org-edna-find-test-heading "cc18dc74-00e8-4081-= b46f-e36800041fe7")) (org-todo-keywords '((sequence "TODO" "|" "DONE"))) @@ -1682,6 +1712,44 @@ This avoids org-id digging into its internal datab= ase." (should (not (org-edna-test-check-block heading1-pom "Head= ing 1 after changing 5")))))) (org-edna-test-restore-test-file)))) =20 +(ert-deftest org-edna-doc-test/descendants-cache () + (let* ((start-heading (org-edna-find-test-heading "cc18dc74-00e8-4081-= b46f-e36800041fe7")) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Enable cache + (org-edna-finder-use-cache t)) + (unwind-protect + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading5-pom (progn (org-next-visible-heading 1) (po= int-marker)))) + (should (org-edna-test-check-block heading1-pom "Heading 1= initial state")) + ;; Change the state at 2 to DONE + (org-edna-test-mark-done heading2-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 2")) + ;; Try 3 + (org-edna-test-mark-done heading3-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 3")) + ;; Try 4 + (org-edna-test-mark-done heading4-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 4")) + ;; Try 5 + (org-edna-test-mark-done heading5-pom) + ;; Verify that ALL descendants need to be changed + (should (not (org-edna-test-check-block heading1-pom "Head= ing 1 after changing 5")))))) + (org-edna-test-restore-test-file)))) + (ert-deftest org-edna-doc-test/laundry () "Test for the \"laundry\" example in the documentation." (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) @@ -1733,6 +1801,62 @@ This avoids org-id digging into its internal datab= ase." ;; Change the test file back to its original state. (org-edna-test-restore-test-file)))))) =20 +(ert-deftest org-edna-doc-test/laundry-cache () + "Test for the \"laundry\" example in the documentation. + +This version enables cache, ensuring that the repeated calls to +the relative finders all still work while cache is enabled." + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (start-heading (org-edna-find-test-heading "e57ce099-9f37-4= 7f4-a6bb-61a84eb1fbbe")) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function) + ;; Enable cache + (org-edna-finder-use-cache t)) + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (unwind-protect + (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker)))) + ;; Verify that headings 2, 3, and 4 are all blocked + (should (org-edna-test-check-block heading2-pom + "Initial attempt to cha= nge heading 2")) + (should (org-edna-test-check-block heading3-pom + "Initial attempt to cha= nge heading 3")) + (should (org-edna-test-check-block heading4-pom + "Initial attempt to cha= nge heading 4")) + ;; Mark heading 1 as DONE + (should (not (org-edna-test-check-block heading1-pom + "Set heading 1 to DO= NE"))) + ;; Only heading 2 should have a scheduled time + (should (string-equal (org-entry-get heading2-pom "SCHEDUL= ED") + "<2000-01-15 Sat 01:00>")) + (should (not (org-entry-get heading3-pom "SCHEDULED"))) + (should (not (org-entry-get heading4-pom "SCHEDULED"))) + ;; The others should still be blocked. + (should (org-edna-test-check-block heading3-pom + "Second attempt to chan= ge heading 3")) + (should (org-edna-test-check-block heading4-pom + "Second attempt to chan= ge heading 4")) + ;; Try changing heading 2 + (should (not (org-edna-test-check-block heading2-pom + "Set heading 2 to DO= NE"))) + (should (string-equal (org-entry-get heading3-pom "SCHEDUL= ED") + "<2000-01-16 Sun 09:00>")) + ;; 4 should still be blocked + (should (org-edna-test-check-block heading4-pom + "Second attempt to chan= ge heading 4"))) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file)))))) + (ert-deftest org-edna-doc-test/nightly () (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (start-heading (org-edna-find-test-heading "8b6d9820-d943-4= 622-85c9-4a346e033453")) @@ -1772,6 +1896,47 @@ This avoids org-id digging into its internal datab= ase." ;; Change the test file back to its original state. (org-edna-test-restore-test-file)))))) =20 +(ert-deftest org-edna-doc-test/nightly-cache () + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (start-heading (org-edna-find-test-heading "8b6d9820-d943-4= 622-85c9-4a346e033453")) + ;; Only use the test file in the agenda + (org-agenda-files `(,org-edna-test-file)) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function) + ;; Enable cache + (org-edna-finder-use-cache t)) + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (unwind-protect + (let* ((nightly-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) + (lunch-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) + (door-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) + (dog-pom (progn (org-next-visible-heading 1) (poi= nt-marker)))) + ;; Verify that Nightly is blocked + (should (org-edna-test-check-block nightly-pom "Initial Ni= ghtly Check")) + ;; Check off Lunch, and verify that nightly is still block= ed + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-check-block nightly-pom "Nightly af= ter Lunch")) + ;; Check off Door, and verify that nightly is still blocke= d + (org-edna-test-mark-done door-pom) + (should (org-edna-test-check-block nightly-pom "Nightly af= ter Door")) + ;; Check off Dog. This should trigger the others. + (org-edna-test-mark-done dog-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Nightly Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Nightly Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Nightly Trigger")) + (should (string-equal (org-entry-get nightly-pom "DEADLINE= ") + "<2000-01-16 Sun +1d>"))) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file)))))) + (ert-deftest org-edna-doc-test/daily () (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (start-heading (org-edna-find-test-heading "630805bb-a864-4= cdc-9a6f-0f126e887c66")) diff --git a/org-edna.el b/org-edna.el index 3247989..102dd06 100644 --- a/org-edna.el +++ b/org-edna.el @@ -583,6 +583,7 @@ following reasons: (org-edna--add-to-finder-cache func-sym args))))) =20 =0C +;;; Interactive Functions =20 (defmacro org-edna-run (change-plist &rest body) "Run a TODO state change. @@ -655,6 +656,7 @@ Remove Edna's workers from `org-trigger-hook' and (remove-hook 'org-blocker-hook 'org-edna-blocker-function)) =20 =0C +;;; Finders =20 ;; Tag Finder (defun org-edna-finder/match (match-spec &optional scope skip) @@ -1256,6 +1258,7 @@ which ones will and won't work." (list (point-min-marker)))) =20 =0C +;;; Actions =20 ;; Set TODO state (defun org-edna-action/todo! (_last-entry new-state) @@ -1882,6 +1885,7 @@ Does nothing if the source heading has no property = PROPERTY." (org-entry-put nil property old-prop))) =20 =0C +;;; Conditions =20 ;; For most conditions, we return true if condition is true and neg is f= alse, or ;; if condition is false and neg is true: @@ -1985,6 +1989,7 @@ starting from target's position." (format "%s %s in %s" (if neg "Did Not Find" "Found") match (buffe= r-name))))) =20 =0C +;;; Consideration =20 (defun org-edna-handle-consideration (consideration blocks) "Handle consideration CONSIDERATION. @@ -2034,7 +2039,6 @@ same as \"consider\"." first-block)))))) =20 =0C - ;;; Popout editing =20 (defvar org-edna-edit-original-marker nil) @@ -2278,6 +2282,7 @@ Displays help for KEYWORD in the Help buffer." (princ doc)))) =20 =0C +;;; Bug Reports =20 (declare-function lm-report-bug "lisp-mnt" (topic)) =20 From MAILER-DAEMON Sun Nov 25 14:09:58 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQzn3-0007SR-S1 for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmw-0007NK-IK for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmv-0002jU-8n for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:50 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmv-0002jG-4B for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:49 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 120DE209DD; Sun, 25 Nov 2018 14:09:49 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master cb98c0f 10/13: Removed remnants of old build system MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: cb98c0f5d56c4549df657410d6154c6acf3afe4f Auto-Submitted: auto-generated Message-Id: <20181125190949.120DE209DD@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:49 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:09:54 -0000 branch: master commit cb98c0f5d56c4549df657410d6154c6acf3afe4f Author: Ian Dunn Commit: Ian Dunn Removed remnants of old build system --- defaults.mk | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/defaults.mk b/defaults.mk deleted file mode 100644 index f599ee4..0000000 --- a/defaults.mk +++ /dev/null @@ -1,26 +0,0 @@ -# This is part of org-edna -# -# Copyright (C) 2017-2018 Free Software Foundation, Inc. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -emacs =3D emacs - -prefix =3D /usr/share - -org_path =3D $(prefix)/emacs/site-lisp/org - -info_dir =3D $(prefix)/info - -lisp_dir =3D $(prefix)/emacs/site-lisp/ From MAILER-DAEMON Sun Nov 25 14:10:10 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQznE-0007WE-36 for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:10:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzn1-0007Pm-8q for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:10:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmv-0002jK-5g for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:55 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmu-0002j3-UG for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:49 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id D583E209C2; Sun, 25 Nov 2018 14:09:48 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 98651a0 09/13: Inverted definition of consideration MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 98651a08d0142b5a2e2130de98d21ad6b17be7e8 Auto-Submitted: auto-generated Message-Id: <20181125190948.D583E209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:48 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:10:02 -0000 branch: master commit 98651a08d0142b5a2e2130de98d21ad6b17be7e8 Author: Ian Dunn Commit: Ian Dunn Inverted definition of consideration =20 Makes it clearer how it works with the rest of the system. =20 * org-edna.el (org-edna-handle-consideration): Inverted semantics. =20 * org-edna-tests.el (org-edna-test-inhibit-messages): New defvar to s= ilence org mode's messages during testing. (org-edna-consideration/any): New test. (org-edna-consideration/all): (org-edna-consideration/integer): (org-edna-consideration/float): Updated tests to match new semantic= s. (org-edna-doc-test/daily): Expanded scope of test. (org-edna-doc-test/snow-shoveling): (org-edna-doc-test/consider-fraction): (org-edna-doc-test/consider-number): New tests from docs. =20 * org-edna.org (Consideration): Updated section. (Conditional Forms): Updated semantics of consideration. =20 * test.mk: Set `org-edna-test-inhibit-messages' to silence Org messag= es. --- org-edna-tests.el | 278 ++++++++++++++++++++++++++++++++++++++++++++---= ------ org-edna-tests.org | 41 +++++++- org-edna.el | 70 ++++++++------ org-edna.info | 261 ++++++++++++++++++++++++++++-------------------= -- org-edna.org | 92 ++++++++++++------ test.mk | 1 + 6 files changed, 532 insertions(+), 211 deletions(-) diff --git a/org-edna-tests.el b/org-edna-tests.el index 6f5fa5e..52c901a 100644 --- a/org-edna-tests.el +++ b/org-edna-tests.el @@ -26,6 +26,9 @@ (require 'ert) (require 'org-id) =20 +(defvar org-edna-test-inhibit-messages nil + "Whether to inhibit messages (apart from ERT messages).") + (defconst org-edna-test-dir (expand-file-name (file-name-directory (or load-file-name buffer-file-= name)))) =20 @@ -1184,6 +1187,7 @@ This avoids org-id digging into its internal databa= se." =20 (ert-deftest org-edna-action/todo-test () (let* ((org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51a-87= fbd34f79f7"))) (unwind-protect (org-with-point-at target @@ -1203,6 +1207,7 @@ This avoids org-id digging into its internal databa= se." ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51= a-87fbd34f79f7"))) (unwind-protect (org-with-point-at target @@ -1220,6 +1225,7 @@ This avoids org-id digging into its internal databa= se." =20 (ert-deftest org-edna-action-scheduled/cp () (let* ((org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51a-87= fbd34f79f7")) (source (org-edna-find-test-heading "97e6b0f0-40c4-464f-b760-6e= 5ca9744eb5")) (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "rem= ove")))) @@ -1237,6 +1243,7 @@ This avoids org-id digging into its internal databa= se." ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) (unwind-protect (org-with-point-at target @@ -1295,6 +1302,7 @@ This avoids org-id digging into its internal databa= se." ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) (unwind-protect (org-with-point-at target @@ -1321,6 +1329,7 @@ This avoids org-id digging into its internal databa= se." ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "caf27724-0887-4565-976= 5-ed2f1edcfb16"))) (unwind-protect (org-with-point-at target @@ -1345,6 +1354,7 @@ This avoids org-id digging into its internal databa= se." (ert-deftest org-edna-action-scheduled/float () (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) (unwind-protect (org-with-point-at target @@ -1386,6 +1396,7 @@ This avoids org-id digging into its internal databa= se." ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51= a-87fbd34f79f7"))) (unwind-protect (org-with-point-at target @@ -1403,6 +1414,7 @@ This avoids org-id digging into its internal databa= se." =20 (ert-deftest org-edna-action-deadline/cp () (let* ((org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51a-87= fbd34f79f7")) (source (org-edna-find-test-heading "97e6b0f0-40c4-464f-b760-6e= 5ca9744eb5")) (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "rem= ove")))) @@ -1420,6 +1432,7 @@ This avoids org-id digging into its internal databa= se." ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) (unwind-protect (org-with-point-at target @@ -1478,6 +1491,7 @@ This avoids org-id digging into its internal databa= se." ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) (unwind-protect (org-with-point-at target @@ -1504,6 +1518,7 @@ This avoids org-id digging into its internal databa= se." ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) + (inhibit-message org-edna-test-inhibit-messages) (target (org-edna-find-test-heading "caf27724-0887-4565-976= 5-ed2f1edcfb16"))) (unwind-protect (org-with-point-at target @@ -1527,6 +1542,7 @@ This avoids org-id digging into its internal databa= se." =20 (ert-deftest org-edna-action-deadline/float () (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (inhibit-message org-edna-test-inhibit-messages) (org-agenda-files `(,org-edna-test-file)) (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) (unwind-protect @@ -1566,7 +1582,8 @@ This avoids org-id digging into its internal databa= se." (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-tag () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) + (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) + (inhibit-message org-edna-test-inhibit-messages)) (unwind-protect (org-with-point-at pom (org-edna-action/tag! nil "tag") @@ -1576,7 +1593,8 @@ This avoids org-id digging into its internal databa= se." (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-property () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) + (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) + (inhibit-message org-edna-test-inhibit-messages)) (unwind-protect (org-with-point-at pom (org-edna-action/set-property! nil "TEST" "1") @@ -1586,7 +1604,8 @@ This avoids org-id digging into its internal databa= se." (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-property/inc-dec () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) + (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) + (inhibit-message org-edna-test-inhibit-messages)) (unwind-protect (org-with-point-at pom (org-edna-action/set-property! nil "TEST" "1") @@ -1608,7 +1627,8 @@ This avoids org-id digging into its internal databa= se." (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-property/next-prev () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) + (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) + (inhibit-message org-edna-test-inhibit-messages)) (unwind-protect (org-with-point-at pom (org-edna-action/set-property! nil "TEST" "a") @@ -1639,7 +1659,8 @@ This avoids org-id digging into its internal databa= se." (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-clock () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) + (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) + (inhibit-message org-edna-test-inhibit-messages)) (unwind-protect (org-with-point-at pom (org-edna-action/clock-in! nil) @@ -1651,6 +1672,7 @@ This avoids org-id digging into its internal databa= se." =20 (ert-deftest org-edna-action-priority () (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) + (inhibit-message org-edna-test-inhibit-messages) (org-lowest-priority ?C) (org-highest-priority ?A) (org-default-priority ?B)) @@ -1669,7 +1691,8 @@ This avoids org-id digging into its internal databa= se." (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-effort () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) + (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) + (inhibit-message org-edna-test-inhibit-messages)) (unwind-protect (org-with-point-at pom (org-edna-action/set-effort! nil "0:01") @@ -1680,11 +1703,12 @@ This avoids org-id digging into its internal data= base." (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-archive () - (let ((org-archive-save-context-info '(todo)) - (pom (org-edna-find-test-heading org-edna-test-archive-heading)) - ;; Archive it to the same location - (org-archive-location "::** Archive") - (org-edna-prompt-for-archive nil)) + (let* ((inhibit-message org-edna-test-inhibit-messages) + (org-archive-save-context-info '(todo)) + (pom (org-edna-find-test-heading org-edna-test-archive-heading)= ) + ;; Archive it to the same location + (org-archive-location "::** Archive") + (org-edna-prompt-for-archive nil)) (unwind-protect (org-with-point-at pom (org-edna-action/archive! nil) @@ -1693,7 +1717,8 @@ This avoids org-id digging into its internal databa= se." (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-chain () - (let ((old-pom (org-edna-find-test-heading org-edna-test-id-heading-on= e)) + (let ((inhibit-message org-edna-test-inhibit-messages) + (old-pom (org-edna-find-test-heading org-edna-test-id-heading-on= e)) (new-pom (org-edna-find-test-heading org-edna-test-id-heading-tw= o))) (unwind-protect (progn @@ -1709,12 +1734,13 @@ This avoids org-id digging into its internal data= base." ;; Conditions =20 (defun org-edna-test-condition-form (func-sym pom-true pom-false block-t= rue block-false &rest args) - (org-with-point-at pom-true - (should-not (apply func-sym t args)) - (should (equal (apply func-sym nil args) block-true))) - (org-with-point-at pom-false - (should (equal (apply func-sym t args) block-false)) - (should-not (apply func-sym nil args)))) + (let* ((inhibit-message org-edna-test-inhibit-messages)) + (org-with-point-at pom-true + (should-not (apply func-sym t args)) + (should (equal (apply func-sym nil args) block-true))) + (org-with-point-at pom-false + (should (equal (apply func-sym t args) block-false)) + (should-not (apply func-sym nil args))))) =20 (ert-deftest org-edna-condition-done () (let* ((pom-done (org-edna-find-test-heading org-edna-test-id-heading-= four)) @@ -1794,27 +1820,37 @@ This avoids org-id digging into its internal data= base." =0C ;; Consideration =20 +(ert-deftest org-edna-consideration/any () + (let ((blocks-all-blocking `("a" "c" "b")) + (blocks-some-blocking `("a" nil "b")) + (blocks-no-blocking `(nil nil nil))) + (should (string-equal (org-edna-handle-consideration 'any blocks-all= -blocking) "a")) + (should (string-equal (org-edna-handle-consideration 'any blocks-som= e-blocking) "a")) + (should (not (org-edna-handle-consideration 'any blocks-no-blocking)= )))) + (ert-deftest org-edna-consideration/all () - (let ((blocks-blocking `("a" nil "b")) + (let ((blocks-all-blocking `("a" "c" "b")) + (blocks-some-blocking `(nil "c" nil)) (blocks-no-blocking `(nil nil nil))) - (should (string-equal (org-edna-handle-consideration 'all blocks-blo= cking) "a")) + (should (string-equal (org-edna-handle-consideration 'all blocks-all= -blocking) "a")) + (should (not (org-edna-handle-consideration 'all blocks-some-blockin= g))) (should (not (org-edna-handle-consideration 'all blocks-no-blocking)= )))) =20 (ert-deftest org-edna-consideration/integer () - (let ((blocks-blocking `("a" "c" "b")) - (blocks-no-blocking `("a" nil "b")) - (blocks-empty `(nil nil nil))) - (should (string-equal (org-edna-handle-consideration 1 blocks-blocki= ng) "a")) - (should (not (org-edna-handle-consideration 1 blocks-no-blocking))) - (should (not (org-edna-handle-consideration 1 blocks-empty))))) + (let ((blocks-all-blocking `("a" "c" "b")) + (blocks-some-blocking `("a" nil "b")) + (blocks-no-blocking `(nil nil nil))) + (should (string-equal (org-edna-handle-consideration 2 blocks-all-bl= ocking) "a")) + (should (string-equal (org-edna-handle-consideration 2 blocks-some-b= locking) "a")) + (should (not (org-edna-handle-consideration 2 blocks-no-blocking))))= ) =20 (ert-deftest org-edna-consideration/float () - (let ((blocks-blocking `("a" "c" "b")) - (blocks-no-blocking `("a" nil "b")) - (blocks-empty `(nil nil nil))) - (should (string-equal (org-edna-handle-consideration 0.25 blocks-blo= cking) "a")) - (should (not (org-edna-handle-consideration 0.25 blocks-no-blocking)= )) - (should (not (org-edna-handle-consideration 0.25 blocks-empty))))) + (let ((blocks-all-blocking `("a" "c" "b")) + (blocks-some-blocking `("a" nil "b")) + (blocks-no-blocking `(nil nil nil))) + (should (string-equal (org-edna-handle-consideration 0.25 blocks-all= -blocking) "a")) + (should (string-equal (org-edna-handle-consideration 0.25 blocks-som= e-blocking) "a")) + (should (not (org-edna-handle-consideration 0.25 blocks-no-blocking)= )))) =20 =0C ;;; Full Run-through Tests from the Documentation @@ -1823,7 +1859,8 @@ This avoids org-id digging into its internal databa= se." (let* ((start-heading (org-edna-find-test-heading "24a0c3bb-7e69-4e9e-= bb98-5aba2ff17bb1")) (org-todo-keywords '((sequence "TODO" "|" "DONE"))) ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function)) + (org-blocker-hook 'org-edna-blocker-function) + (inhibit-message org-edna-test-inhibit-messages)) (unwind-protect (org-with-point-at start-heading (save-restriction @@ -1856,7 +1893,8 @@ This avoids org-id digging into its internal databa= se." ;; Only block based on Edna (org-blocker-hook 'org-edna-blocker-function) ;; Enable cache - (org-edna-finder-use-cache t)) + (org-edna-finder-use-cache t) + (inhibit-message org-edna-test-inhibit-messages)) (unwind-protect (org-with-point-at start-heading (save-restriction @@ -1887,7 +1925,8 @@ This avoids org-id digging into its internal databa= se." (let* ((start-heading (org-edna-find-test-heading "cc18dc74-00e8-4081-= b46f-e36800041fe7")) (org-todo-keywords '((sequence "TODO" "|" "DONE"))) ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function)) + (org-blocker-hook 'org-edna-blocker-function) + (inhibit-message org-edna-test-inhibit-messages)) (unwind-protect (org-with-point-at start-heading (save-restriction @@ -1925,7 +1964,8 @@ This avoids org-id digging into its internal databa= se." ;; Only block based on Edna (org-blocker-hook 'org-edna-blocker-function) ;; Enable cache - (org-edna-finder-use-cache t)) + (org-edna-finder-use-cache t) + (inhibit-message org-edna-test-inhibit-messages)) (unwind-protect (org-with-point-at start-heading (save-restriction @@ -1965,7 +2005,8 @@ This avoids org-id digging into its internal databa= se." ;; Only block based on Edna (org-blocker-hook 'org-edna-blocker-function) ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function)) + (org-trigger-hook 'org-edna-trigger-function) + (inhibit-message org-edna-test-inhibit-messages)) (org-with-point-at start-heading (save-restriction ;; Only allow operating on the current tree @@ -2021,7 +2062,8 @@ the relative finders all still work while cache is = enabled." ;; Only trigger based on Edna (org-trigger-hook 'org-edna-trigger-function) ;; Enable cache - (org-edna-finder-use-cache t)) + (org-edna-finder-use-cache t) + (inhibit-message org-edna-test-inhibit-messages)) (org-with-point-at start-heading (save-restriction ;; Only allow operating on the current tree @@ -2073,7 +2115,8 @@ the relative finders all still work while cache is = enabled." ;; Only block based on Edna (org-blocker-hook 'org-edna-blocker-function) ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function)) + (org-trigger-hook 'org-edna-trigger-function) + (inhibit-message org-edna-test-inhibit-messages)) (org-with-point-at start-heading (save-restriction ;; Only allow operating on the current tree @@ -2114,7 +2157,8 @@ the relative finders all still work while cache is = enabled." ;; Only trigger based on Edna (org-trigger-hook 'org-edna-trigger-function) ;; Enable cache - (org-edna-finder-use-cache t)) + (org-edna-finder-use-cache t) + (inhibit-message org-edna-test-inhibit-messages)) (org-with-point-at start-heading (save-restriction ;; Only allow operating on the current tree @@ -2153,7 +2197,8 @@ the relative finders all still work while cache is = enabled." ;; Only block based on Edna (org-blocker-hook 'org-edna-blocker-function) ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function)) + (org-trigger-hook 'org-edna-trigger-function) + (inhibit-message org-edna-test-inhibit-messages)) (org-with-point-at start-heading (save-restriction ;; Only allow operating on the current tree @@ -2171,7 +2216,21 @@ the relative finders all still work while cache is= enabled." (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Daily Trigger")) (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Daily Trigger")) (should (string-equal (org-entry-get daily-pom "DEADLINE") - "<2000-01-16 Sun +1d>"))) + "<2000-01-16 Sun +1d>")) + ;; Check off Door. This should trigger the others. + (org-edna-test-mark-done door-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Door Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Door Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Door Trigger")) + (should (string-equal (org-entry-get daily-pom "DEADLINE") + "<2000-01-17 Mon +1d>")) + ;; Check off Dog. This should trigger the others. + (org-edna-test-mark-done dog-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Dog Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Dog Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Dog Trigger")) + (should (string-equal (org-entry-get daily-pom "DEADLINE") + "<2000-01-18 Tue +1d>"))) ;; Change the test file back to its original state. (org-edna-test-restore-test-file)))))) =20 @@ -2184,7 +2243,8 @@ the relative finders all still work while cache is = enabled." ;; Only block based on Edna (org-blocker-hook 'org-edna-blocker-function) ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function)) + (org-trigger-hook 'org-edna-trigger-function) + (inhibit-message org-edna-test-inhibit-messages)) (org-with-point-at start-heading (save-restriction ;; Only allow operating on the current tree @@ -2215,7 +2275,8 @@ the relative finders all still work while cache is = enabled." ;; Only block based on Edna (org-blocker-hook 'org-edna-blocker-function) ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function)) + (org-trigger-hook 'org-edna-trigger-function) + (inhibit-message org-edna-test-inhibit-messages)) (org-with-point-at start-heading (save-restriction ;; Only allow operating on the current tree @@ -2247,6 +2308,135 @@ the relative finders all still work while cache i= s enabled." ;; Change the test file back to its original state. (org-edna-test-restore-test-file)))))) =20 +(ert-deftest org-edna-doc-test/snow-shoveling () + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (start-heading (org-edna-find-test-heading "b1d89bd8-db96-4= 86e-874c-98e2b3a8cbf2")) + ;; Only use the test file in the agenda + (org-agenda-files `(,org-edna-test-file)) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function) + (inhibit-message org-edna-test-inhibit-messages)) + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (unwind-protect + (let* ((monday-pom (progn (org-next-visible-heading 1) (poin= t-marker))) + (tuesday-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) + (wednesday-pom (progn (org-next-visible-heading 1) (p= oint-marker))) + (shovel-pom (progn (org-next-visible-heading 1) (poin= t-marker)))) + ;; Verify shovels is blocked + (should (org-edna-test-check-block shovel-pom "Initial Sho= vel Check")) + + ;; Mark Monday as done + (org-edna-test-mark-done monday-pom) + (should (not (org-edna-test-check-block shovel-pom "Shovel= after changing Monday"))) + ;; Reset + (org-edna-test-mark-todo monday-pom tuesday-pom wednesday-= pom shovel-pom) + + ;; Mark Tuesday as done + (org-edna-test-mark-done tuesday-pom) + (should (not (org-edna-test-check-block shovel-pom "Shovel= after changing Tuesday"))) + + ;; Reset + (org-edna-test-mark-todo monday-pom tuesday-pom wednesday-= pom shovel-pom) + ;; Mark Wednesday as done + (org-edna-test-mark-done wednesday-pom) + (should (not (org-edna-test-check-block shovel-pom "Shovel= after changing Wednesday")))) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file)))))) + +(ert-deftest org-edna-doc-test/consider-fraction () + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (start-heading (org-edna-find-test-heading "7de5af8b-a226-4= 63f-8360-edd88b99462a")) + ;; Only use the test file in the agenda + (org-agenda-files `(,org-edna-test-file)) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function) + (inhibit-message org-edna-test-inhibit-messages)) + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (unwind-protect + (let* ((shovel-pom (progn (org-next-visible-heading 1) (poin= t-marker))) + (room-pom (progn (org-next-visible-heading 1) (point-= marker))) + (vacuum-pom (progn (org-next-visible-heading 1) (poin= t-marker))) + (lunch-pom (progn (org-next-visible-heading 1) (point= -marker))) + (edna-pom (progn (org-next-visible-heading 1) (point-= marker)))) + ;; Verify Edna is blocked + (should (org-edna-test-check-block edna-pom "Initial Edna = Check")) + + ;; Mark Shovel snow as done + (org-edna-test-mark-done shovel-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check af= ter Shovel")) + + ;; Mark Vacuum as done + (org-edna-test-mark-done vacuum-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check af= ter Vacuum")) + + ;; Mark Room as done + (org-edna-test-mark-done room-pom) + ;; Verify Edna is no longer blocked + (should (not (org-edna-test-check-block edna-pom "Edna Che= ck after Room")))) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file)))))) + +(ert-deftest org-edna-doc-test/consider-number () + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (start-heading (org-edna-find-test-heading "b79279f7-be3c-4= 5ac-96dc-6e962a5873d4")) + ;; Only use the test file in the agenda + (org-agenda-files `(,org-edna-test-file)) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function) + (inhibit-message org-edna-test-inhibit-messages)) + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (unwind-protect + (let* ((shovel-pom (progn (org-next-visible-heading 1) (poin= t-marker))) + (room-pom (progn (org-next-visible-heading 1) (point-= marker))) + (vacuum-pom (progn (org-next-visible-heading 1) (poin= t-marker))) + (lunch-pom (progn (org-next-visible-heading 1) (point= -marker))) + (edna-pom (progn (org-next-visible-heading 1) (point-= marker)))) + ;; Verify Edna is blocked + (should (org-edna-test-check-block edna-pom "Initial Edna = Check")) + + ;; Mark Shovel snow as done + (org-edna-test-mark-done shovel-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check af= ter Shovel")) + + ;; Mark Vacuum as done + (org-edna-test-mark-done vacuum-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check af= ter Vacuum")) + + ;; Mark Room as done + (org-edna-test-mark-done room-pom) + ;; Verify Edna is no longer blocked + (should (not (org-edna-test-check-block edna-pom "Edna Che= ck after Room")))) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file)))))) + (provide 'org-edna-tests) =20 ;;; org-edna-tests.el ends here diff --git a/org-edna-tests.org b/org-edna-tests.org index 4d9aa9d..35d5455 100644 --- a/org-edna-tests.org +++ b/org-edna-tests.org @@ -231,15 +231,15 @@ DEADLINE: <2000-01-15 Sat +1d> :END: *** TODO Prepare Tomorrow's Lunch :dai= ly: :PROPERTIES: -:TRIGGER: if consider(any) match("daily") then ids(96f7e46c-40c3-4f5b-8= f00-81a6e3cb122b) todo!(DONE) endif +:TRIGGER: if consider(all) match("daily") then ids(96f7e46c-40c3-4f5b-8= f00-81a6e3cb122b) todo!(DONE) endif :END: *** TODO Lock Back Door :dai= ly: :PROPERTIES: -:TRIGGER: if consider(any) match("daily") then ids(96f7e46c-40c3-4f5b-8= f00-81a6e3cb122b) todo!(DONE) endif +:TRIGGER: if consider(3) match("daily") then ids(96f7e46c-40c3-4f5b-8f0= 0-81a6e3cb122b) todo!(DONE) endif :END: *** TODO Feed Dog :dai= ly: :PROPERTIES: -:TRIGGER: if consider(any) match("daily") then ids(96f7e46c-40c3-4f5b-8= f00-81a6e3cb122b) todo!(DONE) endif +:TRIGGER: if consider(0.9) match("daily") then ids(96f7e46c-40c3-4f5b-8= f00-81a6e3cb122b) todo!(DONE) endif :END: ** Weeklies - Inverted Conditional :PROPERTIES: @@ -277,3 +277,38 @@ DEADLINE: <2000-01-15 Sat +1d> :BLOCKER: previous-sibling !has-property?("COUNT" "3") :TRIGGER: previous-sibling set-property!("COUNT" "0") :END: +** Snow Shoveling +:PROPERTIES: +:ID: b1d89bd8-db96-486e-874c-98e2b3a8cbf2 +:END: +*** TODO Shovel on Monday +*** TODO Shovel on Tuesday +*** TODO Shovel on Wednesday +*** TODO Put shovel away +:PROPERTIES: +:BLOCKER: consider(all) rest-of-siblings-wrap +:END: +** Work I - Consider Fraction +:PROPERTIES: +:ID: 7de5af8b-a226-463f-8360-edd88b99462a +:END: +*** TODO Shovel Snow +*** TODO Clean room +*** TODO Vacuum +*** TODO Eat lunch +*** TODO Work on Edna +:PROPERTIES: +:BLOCKER: consider(0.5) rest-of-siblings-wrap +:END: +** Work II - Consider Number +:PROPERTIES: +:ID: b79279f7-be3c-45ac-96dc-6e962a5873d4 +:END: +*** TODO Shovel Snow +*** TODO Clean room +*** TODO Vacuum +*** TODO Eat lunch +*** TODO Work on Edna +:PROPERTIES: +:BLOCKER: consider(2) rest-of-siblings-wrap +:END: diff --git a/org-edna.el b/org-edna.el index 36f3afa..929d8ff 100644 --- a/org-edna.el +++ b/org-edna.el @@ -2023,49 +2023,65 @@ starting from target's position." (defun org-edna-handle-consideration (consideration blocks) "Handle consideration CONSIDERATION. =20 -Edna Syntax: consider(all) [1] +Edna Syntax: consider(any) [1] Edna Syntax: consider(N) [2] Edna Syntax: consider(P) [3] -Edna Syntax: consider(any) [4] +Edna Syntax: consider(all) [4] =20 -Form 1: consider all targets when evaluating conditions. -Form 2: consider the condition met if only N of the targets pass. -Form 3: consider the condition met if only P% of the targets pass. -Form 4: consider the condition met if any target meets it +A blocker can be read as: +\"If ANY heading in TARGETS matches CONDITION, block this heading\" =20 -If CONSIDERATION is nil, default to 'all. +The consideration is \"ANY\". + +Form 1 blocks only if any target matches the condition. This is +the default. + +Form 2 blocks only if at least N targets meet the condition. N=3D1 +is the same as 'any'. + +Form 3 blocks only if *at least* fraction P of the targets meet +the condition. This should be a decimal value between 0 and 1. + +Form 4 blocks only if all targets match the condition. + +The default consideration is \"any\". + +If CONSIDERATION is nil, default to 'any. =20 The \"consideration\" keyword is also provided. It functions the same as \"consider\"." - ;; BLOCKS is a list of blocking entries; if one isn't blocked, its ent= ry will - ;; be nil. - (let ((consideration (or consideration 'all)) - (first-block (seq-find #'identity blocks)) - (total-blocks (seq-length blocks)) - (fulfilled (seq-count #'not blocks))) + ;; BLOCKS is a list of entries that meets the blocking condition; if o= ne isn't + ;; blocked, its entry will be nil. + (let* ((consideration (or consideration 'any)) + (first-block (seq-find #'identity blocks)) + (total-blocks (seq-length blocks)) + (fulfilled (seq-count #'not blocks)) + (blocked (- total-blocks fulfilled))) (pcase consideration - ('all - ;; All of them must be fulfilled, so find the first one that isn'= t. - first-block) ('any - ;; Any of them can be fulfilled, so find the first one that is + ;; In order to pass, all of them must be fulfilled, so find the f= irst one + ;; that isn't. + first-block) + ('all + ;; All of them must be set to block, so if one of them doesn't bl= ock, the + ;; entire entry won't block. (if (> fulfilled 0) ;; Have one fulfilled nil ;; None of them are fulfilled first-block)) ((pred integerp) - ;; A fixed number of them must be fulfilled, so check how many ar= en't. - (let* ((fulfilled (seq-count #'not blocks))) - (if (>=3D fulfilled consideration) - nil - first-block))) + ;; A minimum number of them must meet the blocking condition, so = check + ;; how many block. + (if (>=3D blocked consideration) + first-block + nil)) ((pred floatp) - ;; A certain percentage of them must be fulfilled - (let* ((fulfilled (seq-count #'not blocks))) - (if (>=3D (/ (float fulfilled) (float total-blocks)) considerat= ion) - nil - first-block)))))) + ;; A certain percentage of them must block for the blocker to blo= ck. + (let* ((float-blocked (/ (float blocked) (float total-blocks)))) + (if (>=3D float-blocked consideration) + first-block + nil)))))) =20 =0C ;;; Popout editing diff --git a/org-edna.info b/org-edna.info index de1c087..691f110 100644 --- a/org-edna.info +++ b/org-edna.info @@ -113,6 +113,7 @@ Contributing =20 Changelog =20 +* 1.0: 10. * 1.0beta8: 10beta8. * 1.0beta7: 10beta7. * 1.0beta6: 10beta6. @@ -668,6 +669,8 @@ and for similarity to org-depend. =E2=80=A2 scheduled-down: Scheduled time, closest first =E2=80=A2 deadline-up: Deadline time, farthest first =E2=80=A2 deadline-down: Deadline time, closest first + =E2=80=A2 timestamp-up: Timestamp time, farthest first + =E2=80=A2 timestamp-down: Timestamp time, closest first =20 Many of the other finders are shorthand for argument combinations of relative: @@ -1301,43 +1304,71 @@ Consideration =E2=80=9CConsideration=E2=80=9D and =E2=80=9Cconsider=E2=80=9D are speci= al keywords that are only valid for blockers. =20 - This says =E2=80=9CAllow a task to complete if CONSIDERATION of its t= argets -pass the given condition=E2=80=9D. + A blocker says =E2=80=9CIf ANY heading in TARGETS meets CONDITION, bl= ock this +task=E2=80=9D. =20 - This keyword can allow specifying only a portion of tasks to -consider: + In order to modify the ANY part of that statement, the =E2=80=98consi= der=E2=80=99 +keyword may be used: =20 - 1. consider(PERCENT) - 2. consider(NUMBER) - 3. consider(all) (Default) - 4. consider(any) + 1. consider(any) + 2. consider(all) + 3. consider(FRACTION) + 4. consider(NUMBER) =20 - (1) tells the blocker to only consider some portion of the targets. -If at least PERCENT of them are in a DONE state, allow the task to be -set to DONE. PERCENT must be a decimal, and doesn=E2=80=99t need to incl= ude a -%-sign. + (1) blocks the current task if any target meets the blocking +condition. This is the default case. =20 - (2) tells the blocker to only consider NUMBER of the targets. + (2) blocks the current task only if all targets meet the blocking +condition. =20 - (3) tells the blocker to consider all following targets. + * Shovel Snow + ** TODO Shovel on Monday + ** TODO Shovel on Tuesday + ** TODO Shovel on Wednesday + ** TODO Put shovel away + :PROPERTIES: + :BLOCKER: consider(all) rest-of-siblings-wrap + :END: =20 - (4) tells the blocker to allow passage if any of the targets pass. + The above example blocks =E2=80=9CPut shovel away=E2=80=9D so long as= all of the +siblings are still marked TODO. =20 - A consideration must be specified before the conditions to which it -applies: + (3) blocks the current task if at least FRACTION of the targets meet +the blocking condition. =20 - consider(0.5) siblings match("find_me") consider(all) !done? + * Work + ** TODO Shovel Snow + ** TODO Clean room + ** TODO Vacuum + ** TODO Eat lunch + ** TODO Work on Edna + :PROPERTIES: + :BLOCKER: consider(0.5) rest-of-siblings-wrap + :END: =20 - The above code will allow task completion if at least half the -siblings are complete, and all tasks tagged =E2=80=9Cfind_me=E2=80=9D ar= e complete. + The above example blocks =E2=80=9CWork on Edna=E2=80=9D so long as at= least half of +the siblings are marked TODO. This means that three of them must be +completed before development can begin on Edna. =20 - consider(1) ids(ID1 ID2 ID3) consider(2) ids(ID3 ID4 ID5 ID6) + (4) blocks the current task if at least NUMBER of the targets meet +the blocking condition. =20 - The above code will allow task completion if at least one of ID1, -ID2, and ID3 are complete, and at least two of ID3, ID4, ID5, and ID6 -are complete. + * Work + ** TODO Shovel Snow + ** TODO Clean room + ** TODO Vacuum + ** TODO Eat lunch + ** TODO Work on Edna + :PROPERTIES: + :BLOCKER: consider(2) rest-of-siblings-wrap + :END: =20 - If no consideration is given, ALL is assumed. + The above example blocks =E2=80=9CWork on Edna=E2=80=9D so long as tw= o of the +siblings are marked TODO. This means that NUMBER=3D1 is the same as +specifying =E2=80=98any=E2=80=99. + + A consideration must be specified before the conditions to which it +applies. =20 Both =E2=80=9Cconsider=E2=80=9D and =E2=80=9Cconsideration=E2=80=9D a= re valid keywords; they both mean the same thing. @@ -1391,18 +1422,18 @@ it won=E2=80=99t trigger the original until the l= ast one is marked DONE. Occasionally, you may find that you=E2=80=99d rather execute a form i= f the condition *would* block. There are two options. =20 - The first is confusing: use =E2=80=98consider(any)=E2=80=99. This wi= ll tell Edna to -pass so long as one of the targets meets the condition. This is the -opposite of Edna=E2=80=99s standard operation, which only allows passage= if all -targets meet the condition. + The first is to use =E2=80=98consider(all)=E2=80=99. This will tell = Edna to block +only if all of the targets meets the condition, and thus not block if at +least one of them does not meet the condition. This is the opposite of +Edna=E2=80=99s standard operation, which only allows passage if all targ= ets meet +the condition. =20 * TODO Prepare Tomorrow's Lunch = :nightly: :PROPERTIES: - :TRIGGER: if consider(any) match("nightly") then ids(12345) todo= !(DONE) endif + :TRIGGER: if consider(all) match("nightly") then ids(12345) todo= !(DONE) endif :END: =20 - The second is a lot easier to understand: just switch the then and -else clauses: + The second is to switch the then and else clauses: =20 * TODO Prepare Tomorrow's Lunch = :nightly: :PROPERTIES: @@ -1729,6 +1760,7 @@ Changelog =20 * Menu: =20 +* 1.0: 10. * 1.0beta8: 10beta8. * 1.0beta7: 10beta7. * 1.0beta6: 10beta6. @@ -1738,7 +1770,21 @@ Changelog * 1.0beta2: 10beta2. =20 =1F -File: org-edna.info, Node: 10beta8, Next: 10beta7, Up: Changelog +File: org-edna.info, Node: 10, Next: 10beta8, Up: Changelog + +1.0 +=3D=3D=3D + + =E2=80=A2 Various bugs fixes + =E2=80=A2 Fixed parsing of consideration + =E2=80=A2 Limited cache to just the finders that don=E2=80=99t d= epend on current + position + =E2=80=A2 Added =E2=80=9Cbuffer=E2=80=9D option for match finder + =E2=80=A2 Added timestamp sorting to relatives finder + =E2=80=A2 Inverted meaning of consideration to avoid confusion + +=1F +File: org-edna.info, Node: 10beta8, Next: 10beta7, Prev: 10, Up: Cha= ngelog =20 1.0beta8 =3D=3D=3D=3D=3D=3D=3D=3D @@ -1852,80 +1898,81 @@ Big release here, with three new features. =1F Tag Table: Node: Top=7F225 -Node: Copying=7F4206 -Node: Introduction=7F5028 -Node: Installation and Setup=7F5976 -Node: Basic Operation=7F6700 -Node: Blockers=7F8551 -Node: Triggers=7F8837 -Node: Syntax=7F9099 -Node: Basic Features=7F9789 -Node: Finders=7F10143 -Node: ancestors=7F11908 -Node: children=7F12502 -Node: descendants=7F12912 -Node: file=7F13434 -Node: first-child=7F14183 -Node: ids=7F14443 -Node: match=7F15104 -Node: next-sibling=7F15742 -Node: next-sibling-wrap=7F15999 -Node: olp=7F16313 -Node: org-file=7F16725 -Node: parent=7F17370 -Node: previous-sibling=7F17568 -Node: previous-sibling-wrap=7F17829 -Node: relatives=7F18108 -Node: rest-of-siblings=7F21729 -Node: rest-of-siblings-wrap=7F22014 -Node: self=7F22363 -Node: siblings=7F22524 -Node: siblings-wrap=7F22761 -Node: Actions=7F23065 -Node: Scheduled/Deadline=7F23828 -Node: TODO State=7F27343 -Node: Archive=7F28068 -Node: Chain Property=7F28388 -Node: Clocking=7F29141 -Node: Property=7F29553 -Node: Priority=7F31726 -Node: Tag=7F32295 -Node: Effort=7F32512 -Node: Getting Help=7F32896 -Node: Advanced Features=7F33341 -Node: Finder Cache=7F33789 -Node: Conditions=7F34828 -Node: Heading is DONE=7F35505 -Node: File Has Headings=7F35711 -Node: Heading TODO State=7F36133 -Node: Lisp Variable Set=7F36427 -Node: Heading Has Property=7F37095 -Node: Regexp Search=7F37841 -Node: Negating Conditions=7F38221 -Node: Consideration=7F38612 -Node: Conditional Forms=7F40200 -Node: Setting the Properties=7F42856 -Node: Extending Edna=7F43940 -Node: Naming Conventions=7F44430 -Node: Finders 1=7F45222 -Node: Actions 1=7F45584 -Node: Conditions 1=7F46043 -Node: Contributing=7F46929 -Node: Bugs=7F47795 -Node: Working with EDE=7F48152 -Node: Compiling Edna=7F49236 -Node: Testing Edna=7F50105 -Node: Before Sending Changes=7F51086 -Node: Developing with Bazaar=7F51773 -Node: Documentation=7F52514 -Node: Changelog=7F52970 -Node: 10beta8=7F53220 -Node: 10beta7=7F53332 -Node: 10beta6=7F53626 -Node: 10beta5=7F53902 -Node: 10beta4=7F54289 -Node: 10beta3=7F54542 -Node: 10beta2=7F54981 +Node: Copying=7F4217 +Node: Introduction=7F5039 +Node: Installation and Setup=7F5987 +Node: Basic Operation=7F6711 +Node: Blockers=7F8562 +Node: Triggers=7F8848 +Node: Syntax=7F9110 +Node: Basic Features=7F9800 +Node: Finders=7F10154 +Node: ancestors=7F11919 +Node: children=7F12513 +Node: descendants=7F12923 +Node: file=7F13445 +Node: first-child=7F14194 +Node: ids=7F14454 +Node: match=7F15115 +Node: next-sibling=7F15753 +Node: next-sibling-wrap=7F16010 +Node: olp=7F16324 +Node: org-file=7F16736 +Node: parent=7F17381 +Node: previous-sibling=7F17579 +Node: previous-sibling-wrap=7F17840 +Node: relatives=7F18119 +Node: rest-of-siblings=7F21845 +Node: rest-of-siblings-wrap=7F22130 +Node: self=7F22479 +Node: siblings=7F22640 +Node: siblings-wrap=7F22877 +Node: Actions=7F23181 +Node: Scheduled/Deadline=7F23944 +Node: TODO State=7F27459 +Node: Archive=7F28184 +Node: Chain Property=7F28504 +Node: Clocking=7F29257 +Node: Property=7F29669 +Node: Priority=7F31842 +Node: Tag=7F32411 +Node: Effort=7F32628 +Node: Getting Help=7F33012 +Node: Advanced Features=7F33457 +Node: Finder Cache=7F33905 +Node: Conditions=7F34944 +Node: Heading is DONE=7F35621 +Node: File Has Headings=7F35827 +Node: Heading TODO State=7F36249 +Node: Lisp Variable Set=7F36543 +Node: Heading Has Property=7F37211 +Node: Regexp Search=7F37957 +Node: Negating Conditions=7F38337 +Node: Consideration=7F38728 +Node: Conditional Forms=7F40912 +Node: Setting the Properties=7F43600 +Node: Extending Edna=7F44684 +Node: Naming Conventions=7F45174 +Node: Finders 1=7F45966 +Node: Actions 1=7F46328 +Node: Conditions 1=7F46787 +Node: Contributing=7F47673 +Node: Bugs=7F48539 +Node: Working with EDE=7F48896 +Node: Compiling Edna=7F49980 +Node: Testing Edna=7F50849 +Node: Before Sending Changes=7F51830 +Node: Developing with Bazaar=7F52517 +Node: Documentation=7F53258 +Node: Changelog=7F53714 +Node: 10=7F53975 +Node: 10beta8=7F54377 +Node: 10beta7=7F54500 +Node: 10beta6=7F54794 +Node: 10beta5=7F55070 +Node: 10beta4=7F55457 +Node: 10beta3=7F55710 +Node: 10beta2=7F56149 =1F End Tag Table =20 diff --git a/org-edna.org b/org-edna.org index 38fe539..2188f53 100644 --- a/org-edna.org +++ b/org-edna.org @@ -1093,43 +1093,73 @@ tagged "test" does *not* have the property PROP s= et to "1". "Consideration" and "consider" are special keywords that are only valid = for blockers. =20 -This says "Allow a task to complete if CONSIDERATION of its targets pass= the -given condition". +A blocker says "If ANY heading in TARGETS meets CONDITION, block this ta= sk". =20 -This keyword can allow specifying only a portion of tasks to consider: +In order to modify the ANY part of that statement, the ~consider~ keywor= d may be +used: =20 -1. consider(PERCENT) -2. consider(NUMBER) -3. consider(all) (Default) -4. consider(any) +1. consider(any) +2. consider(all) +3. consider(FRACTION) +4. consider(NUMBER) =20 -(1) tells the blocker to only consider some portion of the targets. If = at least -PERCENT of them are in a DONE state, allow the task to be set to DONE. = PERCENT -must be a decimal, and doesn't need to include a %-sign. +(1) blocks the current task if any target meets the blocking condition. = This is +the default case. =20 -(2) tells the blocker to only consider NUMBER of the targets. +(2) blocks the current task only if all targets meet the blocking condit= ion. =20 -(3) tells the blocker to consider all following targets. +#+begin_src org +,* Shovel Snow +,** TODO Shovel on Monday +,** TODO Shovel on Tuesday +,** TODO Shovel on Wednesday +,** TODO Put shovel away + :PROPERTIES: + :BLOCKER: consider(all) rest-of-siblings-wrap + :END: +#+end_src =20 -(4) tells the blocker to allow passage if any of the targets pass. +The above example blocks "Put shovel away" so long as all of the sibling= s are +still marked TODO. =20 -A consideration must be specified before the conditions to which it appl= ies: +(3) blocks the current task if at least FRACTION of the targets meet the +blocking condition. =20 -#+BEGIN_EXAMPLE -consider(0.5) siblings match("find_me") consider(all) !done? -#+END_EXAMPLE +#+begin_src org +,* Work +,** TODO Shovel Snow +,** TODO Clean room +,** TODO Vacuum +,** TODO Eat lunch +,** TODO Work on Edna + :PROPERTIES: + :BLOCKER: consider(0.5) rest-of-siblings-wrap + :END: +#+end_src =20 -The above code will allow task completion if at least half the siblings = are -complete, and all tasks tagged "find_me" are complete. +The above example blocks "Work on Edna" so long as at least half of the = siblings +are marked TODO. This means that three of them must be completed before +development can begin on Edna. =20 -#+BEGIN_SRC emacs-lisp -consider(1) ids(ID1 ID2 ID3) consider(2) ids(ID3 ID4 ID5 ID6) -#+END_SRC +(4) blocks the current task if at least NUMBER of the targets meet the b= locking +condition. + +#+begin_src org +,* Work +,** TODO Shovel Snow +,** TODO Clean room +,** TODO Vacuum +,** TODO Eat lunch +,** TODO Work on Edna + :PROPERTIES: + :BLOCKER: consider(2) rest-of-siblings-wrap + :END: +#+end_src =20 -The above code will allow task completion if at least one of ID1, ID2, a= nd ID3 -are complete, and at least two of ID3, ID4, ID5, and ID6 are complete. +The above example blocks "Work on Edna" so long as two of the siblings a= re +marked TODO. This means that NUMBER=3D1 is the same as specifying ~any~= . =20 -If no consideration is given, ALL is assumed. +A consideration must be specified before the conditions to which it appl= ies. =20 Both "consider" and "consideration" are valid keywords; they both mean t= he same thing. @@ -1188,18 +1218,19 @@ trigger the original until the last one is marked= DONE. Occasionally, you may find that you'd rather execute a form if the condi= tion *would* block. There are two options. =20 -The first is confusing: use ~consider(any)~. This will tell Edna to pas= s so -long as one of the targets meets the condition. This is the opposite of= Edna's -standard operation, which only allows passage if all targets meet the co= ndition. +The first is to use ~consider(all)~. This will tell Edna to block only = if all +of the targets meets the condition, and thus not block if at least one o= f them +does not meet the condition. This is the opposite of Edna's standard op= eration, +which only allows passage if all targets meet the condition. =20 #+begin_src org ,* TODO Prepare Tomorrow's Lunch :ni= ghtly: :PROPERTIES: - :TRIGGER: if consider(any) match("nightly") then ids(12345) todo!(DON= E) endif + :TRIGGER: if consider(all) match("nightly") then ids(12345) todo!(DON= E) endif :END: #+end_src =20 -The second is a lot easier to understand: just switch the then and else = clauses: +The second is to switch the then and else clauses: =20 #+begin_src org ,* TODO Prepare Tomorrow's Lunch :ni= ghtly: @@ -1512,6 +1543,7 @@ making any changes: - Limited cache to just the finders that don't depend on current posit= ion - Added "buffer" option for match finder - Added timestamp sorting to relatives finder +- Inverted meaning of consideration to avoid confusion =20 ** 1.0beta8 Quick fix for beta7. diff --git a/test.mk b/test.mk index 29e31e5..4b6590c 100644 --- a/test.mk +++ b/test.mk @@ -23,6 +23,7 @@ test: compile -L "." \ -l "ert" \ -l "org-edna-tests.el" \ + --eval "(setq org-edna-test-inhibit-messages t)" \ -f ert-run-tests-batch-and-exit =20 include Makefile From MAILER-DAEMON Sun Nov 25 14:10:10 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQznG-0007Wt-4p for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:10:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzn3-0007RS-1e for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:10:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmu-0002hy-3S for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:57 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmt-0002hr-TV for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:48 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id D479A209C2; Sun, 25 Nov 2018 14:09:47 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 45310da 05/13: Various fixes from testing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 45310dae4df4af76b8315643846bf026f7a1d53e Auto-Submitted: auto-generated Message-Id: <20181125190947.D479A209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:47 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:10:05 -0000 branch: master commit 45310dae4df4af76b8315643846bf026f7a1d53e Author: Ian Dunn Commit: Ian Dunn Various fixes from testing =20 * org-edna.el (org-edna--function-for-key): Return nil on invalid inp= ut (org-edna--expand-single-sexp-form): Quote arguments to considerati= on. (org-edna-finder/match): Introduced 'buffer SCOPE to match the nil = argument in org-map-entries. =20 * org-edna-tests.el: Protect all access to the test file in unwind-pr= otect. Use `org-edna-find-test-heading' in all tests instead of org-id-fin= d. (org-edna-test-restore-test-file): New function to revert test file= . (org-edna-test-compare-todos): (org-edna-test-change-todo-state): (org-edna-test-check-block): (org-edna-test-mark-done): (org-edna-test-mark-todo): New helper functions. (org-edna-doc-test/ancestors): (org-edna-doc-test/descendants): (org-edna-doc-test/laundry): (org-edna-doc-test/nightly): (org-edna-doc-test/daily): (org-edna-doc-test/weekly): (org-edna-doc-test/basic-shower): New full tests from the documenta= tion. =20 * org-edna.org (Scheduled/Deadline): Fixed up examples to render on i= nfo. (TODO State): Added example. (Chain Property): Added example. (Property): Fixed examples. (Conditions): Changed heading names. --- org-edna-tests.el | 963 +++++++++++++++++++++++++++++++++++------------= ------ org-edna-tests.org | 131 ++++++++ org-edna.el | 19 +- org-edna.info | 192 +++++++---- org-edna.org | 107 ++++-- 5 files changed, 1006 insertions(+), 406 deletions(-) diff --git a/org-edna-tests.el b/org-edna-tests.el index da766a9..da8e437 100644 --- a/org-edna-tests.el +++ b/org-edna-tests.el @@ -64,10 +64,42 @@ (defconst org-edna-test-relative-archived-child "a4b6131e-0560-4201-86d5= -f32b36363431") (defconst org-edna-test-relative-child-with-done "4a1d74a2-b032-47da-a82= 3-b32f5cab0aae") =20 +(defun org-edna-test-restore-test-file () + "Restore the test file back to its original state." + (with-current-buffer (get-file-buffer org-edna-test-file) + (revert-buffer nil t))) + (defun org-edna-find-test-heading (id) - "Find the test heading with id ID." + "Find the test heading with id ID. + +This avoids org-id digging into its internal database." (org-id-find-id-in-file id org-edna-test-file t)) =20 +;; _test exists to give more detailed reports in ERT output. +(defun org-edna-test-compare-todos (pom expected-state _test) + (string-equal (org-entry-get pom "TODO") expected-state)) + +(defun org-edna-test-change-todo-state (pom new-state) + (org-with-point-at pom (org-todo new-state))) + +(defun org-edna-test-check-block (pom _test) + "Check if the heading at point-or-marker POM is blocked." + (org-edna-test-change-todo-state pom "DONE") + (org-edna-test-compare-todos pom "TODO" _test)) + +(defun org-edna-test-mark-done (&rest poms) + "Mark all points-or-markers in POMS as DONE." + (dolist (pom poms) + (org-edna-test-change-todo-state pom "DONE"))) + +(defun org-edna-test-mark-todo (&rest poms) + "Mark all points-or-markers in POMS as TODO." + (dolist (pom poms) + (org-edna-test-change-todo-state pom "TODO"))) + +=0C +;;;; Parser Tests + (ert-deftest org-edna-parse-form-no-arguments () (let* ((input-string "test-string") (parsed (org-edna-parse-string-form input-string))) @@ -471,7 +503,7 @@ =20 (ert-deftest org-edna-finder/match-blocker () (let* ((org-agenda-files `(,org-edna-test-file)) - (heading (org-id-find "caccd0a6-d400-410a-9018-b0635b07a37e" t)= ) + (heading (org-edna-find-test-heading "caccd0a6-d400-410a-9018-b= 0635b07a37e")) (blocker (org-entry-get heading "BLOCKER")) blocking-entry) (should (string-equal "match(\"test&1\")" blocker)) @@ -499,16 +531,16 @@ =20 (ert-deftest org-edna-finder/self () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find "82a4ac3d-9565-4f94-bc84-2bbfd8d7d96c" t)= ) + (current (org-edna-find-test-heading "82a4ac3d-9565-4f94-bc84-2= bbfd8d7d96c")) (targets (org-with-point-at current (org-edna-finder/self)))) (should (=3D (length targets) 1)) (should (equal current (nth 0 targets))))) =20 (ert-deftest org-edna-finder/siblings () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-one-id t)) + (current (org-edna-find-test-heading org-edna-test-sibling-one-= id)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-one-id ,org-edna-test-sibling-two-id ,org-edna-test-sibling-three-id))) @@ -518,9 +550,9 @@ =20 (ert-deftest org-edna-finder/siblings-wrap () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find "72534efa-e932-460b-ae2d-f044a0074815" t)= ) + (current (org-edna-find-test-heading "72534efa-e932-460b-ae2d-f= 044a0074815")) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) '("06aca55e-ce09-46df-80d7-5b52e55d6505" "82a4ac3d-9565-4f94-bc84-2bbfd8d7d96c"))) (targets (org-with-point-at current @@ -530,9 +562,9 @@ =20 (ert-deftest org-edna-finder/rest-of-siblings () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find "72534efa-e932-460b-ae2d-f044a0074815" t)= ) + (current (org-edna-find-test-heading "72534efa-e932-460b-ae2d-f= 044a0074815")) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) '("06aca55e-ce09-46df-80d7-5b52e55d6505"))) (targets (org-with-point-at current (org-edna-finder/rest-of-siblings)))) @@ -541,9 +573,9 @@ =20 (ert-deftest org-edna-finder/next-sibling () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find "72534efa-e932-460b-ae2d-f044a0074815" t)= ) + (current (org-edna-find-test-heading "72534efa-e932-460b-ae2d-f= 044a0074815")) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) '("06aca55e-ce09-46df-80d7-5b52e55d6505"))) (targets (org-with-point-at current (org-edna-finder/next-sibling)))) @@ -552,9 +584,9 @@ =20 (ert-deftest org-edna-finder/next-sibling-wrap-next () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-two-id t)) + (current (org-edna-find-test-heading org-edna-test-sibling-two-= id)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-three-id))) (targets (org-with-point-at current (org-edna-finder/next-sibling-wrap)))) @@ -563,9 +595,9 @@ =20 (ert-deftest org-edna-finder/next-sibling-wrap-wrap () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-three-id t)) + (current (org-edna-find-test-heading org-edna-test-sibling-thre= e-id)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-one-id))) (targets (org-with-point-at current (org-edna-finder/next-sibling-wrap)))) @@ -574,9 +606,9 @@ =20 (ert-deftest org-edna-finder/previous-sibling () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find "06aca55e-ce09-46df-80d7-5b52e55d6505" t)= ) + (current (org-edna-find-test-heading "06aca55e-ce09-46df-80d7-5= b52e55d6505")) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) '("72534efa-e932-460b-ae2d-f044a0074815"))) (targets (org-with-point-at current (org-edna-finder/previous-sibling)))) @@ -585,8 +617,8 @@ =20 (ert-deftest org-edna-finder/first-child () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-parent-id t)) - (first-child (list (org-id-find org-edna-test-sibling-one-id t)= )) + (current (org-edna-find-test-heading org-edna-test-parent-id)) + (first-child (list (org-edna-find-test-heading org-edna-test-si= bling-one-id))) (targets (org-with-point-at current (org-edna-finder/first-child)))) (should (=3D (length targets) 1)) @@ -594,9 +626,9 @@ =20 (ert-deftest org-edna-finder/children () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-parent-id t)) + (current (org-edna-find-test-heading org-edna-test-parent-id)) (children (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-one-id ,org-edna-test-sibling-two-id ,org-edna-test-sibling-three-id))) @@ -607,8 +639,8 @@ =20 (ert-deftest org-edna-finder/parent () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-one-id t)) - (parent (list (org-id-find org-edna-test-parent-id t))) + (current (org-edna-find-test-heading org-edna-test-sibling-one-= id)) + (parent (list (org-edna-find-test-heading org-edna-test-parent-= id))) (targets (org-with-point-at current (org-edna-finder/parent)))) (should (=3D (length targets) 1)) @@ -616,9 +648,9 @@ =20 (ert-deftest org-edna-relatives/from-top () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-one-id t)) + (current (org-edna-find-test-heading org-edna-test-sibling-one-= id)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-one-id))) (targets (org-with-point-at current (org-edna-finder/relatives 'from-top 1)))) @@ -626,9 +658,9 @@ =20 (ert-deftest org-edna-relatives/from-bottom () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-one-id t)) + (current (org-edna-find-test-heading org-edna-test-sibling-one-= id)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-three-id))) (targets (org-with-point-at current (org-edna-finder/relatives 'from-bottom 1)))) @@ -639,9 +671,9 @@ (target-list `(,org-edna-test-sibling-two-id)) (arg 'forward-wrap) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -652,9 +684,9 @@ (target-list `(,org-edna-test-sibling-one-id)) (arg 'forward-wrap) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -665,9 +697,9 @@ (target-list `(,org-edna-test-sibling-two-id)) (arg 'forward-no-wrap) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -678,9 +710,9 @@ (target-list nil) (arg 'forward-no-wrap) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg)))) @@ -692,9 +724,9 @@ (arg 'backward-wrap) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -706,9 +738,9 @@ (arg 'backward-wrap) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -720,9 +752,9 @@ (arg 'backward-no-wrap) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -734,9 +766,9 @@ (arg 'backward-no-wrap) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -748,9 +780,9 @@ (arg 'walk-up) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -761,9 +793,9 @@ (target-list `(,org-edna-test-sibling-one-id)) (arg 'walk-up-with-self) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -774,9 +806,9 @@ (target-list `(,org-edna-test-sibling-one-id)) (arg 'walk-down) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -787,9 +819,9 @@ (target-list `(,org-edna-test-parent-id)) (arg 'walk-down-with-self) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -800,9 +832,9 @@ (target-list `(,org-edna-test-sibling-one-id)) (arg 'walk-down) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -821,9 +853,9 @@ (arg 'walk-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -840,9 +872,9 @@ (arg 'step-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -853,9 +885,9 @@ (target-list `(,org-edna-test-relative-child-with-todo)) (arg 'step-down) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 'todo-only)))) @@ -867,9 +899,9 @@ ,org-edna-test-relative-child-with-done)) (arg 'step-down) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 'todo-and-done-only))= )) @@ -886,9 +918,9 @@ (filter 'no-comment) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg filter size)))) @@ -905,9 +937,9 @@ (filter 'no-archive) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg filter size)))) @@ -920,9 +952,9 @@ (filter "+ARCHIVE") (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg filter size)))) @@ -939,9 +971,9 @@ (filter "-ARCHIVE") (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg filter size)))) @@ -956,9 +988,9 @@ (filter "Child Heading With .*") (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg filter size)))) @@ -976,9 +1008,9 @@ (sort 'reverse-sort) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg sort size)))) @@ -995,9 +1027,9 @@ (arg 'step-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets )) (should (equal siblings @@ -1018,9 +1050,9 @@ (arg 'step-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list))) (should (equal siblings (org-with-point-at current @@ -1040,9 +1072,9 @@ (arg 'step-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list))) (should (equal siblings (org-with-point-at current @@ -1062,9 +1094,9 @@ (arg 'step-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list))) (should (equal siblings (org-with-point-at current @@ -1133,287 +1165,315 @@ =20 (ert-deftest org-edna-action/todo-test () (let* ((org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "0d491588-7da3-43c5-b51a-87fbd34f79f7" t))= ) - (org-with-point-at target - (org-edna-action/todo! nil "DONE") - (should (string-equal (org-entry-get nil "TODO") "DONE")) - (org-edna-action/todo! nil "TODO") - (should (string-equal (org-entry-get nil "TODO") "TODO")) - (org-edna-action/todo! nil 'DONE) - (should (string-equal (org-entry-get nil "TODO") "DONE")) - (org-edna-action/todo! nil 'TODO) - (should (string-equal (org-entry-get nil "TODO") "TODO"))))) + (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51a-87= fbd34f79f7"))) + (unwind-protect + (org-with-point-at target + (org-edna-action/todo! nil "DONE") + (should (string-equal (org-entry-get nil "TODO") "DONE")) + (org-edna-action/todo! nil "TODO") + (should (string-equal (org-entry-get nil "TODO") "TODO")) + (org-edna-action/todo! nil 'DONE) + (should (string-equal (org-entry-get nil "TODO") "DONE")) + (org-edna-action/todo! nil 'TODO) + (should (string-equal (org-entry-get nil "TODO") "TODO"))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-scheduled/wkdy () ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "0d491588-7da3-43c5-b51a-87fbd34f79f7"= t))) - (org-with-point-at target - (org-edna-action/scheduled! nil "Mon") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-17 Mon>")) - (org-edna-action/scheduled! nil 'rm) - (should (not (org-entry-get nil "SCHEDULED"))) - (org-edna-action/scheduled! nil "Mon 9:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-17 Mon 09:00>")) - (org-edna-action/scheduled! nil 'rm) - (should (not (org-entry-get nil "SCHEDULED")))))) + (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51= a-87fbd34f79f7"))) + (unwind-protect + (org-with-point-at target + (org-edna-action/scheduled! nil "Mon") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-17 Mon>")) + (org-edna-action/scheduled! nil 'rm) + (should (not (org-entry-get nil "SCHEDULED"))) + (org-edna-action/scheduled! nil "Mon 9:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-17 Mon 09:00>")) + (org-edna-action/scheduled! nil 'rm) + (should (not (org-entry-get nil "SCHEDULED")))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-scheduled/cp () (let* ((org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "0d491588-7da3-43c5-b51a-87fbd34f79f7" t)) - (source (org-id-find "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" t)) + (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51a-87= fbd34f79f7")) + (source (org-edna-find-test-heading "97e6b0f0-40c4-464f-b760-6e= 5ca9744eb5")) (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "rem= ove")))) - (org-with-point-at target - (dolist (pair pairs) - (org-edna-action/scheduled! source (car pair)) - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - (org-edna-action/scheduled! source (cdr pair)) - (should (not (org-entry-get nil "SCHEDULED"))))))) + (unwind-protect + (org-with-point-at target + (dolist (pair pairs) + (org-edna-action/scheduled! source (car pair)) + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + (org-edna-action/scheduled! source (cdr pair)) + (should (not (org-entry-get nil "SCHEDULED"))))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-scheduled/inc () ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "97e6b0f0-40c4-464f-b760-6e5ca9744eb5"= t))) - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; Increment 1 minute - (org-edna-action/scheduled! nil "+1M") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:01>")) - ;; Decrement 1 minute - (org-edna-action/scheduled! nil "-1M") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; +1 day - (org-edna-action/scheduled! nil "+1d") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-16 Sun 00:00>")) - ;; +1 hour from current time - (org-edna-action/scheduled! nil "++1h") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 01:00>")) - ;; Back to Saturday - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; -1 day to Friday - (org-edna-action/scheduled! nil "-1d") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-14 Fri 00:00>")) - ;; Increment two days to the next weekday - (org-edna-action/scheduled! nil "+2wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-17 Mon 00:00>")) - ;; Increment one day, expected to land on a weekday - (org-edna-action/scheduled! nil "+1wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-18 Tue 00:00>")) - ;; Move forward 8 days, then backward until we find a weekend - (org-edna-action/scheduled! nil "+8d -wknd") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-23 Sun 00:00>")) - ;; Move forward one week, then forward until we find a weekday - ;; (org-edna-action/scheduled! nil "+1w +wkdy") - ;; (should (string-equal (org-entry-get nil "SCHEDULED") - ;; "<2000-01-31 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>"))))) + (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) + (unwind-protect + (org-with-point-at target + ;; Time starts at Jan 15, 2000 + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; Increment 1 minute + (org-edna-action/scheduled! nil "+1M") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:01>")) + ;; Decrement 1 minute + (org-edna-action/scheduled! nil "-1M") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; +1 day + (org-edna-action/scheduled! nil "+1d") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-16 Sun 00:00>")) + ;; +1 hour from current time + (org-edna-action/scheduled! nil "++1h") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 01:00>")) + ;; Back to Saturday + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; -1 day to Friday + (org-edna-action/scheduled! nil "-1d") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-14 Fri 00:00>")) + ;; Increment two days to the next weekday + (org-edna-action/scheduled! nil "+2wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-17 Mon 00:00>")) + ;; Increment one day, expected to land on a weekday + (org-edna-action/scheduled! nil "+1wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-18 Tue 00:00>")) + ;; Move forward 8 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+8d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + ;; (org-edna-action/scheduled! nil "+1w +wkdy") + ;; (should (string-equal (org-entry-get nil "SCHEDULED") + ;; "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>"))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-scheduled/landing () "Test landing arguments to scheduled increment." ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "97e6b0f0-40c4-464f-b760-6e5ca9744eb5"= t))) - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; Move forward 10 days, then backward until we find a weekend - (org-edna-action/scheduled! nil "+10d -wknd") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-23 Sun 00:00>")) - ;; Move forward one week, then forward until we find a weekday - (org-edna-action/scheduled! nil "+1w +wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-31 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>"))))) + (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) + (unwind-protect + (org-with-point-at target + ;; Time starts at Jan 15, 2000 + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/scheduled! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>"))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-scheduled/landing-no-hour () "Test landing arguments to scheduled increment, without hour." ;; Override `current-time' so we can get a deterministic value (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "caf27724-0887-4565-9765-ed2f1edcfb16"= t))) - (org-with-point-at target - ;; Time starts at Jan 1, 2017 - (org-edna-action/scheduled! nil "2017-01-01 Sun") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-01 Sun>")) - ;; Move forward 10 days, then backward until we find a weekend - (org-edna-action/scheduled! nil "+10d -wknd") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-08 Sun>")) - ;; Move forward one week, then forward until we find a weekday - (org-edna-action/scheduled! nil "+1w +wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-16 Mon>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2017-01-01 Sun") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-01 Sun>"))))) + (target (org-edna-find-test-heading "caf27724-0887-4565-976= 5-ed2f1edcfb16"))) + (unwind-protect + (org-with-point-at target + ;; Time starts at Jan 1, 2017 + (org-edna-action/scheduled! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-01 Sun>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-08 Sun>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/scheduled! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-16 Mon>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-01 Sun>"))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-scheduled/float () (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) (org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "97e6b0f0-40c4-464f-b760-6e5ca9744eb5"= t))) - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; The third Tuesday of next month (Feb 15th) - (org-edna-action/scheduled! nil "float 3 Tue") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-02-15 Tue 00:00>")) - ;; The second Friday of the following May (May 12th) - (org-edna-action/scheduled! nil "float 2 5 May") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-05-12 Fri 00:00>")) - ;; Move forward to the second Wednesday of the next month (June 14= th) - (org-edna-action/scheduled! nil "float 2 Wednesday") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-06-14 Wed 00:00>")) - ;; Move forward to the first Thursday in the following Jan (Jan 4t= h, 2001) - (org-edna-action/scheduled! nil "float 1 4 Jan") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2001-01-04 Thu 00:00>")) - ;; The fourth Monday in Feb, 2000 (Feb 28th) - (org-edna-action/scheduled! nil "float ++4 monday") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-02-28 Mon 00:00>")) - ;; The second Monday after Mar 12th, 2000 (Mar 20th) - (org-edna-action/scheduled! nil "float 2 monday Mar 12") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-03-20 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>"))))) + (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) + (unwind-protect + (org-with-point-at target + ;; Time starts at Jan 15, 2000 + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; The third Tuesday of next month (Feb 15th) + (org-edna-action/scheduled! nil "float 3 Tue") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-02-15 Tue 00:00>")) + ;; The second Friday of the following May (May 12th) + (org-edna-action/scheduled! nil "float 2 5 May") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-05-12 Fri 00:00>")) + ;; Move forward to the second Wednesday of the next month (Jun= e 14th) + (org-edna-action/scheduled! nil "float 2 Wednesday") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-06-14 Wed 00:00>")) + ;; Move forward to the first Thursday in the following Jan (Ja= n 4th, 2001) + (org-edna-action/scheduled! nil "float 1 4 Jan") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2001-01-04 Thu 00:00>")) + ;; The fourth Monday in Feb, 2000 (Feb 28th) + (org-edna-action/scheduled! nil "float ++4 monday") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-02-28 Mon 00:00>")) + ;; The second Monday after Mar 12th, 2000 (Mar 20th) + (org-edna-action/scheduled! nil "float 2 monday Mar 12") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-03-20 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>"))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-tag () (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/tag! nil "tag") - (should (equal (org-get-tags) '("tag"))) - (org-edna-action/tag! nil "") - (should (equal (org-get-tags) '("")))))) + (unwind-protect + (org-with-point-at pom + (org-edna-action/tag! nil "tag") + (should (equal (org-get-tags) '("tag"))) + (org-edna-action/tag! nil "") + (should (equal (org-get-tags) '("")))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-property () (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/set-property! nil "TEST" "1") - (should (equal (org-entry-get nil "TEST") "1")) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST"))))) + (unwind-protect + (org-with-point-at pom + (org-edna-action/set-property! nil "TEST" "1") + (should (equal (org-entry-get nil "TEST") "1")) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST"))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-property/inc-dec () (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/set-property! nil "TEST" "1") - (should (equal (org-entry-get nil "TEST") "1")) - (org-edna-action/set-property! nil "TEST" 'inc) - (should (equal (org-entry-get nil "TEST") "2")) - (org-edna-action/set-property! nil "TEST" 'dec) - (should (equal (org-entry-get nil "TEST") "1")) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST")) - (should-error (org-edna-action/set-property! nil "TEST" 'inc)) - (should-error (org-edna-action/set-property! nil "TEST" 'dec)) - (org-edna-action/set-property! nil "TEST" "a") - (should (equal (org-entry-get nil "TEST") "a")) - (should-error (org-edna-action/set-property! nil "TEST" 'inc)) - (should-error (org-edna-action/set-property! nil "TEST" 'dec)) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST"))))) + (unwind-protect + (org-with-point-at pom + (org-edna-action/set-property! nil "TEST" "1") + (should (equal (org-entry-get nil "TEST") "1")) + (org-edna-action/set-property! nil "TEST" 'inc) + (should (equal (org-entry-get nil "TEST") "2")) + (org-edna-action/set-property! nil "TEST" 'dec) + (should (equal (org-entry-get nil "TEST") "1")) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST")) + (should-error (org-edna-action/set-property! nil "TEST" 'inc)) + (should-error (org-edna-action/set-property! nil "TEST" 'dec)) + (org-edna-action/set-property! nil "TEST" "a") + (should (equal (org-entry-get nil "TEST") "a")) + (should-error (org-edna-action/set-property! nil "TEST" 'inc)) + (should-error (org-edna-action/set-property! nil "TEST" 'dec)) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST"))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-property/next-prev () (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/set-property! nil "TEST" "a") - (should (equal (org-entry-get nil "TEST") "a")) - (should-error (org-edna-action/set-property! nil "TEST" 'next)) - (should-error (org-edna-action/set-property! nil "TEST" 'prev)) - (should-error (org-edna-action/set-property! nil "TEST" 'previous)= ) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST")) - ;; Test moving forwards - (org-edna-action/set-property! nil "COUNTER" "a") - (should (equal (org-entry-get nil "COUNTER") "a")) - (org-edna-action/set-property! nil "COUNTER" 'next) - (should (equal (org-entry-get nil "COUNTER") "b")) - ;; Test moving forwards past the last one - (org-edna-action/set-property! nil "COUNTER" "d") - (should (equal (org-entry-get nil "COUNTER") "d")) - (org-edna-action/set-property! nil "COUNTER" 'next) - (should (equal (org-entry-get nil "COUNTER") "a")) - ;; Test moving backwards past the first one - (org-edna-action/set-property! nil "COUNTER" 'prev) - (should (equal (org-entry-get nil "COUNTER") "d")) - ;; Test moving backwards normally - (org-edna-action/set-property! nil "COUNTER" 'previous) - (should (equal (org-entry-get nil "COUNTER") "c")) - (org-edna-action/delete-property! nil "COUNTER") - (should-not (org-entry-get nil "COUNTER"))))) + (unwind-protect + (org-with-point-at pom + (org-edna-action/set-property! nil "TEST" "a") + (should (equal (org-entry-get nil "TEST") "a")) + (should-error (org-edna-action/set-property! nil "TEST" 'next)= ) + (should-error (org-edna-action/set-property! nil "TEST" 'prev)= ) + (should-error (org-edna-action/set-property! nil "TEST" 'previ= ous)) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST")) + ;; Test moving forwards + (org-edna-action/set-property! nil "COUNTER" "a") + (should (equal (org-entry-get nil "COUNTER") "a")) + (org-edna-action/set-property! nil "COUNTER" 'next) + (should (equal (org-entry-get nil "COUNTER") "b")) + ;; Test moving forwards past the last one + (org-edna-action/set-property! nil "COUNTER" "d") + (should (equal (org-entry-get nil "COUNTER") "d")) + (org-edna-action/set-property! nil "COUNTER" 'next) + (should (equal (org-entry-get nil "COUNTER") "a")) + ;; Test moving backwards past the first one + (org-edna-action/set-property! nil "COUNTER" 'prev) + (should (equal (org-entry-get nil "COUNTER") "d")) + ;; Test moving backwards normally + (org-edna-action/set-property! nil "COUNTER" 'previous) + (should (equal (org-entry-get nil "COUNTER") "c")) + (org-edna-action/delete-property! nil "COUNTER") + (should-not (org-entry-get nil "COUNTER"))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-clock () (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/clock-in! nil) - (should (org-clocking-p)) - (should (equal org-clock-hd-marker pom)) - (org-edna-action/clock-out! nil) - (should-not (org-clocking-p))))) + (unwind-protect + (org-with-point-at pom + (org-edna-action/clock-in! nil) + (should (org-clocking-p)) + (should (equal org-clock-hd-marker pom)) + (org-edna-action/clock-out! nil) + (should-not (org-clocking-p))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-priority () (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) (org-lowest-priority ?C) (org-highest-priority ?A) (org-default-priority ?B)) - (org-with-point-at pom - (org-edna-action/set-priority! nil "A") - (should (equal (org-entry-get nil "PRIORITY") "A")) - (org-edna-action/set-priority! nil 'down) - (should (equal (org-entry-get nil "PRIORITY") "B")) - (org-edna-action/set-priority! nil 'up) - (should (equal (org-entry-get nil "PRIORITY") "A")) - (org-edna-action/set-priority! nil ?C) - (should (equal (org-entry-get nil "PRIORITY") "C")) - (org-edna-action/set-priority! nil 'remove) - (should (equal (org-entry-get nil "PRIORITY") "B"))))) + (unwind-protect + (org-with-point-at pom + (org-edna-action/set-priority! nil "A") + (should (equal (org-entry-get nil "PRIORITY") "A")) + (org-edna-action/set-priority! nil 'down) + (should (equal (org-entry-get nil "PRIORITY") "B")) + (org-edna-action/set-priority! nil 'up) + (should (equal (org-entry-get nil "PRIORITY") "A")) + (org-edna-action/set-priority! nil ?C) + (should (equal (org-entry-get nil "PRIORITY") "C")) + (org-edna-action/set-priority! nil 'remove) + (should (equal (org-entry-get nil "PRIORITY") "B"))) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-effort () (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/set-effort! nil "0:01") - (should (equal (org-entry-get nil "EFFORT") "0:01")) - (org-edna-action/set-effort! nil 'increment) - (should (equal (org-entry-get nil "EFFORT") "0:02")) - (org-entry-delete nil "EFFORT")))) + (unwind-protect + (org-with-point-at pom + (org-edna-action/set-effort! nil "0:01") + (should (equal (org-entry-get nil "EFFORT") "0:01")) + (org-edna-action/set-effort! nil 'increment) + (should (equal (org-entry-get nil "EFFORT") "0:02")) + (org-entry-delete nil "EFFORT")) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-archive () (let ((org-archive-save-context-info '(todo)) @@ -1421,20 +1481,25 @@ ;; Archive it to the same location (org-archive-location "::** Archive") (org-edna-prompt-for-archive nil)) - (org-with-point-at pom - (org-edna-action/archive! nil) - (should (equal (org-entry-get nil "ARCHIVE_TODO") "TODO")) - (org-entry-delete nil "ARCHIVE_TODO")))) + (unwind-protect + (org-with-point-at pom + (org-edna-action/archive! nil) + (should (equal (org-entry-get nil "ARCHIVE_TODO") "TODO")) + (org-entry-delete nil "ARCHIVE_TODO")) + (org-edna-test-restore-test-file)))) =20 (ert-deftest org-edna-action-chain () (let ((old-pom (org-edna-find-test-heading org-edna-test-id-heading-on= e)) (new-pom (org-edna-find-test-heading org-edna-test-id-heading-tw= o))) - (org-entry-put old-pom "TEST" "1") - (org-with-point-at new-pom - (org-edna-action/chain! old-pom "TEST") - (should (equal (org-entry-get nil "TEST") "1"))) - (org-entry-delete old-pom "TEST") - (org-entry-delete new-pom "TEST"))) + (unwind-protect + (progn + (org-entry-put old-pom "TEST" "1") + (org-with-point-at new-pom + (org-edna-action/chain! old-pom "TEST") + (should (equal (org-entry-get nil "TEST") "1"))) + (org-entry-delete old-pom "TEST") + (org-entry-delete new-pom "TEST")) + (org-edna-test-restore-test-file)))) =20 =0C ;; Conditions @@ -1547,6 +1612,268 @@ (should (not (org-edna-handle-consideration 0.25 blocks-no-blocking)= )) (should (not (org-edna-handle-consideration 0.25 blocks-empty))))) =20 +=0C +;;; Full Run-through Tests from the Documentation + +(ert-deftest org-edna-doc-test/ancestors () + (let* ((start-heading (org-edna-find-test-heading "24a0c3bb-7e69-4e9e-= bb98-5aba2ff17bb1")) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function)) + (unwind-protect + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading5-pom (progn (org-next-visible-heading 1) (po= int-marker)))) + ;; Verify that we can't change the TODO state to DONE + (should (org-edna-test-check-block heading5-pom "Initial s= tate of heading 5")) + ;; Change the state at 4 to DONE + (org-edna-test-change-todo-state heading4-pom "DONE") + ;; Verify that ALL ancestors need to be changed + (should (org-edna-test-check-block heading5-pom "Heading 5= after parent changed")) + (org-edna-test-mark-done heading1-pom heading3-pom) + ;; Only need 1, 3, and 4 to change 5 + (should (not (org-edna-test-check-block heading5-pom + "Heading 5 after all= parents changed"))) + ;; Change the state back to TODO on all of them + (org-edna-test-mark-todo heading1-pom heading3-pom heading= 4-pom heading5-pom)))) + (org-edna-test-restore-test-file)))) + +(ert-deftest org-edna-doc-test/descendants () + (let* ((start-heading (org-edna-find-test-heading "cc18dc74-00e8-4081-= b46f-e36800041fe7")) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function)) + (unwind-protect + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading5-pom (progn (org-next-visible-heading 1) (po= int-marker)))) + (should (org-edna-test-check-block heading1-pom "Heading 1= initial state")) + ;; Change the state at 2 to DONE + (org-edna-test-mark-done heading2-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 2")) + ;; Try 3 + (org-edna-test-mark-done heading3-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 3")) + ;; Try 4 + (org-edna-test-mark-done heading4-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 4")) + ;; Try 5 + (org-edna-test-mark-done heading5-pom) + ;; Verify that ALL descendants need to be changed + (should (not (org-edna-test-check-block heading1-pom "Head= ing 1 after changing 5")))))) + (org-edna-test-restore-test-file)))) + +(ert-deftest org-edna-doc-test/laundry () + "Test for the \"laundry\" example in the documentation." + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (start-heading (org-edna-find-test-heading "e57ce099-9f37-4= 7f4-a6bb-61a84eb1fbbe")) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function)) + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (unwind-protect + (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) + (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker)))) + ;; Verify that headings 2, 3, and 4 are all blocked + (should (org-edna-test-check-block heading2-pom + "Initial attempt to cha= nge heading 2")) + (should (org-edna-test-check-block heading3-pom + "Initial attempt to cha= nge heading 3")) + (should (org-edna-test-check-block heading4-pom + "Initial attempt to cha= nge heading 4")) + ;; Mark heading 1 as DONE + (should (not (org-edna-test-check-block heading1-pom + "Set heading 1 to DO= NE"))) + ;; Only heading 2 should have a scheduled time + (should (string-equal (org-entry-get heading2-pom "SCHEDUL= ED") + "<2000-01-15 Sat 01:00>")) + (should (not (org-entry-get heading3-pom "SCHEDULED"))) + (should (not (org-entry-get heading4-pom "SCHEDULED"))) + ;; The others should still be blocked. + (should (org-edna-test-check-block heading3-pom + "Second attempt to chan= ge heading 3")) + (should (org-edna-test-check-block heading4-pom + "Second attempt to chan= ge heading 4")) + ;; Try changing heading 2 + (should (not (org-edna-test-check-block heading2-pom + "Set heading 2 to DO= NE"))) + (should (string-equal (org-entry-get heading3-pom "SCHEDUL= ED") + "<2000-01-16 Sun 09:00>")) + ;; 4 should still be blocked + (should (org-edna-test-check-block heading4-pom + "Second attempt to chan= ge heading 4"))) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file)))))) + +(ert-deftest org-edna-doc-test/nightly () + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (start-heading (org-edna-find-test-heading "8b6d9820-d943-4= 622-85c9-4a346e033453")) + ;; Only use the test file in the agenda + (org-agenda-files `(,org-edna-test-file)) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function)) + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (unwind-protect + (let* ((nightly-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) + (lunch-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) + (door-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) + (dog-pom (progn (org-next-visible-heading 1) (poi= nt-marker)))) + ;; Verify that Nightly is blocked + (should (org-edna-test-check-block nightly-pom "Initial Ni= ghtly Check")) + ;; Check off Lunch, and verify that nightly is still block= ed + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-check-block nightly-pom "Nightly af= ter Lunch")) + ;; Check off Door, and verify that nightly is still blocke= d + (org-edna-test-mark-done door-pom) + (should (org-edna-test-check-block nightly-pom "Nightly af= ter Door")) + ;; Check off Dog. This should trigger the others. + (org-edna-test-mark-done dog-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Nightly Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Nightly Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Nightly Trigger")) + (should (string-equal (org-entry-get nightly-pom "DEADLINE= ") + "<2000-01-16 Sun +1d>"))) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file)))))) + +(ert-deftest org-edna-doc-test/daily () + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (start-heading (org-edna-find-test-heading "630805bb-a864-4= cdc-9a6f-0f126e887c66")) + ;; Only use the test file in the agenda + (org-agenda-files `(,org-edna-test-file)) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function)) + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (unwind-protect + (let* ((daily-pom (progn (org-next-visible-heading 1) (point= -marker))) + (lunch-pom (progn (org-next-visible-heading 1) (point= -marker))) + (door-pom (progn (org-next-visible-heading 1) (point= -marker))) + (dog-pom (progn (org-next-visible-heading 1) (point= -marker)))) + ;; Check off Lunch. This should trigger the others. + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Daily Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Daily Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Daily Trigger")) + (should (string-equal (org-entry-get daily-pom "DEADLINE") + "<2000-01-16 Sun +1d>"))) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file)))))) + +(ert-deftest org-edna-doc-test/weekly () + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (start-heading (org-edna-find-test-heading "cf529a5e-1b0c-4= 0c3-8f85-fe2fc4df0ffd")) + ;; Only use the test file in the agenda + (org-agenda-files `(,org-edna-test-file)) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function)) + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (unwind-protect + (let* ((weekly-pom (progn (org-next-visible-heading 1) (poin= t-marker))) + (lunch-pom (progn (org-next-visible-heading 1) (poin= t-marker))) + (door-pom (progn (org-next-visible-heading 1) (poin= t-marker))) + (dog-pom (progn (org-next-visible-heading 1) (poin= t-marker)))) + ;; Check off Lunch. This should trigger the others. + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Weekly Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Weekly Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Weekly Trigger")) + (should (string-equal (org-entry-get weekly-pom "DEADLINE"= ) + "<2000-01-16 Sun +1d>"))) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file)))))) + +(ert-deftest org-edna-doc-test/basic-shower () + (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) + (start-heading (org-edna-find-test-heading "34d67756-927b-4= a21-a62d-7989bd138946")) + ;; Only use the test file in the agenda + (org-agenda-files `(,org-edna-test-file)) + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function)) + (org-with-point-at start-heading + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + (unwind-protect + (let* ((shower-pom (progn (org-next-visible-heading 1) (poin= t-marker))) + (towels-pom (progn (org-next-visible-heading 1) (poin= t-marker)))) + ;; Verify towels is blocked + (should (org-edna-test-check-block towels-pom "Initial Tow= els Check")) + ;; Check off "Take Shower" and verify that it incremented = the property + (org-edna-test-mark-done shower-pom) + (should (string-equal (org-entry-get shower-pom "COUNT") "= 1")) + ;; Verify towels is blocked + (should (org-edna-test-check-block towels-pom "Towels Chec= k, Count=3D1")) + ;; Check off "Take Shower" and verify that it incremented = the property + (org-edna-test-mark-done shower-pom) + (should (string-equal (org-entry-get shower-pom "COUNT") "= 2")) + ;; Verify towels is blocked + (should (org-edna-test-check-block towels-pom "Towels Chec= k, Count=3D2")) + ;; Check off "Take Shower" and verify that it incremented = the property + (org-edna-test-mark-done shower-pom) + (should (string-equal (org-entry-get shower-pom "COUNT") "= 3")) + ;; Verify that towels is no longer blocked. + (should (not (org-edna-test-check-block towels-pom "Towels= Check, Count=3D3"))) + ;; Verify that the property was reset. + (should (string-equal (org-entry-get shower-pom "COUNT") "= 0"))) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file)))))) (provide 'org-edna-tests) =20 ;;; org-edna-tests.el ends here diff --git a/org-edna-tests.org b/org-edna-tests.org index 5e20614..9eb8756 100644 --- a/org-edna-tests.org +++ b/org-edna-tests.org @@ -1,4 +1,5 @@ #+STARTUP: nologdone +#+STARTUP: indent #+PROPERTY: Effort_ALL 0:01 0:02 0:03 #+PROPERTY: COUNTER_ALL a b c d =20 @@ -137,3 +138,133 @@ DEADLINE: <2017-01-05 Thu> SCHEDULED: <2017-01-05 T= hu> :PROPERTIES: :ID: 4fe67f03-2b35-4708-8c38-54d2c4dfab81 :END: +* Documentation Tests +** Ancestors +:PROPERTIES: +:ID: 24a0c3bb-7e69-4e9e-bb98-5aba2ff17bb1 +:END: +*** TODO Heading 1 +**** TODO Heading 2 +**** TODO Heading 3 +***** TODO Heading 4 +****** TODO Heading 5 +:PROPERTIES: +:BLOCKER: ancestors +:END: +** Descendants +:PROPERTIES: +:ID: cc18dc74-00e8-4081-b46f-e36800041fe7 +:END: +*** TODO Heading 1 +:PROPERTIES: +:BLOCKER: descendants +:END: +**** TODO Heading 2 +**** TODO Heading 3 +***** TODO Heading 4 +****** TODO Heading 5 +** Laundry +:PROPERTIES: +:ID: e57ce099-9f37-47f4-a6bb-61a84eb1fbbe +:END: +*** TODO Put clothes in washer +SCHEDULED: <2000-01-15 Sat 00:00> +:PROPERTIES: +:TRIGGER: next-sibling scheduled!("++1h") +:END: +*** TODO Put clothes in dryer +:PROPERTIES: +:TRIGGER: next-sibling scheduled!("Sun 9:00") +:BLOCKER: previous-sibling +:END: +*** TODO Fold laundry +:PROPERTIES: +:TRIGGER: next-sibling scheduled!("++1h") +:BLOCKER: previous-sibling +:END: +*** TODO Put clothes away +:PROPERTIES: +:TRIGGER: next-sibling scheduled!("++1h") +:BLOCKER: previous-sibling +:END: +** Nightlies - Standard +:PROPERTIES: +:ID: 8b6d9820-d943-4622-85c9-4a346e033453 +:END: +*** TODO Nightly +DEADLINE: <2000-01-15 Sat +1d> +:PROPERTIES: +:ID: 2d94abf9-2d63-46fd-8dc5-cd396555bcfe +:BLOCKER: match("nightly") +:TRIGGER: match("nightly") todo!(TODO) +:END: +*** TODO Prepare Tomorrow's Lunch :night= ly: +:PROPERTIES: +:TRIGGER: if match("nightly") then ids(2d94abf9-2d63-46fd-8dc5-cd396555= bcfe) todo!(DONE) endif +:END: +*** TODO Lock Back Door :night= ly: +:PROPERTIES: +:TRIGGER: if match("nightly") then ids(2d94abf9-2d63-46fd-8dc5-cd396555= bcfe) todo!(DONE) endif +:END: +*** TODO Feed Dog :night= ly: +:PROPERTIES: +:TRIGGER: if match("nightly") then ids(2d94abf9-2d63-46fd-8dc5-cd396555= bcfe) todo!(DONE) endif +:END: +** Dailies - Consideration +:PROPERTIES: +:ID: 630805bb-a864-4cdc-9a6f-0f126e887c66 +:END: +*** TODO Daily +DEADLINE: <2000-01-15 Sat +1d> +:PROPERTIES: +:ID: 96f7e46c-40c3-4f5b-8f00-81a6e3cb122b +:TRIGGER: match("daily") todo!(TODO) +:END: +*** TODO Prepare Tomorrow's Lunch :dai= ly: +:PROPERTIES: +:TRIGGER: if consider(any) match("daily") then ids(96f7e46c-40c3-4f5b-8= f00-81a6e3cb122b) todo!(DONE) endif +:END: +*** TODO Lock Back Door :dai= ly: +:PROPERTIES: +:TRIGGER: if consider(any) match("daily") then ids(96f7e46c-40c3-4f5b-8= f00-81a6e3cb122b) todo!(DONE) endif +:END: +*** TODO Feed Dog :dai= ly: +:PROPERTIES: +:TRIGGER: if consider(any) match("daily") then ids(96f7e46c-40c3-4f5b-8= f00-81a6e3cb122b) todo!(DONE) endif +:END: +** Weeklies - Inverted Conditional +:PROPERTIES: +:ID: cf529a5e-1b0c-40c3-8f85-fe2fc4df0ffd +:END: +*** TODO Weekly +DEADLINE: <2000-01-15 Sat +1d> +:PROPERTIES: +:ID: 9a0c4b00-64be-4971-a93e-c530cbdd4b2b +:TRIGGER: match("weekly") todo!(TODO) +:END: +*** TODO Prepare Tomorrow's Lunch :weekl= y: +:PROPERTIES: +:TRIGGER: if match("weekly") then else ids(9a0c4b00-64be-4971-a93e-c530= cbdd4b2b) todo!(DONE) endif +:END: +*** TODO Lock Back Door :weekl= y: +:PROPERTIES: +:TRIGGER: if match("weekly") then else ids(9a0c4b00-64be-4971-a93e-c530= cbdd4b2b) todo!(DONE) endif +:END: +*** TODO Feed Dog :weekl= y: +:PROPERTIES: +:TRIGGER: if match("weekly") then else ids(9a0c4b00-64be-4971-a93e-c530= cbdd4b2b) todo!(DONE) endif +:END: +** Basic Shower - No Conditional +:PROPERTIES: +:ID: 34d67756-927b-4a21-a62d-7989bd138946 +:END: +*** TODO Take Shower +:PROPERTIES: +:COUNT: 0 +:TRIGGER: self set-property!("COUNT" inc) todo!("TODO") +:END: +*** TODO Wash Towels +:PROPERTIES: +:BLOCKER: previous-sibling !has-property?("COUNT" "3") +:TRIGGER: previous-sibling set-property!("COUNT" "0") +:END: diff --git a/org-edna.el b/org-edna.el index dcb3157..3247989 100644 --- a/org-edna.el +++ b/org-edna.el @@ -96,7 +96,8 @@ Currently, the following are handled: =20 Everything else is returned as is." (pcase arg - ((and (pred symbolp) + ((and (pred symbolp) ;; Symbol + ;; Name matches `org-uuidgen-p' (let (pred org-uuidgen-p) (symbol-name arg))) (symbol-name arg)) (_ @@ -127,7 +128,8 @@ If KEY is an invalid Edna keyword, then return nil." (cond ;; Just return nil if it's not a symbol ((or (not key) - (not (symbolp key)))) + (not (symbolp key))) + nil) ((memq key '(consideration consider)) ;; Function is ignored here, but `org-edna-describe-keyword' needs t= his ;; function. @@ -397,7 +399,7 @@ correspond to internal variables." ,target-var ,considerati= on-var)))) ('consideration - `(setq ,consideration-var ,(nth 0 args)))))) + `(setq ,consideration-var ',(nth 0 args)))))) =20 (defun org-edna--expand-sexp-form (form &optional use-old-scope @@ -664,7 +666,11 @@ MATCH-SPEC may be any valid match string; it is pass= ed straight into `org-map-entries'. =20 SCOPE and SKIP are their counterparts in `org-map-entries'. -SCOPE defaults to agenda, and SKIP defaults to nil. +SCOPE defaults to agenda, and SKIP defaults to nil. Because of +the different defaults in SCOPE, the symbol 'buffer may also be +used. This indicates that scope should be the current buffer, +honoring any restriction (the equivalent of the nil SCOPE in +`org-map-entries'.) =20 * TODO Test :PROPERTIES: @@ -673,7 +679,10 @@ SCOPE defaults to agenda, and SKIP defaults to nil. =20 \"Test\" will block until all entries tagged \"test\" and \"mine\" in the agenda files are marked DONE." + ;; Our default is agenda... (setq scope (or scope 'agenda)) + ;; ...but theirs is the buffer + (when (eq scope 'buffer) (setq scope nil)) (org-map-entries ;; Find all entries in the agenda files that match the given tag. (lambda nil (point-marker)) @@ -2206,7 +2215,7 @@ SUFFIX is an additional suffix to use when matching= keywords." "Return a list of all allowed Edna keywords for a blocker." `(,@(org-edna--collect-finders) ,@(org-edna--collect-conditions) - "consideration")) + "consideration" "consider")) =20 (defun org-edna-completions-for-trigger () "Return a list of all allowed Edna keywords for a trigger." diff --git a/org-edna.info b/org-edna.info index d1f6a35..2bc5847 100644 --- a/org-edna.info +++ b/org-edna.info @@ -865,19 +865,23 @@ following, PLANNING is either scheduled or deadline= . =20 Examples: =20 - =E2=80=A2 scheduled!(=E2=80=9CMon 09:00=E2=80=9D) -> Set SCHEDULED to= the following Monday at - 9:00 - =E2=80=A2 deadline!(=E2=80=9C++2h=E2=80=9D) -> Set DEADLINE to two ho= urs from now. - =E2=80=A2 deadline!(copy) deadline!(=E2=80=9C+1h=E2=80=9D) -> Copy th= e source deadline to the - target, then increment it by an hour. - =E2=80=A2 scheduled!(=E2=80=9C+1wkdy=E2=80=9D) -> Set SCHEDULED to th= e next weekday - =E2=80=A2 scheduled!(=E2=80=9C+1d +wkdy=E2=80=9D) -> Same as above - =E2=80=A2 deadline!(=E2=80=9C+1m -wkdy=E2=80=9D) -> Set SCHEDULED up = one month, but move - backward to find a weekend - =E2=80=A2 scheduled!(=E2=80=9Cfloat 2 Tue Feb=E2=80=9D) -> Set SCHEDU= LED to the second - Tuesday in the following February - =E2=80=A2 scheduled!(=E2=80=9Cfloat 3 Thu=E2=80=9D) -> Set SCHEDULED = to the third Thursday in - the following month +scheduled!(=E2=80=9CMon 09:00=E2=80=9D) + Set SCHEDULED to the following Monday at 9:00 +deadline!(=E2=80=9C++2h=E2=80=9D) + Set DEADLINE to two hours from now. +deadline!(copy) deadline!(=E2=80=9C+1h=E2=80=9D) + Copy the source deadline to the target, then increment it by an + hour. +scheduled!(=E2=80=9C+1wkdy=E2=80=9D) + Set SCHEDULED to the next weekday +scheduled!(=E2=80=9C+1d +wkdy=E2=80=9D) + Same as above +deadline!(=E2=80=9C+1m -wkdy=E2=80=9D) + Set SCHEDULED up one month, but move backward to find a weekend +scheduled!(=E2=80=9Cfloat 2 Tue Feb=E2=80=9D) + Set SCHEDULED to the second Tuesday in the following February +scheduled!(=E2=80=9Cfloat 3 Thu=E2=80=9D) + Set SCHEDULED to the third Thursday in the following month =20 =1F File: org-edna.info, Node: TODO State, Next: Archive, Prev: Scheduled= /Deadline, Up: Actions @@ -893,6 +897,23 @@ TODO State state. It can also be the empty string, in which case the TODO state is removed. =20 + Example: + + * TODO Heading 1 + :PROPERTIES: + :TRIGGER: next-sibling todo!(DONE) + :END: + * TODO Heading 2 + + In this example, when =E2=80=9CHeading 1=E2=80=9D is marked as DONE, = it will also +mark =E2=80=9CHeading 2=E2=80=9D as DONE: + + * DONE Heading 1 + :PROPERTIES: + :TRIGGER: next-sibling todo!(DONE) + :END: + * DONE Heading 2 + =1F File: org-edna.info, Node: Archive, Next: Chain Property, Prev: TODO = State, Up: Actions =20 @@ -917,6 +938,28 @@ Chain Property Copies PROPERTY from the source entry to all targets. Does nothing if the source heading has no property PROPERTY. =20 + Example: + + * TODO Heading 1 + :PROPERTIES: + :COUNTER: 2 + :TRIGGER: next-sibling chain!("COUNTER") + :END: + * TODO Heading 2 + + In this example, when =E2=80=9CHeading 1=E2=80=9D is marked as DONE, = it will copy its +COUNTER property to =E2=80=9CHeading 2=E2=80=9D: + + * DONE Heading 1 + :PROPERTIES: + :COUNTER: 2 + :TRIGGER: next-sibling chain!("COUNTER") + :END: + * TODO Heading 2 + :PROPERTIES: + :COUNTER: 2 + :END: + =1F File: org-edna.info, Node: Clocking, Next: Property, Prev: Chain Prop= erty, Up: Actions =20 @@ -987,7 +1030,7 @@ already set: =20 * TODO Test :PROPERTIES: - :TRIGGER: self set-property("TEST" inc) + :TRIGGER: self set-property!("TEST" inc) :END: =20 In the above example, if =E2=80=9CTest=E2=80=9D is set to DONE, Edna = will fail to @@ -999,10 +1042,11 @@ increment the TEST property, since it doesn=E2=80=99= t exist. =20 Examples: =20 - =E2=80=A2 set-property!(=E2=80=9CCOUNTER=E2=80=9D =E2=80=9C1=E2=80=9D= ) -> Sets the property COUNTER to 1 on - all targets - =E2=80=A2 set-property!(=E2=80=9CCOUNTER=E2=80=9D inc) -> Increments = the property COUNTER by - 1. Following the previous example, it would be 2. +set-property!(=E2=80=9CCOUNTER=E2=80=9D =E2=80=9C1=E2=80=9D) + Sets the property COUNTER to 1 on all targets +set-property!(=E2=80=9CCOUNTER=E2=80=9D inc) + Increments the property COUNTER by 1. Following the previous + example, it would be 2. =20 =1F File: org-edna.info, Node: Priority, Next: Tag, Prev: Property, Up: = Actions @@ -1182,7 +1226,12 @@ against VALUE. Block the source heading if VARIABL= E =3D VALUE. =20 VARIABLE should be a symbol, and VALUE is any valid lisp expression. =20 - self variable-set?(test-variable 12) + Examples: + +self variable-set?(test-variable 12) + Blocks if the variable =E2=80=98test-variable=E2=80=99 is set to 12= . +self variable-set?(buffer-file-name =E2=80=9Corg-edna.org=E2=80=9D) + Blocks if the variable =E2=80=98buffer-file-name=E2=80=99 is set to= =E2=80=9Corg-edna.org=E2=80=9D. =20 =1F File: org-edna.info, Node: has-property, Next: re-search, Prev: varia= ble-set, Up: Conditions @@ -1195,6 +1244,22 @@ has-property Tests each target for the property PROPERTY, and blocks if it=E2=80=99= s set to VALUE. =20 + Example: + + * TODO Take Shower + :PROPERTIES: + :COUNT: 1 + :TRIGGER: self set-property!("COUNT" inc) todo!("TODO") + :END: + * TODO Wash Towels + :PROPERTIES: + :BLOCKER: previous-sibling !has-property?("COUNT" "3") + :TRIGGER: previous-sibling set-property!("COUNT" "0") + :END: + + In this example, =E2=80=9CWash Towels=E2=80=9D can=E2=80=99t be compl= eted until the user has +showered at least three times. + =1F File: org-edna.info, Node: re-search, Next: Negating Conditions, Prev= : has-property, Up: Conditions =20 @@ -1228,7 +1293,8 @@ File: org-edna.info, Node: Consideration, Next: C= onditional Forms, Prev: Cond Consideration =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -=E2=80=9CConsideration=E2=80=9D is a special keyword that=E2=80=99s only= valid for blockers. +=E2=80=9CConsideration=E2=80=9D and =E2=80=9Cconsider=E2=80=9D are speci= al keywords that are only valid +for blockers. =20 This says =E2=80=9CAllow a task to complete if CONSIDERATION of its t= argets pass the given condition=E2=80=9D. @@ -1812,49 +1878,49 @@ Node: siblings=7F22483 Node: siblings-wrap=7F22720 Node: Actions=7F23024 Node: Scheduled/Deadline=7F23787 -Node: TODO State=7F27362 -Node: Archive=7F27730 -Node: Chain Property=7F28050 -Node: Clocking=7F28333 -Node: Property=7F28745 -Node: Priority=7F30932 -Node: Tag=7F31501 -Node: Effort=7F31718 -Node: Getting Help=7F32107 -Node: Advanced Features=7F32552 -Node: Finder Cache=7F33000 -Node: Conditions=7F34039 -Node: done=7F34675 -Node: headings=7F34839 -Node: todo-state=7F35215 -Node: variable-set=7F35471 -Node: has-property=7F35900 -Node: re-search=7F36169 -Node: Negating Conditions=7F36529 -Node: Consideration=7F36916 -Node: Conditional Forms=7F38485 -Node: Setting the Properties=7F41141 -Node: Extending Edna=7F42225 -Node: Naming Conventions=7F42715 -Node: Finders 1=7F43507 -Node: Actions 1=7F43869 -Node: Conditions 1=7F44328 -Node: Contributing=7F45214 -Node: Bugs=7F46080 -Node: Working with EDE=7F46437 -Node: Compiling Edna=7F47521 -Node: Testing Edna=7F48390 -Node: Before Sending Changes=7F49371 -Node: Developing with Bazaar=7F50058 -Node: Documentation=7F50799 -Node: Changelog=7F51255 -Node: 10beta8=7F51505 -Node: 10beta7=7F51617 -Node: 10beta6=7F51911 -Node: 10beta5=7F52187 -Node: 10beta4=7F52574 -Node: 10beta3=7F52827 -Node: 10beta2=7F53266 +Node: TODO State=7F27302 +Node: Archive=7F28027 +Node: Chain Property=7F28347 +Node: Clocking=7F29100 +Node: Property=7F29512 +Node: Priority=7F31685 +Node: Tag=7F32254 +Node: Effort=7F32471 +Node: Getting Help=7F32860 +Node: Advanced Features=7F33305 +Node: Finder Cache=7F33753 +Node: Conditions=7F34792 +Node: done=7F35428 +Node: headings=7F35592 +Node: todo-state=7F35968 +Node: variable-set=7F36224 +Node: has-property=7F36861 +Node: re-search=7F37574 +Node: Negating Conditions=7F37934 +Node: Consideration=7F38321 +Node: Conditional Forms=7F39909 +Node: Setting the Properties=7F42565 +Node: Extending Edna=7F43649 +Node: Naming Conventions=7F44139 +Node: Finders 1=7F44931 +Node: Actions 1=7F45293 +Node: Conditions 1=7F45752 +Node: Contributing=7F46638 +Node: Bugs=7F47504 +Node: Working with EDE=7F47861 +Node: Compiling Edna=7F48945 +Node: Testing Edna=7F49814 +Node: Before Sending Changes=7F50795 +Node: Developing with Bazaar=7F51482 +Node: Documentation=7F52223 +Node: Changelog=7F52679 +Node: 10beta8=7F52929 +Node: 10beta7=7F53041 +Node: 10beta6=7F53335 +Node: 10beta5=7F53611 +Node: 10beta4=7F53998 +Node: 10beta3=7F54251 +Node: 10beta2=7F54690 =1F End Tag Table =20 diff --git a/org-edna.org b/org-edna.org index 65d1832..5fd4cf4 100644 --- a/org-edna.org +++ b/org-edna.org @@ -692,14 +692,15 @@ PLANNING is either scheduled or deadline. =20 Examples: =20 -- scheduled!("Mon 09:00") -> Set SCHEDULED to the following Monday at 9:= 00 -- deadline!("++2h") -> Set DEADLINE to two hours from now. -- deadline!(copy) deadline!("+1h") -> Copy the source deadline to the ta= rget, then increment it by an hour. -- scheduled!("+1wkdy") -> Set SCHEDULED to the next weekday -- scheduled!("+1d +wkdy") -> Same as above -- deadline!("+1m -wkdy") -> Set SCHEDULED up one month, but move backwar= d to find a weekend -- scheduled!("float 2 Tue Feb") -> Set SCHEDULED to the second Tuesday i= n the following February -- scheduled!("float 3 Thu") -> Set SCHEDULED to the third Thursday in th= e following month +- scheduled!("Mon 09:00") :: Set SCHEDULED to the following Monday at 9:= 00 +- deadline!("++2h") :: Set DEADLINE to two hours from now. +- deadline!(copy) deadline!("+1h") :: Copy the source deadline to the ta= rget, then increment it by an hour. +- scheduled!("+1wkdy") :: Set SCHEDULED to the next weekday +- scheduled!("+1d +wkdy") :: Same as above +- deadline!("+1m -wkdy") :: Set SCHEDULED up one month, but move backwar= d to find a weekend +- scheduled!("float 2 Tue Feb") :: Set SCHEDULED to the second Tuesday i= n the following February +- scheduled!("float 3 Thu") :: Set SCHEDULED to the third Thursday in th= e following month + *** TODO State :PROPERTIES: :CUSTOM_ID: todo! @@ -713,6 +714,27 @@ Sets the TODO state of the target heading to NEW-STA= TE. NEW-STATE may either be a string or a symbol denoting the new TODO state= . It can also be the empty string, in which case the TODO state is removed. =20 +Example: + +#+BEGIN_SRC org +,* TODO Heading 1 + :PROPERTIES: + :TRIGGER: next-sibling todo!(DONE) + :END: +,* TODO Heading 2 +#+END_SRC + +In this example, when "Heading 1" is marked as DONE, it will also mark "= Heading +2" as DONE: + +#+BEGIN_SRC org +,* DONE Heading 1 + :PROPERTIES: + :TRIGGER: next-sibling todo!(DONE) + :END: +,* DONE Heading 2 +#+END_SRC + *** Archive :PROPERTIES: :CUSTOM_ID: archive! @@ -737,6 +759,32 @@ nil, Edna will not ask before archiving targets. Copies PROPERTY from the source entry to all targets. Does nothing if t= he source heading has no property PROPERTY. =20 +Example: + +#+BEGIN_SRC org +,* TODO Heading 1 + :PROPERTIES: + :COUNTER: 2 + :TRIGGER: next-sibling chain!("COUNTER") + :END: +,* TODO Heading 2 +#+END_SRC + +In this example, when "Heading 1" is marked as DONE, it will copy its CO= UNTER +property to "Heading 2": + +#+BEGIN_SRC org +,* DONE Heading 1 + :PROPERTIES: + :COUNTER: 2 + :TRIGGER: next-sibling chain!("COUNTER") + :END: +,* TODO Heading 2 + :PROPERTIES: + :COUNTER: 2 + :END: +#+END_SRC + *** Clocking :PROPERTIES: :CUSTOM_ID: clocking @@ -804,7 +852,7 @@ Additionally, all special forms will fail if the prop= erty is not already set: #+begin_src org ,* TODO Test :PROPERTIES: - :TRIGGER: self set-property("TEST" inc) + :TRIGGER: self set-property!("TEST" inc) :END: #+end_src =20 @@ -817,8 +865,8 @@ Deletes the property PROPERTY from all targets. =20 Examples: =20 -- set-property!("COUNTER" "1") -> Sets the property COUNTER to 1 on all = targets -- set-property!("COUNTER" inc) -> Increments the property COUNTER by 1. = Following the previous example, it would be 2. +- set-property!("COUNTER" "1") :: Sets the property COUNTER to 1 on all = targets +- set-property!("COUNTER" inc) :: Increments the property COUNTER by 1. = Following the previous example, it would be 2. =20 *** Priority :PROPERTIES: @@ -923,7 +971,7 @@ that target, then the source heading is blocked. If no condition is specified, ~!done?~ is used by default, which means b= lock if any target heading isn't done. =20 -*** done +*** Heading is DONE :PROPERTIES: :CUSTOM_ID: done :END: @@ -932,7 +980,7 @@ any target heading isn't done. =20 Blocks the source heading if any target heading is DONE. =20 -*** headings +*** File Has Headings :PROPERTIES: :CUSTOM_ID: headings :END: @@ -948,7 +996,7 @@ org-file("refile.org") headings? =20 The above example blocks if refile.org has any headings. =20 -*** todo-state +*** Heading TODO State :PROPERTIES: :CUSTOM_ID: todo-state :END: @@ -959,7 +1007,7 @@ Blocks if any target heading has TODO state set to S= TATE. =20 STATE may be a string or a symbol. =20 -*** variable-set +*** Lisp Variable Set :PROPERTIES: :CUSTOM_ID: variable-set :END: @@ -971,11 +1019,12 @@ against VALUE. Block the source heading if VARIAB= LE =3D VALUE. =20 VARIABLE should be a symbol, and VALUE is any valid lisp expression. =20 -#+BEGIN_EXAMPLE -self variable-set?(test-variable 12) -#+END_EXAMPLE +Examples: =20 -*** has-property +- self variable-set?(test-variable 12) :: Blocks if the variable ~test-v= ariable~ is set to 12. +- self variable-set?(buffer-file-name "org-edna.org") :: Blocks if the v= ariable ~buffer-file-name~ is set to "org-edna.org". + +*** Heading Has Property :PROPERTIES: :CUSTOM_ID: has-property :END: @@ -984,7 +1033,25 @@ self variable-set?(test-variable 12) =20 Tests each target for the property PROPERTY, and blocks if it's set to V= ALUE. =20 -*** re-search +Example: + +#+begin_src org +,* TODO Take Shower + :PROPERTIES: + :COUNT: 1 + :TRIGGER: self set-property!("COUNT" inc) todo!("TODO") + :END: +,* TODO Wash Towels + :PROPERTIES: + :BLOCKER: previous-sibling !has-property?("COUNT" "3") + :TRIGGER: previous-sibling set-property!("COUNT" "0") + :END: +#+end_src + +In this example, "Wash Towels" can't be completed until the user has sho= wered at +least three times. + +*** Regexp Search :PROPERTIES: :CUSTOM_ID: re-search :DESCRIPTION: Search for a regular expression From MAILER-DAEMON Sun Nov 25 14:10:11 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQznH-0007Z1-3C for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:10:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzn7-0007U4-Ab for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:10:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmv-0002jw-Ox for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:10:01 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmv-0002jb-EE for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:49 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id 5D8BF209C2; Sun, 25 Nov 2018 14:09:49 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 26d2a0d 11/13: Added has-tags? and matches? conditions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 26d2a0d716bbb7a92c288b8b78474e6e279bc9b0 Auto-Submitted: auto-generated Message-Id: <20181125190949.5D8BF209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:49 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:10:10 -0000 branch: master commit 26d2a0d716bbb7a92c288b8b78474e6e279bc9b0 Author: Ian Dunn Commit: Ian Dunn Added has-tags? and matches? conditions =20 * org-edna.el (org-edna-condition/has-tags?): New defun. (org-edna--heading-matches): New helper defun. (org-edna-condition/matches?): New defun. =20 * org-edna-tests.el: Refactored to consolidate common forms. (org-edna-protect-test-file): (org-edna-test-setup): (org-edna-with-point-at-test-heading): (org-edna-with-test-heading): New helper macros. (org-edna-test-children-marks): New helper function. (org-edna-doc-test/has-tags): (org-edna-doc-test/matches): (org-edna-doc-test/chain): New tests. =20 * org-edna.org (Checking Tags): (Matching Headings): Sections for new conditions. --- org-edna-tests.el | 1920 +++++++++++++++++++++++-----------------------= ------ org-edna-tests.org | 36 + org-edna.el | 33 +- org-edna.info | 215 +++--- org-edna.org | 55 +- 5 files changed, 1092 insertions(+), 1167 deletions(-) diff --git a/org-edna-tests.el b/org-edna-tests.el index 52c901a..b6adf15 100644 --- a/org-edna-tests.el +++ b/org-edna-tests.el @@ -69,6 +69,48 @@ (with-current-buffer (get-file-buffer org-edna-test-file) (revert-buffer nil t))) =20 +(defmacro org-edna-protect-test-file (&rest body) + (declare (indent 0)) + `(unwind-protect + (progn ,@body) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file))) + +(defmacro org-edna-test-setup (&rest body) + "Common settings for tests." + (declare (indent 0)) + ;; Override `current-time' so we can get a deterministic value + `(cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-= time)) + ;; Only use the test file in the agenda + (org-agenda-files `(,org-edna-test-file)) + ;; Ensure interactive modification of TODO states works. + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function) + ;; Inhibit messages if indicated + (inhibit-message org-edna-test-inhibit-messages)) + ,@body)) + +(defmacro org-edna-with-point-at-test-heading (heading-id &rest body) + (declare (indent 1)) + `(org-with-point-at (org-edna-find-test-heading ,heading-id) + ,@body)) + +(defmacro org-edna-with-test-heading (heading-id &rest body) + "Establish a test case with test heading HEADING-ID. + +HEADING-ID is a UUID string of a heading to use. + +Moves point to the heading, protects the test file, sets default +test settings, then runs BODY." + (declare (indent 1)) + `(org-edna-test-setup + (org-edna-protect-test-file + (org-edna-with-point-at-test-heading ,heading-id + ,@body)))) + (defun org-edna-find-test-heading (id) "Find the test heading with id ID. =20 @@ -97,8 +139,11 @@ This avoids org-id digging into its internal database= ." (dolist (pom poms) (org-edna-test-change-todo-state pom "TODO"))) =20 +(defun org-edna-test-children-marks () + (org-edna-collect-descendants nil)) + =0C -;;;; Parser Tests +;;; Parser Tests =20 (ert-deftest org-edna-parse-form-no-arguments () (let* ((input-string "test-string") @@ -469,48 +514,48 @@ This avoids org-id digging into its internal databa= se." (should (equal output-form expected-form)))) =20 =0C -;; Finders +;;; Finders =20 (defsubst org-edna-heading (pom) (org-with-point-at pom (org-get-heading t t t t))) =20 (ert-deftest org-edna-finder/match-single-arg () - (let* ((org-agenda-files `(,org-edna-test-file)) - (targets (org-edna-finder/match "test&1"))) - (should (=3D (length targets) 2)) - (should (string-equal (org-edna-heading (nth 0 targets)) "Tagged Hea= ding 1")) - (should (string-equal (org-edna-heading (nth 1 targets)) "Tagged Hea= ding 2")))) + (org-edna-test-setup + (let* ((targets (org-edna-finder/match "test&1"))) + (should (=3D (length targets) 2)) + (should (string-equal (org-edna-heading (nth 0 targets)) "Tagged H= eading 1")) + (should (string-equal (org-edna-heading (nth 1 targets)) "Tagged H= eading 2"))))) =20 (ert-deftest org-edna-finder/ids-single () - (let* ((org-agenda-files `(,org-edna-test-file)) - (test-id "caccd0a6-d400-410a-9018-b0635b07a37e") - (targets (org-edna-finder/ids test-id))) - (should (=3D (length targets) 1)) - (should (string-equal (org-edna-heading (nth 0 targets)) "Blocking T= est")) - (should (string-equal (org-entry-get (nth 0 targets) "ID") test-id))= )) + (org-edna-test-setup + (let* ((test-id "caccd0a6-d400-410a-9018-b0635b07a37e") + (targets (org-edna-finder/ids test-id))) + (should (=3D (length targets) 1)) + (should (string-equal (org-edna-heading (nth 0 targets)) "Blocking= Test")) + (should (string-equal (org-entry-get (nth 0 targets) "ID") test-id= ))))) =20 (ert-deftest org-edna-finder/ids-multiple () - (let* ((org-agenda-files `(,org-edna-test-file)) - (test-ids '("0d491588-7da3-43c5-b51a-87fbd34f79f7" - "b010cbad-60dc-46ef-a164-eb155e62cbb2")) - (targets (apply 'org-edna-finder/ids test-ids))) - (should (=3D (length targets) 2)) - (should (string-equal (org-edna-heading (nth 0 targets)) "ID Heading= 1")) - (should (string-equal (org-entry-get (nth 0 targets) "ID") (nth 0 te= st-ids))) - (should (string-equal (org-edna-heading (nth 1 targets)) "ID Heading= 2")) - (should (string-equal (org-entry-get (nth 1 targets) "ID") (nth 1 te= st-ids))))) + (org-edna-test-setup + (let* ((test-ids '("0d491588-7da3-43c5-b51a-87fbd34f79f7" + "b010cbad-60dc-46ef-a164-eb155e62cbb2")) + (targets (apply 'org-edna-finder/ids test-ids))) + (should (=3D (length targets) 2)) + (should (string-equal (org-edna-heading (nth 0 targets)) "ID Headi= ng 1")) + (should (string-equal (org-entry-get (nth 0 targets) "ID") (nth 0 = test-ids))) + (should (string-equal (org-edna-heading (nth 1 targets)) "ID Headi= ng 2")) + (should (string-equal (org-entry-get (nth 1 targets) "ID") (nth 1 = test-ids)))))) =20 (ert-deftest org-edna-finder/match-blocker () - (let* ((org-agenda-files `(,org-edna-test-file)) - (heading (org-edna-find-test-heading "caccd0a6-d400-410a-9018-b= 0635b07a37e")) - (blocker (org-entry-get heading "BLOCKER")) - blocking-entry) - (should (string-equal "match(\"test&1\")" blocker)) - (org-with-point-at heading - (setq blocking-entry (org-edna-process-form blocker 'condition))) - (should (string-equal (substring-no-properties blocking-entry) - "TODO Tagged Heading 1 :1:test:")))) + (org-edna-test-setup + (let* ((heading (org-edna-find-test-heading "caccd0a6-d400-410a-9018= -b0635b07a37e")) + (blocker (org-entry-get heading "BLOCKER")) + blocking-entry) + (should (string-equal "match(\"test&1\")" blocker)) + (org-with-point-at heading + (setq blocking-entry (org-edna-process-form blocker 'condition))= ) + (should (string-equal (substring-no-properties blocking-entry) + "TODO Tagged Heading 1 :1:test:"))))) =20 (ert-deftest org-edna-finder/file () (let* ((targets (org-edna-finder/file org-edna-test-file))) @@ -1183,564 +1228,450 @@ This avoids org-id digging into its internal da= tabase." (should (not (org-edna--get-cache-entry 'org-edna-finder/match '= ("test&1")))))))) =20 =0C -;; Actions +;;; Actions =20 (ert-deftest org-edna-action/todo-test () - (let* ((org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51a-87= fbd34f79f7"))) - (unwind-protect - (org-with-point-at target - (org-edna-action/todo! nil "DONE") - (should (string-equal (org-entry-get nil "TODO") "DONE")) - (org-edna-action/todo! nil "TODO") - (should (string-equal (org-entry-get nil "TODO") "TODO")) - (org-edna-action/todo! nil 'DONE) - (should (string-equal (org-entry-get nil "TODO") "DONE")) - (org-edna-action/todo! nil 'TODO) - (should (string-equal (org-entry-get nil "TODO") "TODO"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7" + (org-edna-action/todo! nil "DONE") + (should (string-equal (org-entry-get nil "TODO") "DONE")) + (org-edna-action/todo! nil "TODO") + (should (string-equal (org-entry-get nil "TODO") "TODO")) + (org-edna-action/todo! nil 'DONE) + (should (string-equal (org-entry-get nil "TODO") "DONE")) + (org-edna-action/todo! nil 'TODO) + (should (string-equal (org-entry-get nil "TODO") "TODO")))) =20 ;; Scheduled =20 (ert-deftest org-edna-action-scheduled/wkdy () - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51= a-87fbd34f79f7"))) - (unwind-protect - (org-with-point-at target - (org-edna-action/scheduled! nil "Mon") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-17 Mon>")) - (org-edna-action/scheduled! nil 'rm) - (should (not (org-entry-get nil "SCHEDULED"))) - (org-edna-action/scheduled! nil "Mon 9:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-17 Mon 09:00>")) - (org-edna-action/scheduled! nil 'rm) - (should (not (org-entry-get nil "SCHEDULED")))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7" + (org-edna-action/scheduled! nil "Mon") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-17 Mon>")) + (org-edna-action/scheduled! nil 'rm) + (should (not (org-entry-get nil "SCHEDULED"))) + (org-edna-action/scheduled! nil "Mon 9:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-17 Mon 09:00>")) + (org-edna-action/scheduled! nil 'rm) + (should (not (org-entry-get nil "SCHEDULED"))))) =20 (ert-deftest org-edna-action-scheduled/cp () - (let* ((org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51a-87= fbd34f79f7")) - (source (org-edna-find-test-heading "97e6b0f0-40c4-464f-b760-6e= 5ca9744eb5")) - (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "rem= ove")))) - (unwind-protect - (org-with-point-at target - (dolist (pair pairs) - (org-edna-action/scheduled! source (car pair)) - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - (org-edna-action/scheduled! source (cdr pair)) - (should (not (org-entry-get nil "SCHEDULED"))))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7" + (let* ((source (org-edna-find-test-heading "97e6b0f0-40c4-464f-b760-= 6e5ca9744eb5")) + (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "r= emove")))) + (dolist (pair pairs) + (org-edna-action/scheduled! source (car pair)) + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + (org-edna-action/scheduled! source (cdr pair)) + (should (not (org-entry-get nil "SCHEDULED"))))))) =20 (ert-deftest org-edna-action-scheduled/inc () - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) - (unwind-protect - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; Increment 1 minute - (org-edna-action/scheduled! nil "+1M") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:01>")) - ;; Decrement 1 minute - (org-edna-action/scheduled! nil "-1M") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; +1 day - (org-edna-action/scheduled! nil "+1d") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-16 Sun 00:00>")) - ;; +1 hour from current time - (org-edna-action/scheduled! nil "++1h") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 01:00>")) - ;; Back to Saturday - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; -1 day to Friday - (org-edna-action/scheduled! nil "-1d") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-14 Fri 00:00>")) - ;; Increment two days to the next weekday - (org-edna-action/scheduled! nil "+2wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-17 Mon 00:00>")) - ;; Increment one day, expected to land on a weekday - (org-edna-action/scheduled! nil "+1wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-18 Tue 00:00>")) - ;; Move forward 8 days, then backward until we find a weekend - (org-edna-action/scheduled! nil "+8d -wknd") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-23 Sun 00:00>")) - ;; Move forward one week, then forward until we find a weekday - ;; (org-edna-action/scheduled! nil "+1w +wkdy") - ;; (should (string-equal (org-entry-get nil "SCHEDULED") - ;; "<2000-01-31 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; Increment 1 minute + (org-edna-action/scheduled! nil "+1M") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:01>")) + ;; Decrement 1 minute + (org-edna-action/scheduled! nil "-1M") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; +1 day + (org-edna-action/scheduled! nil "+1d") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-16 Sun 00:00>")) + ;; +1 hour from current time + (org-edna-action/scheduled! nil "++1h") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 01:00>")) + ;; Back to Saturday + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; -1 day to Friday + (org-edna-action/scheduled! nil "-1d") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-14 Fri 00:00>")) + ;; Increment two days to the next weekday + (org-edna-action/scheduled! nil "+2wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-17 Mon 00:00>")) + ;; Increment one day, expected to land on a weekday + (org-edna-action/scheduled! nil "+1wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-18 Tue 00:00>")) + ;; Move forward 8 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+8d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + ;; (org-edna-action/scheduled! nil "+1w +wkdy") + ;; (should (string-equal (org-entry-get nil "SCHEDULED") + ;; "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")))) =20 (ert-deftest org-edna-action-scheduled/landing () "Test landing arguments to scheduled increment." - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) - (unwind-protect - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; Move forward 10 days, then backward until we find a weekend - (org-edna-action/scheduled! nil "+10d -wknd") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-23 Sun 00:00>")) - ;; Move forward one week, then forward until we find a weekday - (org-edna-action/scheduled! nil "+1w +wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-31 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/scheduled! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")))) =20 (ert-deftest org-edna-action-scheduled/landing-no-hour () "Test landing arguments to scheduled increment, without hour." - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "caf27724-0887-4565-976= 5-ed2f1edcfb16"))) - (unwind-protect - (org-with-point-at target - ;; Time starts at Jan 1, 2017 - (org-edna-action/scheduled! nil "2017-01-01 Sun") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-01 Sun>")) - ;; Move forward 10 days, then backward until we find a weekend - (org-edna-action/scheduled! nil "+10d -wknd") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-08 Sun>")) - ;; Move forward one week, then forward until we find a weekday - (org-edna-action/scheduled! nil "+1w +wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-16 Mon>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2017-01-01 Sun") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-01 Sun>"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "caf27724-0887-4565-9765-ed2f1edcfb16" + ;; Time starts at Jan 1, 2017 + (org-edna-action/scheduled! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-01 Sun>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-08 Sun>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/scheduled! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-16 Mon>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-01 Sun>")))) =20 (ert-deftest org-edna-action-scheduled/float () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) - (unwind-protect - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; The third Tuesday of next month (Feb 15th) - (org-edna-action/scheduled! nil "float 3 Tue") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-02-15 Tue 00:00>")) - ;; The second Friday of the following May (May 12th) - (org-edna-action/scheduled! nil "float 2 5 May") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-05-12 Fri 00:00>")) - ;; Move forward to the second Wednesday of the next month (Jun= e 14th) - (org-edna-action/scheduled! nil "float 2 Wednesday") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-06-14 Wed 00:00>")) - ;; Move forward to the first Thursday in the following Jan (Ja= n 4th, 2001) - (org-edna-action/scheduled! nil "float 1 4 Jan") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2001-01-04 Thu 00:00>")) - ;; The fourth Monday in Feb, 2000 (Feb 28th) - (org-edna-action/scheduled! nil "float ++4 monday") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-02-28 Mon 00:00>")) - ;; The second Monday after Mar 12th, 2000 (Mar 20th) - (org-edna-action/scheduled! nil "float 2 monday Mar 12") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-03-20 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; The third Tuesday of next month (Feb 15th) + (org-edna-action/scheduled! nil "float 3 Tue") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-02-15 Tue 00:00>")) + ;; The second Friday of the following May (May 12th) + (org-edna-action/scheduled! nil "float 2 5 May") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-05-12 Fri 00:00>")) + ;; Move forward to the second Wednesday of the next month (June 14th= ) + (org-edna-action/scheduled! nil "float 2 Wednesday") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-06-14 Wed 00:00>")) + ;; Move forward to the first Thursday in the following Jan (Jan 4th,= 2001) + (org-edna-action/scheduled! nil "float 1 4 Jan") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2001-01-04 Thu 00:00>")) + ;; The fourth Monday in Feb, 2000 (Feb 28th) + (org-edna-action/scheduled! nil "float ++4 monday") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-02-28 Mon 00:00>")) + ;; The second Monday after Mar 12th, 2000 (Mar 20th) + (org-edna-action/scheduled! nil "float 2 monday Mar 12") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-03-20 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")))) =20 (ert-deftest org-edna-action-deadline/wkdy () - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51= a-87fbd34f79f7"))) - (unwind-protect - (org-with-point-at target - (org-edna-action/deadline! nil "Mon") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-17 Mon>")) - (org-edna-action/deadline! nil 'rm) - (should (not (org-entry-get nil "DEADLINE"))) - (org-edna-action/deadline! nil "Mon 9:00") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-17 Mon 09:00>")) - (org-edna-action/deadline! nil 'rm) - (should (not (org-entry-get nil "DEADLINE")))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7" + (org-edna-action/deadline! nil "Mon") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-17 Mon>")) + (org-edna-action/deadline! nil 'rm) + (should (not (org-entry-get nil "DEADLINE"))) + (org-edna-action/deadline! nil "Mon 9:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-17 Mon 09:00>")) + (org-edna-action/deadline! nil 'rm) + (should (not (org-entry-get nil "DEADLINE"))))) =20 (ert-deftest org-edna-action-deadline/cp () - (let* ((org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "0d491588-7da3-43c5-b51a-87= fbd34f79f7")) - (source (org-edna-find-test-heading "97e6b0f0-40c4-464f-b760-6e= 5ca9744eb5")) - (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "rem= ove")))) - (unwind-protect - (org-with-point-at target - (dolist (pair pairs) - (org-edna-action/deadline! source (car pair)) - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 00:00>")) - (org-edna-action/deadline! source (cdr pair)) - (should (not (org-entry-get nil "DEADLINE"))))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7" + (let* ((source (org-edna-find-test-heading "97e6b0f0-40c4-464f-b760-= 6e5ca9744eb5")) + (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "r= emove")))) + (dolist (pair pairs) + (org-edna-action/deadline! source (car pair)) + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + (org-edna-action/deadline! source (cdr pair)) + (should (not (org-entry-get nil "DEADLINE"))))))) =20 (ert-deftest org-edna-action-deadline/inc () - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) - (unwind-protect - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 00:00>")) - ;; Increment 1 minute - (org-edna-action/deadline! nil "+1M") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 00:01>")) - ;; Decrement 1 minute - (org-edna-action/deadline! nil "-1M") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 00:00>")) - ;; +1 day - (org-edna-action/deadline! nil "+1d") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-16 Sun 00:00>")) - ;; +1 hour from current time - (org-edna-action/deadline! nil "++1h") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 01:00>")) - ;; Back to Saturday - (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 00:00>")) - ;; -1 day to Friday - (org-edna-action/deadline! nil "-1d") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-14 Fri 00:00>")) - ;; Increment two days to the next weekday - (org-edna-action/deadline! nil "+2wkdy") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-17 Mon 00:00>")) - ;; Increment one day, expected to land on a weekday - (org-edna-action/deadline! nil "+1wkdy") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-18 Tue 00:00>")) - ;; Move forward 8 days, then backward until we find a weekend - (org-edna-action/deadline! nil "+8d -wknd") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-23 Sun 00:00>")) - ;; Move forward one week, then forward until we find a weekday - ;; (org-edna-action/deadline! nil "+1w +wkdy") - ;; (should (string-equal (org-entry-get nil "DEADLINE") - ;; "<2000-01-31 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 00:00>"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; Increment 1 minute + (org-edna-action/deadline! nil "+1M") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:01>")) + ;; Decrement 1 minute + (org-edna-action/deadline! nil "-1M") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; +1 day + (org-edna-action/deadline! nil "+1d") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-16 Sun 00:00>")) + ;; +1 hour from current time + (org-edna-action/deadline! nil "++1h") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 01:00>")) + ;; Back to Saturday + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; -1 day to Friday + (org-edna-action/deadline! nil "-1d") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-14 Fri 00:00>")) + ;; Increment two days to the next weekday + (org-edna-action/deadline! nil "+2wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-17 Mon 00:00>")) + ;; Increment one day, expected to land on a weekday + (org-edna-action/deadline! nil "+1wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-18 Tue 00:00>")) + ;; Move forward 8 days, then backward until we find a weekend + (org-edna-action/deadline! nil "+8d -wknd") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + ;; (org-edna-action/deadline! nil "+1w +wkdy") + ;; (should (string-equal (org-entry-get nil "DEADLINE") + ;; "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")))) =20 (ert-deftest org-edna-action-deadline/landing () "Test landing arguments to deadline increment." - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) - (unwind-protect - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 00:00>")) - ;; Move forward 10 days, then backward until we find a weekend - (org-edna-action/deadline! nil "+10d -wknd") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-23 Sun 00:00>")) - ;; Move forward one week, then forward until we find a weekday - (org-edna-action/deadline! nil "+1w +wkdy") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-31 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 00:00>"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/deadline! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/deadline! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")))) =20 (ert-deftest org-edna-action-deadline/landing-no-hour () "Test landing arguments to deadline increment, without hour." - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (inhibit-message org-edna-test-inhibit-messages) - (target (org-edna-find-test-heading "caf27724-0887-4565-976= 5-ed2f1edcfb16"))) - (unwind-protect - (org-with-point-at target - ;; Time starts at Jan 1, 2017 - (org-edna-action/deadline! nil "2017-01-01 Sun") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2017-01-01 Sun>")) - ;; Move forward 10 days, then backward until we find a weekend - (org-edna-action/deadline! nil "+10d -wknd") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2017-01-08 Sun>")) - ;; Move forward one week, then forward until we find a weekday - (org-edna-action/deadline! nil "+1w +wkdy") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2017-01-16 Mon>")) - ;; Back to Saturday for other tests - (org-edna-action/deadline! nil "2017-01-01 Sun") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2017-01-01 Sun>"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "caf27724-0887-4565-9765-ed2f1edcfb16" + ;; Time starts at Jan 1, 2017 + (org-edna-action/deadline! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-01 Sun>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/deadline! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-08 Sun>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/deadline! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-16 Mon>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-01 Sun>")))) =20 (ert-deftest org-edna-action-deadline/float () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (inhibit-message org-edna-test-inhibit-messages) - (org-agenda-files `(,org-edna-test-file)) - (target (org-edna-find-test-heading "97e6b0f0-40c4-464f-b76= 0-6e5ca9744eb5"))) - (unwind-protect - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 00:00>")) - ;; The third Tuesday of next month (Feb 15th) - (org-edna-action/deadline! nil "float 3 Tue") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-02-15 Tue 00:00>")) - ;; The second Friday of the following May (May 12th) - (org-edna-action/deadline! nil "float 2 5 May") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-05-12 Fri 00:00>")) - ;; Move forward to the second Wednesday of the next month (Jun= e 14th) - (org-edna-action/deadline! nil "float 2 Wednesday") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-06-14 Wed 00:00>")) - ;; Move forward to the first Thursday in the following Jan (Ja= n 4th, 2001) - (org-edna-action/deadline! nil "float 1 4 Jan") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2001-01-04 Thu 00:00>")) - ;; The fourth Monday in Feb, 2000 (Feb 28th) - (org-edna-action/deadline! nil "float ++4 monday") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-02-28 Mon 00:00>")) - ;; The second Monday after Mar 12th, 2000 (Mar 20th) - (org-edna-action/deadline! nil "float 2 monday Mar 12") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-03-20 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "DEADLINE") - "<2000-01-15 Sat 00:00>"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; The third Tuesday of next month (Feb 15th) + (org-edna-action/deadline! nil "float 3 Tue") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-02-15 Tue 00:00>")) + ;; The second Friday of the following May (May 12th) + (org-edna-action/deadline! nil "float 2 5 May") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-05-12 Fri 00:00>")) + ;; Move forward to the second Wednesday of the next month (June 14th= ) + (org-edna-action/deadline! nil "float 2 Wednesday") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-06-14 Wed 00:00>")) + ;; Move forward to the first Thursday in the following Jan (Jan 4th,= 2001) + (org-edna-action/deadline! nil "float 1 4 Jan") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2001-01-04 Thu 00:00>")) + ;; The fourth Monday in Feb, 2000 (Feb 28th) + (org-edna-action/deadline! nil "float ++4 monday") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-02-28 Mon 00:00>")) + ;; The second Monday after Mar 12th, 2000 (Mar 20th) + (org-edna-action/deadline! nil "float 2 monday Mar 12") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-03-20 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")))) =20 (ert-deftest org-edna-action-tag () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) - (inhibit-message org-edna-test-inhibit-messages)) - (unwind-protect - (org-with-point-at pom - (org-edna-action/tag! nil "tag") - (should (equal (org-get-tags) '("tag"))) - (org-edna-action/tag! nil "") - (should (equal (org-get-tags) '("")))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/tag! nil "tag") + (should (equal (org-get-tags) '("tag"))) + (org-edna-action/tag! nil "") + (should (equal (org-get-tags) '(""))))) =20 (ert-deftest org-edna-action-property () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) - (inhibit-message org-edna-test-inhibit-messages)) - (unwind-protect - (org-with-point-at pom - (org-edna-action/set-property! nil "TEST" "1") - (should (equal (org-entry-get nil "TEST") "1")) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/set-property! nil "TEST" "1") + (should (equal (org-entry-get nil "TEST") "1")) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST")))) =20 (ert-deftest org-edna-action-property/inc-dec () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) - (inhibit-message org-edna-test-inhibit-messages)) - (unwind-protect - (org-with-point-at pom - (org-edna-action/set-property! nil "TEST" "1") - (should (equal (org-entry-get nil "TEST") "1")) - (org-edna-action/set-property! nil "TEST" 'inc) - (should (equal (org-entry-get nil "TEST") "2")) - (org-edna-action/set-property! nil "TEST" 'dec) - (should (equal (org-entry-get nil "TEST") "1")) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST")) - (should-error (org-edna-action/set-property! nil "TEST" 'inc)) - (should-error (org-edna-action/set-property! nil "TEST" 'dec)) - (org-edna-action/set-property! nil "TEST" "a") - (should (equal (org-entry-get nil "TEST") "a")) - (should-error (org-edna-action/set-property! nil "TEST" 'inc)) - (should-error (org-edna-action/set-property! nil "TEST" 'dec)) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/set-property! nil "TEST" "1") + (should (equal (org-entry-get nil "TEST") "1")) + (org-edna-action/set-property! nil "TEST" 'inc) + (should (equal (org-entry-get nil "TEST") "2")) + (org-edna-action/set-property! nil "TEST" 'dec) + (should (equal (org-entry-get nil "TEST") "1")) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST")) + (should-error (org-edna-action/set-property! nil "TEST" 'inc)) + (should-error (org-edna-action/set-property! nil "TEST" 'dec)) + (org-edna-action/set-property! nil "TEST" "a") + (should (equal (org-entry-get nil "TEST") "a")) + (should-error (org-edna-action/set-property! nil "TEST" 'inc)) + (should-error (org-edna-action/set-property! nil "TEST" 'dec)) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST")))) =20 (ert-deftest org-edna-action-property/next-prev () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) - (inhibit-message org-edna-test-inhibit-messages)) - (unwind-protect - (org-with-point-at pom - (org-edna-action/set-property! nil "TEST" "a") - (should (equal (org-entry-get nil "TEST") "a")) - (should-error (org-edna-action/set-property! nil "TEST" 'next)= ) - (should-error (org-edna-action/set-property! nil "TEST" 'prev)= ) - (should-error (org-edna-action/set-property! nil "TEST" 'previ= ous)) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST")) - ;; Test moving forwards - (org-edna-action/set-property! nil "COUNTER" "a") - (should (equal (org-entry-get nil "COUNTER") "a")) - (org-edna-action/set-property! nil "COUNTER" 'next) - (should (equal (org-entry-get nil "COUNTER") "b")) - ;; Test moving forwards past the last one - (org-edna-action/set-property! nil "COUNTER" "d") - (should (equal (org-entry-get nil "COUNTER") "d")) - (org-edna-action/set-property! nil "COUNTER" 'next) - (should (equal (org-entry-get nil "COUNTER") "a")) - ;; Test moving backwards past the first one - (org-edna-action/set-property! nil "COUNTER" 'prev) - (should (equal (org-entry-get nil "COUNTER") "d")) - ;; Test moving backwards normally - (org-edna-action/set-property! nil "COUNTER" 'previous) - (should (equal (org-entry-get nil "COUNTER") "c")) - (org-edna-action/delete-property! nil "COUNTER") - (should-not (org-entry-get nil "COUNTER"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/set-property! nil "TEST" "a") + (should (equal (org-entry-get nil "TEST") "a")) + (should-error (org-edna-action/set-property! nil "TEST" 'next)) + (should-error (org-edna-action/set-property! nil "TEST" 'prev)) + (should-error (org-edna-action/set-property! nil "TEST" 'previous)) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST")) + ;; Test moving forwards + (org-edna-action/set-property! nil "COUNTER" "a") + (should (equal (org-entry-get nil "COUNTER") "a")) + (org-edna-action/set-property! nil "COUNTER" 'next) + (should (equal (org-entry-get nil "COUNTER") "b")) + ;; Test moving forwards past the last one + (org-edna-action/set-property! nil "COUNTER" "d") + (should (equal (org-entry-get nil "COUNTER") "d")) + (org-edna-action/set-property! nil "COUNTER" 'next) + (should (equal (org-entry-get nil "COUNTER") "a")) + ;; Test moving backwards past the first one + (org-edna-action/set-property! nil "COUNTER" 'prev) + (should (equal (org-entry-get nil "COUNTER") "d")) + ;; Test moving backwards normally + (org-edna-action/set-property! nil "COUNTER" 'previous) + (should (equal (org-entry-get nil "COUNTER") "c")) + (org-edna-action/delete-property! nil "COUNTER") + (should-not (org-entry-get nil "COUNTER")))) =20 (ert-deftest org-edna-action-clock () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) - (inhibit-message org-edna-test-inhibit-messages)) - (unwind-protect - (org-with-point-at pom - (org-edna-action/clock-in! nil) - (should (org-clocking-p)) - (should (equal org-clock-hd-marker pom)) - (org-edna-action/clock-out! nil) - (should-not (org-clocking-p))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/clock-in! nil) + (should (org-clocking-p)) + (should (equal org-clock-hd-marker (point-marker))) + (org-edna-action/clock-out! nil) + (should-not (org-clocking-p)))) =20 (ert-deftest org-edna-action-priority () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) - (inhibit-message org-edna-test-inhibit-messages) - (org-lowest-priority ?C) - (org-highest-priority ?A) - (org-default-priority ?B)) - (unwind-protect - (org-with-point-at pom - (org-edna-action/set-priority! nil "A") - (should (equal (org-entry-get nil "PRIORITY") "A")) - (org-edna-action/set-priority! nil 'down) - (should (equal (org-entry-get nil "PRIORITY") "B")) - (org-edna-action/set-priority! nil 'up) - (should (equal (org-entry-get nil "PRIORITY") "A")) - (org-edna-action/set-priority! nil ?C) - (should (equal (org-entry-get nil "PRIORITY") "C")) - (org-edna-action/set-priority! nil 'remove) - (should (equal (org-entry-get nil "PRIORITY") "B"))) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (let ((org-lowest-priority ?C) + (org-highest-priority ?A) + (org-default-priority ?B)) + (org-edna-action/set-priority! nil "A") + (should (equal (org-entry-get nil "PRIORITY") "A")) + (org-edna-action/set-priority! nil 'down) + (should (equal (org-entry-get nil "PRIORITY") "B")) + (org-edna-action/set-priority! nil 'up) + (should (equal (org-entry-get nil "PRIORITY") "A")) + (org-edna-action/set-priority! nil ?C) + (should (equal (org-entry-get nil "PRIORITY") "C")) + (org-edna-action/set-priority! nil 'remove) + (should (equal (org-entry-get nil "PRIORITY") "B"))))) =20 (ert-deftest org-edna-action-effort () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) - (inhibit-message org-edna-test-inhibit-messages)) - (unwind-protect - (org-with-point-at pom - (org-edna-action/set-effort! nil "0:01") - (should (equal (org-entry-get nil "EFFORT") "0:01")) - (org-edna-action/set-effort! nil 'increment) - (should (equal (org-entry-get nil "EFFORT") "0:02")) - (org-entry-delete nil "EFFORT")) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/set-effort! nil "0:01") + (should (equal (org-entry-get nil "EFFORT") "0:01")) + (org-edna-action/set-effort! nil 'increment) + (should (equal (org-entry-get nil "EFFORT") "0:02")) + (org-entry-delete nil "EFFORT"))) =20 (ert-deftest org-edna-action-archive () - (let* ((inhibit-message org-edna-test-inhibit-messages) - (org-archive-save-context-info '(todo)) - (pom (org-edna-find-test-heading org-edna-test-archive-heading)= ) - ;; Archive it to the same location - (org-archive-location "::** Archive") - (org-edna-prompt-for-archive nil)) - (unwind-protect - (org-with-point-at pom - (org-edna-action/archive! nil) - (should (equal (org-entry-get nil "ARCHIVE_TODO") "TODO")) - (org-entry-delete nil "ARCHIVE_TODO")) - (org-edna-test-restore-test-file)))) + (org-edna-with-test-heading org-edna-test-archive-heading + (let* ((org-archive-save-context-info '(todo)) + ;; Archive it to the same location + (org-archive-location "::** Archive") + ;; We're non-interactive, so no prompt. + (org-edna-prompt-for-archive nil)) + (org-edna-action/archive! nil) + (should (equal (org-entry-get nil "ARCHIVE_TODO") "TODO")) + (org-entry-delete nil "ARCHIVE_TODO")))) =20 (ert-deftest org-edna-action-chain () - (let ((inhibit-message org-edna-test-inhibit-messages) - (old-pom (org-edna-find-test-heading org-edna-test-id-heading-on= e)) - (new-pom (org-edna-find-test-heading org-edna-test-id-heading-tw= o))) - (unwind-protect - (progn - (org-entry-put old-pom "TEST" "1") - (org-with-point-at new-pom - (org-edna-action/chain! old-pom "TEST") - (should (equal (org-entry-get nil "TEST") "1"))) - (org-entry-delete old-pom "TEST") - (org-entry-delete new-pom "TEST")) - (org-edna-test-restore-test-file)))) + (org-edna-test-setup + (let ((old-pom (org-edna-find-test-heading org-edna-test-id-heading-= one)) + (new-pom (org-edna-find-test-heading org-edna-test-id-heading-= two))) + (org-edna-protect-test-file + (org-entry-put old-pom "TEST" "1") + (org-with-point-at new-pom + (org-edna-action/chain! old-pom "TEST") + (should (equal (org-entry-get nil "TEST") "1"))) + (org-entry-delete old-pom "TEST") + (org-entry-delete new-pom "TEST"))))) =20 =0C -;; Conditions +;;; Conditions =20 (defun org-edna-test-condition-form (func-sym pom-true pom-false block-t= rue block-false &rest args) - (let* ((inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at pom-true - (should-not (apply func-sym t args)) - (should (equal (apply func-sym nil args) block-true))) - (org-with-point-at pom-false - (should (equal (apply func-sym t args) block-false)) - (should-not (apply func-sym nil args))))) + (org-edna-test-setup + (let* ((block-true (or block-true (org-with-point-at pom-true (org-g= et-heading)))) + (block-false (or block-false (org-with-point-at pom-false (or= g-get-heading))))) + (org-with-point-at pom-true + (should-not (apply func-sym t args)) + (should (equal (apply func-sym nil args) block-true))) + (org-with-point-at pom-false + (should (equal (apply func-sym t args) block-false)) + (should-not (apply func-sym nil args)))))) =20 (ert-deftest org-edna-condition-done () (let* ((pom-done (org-edna-find-test-heading org-edna-test-id-heading-= four)) @@ -1817,8 +1748,32 @@ This avoids org-id digging into its internal datab= ase." block-true block-false string))) =20 +(ert-deftest org-edna-condition/has-tags () + (let* ((pom-true (org-edna-find-test-heading "0fa0d4dd-40f2-4251-a558-= 4c6e2898c2df")) + (pom-false (org-edna-find-test-heading org-edna-test-id-heading= -one)) + (block-true (org-with-point-at pom-true (org-get-heading))) + (block-false (org-with-point-at pom-false (org-get-heading)))) + (org-edna-test-condition-form 'org-edna-condition/has-tags? + pom-true pom-false + block-true block-false + "test"))) + +(ert-deftest org-edna-condition/matches-tags () + (org-edna-test-condition-form + 'org-edna-condition/matches? + (org-edna-find-test-heading "0fa0d4dd-40f2-4251-a558-4c6e2898c2df") + (org-edna-find-test-heading org-edna-test-id-heading-one) + nil nil + "1&test") + (org-edna-test-condition-form + 'org-edna-condition/matches? + (org-edna-find-test-heading org-edna-test-id-heading-four) + (org-edna-find-test-heading "0fa0d4dd-40f2-4251-a558-4c6e2898c2df") + nil nil + "TODO=3D=3D\"DONE\"")) + =0C -;; Consideration +;;; Consideration =20 (ert-deftest org-edna-consideration/any () (let ((blocks-all-blocking `("a" "c" "b")) @@ -1855,587 +1810,382 @@ This avoids org-id digging into its internal da= tabase." =0C ;;; Full Run-through Tests from the Documentation =20 +(defmacro org-edna-doc-test-setup (heading-id &rest body) + (declare (indent 1)) + `(org-edna-with-test-heading ,heading-id + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + ,@body))) + (ert-deftest org-edna-doc-test/ancestors () - (let* ((start-heading (org-edna-find-test-heading "24a0c3bb-7e69-4e9e-= bb98-5aba2ff17bb1")) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - (inhibit-message org-edna-test-inhibit-messages)) - (unwind-protect - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading5-pom (progn (org-next-visible-heading 1) (po= int-marker)))) - ;; Verify that we can't change the TODO state to DONE - (should (org-edna-test-check-block heading5-pom "Initial s= tate of heading 5")) - ;; Change the state at 4 to DONE - (org-edna-test-change-todo-state heading4-pom "DONE") - ;; Verify that ALL ancestors need to be changed - (should (org-edna-test-check-block heading5-pom "Heading 5= after parent changed")) - (org-edna-test-mark-done heading1-pom heading3-pom) - ;; Only need 1, 3, and 4 to change 5 - (should (not (org-edna-test-check-block heading5-pom - "Heading 5 after all= parents changed"))) - ;; Change the state back to TODO on all of them - (org-edna-test-mark-todo heading1-pom heading3-pom heading= 4-pom heading5-pom)))) - (org-edna-test-restore-test-file)))) + (org-edna-doc-test-setup "24a0c3bb-7e69-4e9e-bb98-5aba2ff17bb1" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading4-= pom ,heading5-pom) + (org-edna-test-children-marks))) + ;; Verify that we can't change the TODO state to DONE + (should (org-edna-test-check-block heading5-pom "Initial state of = heading 5")) + ;; Change the state at 4 to DONE + (org-edna-test-mark-done heading4-pom) + ;; Verify that ALL ancestors need to be changed + (should (org-edna-test-check-block heading5-pom "Heading 5 after p= arent changed")) + (org-edna-test-mark-done heading1-pom heading3-pom) + ;; Only need 1, 3, and 4 to change 5 + (should (not (org-edna-test-check-block heading5-pom + "Heading 5 after all parents= changed"))) + ;; Change the state back to TODO on all of them + (org-edna-test-mark-todo heading1-pom heading3-pom heading4-pom he= ading5-pom)))) =20 (ert-deftest org-edna-doc-test/ancestors-cache () - (let* ((start-heading (org-edna-find-test-heading "24a0c3bb-7e69-4e9e-= bb98-5aba2ff17bb1")) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Enable cache - (org-edna-finder-use-cache t) - (inhibit-message org-edna-test-inhibit-messages)) - (unwind-protect - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading5-pom (progn (org-next-visible-heading 1) (po= int-marker)))) - ;; Verify that we can't change the TODO state to DONE - (should (org-edna-test-check-block heading5-pom "Initial s= tate of heading 5")) - ;; Change the state at 4 to DONE - (org-edna-test-change-todo-state heading4-pom "DONE") - ;; Verify that ALL ancestors need to be changed - (should (org-edna-test-check-block heading5-pom "Heading 5= after parent changed")) - (org-edna-test-mark-done heading1-pom heading3-pom) - ;; Only need 1, 3, and 4 to change 5 - (should (not (org-edna-test-check-block heading5-pom - "Heading 5 after all= parents changed"))) - ;; Change the state back to TODO on all of them - (org-edna-test-mark-todo heading1-pom heading3-pom heading= 4-pom heading5-pom)))) - (org-edna-test-restore-test-file)))) + (let ((org-edna-finder-use-cache t)) + (org-edna-doc-test-setup "24a0c3bb-7e69-4e9e-bb98-5aba2ff17bb1" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading= 4-pom ,heading5-pom) + (org-edna-test-children-marks))) + ;; Verify that we can't change the TODO state to DONE + (should (org-edna-test-check-block heading5-pom "Initial state o= f heading 5")) + ;; Change the state at 4 to DONE + (org-edna-test-mark-done heading4-pom) + ;; Verify that ALL ancestors need to be changed + (should (org-edna-test-check-block heading5-pom "Heading 5 after= parent changed")) + (org-edna-test-mark-done heading1-pom heading3-pom) + ;; Only need 1, 3, and 4 to change 5 + (should (not (org-edna-test-check-block heading5-pom + "Heading 5 after all paren= ts changed"))) + ;; Change the state back to TODO on all of them + (org-edna-test-mark-todo heading1-pom heading3-pom heading4-pom = heading5-pom))))) =20 (ert-deftest org-edna-doc-test/descendants () - (let* ((start-heading (org-edna-find-test-heading "cc18dc74-00e8-4081-= b46f-e36800041fe7")) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - (inhibit-message org-edna-test-inhibit-messages)) - (unwind-protect - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading5-pom (progn (org-next-visible-heading 1) (po= int-marker)))) - (should (org-edna-test-check-block heading1-pom "Heading 1= initial state")) - ;; Change the state at 2 to DONE - (org-edna-test-mark-done heading2-pom) - ;; Verify that ALL descendants need to be changed - (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 2")) - ;; Try 3 - (org-edna-test-mark-done heading3-pom) - ;; Verify that ALL descendants need to be changed - (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 3")) - ;; Try 4 - (org-edna-test-mark-done heading4-pom) - ;; Verify that ALL descendants need to be changed - (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 4")) - ;; Try 5 - (org-edna-test-mark-done heading5-pom) - ;; Verify that ALL descendants need to be changed - (should (not (org-edna-test-check-block heading1-pom "Head= ing 1 after changing 5")))))) - (org-edna-test-restore-test-file)))) + (org-edna-doc-test-setup "cc18dc74-00e8-4081-b46f-e36800041fe7" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading4-= pom ,heading5-pom) + (org-edna-test-children-marks))) + (should (org-edna-test-check-block heading1-pom "Heading 1 initial= state")) + ;; Change the state at 2 to DONE + (org-edna-test-mark-done heading2-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after c= hanging 2")) + ;; Try 3 + (org-edna-test-mark-done heading3-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after c= hanging 3")) + ;; Try 4 + (org-edna-test-mark-done heading4-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after c= hanging 4")) + ;; Try 5 + (org-edna-test-mark-done heading5-pom) + ;; Verify that ALL descendants need to be changed + (should (not (org-edna-test-check-block heading1-pom "Heading 1 af= ter changing 5")))))) =20 (ert-deftest org-edna-doc-test/descendants-cache () - (let* ((start-heading (org-edna-find-test-heading "cc18dc74-00e8-4081-= b46f-e36800041fe7")) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Enable cache - (org-edna-finder-use-cache t) - (inhibit-message org-edna-test-inhibit-messages)) - (unwind-protect - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading5-pom (progn (org-next-visible-heading 1) (po= int-marker)))) - (should (org-edna-test-check-block heading1-pom "Heading 1= initial state")) - ;; Change the state at 2 to DONE - (org-edna-test-mark-done heading2-pom) - ;; Verify that ALL descendants need to be changed - (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 2")) - ;; Try 3 - (org-edna-test-mark-done heading3-pom) - ;; Verify that ALL descendants need to be changed - (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 3")) - ;; Try 4 - (org-edna-test-mark-done heading4-pom) - ;; Verify that ALL descendants need to be changed - (should (org-edna-test-check-block heading1-pom "Heading 1= after changing 4")) - ;; Try 5 - (org-edna-test-mark-done heading5-pom) - ;; Verify that ALL descendants need to be changed - (should (not (org-edna-test-check-block heading1-pom "Head= ing 1 after changing 5")))))) - (org-edna-test-restore-test-file)))) + (let ((org-edna-finder-use-cache t)) + (org-edna-doc-test-setup "cc18dc74-00e8-4081-b46f-e36800041fe7" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading= 4-pom ,heading5-pom) + (org-edna-test-children-marks))) + (should (org-edna-test-check-block heading1-pom "Heading 1 initi= al state")) + ;; Change the state at 2 to DONE + (org-edna-test-mark-done heading2-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after= changing 2")) + ;; Try 3 + (org-edna-test-mark-done heading3-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after= changing 3")) + ;; Try 4 + (org-edna-test-mark-done heading4-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after= changing 4")) + ;; Try 5 + (org-edna-test-mark-done heading5-pom) + ;; Verify that ALL descendants need to be changed + (should (not (org-edna-test-check-block heading1-pom "Heading 1 = after changing 5"))))))) =20 (ert-deftest org-edna-doc-test/laundry () "Test for the \"laundry\" example in the documentation." - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (start-heading (org-edna-find-test-heading "e57ce099-9f37-4= 7f4-a6bb-61a84eb1fbbe")) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function) - (inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (unwind-protect - (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker)))) - ;; Verify that headings 2, 3, and 4 are all blocked - (should (org-edna-test-check-block heading2-pom - "Initial attempt to cha= nge heading 2")) - (should (org-edna-test-check-block heading3-pom - "Initial attempt to cha= nge heading 3")) - (should (org-edna-test-check-block heading4-pom - "Initial attempt to cha= nge heading 4")) - ;; Mark heading 1 as DONE - (should (not (org-edna-test-check-block heading1-pom - "Set heading 1 to DO= NE"))) - ;; Only heading 2 should have a scheduled time - (should (string-equal (org-entry-get heading2-pom "SCHEDUL= ED") - "<2000-01-15 Sat 01:00>")) - (should (not (org-entry-get heading3-pom "SCHEDULED"))) - (should (not (org-entry-get heading4-pom "SCHEDULED"))) - ;; The others should still be blocked. - (should (org-edna-test-check-block heading3-pom - "Second attempt to chan= ge heading 3")) - (should (org-edna-test-check-block heading4-pom - "Second attempt to chan= ge heading 4")) - ;; Try changing heading 2 - (should (not (org-edna-test-check-block heading2-pom - "Set heading 2 to DO= NE"))) - (should (string-equal (org-entry-get heading3-pom "SCHEDUL= ED") - "<2000-01-16 Sun 09:00>")) - ;; 4 should still be blocked - (should (org-edna-test-check-block heading4-pom - "Second attempt to chan= ge heading 4"))) - ;; Change the test file back to its original state. - (org-edna-test-restore-test-file)))))) + (org-edna-doc-test-setup "e57ce099-9f37-47f4-a6bb-61a84eb1fbbe" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading4-= pom) + (org-edna-test-children-marks))) + ;; Verify that headings 2, 3, and 4 are all blocked + (should (org-edna-test-check-block heading2-pom + "Initial attempt to change head= ing 2")) + (should (org-edna-test-check-block heading3-pom + "Initial attempt to change head= ing 3")) + (should (org-edna-test-check-block heading4-pom + "Initial attempt to change head= ing 4")) + ;; Mark heading 1 as DONE + (should (not (org-edna-test-check-block heading1-pom + "Set heading 1 to DONE"))) + ;; Only heading 2 should have a scheduled time + (should (string-equal (org-entry-get heading2-pom "SCHEDULED") + "<2000-01-15 Sat 01:00>")) + (should (not (org-entry-get heading3-pom "SCHEDULED"))) + (should (not (org-entry-get heading4-pom "SCHEDULED"))) + ;; The others should still be blocked. + (should (org-edna-test-check-block heading3-pom + "Second attempt to change headi= ng 3")) + (should (org-edna-test-check-block heading4-pom + "Second attempt to change headi= ng 4")) + ;; Try changing heading 2 + (should (not (org-edna-test-check-block heading2-pom + "Set heading 2 to DONE"))) + (should (string-equal (org-entry-get heading3-pom "SCHEDULED") + "<2000-01-16 Sun 09:00>")) + ;; 4 should still be blocked + (should (org-edna-test-check-block heading4-pom + "Second attempt to change headi= ng 4"))))) =20 (ert-deftest org-edna-doc-test/laundry-cache () "Test for the \"laundry\" example in the documentation. =20 This version enables cache, ensuring that the repeated calls to the relative finders all still work while cache is enabled." - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (start-heading (org-edna-find-test-heading "e57ce099-9f37-4= 7f4-a6bb-61a84eb1fbbe")) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function) - ;; Enable cache - (org-edna-finder-use-cache t) - (inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (unwind-protect - (let* ((heading1-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading2-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading3-pom (progn (org-next-visible-heading 1) (po= int-marker))) - (heading4-pom (progn (org-next-visible-heading 1) (po= int-marker)))) - ;; Verify that headings 2, 3, and 4 are all blocked - (should (org-edna-test-check-block heading2-pom - "Initial attempt to cha= nge heading 2")) - (should (org-edna-test-check-block heading3-pom - "Initial attempt to cha= nge heading 3")) - (should (org-edna-test-check-block heading4-pom - "Initial attempt to cha= nge heading 4")) - ;; Mark heading 1 as DONE - (should (not (org-edna-test-check-block heading1-pom - "Set heading 1 to DO= NE"))) - ;; Only heading 2 should have a scheduled time - (should (string-equal (org-entry-get heading2-pom "SCHEDUL= ED") - "<2000-01-15 Sat 01:00>")) - (should (not (org-entry-get heading3-pom "SCHEDULED"))) - (should (not (org-entry-get heading4-pom "SCHEDULED"))) - ;; The others should still be blocked. - (should (org-edna-test-check-block heading3-pom - "Second attempt to chan= ge heading 3")) - (should (org-edna-test-check-block heading4-pom - "Second attempt to chan= ge heading 4")) - ;; Try changing heading 2 - (should (not (org-edna-test-check-block heading2-pom - "Set heading 2 to DO= NE"))) - (should (string-equal (org-entry-get heading3-pom "SCHEDUL= ED") - "<2000-01-16 Sun 09:00>")) - ;; 4 should still be blocked - (should (org-edna-test-check-block heading4-pom - "Second attempt to chan= ge heading 4"))) - ;; Change the test file back to its original state. - (org-edna-test-restore-test-file)))))) + (let ((org-edna-finder-use-cache t)) + (org-edna-doc-test-setup "e57ce099-9f37-47f4-a6bb-61a84eb1fbbe" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading= 4-pom) + (org-edna-test-children-marks))) + ;; Verify that headings 2, 3, and 4 are all blocked + (should (org-edna-test-check-block heading2-pom + "Initial attempt to change he= ading 2")) + (should (org-edna-test-check-block heading3-pom + "Initial attempt to change he= ading 3")) + (should (org-edna-test-check-block heading4-pom + "Initial attempt to change he= ading 4")) + ;; Mark heading 1 as DONE + (should (not (org-edna-test-check-block heading1-pom + "Set heading 1 to DONE"))) + ;; Only heading 2 should have a scheduled time + (should (string-equal (org-entry-get heading2-pom "SCHEDULED") + "<2000-01-15 Sat 01:00>")) + (should (not (org-entry-get heading3-pom "SCHEDULED"))) + (should (not (org-entry-get heading4-pom "SCHEDULED"))) + ;; The others should still be blocked. + (should (org-edna-test-check-block heading3-pom + "Second attempt to change hea= ding 3")) + (should (org-edna-test-check-block heading4-pom + "Second attempt to change hea= ding 4")) + ;; Try changing heading 2 + (should (not (org-edna-test-check-block heading2-pom + "Set heading 2 to DONE"))) + (should (string-equal (org-entry-get heading3-pom "SCHEDULED") + "<2000-01-16 Sun 09:00>")) + ;; 4 should still be blocked + (should (org-edna-test-check-block heading4-pom + "Second attempt to change hea= ding 4")))))) =20 (ert-deftest org-edna-doc-test/nightly () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (start-heading (org-edna-find-test-heading "8b6d9820-d943-4= 622-85c9-4a346e033453")) - ;; Only use the test file in the agenda - (org-agenda-files `(,org-edna-test-file)) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function) - (inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (unwind-protect - (let* ((nightly-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) - (lunch-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) - (door-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) - (dog-pom (progn (org-next-visible-heading 1) (poi= nt-marker)))) - ;; Verify that Nightly is blocked - (should (org-edna-test-check-block nightly-pom "Initial Ni= ghtly Check")) - ;; Check off Lunch, and verify that nightly is still block= ed - (org-edna-test-mark-done lunch-pom) - (should (org-edna-test-check-block nightly-pom "Nightly af= ter Lunch")) - ;; Check off Door, and verify that nightly is still blocke= d - (org-edna-test-mark-done door-pom) - (should (org-edna-test-check-block nightly-pom "Nightly af= ter Door")) - ;; Check off Dog. This should trigger the others. - (org-edna-test-mark-done dog-pom) - (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Nightly Trigger")) - (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Nightly Trigger")) - (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Nightly Trigger")) - (should (string-equal (org-entry-get nightly-pom "DEADLINE= ") - "<2000-01-16 Sun +1d>"))) - ;; Change the test file back to its original state. - (org-edna-test-restore-test-file)))))) + (org-edna-doc-test-setup "8b6d9820-d943-4622-85c9-4a346e033453" + (pcase-let* ((`(,nightly-pom ,lunch-pom ,door-pom ,dog-pom) + (org-edna-test-children-marks))) + ;; Verify that Nightly is blocked + (should (org-edna-test-check-block nightly-pom "Initial Nightly Ch= eck")) + ;; Check off Lunch, and verify that nightly is still blocked + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-check-block nightly-pom "Nightly after Lunc= h")) + ;; Check off Door, and verify that nightly is still blocked + (org-edna-test-mark-done door-pom) + (should (org-edna-test-check-block nightly-pom "Nightly after Door= ")) + ;; Check off Dog. This should trigger the others. + (org-edna-test-mark-done dog-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch after= Nightly Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after N= ightly Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after Nig= htly Trigger")) + (should (string-equal (org-entry-get nightly-pom "DEADLINE") + "<2000-01-16 Sun +1d>"))))) =20 (ert-deftest org-edna-doc-test/nightly-cache () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (start-heading (org-edna-find-test-heading "8b6d9820-d943-4= 622-85c9-4a346e033453")) - ;; Only use the test file in the agenda - (org-agenda-files `(,org-edna-test-file)) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function) - ;; Enable cache - (org-edna-finder-use-cache t) - (inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (unwind-protect - (let* ((nightly-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) - (lunch-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) - (door-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) - (dog-pom (progn (org-next-visible-heading 1) (poi= nt-marker)))) - ;; Verify that Nightly is blocked - (should (org-edna-test-check-block nightly-pom "Initial Ni= ghtly Check")) - ;; Check off Lunch, and verify that nightly is still block= ed - (org-edna-test-mark-done lunch-pom) - (should (org-edna-test-check-block nightly-pom "Nightly af= ter Lunch")) - ;; Check off Door, and verify that nightly is still blocke= d - (org-edna-test-mark-done door-pom) - (should (org-edna-test-check-block nightly-pom "Nightly af= ter Door")) - ;; Check off Dog. This should trigger the others. - (org-edna-test-mark-done dog-pom) - (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Nightly Trigger")) - (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Nightly Trigger")) - (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Nightly Trigger")) - (should (string-equal (org-entry-get nightly-pom "DEADLINE= ") - "<2000-01-16 Sun +1d>"))) - ;; Change the test file back to its original state. - (org-edna-test-restore-test-file)))))) + (let ((org-edna-finder-use-cache t)) + (org-edna-doc-test-setup "8b6d9820-d943-4622-85c9-4a346e033453" + (pcase-let* ((`(,nightly-pom ,lunch-pom ,door-pom ,dog-pom) + (org-edna-test-children-marks))) + ;; Verify that Nightly is blocked + (should (org-edna-test-check-block nightly-pom "Initial Nightly = Check")) + ;; Check off Lunch, and verify that nightly is still blocked + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-check-block nightly-pom "Nightly after Lu= nch")) + ;; Check off Door, and verify that nightly is still blocked + (org-edna-test-mark-done door-pom) + (should (org-edna-test-check-block nightly-pom "Nightly after Do= or")) + ;; Check off Dog. This should trigger the others. + (org-edna-test-mark-done dog-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch aft= er Nightly Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after= Nightly Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after N= ightly Trigger")) + (should (string-equal (org-entry-get nightly-pom "DEADLINE") + "<2000-01-16 Sun +1d>")))))) =20 (ert-deftest org-edna-doc-test/daily () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (start-heading (org-edna-find-test-heading "630805bb-a864-4= cdc-9a6f-0f126e887c66")) - ;; Only use the test file in the agenda - (org-agenda-files `(,org-edna-test-file)) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function) - (inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (unwind-protect - (let* ((daily-pom (progn (org-next-visible-heading 1) (point= -marker))) - (lunch-pom (progn (org-next-visible-heading 1) (point= -marker))) - (door-pom (progn (org-next-visible-heading 1) (point= -marker))) - (dog-pom (progn (org-next-visible-heading 1) (point= -marker)))) - ;; Check off Lunch. This should trigger the others. - (org-edna-test-mark-done lunch-pom) - (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Daily Trigger")) - (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Daily Trigger")) - (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Daily Trigger")) - (should (string-equal (org-entry-get daily-pom "DEADLINE") - "<2000-01-16 Sun +1d>")) - ;; Check off Door. This should trigger the others. - (org-edna-test-mark-done door-pom) - (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Door Trigger")) - (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Door Trigger")) - (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Door Trigger")) - (should (string-equal (org-entry-get daily-pom "DEADLINE") - "<2000-01-17 Mon +1d>")) - ;; Check off Dog. This should trigger the others. - (org-edna-test-mark-done dog-pom) - (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Dog Trigger")) - (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Dog Trigger")) - (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Dog Trigger")) - (should (string-equal (org-entry-get daily-pom "DEADLINE") - "<2000-01-18 Tue +1d>"))) - ;; Change the test file back to its original state. - (org-edna-test-restore-test-file)))))) + (org-edna-doc-test-setup "630805bb-a864-4cdc-9a6f-0f126e887c66" + (pcase-let* ((`(,daily-pom ,lunch-pom ,door-pom ,dog-pom) + (org-edna-test-children-marks))) + ;; Check off Lunch. This should trigger the others. + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch after= Daily Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after D= aily Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after Dai= ly Trigger")) + (should (string-equal (org-entry-get daily-pom "DEADLINE") + "<2000-01-16 Sun +1d>")) + ;; Check off Door. This should trigger the others. + (org-edna-test-mark-done door-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch after= Door Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after D= oor Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after Doo= r Trigger")) + (should (string-equal (org-entry-get daily-pom "DEADLINE") + "<2000-01-17 Mon +1d>")) + ;; Check off Dog. This should trigger the others. + (org-edna-test-mark-done dog-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch after= Dog Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after D= og Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after Dog= Trigger")) + (should (string-equal (org-entry-get daily-pom "DEADLINE") + "<2000-01-18 Tue +1d>"))))) =20 (ert-deftest org-edna-doc-test/weekly () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (start-heading (org-edna-find-test-heading "cf529a5e-1b0c-4= 0c3-8f85-fe2fc4df0ffd")) - ;; Only use the test file in the agenda - (org-agenda-files `(,org-edna-test-file)) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function) - (inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (unwind-protect - (let* ((weekly-pom (progn (org-next-visible-heading 1) (poin= t-marker))) - (lunch-pom (progn (org-next-visible-heading 1) (poin= t-marker))) - (door-pom (progn (org-next-visible-heading 1) (poin= t-marker))) - (dog-pom (progn (org-next-visible-heading 1) (poin= t-marker)))) - ;; Check off Lunch. This should trigger the others. - (org-edna-test-mark-done lunch-pom) - (should (org-edna-test-compare-todos lunch-pom "TODO" "Lun= ch after Weekly Trigger")) - (should (org-edna-test-compare-todos door-pom "TODO" "Door= after Weekly Trigger")) - (should (org-edna-test-compare-todos dog-pom "TODO" "Dog a= fter Weekly Trigger")) - (should (string-equal (org-entry-get weekly-pom "DEADLINE"= ) - "<2000-01-16 Sun +1d>"))) - ;; Change the test file back to its original state. - (org-edna-test-restore-test-file)))))) + (org-edna-doc-test-setup "cf529a5e-1b0c-40c3-8f85-fe2fc4df0ffd" + (pcase-let* ((`(,weekly-pom ,lunch-pom ,door-pom ,dog-pom) + (org-edna-test-children-marks))) + ;; Check off Lunch. This should trigger the others. + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch after= Weekly Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after W= eekly Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after Wee= kly Trigger")) + (should (string-equal (org-entry-get weekly-pom "DEADLINE") + "<2000-01-16 Sun +1d>"))))) =20 (ert-deftest org-edna-doc-test/basic-shower () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (start-heading (org-edna-find-test-heading "34d67756-927b-4= a21-a62d-7989bd138946")) - ;; Only use the test file in the agenda - (org-agenda-files `(,org-edna-test-file)) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function) - (inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (unwind-protect - (let* ((shower-pom (progn (org-next-visible-heading 1) (poin= t-marker))) - (towels-pom (progn (org-next-visible-heading 1) (poin= t-marker)))) - ;; Verify towels is blocked - (should (org-edna-test-check-block towels-pom "Initial Tow= els Check")) - ;; Check off "Take Shower" and verify that it incremented = the property - (org-edna-test-mark-done shower-pom) - (should (string-equal (org-entry-get shower-pom "COUNT") "= 1")) - ;; Verify towels is blocked - (should (org-edna-test-check-block towels-pom "Towels Chec= k, Count=3D1")) - ;; Check off "Take Shower" and verify that it incremented = the property - (org-edna-test-mark-done shower-pom) - (should (string-equal (org-entry-get shower-pom "COUNT") "= 2")) - ;; Verify towels is blocked - (should (org-edna-test-check-block towels-pom "Towels Chec= k, Count=3D2")) - ;; Check off "Take Shower" and verify that it incremented = the property - (org-edna-test-mark-done shower-pom) - (should (string-equal (org-entry-get shower-pom "COUNT") "= 3")) - ;; Verify that towels is no longer blocked. - (should (not (org-edna-test-check-block towels-pom "Towels= Check, Count=3D3"))) - ;; Verify that the property was reset. - (should (string-equal (org-entry-get shower-pom "COUNT") "= 0"))) - ;; Change the test file back to its original state. - (org-edna-test-restore-test-file)))))) + (org-edna-doc-test-setup "34d67756-927b-4a21-a62d-7989bd138946" + (pcase-let* ((`(,shower-pom ,towels-pom) (org-edna-test-children-mar= ks))) + ;; Verify towels is blocked + (should (org-edna-test-check-block towels-pom "Initial Towels Chec= k")) + ;; Check off "Take Shower" and verify that it incremented the prop= erty + (org-edna-test-mark-done shower-pom) + (should (string-equal (org-entry-get shower-pom "COUNT") "1")) + ;; Verify towels is blocked + (should (org-edna-test-check-block towels-pom "Towels Check, Count= =3D1")) + ;; Check off "Take Shower" and verify that it incremented the prop= erty + (org-edna-test-mark-done shower-pom) + (should (string-equal (org-entry-get shower-pom "COUNT") "2")) + ;; Verify towels is blocked + (should (org-edna-test-check-block towels-pom "Towels Check, Count= =3D2")) + ;; Check off "Take Shower" and verify that it incremented the prop= erty + (org-edna-test-mark-done shower-pom) + (should (string-equal (org-entry-get shower-pom "COUNT") "3")) + ;; Verify that towels is no longer blocked. + (should (not (org-edna-test-check-block towels-pom "Towels Check, = Count=3D3"))) + ;; Verify that the property was reset. + (should (string-equal (org-entry-get shower-pom "COUNT") "0"))))) =20 (ert-deftest org-edna-doc-test/snow-shoveling () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (start-heading (org-edna-find-test-heading "b1d89bd8-db96-4= 86e-874c-98e2b3a8cbf2")) - ;; Only use the test file in the agenda - (org-agenda-files `(,org-edna-test-file)) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function) - (inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (unwind-protect - (let* ((monday-pom (progn (org-next-visible-heading 1) (poin= t-marker))) - (tuesday-pom (progn (org-next-visible-heading 1) (poi= nt-marker))) - (wednesday-pom (progn (org-next-visible-heading 1) (p= oint-marker))) - (shovel-pom (progn (org-next-visible-heading 1) (poin= t-marker)))) - ;; Verify shovels is blocked - (should (org-edna-test-check-block shovel-pom "Initial Sho= vel Check")) - - ;; Mark Monday as done - (org-edna-test-mark-done monday-pom) - (should (not (org-edna-test-check-block shovel-pom "Shovel= after changing Monday"))) - ;; Reset - (org-edna-test-mark-todo monday-pom tuesday-pom wednesday-= pom shovel-pom) - - ;; Mark Tuesday as done - (org-edna-test-mark-done tuesday-pom) - (should (not (org-edna-test-check-block shovel-pom "Shovel= after changing Tuesday"))) - - ;; Reset - (org-edna-test-mark-todo monday-pom tuesday-pom wednesday-= pom shovel-pom) - ;; Mark Wednesday as done - (org-edna-test-mark-done wednesday-pom) - (should (not (org-edna-test-check-block shovel-pom "Shovel= after changing Wednesday")))) - ;; Change the test file back to its original state. - (org-edna-test-restore-test-file)))))) + (org-edna-doc-test-setup "b1d89bd8-db96-486e-874c-98e2b3a8cbf2" + (pcase-let* ((`(,monday-pom ,tuesday-pom ,wednesday-pom ,shovel-pom) + (org-edna-test-children-marks))) + ;; Verify shovels is blocked + (should (org-edna-test-check-block shovel-pom "Initial Shovel Chec= k")) + + ;; Mark Monday as done + (org-edna-test-mark-done monday-pom) + (should (not (org-edna-test-check-block shovel-pom "Shovel after c= hanging Monday"))) + ;; Reset + (org-edna-test-mark-todo monday-pom tuesday-pom wednesday-pom shov= el-pom) + + ;; Mark Tuesday as done + (org-edna-test-mark-done tuesday-pom) + (should (not (org-edna-test-check-block shovel-pom "Shovel after c= hanging Tuesday"))) + + ;; Reset + (org-edna-test-mark-todo monday-pom tuesday-pom wednesday-pom shov= el-pom) + ;; Mark Wednesday as done + (org-edna-test-mark-done wednesday-pom) + (should (not (org-edna-test-check-block shovel-pom "Shovel after c= hanging Wednesday")))))) =20 (ert-deftest org-edna-doc-test/consider-fraction () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (start-heading (org-edna-find-test-heading "7de5af8b-a226-4= 63f-8360-edd88b99462a")) - ;; Only use the test file in the agenda - (org-agenda-files `(,org-edna-test-file)) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function) - (inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (unwind-protect - (let* ((shovel-pom (progn (org-next-visible-heading 1) (poin= t-marker))) - (room-pom (progn (org-next-visible-heading 1) (point-= marker))) - (vacuum-pom (progn (org-next-visible-heading 1) (poin= t-marker))) - (lunch-pom (progn (org-next-visible-heading 1) (point= -marker))) - (edna-pom (progn (org-next-visible-heading 1) (point-= marker)))) - ;; Verify Edna is blocked - (should (org-edna-test-check-block edna-pom "Initial Edna = Check")) - - ;; Mark Shovel snow as done - (org-edna-test-mark-done shovel-pom) - ;; Verify Edna is still blocked - (should (org-edna-test-check-block edna-pom "Edna Check af= ter Shovel")) - - ;; Mark Vacuum as done - (org-edna-test-mark-done vacuum-pom) - ;; Verify Edna is still blocked - (should (org-edna-test-check-block edna-pom "Edna Check af= ter Vacuum")) - - ;; Mark Room as done - (org-edna-test-mark-done room-pom) - ;; Verify Edna is no longer blocked - (should (not (org-edna-test-check-block edna-pom "Edna Che= ck after Room")))) - ;; Change the test file back to its original state. - (org-edna-test-restore-test-file)))))) + (org-edna-doc-test-setup "7de5af8b-a226-463f-8360-edd88b99462a" + (pcase-let* ((`(,shovel-pom ,room-pom ,vacuum-pom ,lunch-pom ,edna-p= om) + (org-edna-test-children-marks))) + ;; Verify Edna is blocked + (should (org-edna-test-check-block edna-pom "Initial Edna Check")) + + ;; Mark Shovel snow as done + (org-edna-test-mark-done shovel-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check after Shov= el")) + + ;; Mark Vacuum as done + (org-edna-test-mark-done vacuum-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check after Vacu= um")) + + ;; Mark Room as done + (org-edna-test-mark-done room-pom) + ;; Verify Edna is no longer blocked + (should (not (org-edna-test-check-block edna-pom "Edna Check after= Room")))))) =20 (ert-deftest org-edna-doc-test/consider-number () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (start-heading (org-edna-find-test-heading "b79279f7-be3c-4= 5ac-96dc-6e962a5873d4")) - ;; Only use the test file in the agenda - (org-agenda-files `(,org-edna-test-file)) - (org-todo-keywords '((sequence "TODO" "|" "DONE"))) - ;; Only block based on Edna - (org-blocker-hook 'org-edna-blocker-function) - ;; Only trigger based on Edna - (org-trigger-hook 'org-edna-trigger-function) - (inhibit-message org-edna-test-inhibit-messages)) - (org-with-point-at start-heading - (save-restriction - ;; Only allow operating on the current tree - (org-narrow-to-subtree) - ;; Show the entire subtree - (outline-show-all) - (unwind-protect - (let* ((shovel-pom (progn (org-next-visible-heading 1) (poin= t-marker))) - (room-pom (progn (org-next-visible-heading 1) (point-= marker))) - (vacuum-pom (progn (org-next-visible-heading 1) (poin= t-marker))) - (lunch-pom (progn (org-next-visible-heading 1) (point= -marker))) - (edna-pom (progn (org-next-visible-heading 1) (point-= marker)))) - ;; Verify Edna is blocked - (should (org-edna-test-check-block edna-pom "Initial Edna = Check")) - - ;; Mark Shovel snow as done - (org-edna-test-mark-done shovel-pom) - ;; Verify Edna is still blocked - (should (org-edna-test-check-block edna-pom "Edna Check af= ter Shovel")) - - ;; Mark Vacuum as done - (org-edna-test-mark-done vacuum-pom) - ;; Verify Edna is still blocked - (should (org-edna-test-check-block edna-pom "Edna Check af= ter Vacuum")) - - ;; Mark Room as done - (org-edna-test-mark-done room-pom) - ;; Verify Edna is no longer blocked - (should (not (org-edna-test-check-block edna-pom "Edna Che= ck after Room")))) - ;; Change the test file back to its original state. - (org-edna-test-restore-test-file)))))) + (org-edna-doc-test-setup "b79279f7-be3c-45ac-96dc-6e962a5873d4" + (pcase-let* ((`(,shovel-pom ,room-pom ,vacuum-pom ,lunch-pom ,edna-p= om) + (org-edna-test-children-marks))) + ;; Verify Edna is blocked + (should (org-edna-test-check-block edna-pom "Initial Edna Check")) + + ;; Mark Shovel snow as done + (org-edna-test-mark-done shovel-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check after Shov= el")) + + ;; Mark Vacuum as done + (org-edna-test-mark-done vacuum-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check after Vacu= um")) + + ;; Mark Room as done + (org-edna-test-mark-done room-pom) + ;; Verify Edna is no longer blocked + (should (not (org-edna-test-check-block edna-pom "Edna Check after= Room")))))) + +(ert-deftest org-edna-doc-test/has-tags () + (org-edna-doc-test-setup "6885e932-2c3e-4f20-ac22-5f5a0e791d67" + (pcase-let* ((`(,first-pom ,second-pom ,third-pom) + (org-edna-test-children-marks))) + ;; Verify that 3 is blocked + (should (org-edna-test-check-block third-pom "Initial Check")) + + ;; Remove the tag from Task 1 + (org-with-point-at first-pom + (org-set-tags-to "")) + + ;; Verify that 3 is still blocked + (should (org-edna-test-check-block third-pom "Check after removing= tag1")) + + ;; Remove the tag from Task 2 + (org-with-point-at second-pom + (org-set-tags-to "")) + + ;; Verify that 3 is no longer blocked + (should (not (org-edna-test-check-block third-pom "Check after rem= oving tag2")))))) + +(ert-deftest org-edna-doc-test/matches () + (org-edna-doc-test-setup "8170bf82-c2ea-49e8-bd79-97a95176783f" + (pcase-let* ((`(,first-pom ,second-pom ,third-pom) (org-edna-test-ch= ildren-marks))) + ;; Verify that 3 is blocked + (should (org-edna-test-check-block third-pom "Initial Check")) + + ;; Set 1 to DONE + (org-edna-test-mark-done first-pom) + + ;; Verify that 3 is still blocked + (should (org-edna-test-check-block third-pom "Check after First")) + + ;; Set 2 to DONE + (org-edna-test-mark-done second-pom) + + ;; Verify that 3 is no longer blocked + (should (not (org-edna-test-check-block third-pom "Check after Sec= ond")))))) + +(ert-deftest org-edna-doc-test/chain () + (org-edna-doc-test-setup "1bd282ea-9238-47ea-9b4d-dafba19d278b" + (pcase-let* ((`(,first-pom ,second-pom) (org-edna-test-children-mark= s))) + ;; Set 1 to DONE + (org-edna-test-mark-done first-pom) + (should (string-equal (org-entry-get second-pom "COUNT") "2"))))) =20 (provide 'org-edna-tests) =20 diff --git a/org-edna-tests.org b/org-edna-tests.org index 35d5455..2819700 100644 --- a/org-edna-tests.org +++ b/org-edna-tests.org @@ -22,7 +22,13 @@ along with this program. If not, see . #+END_QUOTE * Test Pool ** TODO Tagged Heading 1 :1:t= est: +:PROPERTIES: +:ID: 0fa0d4dd-40f2-4251-a558-4c6e2898c2df +:END: ** TODO Tagged Heading 2 :1:t= est: +:PROPERTIES: +:ID: 30957f69-8c31-4a13-86ff-f0c5026fb65d +:END: ** TODO ID Heading 1 :PROPERTIES: :ID: 0d491588-7da3-43c5-b51a-87fbd34f79f7 @@ -312,3 +318,33 @@ DEADLINE: <2000-01-15 Sat +1d> :PROPERTIES: :BLOCKER: consider(2) rest-of-siblings-wrap :END: +** Has Tags +:PROPERTIES: +:ID: 6885e932-2c3e-4f20-ac22-5f5a0e791d67 +:END: +*** Task 1 :ta= g1: +*** Task 2 :tag3:ta= g2: +*** TODO Task 3 +:PROPERTIES: +:BLOCKER: rest-of-siblings-wrap has-tags?("tag1" "tag2") +:END: +** Matches +:PROPERTIES: +:ID: 8170bf82-c2ea-49e8-bd79-97a95176783f +:END: +*** TODO Task 1 +*** TODO Task 2 +*** TODO Task 3 +:PROPERTIES: +:BLOCKER: rest-of-siblings-wrap !matches?("TODO=3D=3D\"DONE\"") +:END: +** Chain +:PROPERTIES: +:ID: 1bd282ea-9238-47ea-9b4d-dafba19d278b +:END: +*** TODO Heading 1 +:PROPERTIES: +:COUNT: 2 +:TRIGGER: next-sibling chain!("COUNT") +:END: +*** TODO Heading 2 diff --git a/org-edna.el b/org-edna.el index 929d8ff..f804dba 100644 --- a/org-edna.el +++ b/org-edna.el @@ -498,7 +498,7 @@ specific form were generated, the results will be reg= enerated and stored in cache. =20 Minor changes to an Org file, such as setting properties or -adding unrelated headlines, will be taken into account." +adding unrelated headings, will be taken into account." :group 'org-edna :type 'boolean) =20 @@ -2017,6 +2017,37 @@ starting from target's position." (when (org-xor condition neg) (format "%s %s in %s" (if neg "Did Not Find" "Found") match (buffe= r-name))))) =20 +(defun org-edna-condition/has-tags? (neg &rest tags) + "Check if the target heading has tags. + +Edna Syntax: has-tags?(\"tag1\" \"tag2\"...) + +Block if the target heading has any of the tags tag1, tag2, etc." + (let* ((condition (apply 'org-edna-entry-has-tags-p tags))) + (when (org-xor condition neg) + (org-get-heading)))) + +(defun org-edna--heading-matches (match-string) + "Return non-nil if the current heading matches MATCH-STRING." + (let* ((matcher (cdr (org-make-tags-matcher match-string))) + (todo (org-entry-get nil "TODO")) + (tags (org-get-tags-at)) + (level (org-reduced-level (org-outline-level)))) + (funcall matcher todo tags level))) + +(defun org-edna-condition/matches? (neg match-string) + "Matches a heading against a match string. + +Edna Syntax: matches?(\"MATCH-STRING\") + +Blocks if the target heading matches MATCH-STRING. + +MATCH-STRING is a valid match string as passed to +`org-map-entries'." + (let* ((condition (org-edna--heading-matches match-string))) + (when (org-xor condition neg) + (org-get-heading)))) + =0C ;;; Consideration =20 diff --git a/org-edna.info b/org-edna.info index 691f110..abd1b88 100644 --- a/org-edna.info +++ b/org-edna.info @@ -91,6 +91,8 @@ Conditions * Lisp Variable Set:: * Heading Has Property:: * Regexp Search:: Search for a regular expression +* Checking Tags:: Matching against a set of tags +* Matching Headings:: Matching against a match string * Negating Conditions:: =20 =20 @@ -880,7 +882,7 @@ scheduled!(=E2=80=9C+1wkdy=E2=80=9D) scheduled!(=E2=80=9C+1d +wkdy=E2=80=9D) Same as above deadline!(=E2=80=9C+1m -wkdy=E2=80=9D) - Set SCHEDULED up one month, but move backward to find a weekend + Set DEADLINE up one month, but move backward to find a weekend scheduled!(=E2=80=9Cfloat 2 Tue Feb=E2=80=9D) Set SCHEDULED to the second Tuesday in the following February scheduled!(=E2=80=9Cfloat 3 Thu=E2=80=9D) @@ -1182,6 +1184,8 @@ means block if any target heading isn=E2=80=99t don= e. * Lisp Variable Set:: * Heading Has Property:: * Regexp Search:: Search for a regular expression +* Checking Tags:: Matching against a set of tags +* Matching Headings:: Matching against a match string * Negating Conditions:: =20 =1F @@ -1269,7 +1273,7 @@ to VALUE. showered at least three times. =20 =1F -File: org-edna.info, Node: Regexp Search, Next: Negating Conditions, = Prev: Heading Has Property, Up: Conditions +File: org-edna.info, Node: Regexp Search, Next: Checking Tags, Prev: = Heading Has Property, Up: Conditions =20 Regexp Search ------------- @@ -1280,10 +1284,59 @@ Regexp Search in any of the targets. =20 The targets are expected to be files, although this will work with -other targets as well. +other targets as well. When given a target heading, the heading=E2=80=99= s file +will be searched. =20 =1F -File: org-edna.info, Node: Negating Conditions, Prev: Regexp Search, = Up: Conditions +File: org-edna.info, Node: Checking Tags, Next: Matching Headings, Pr= ev: Regexp Search, Up: Conditions + +Checking Tags +------------- + + =E2=80=A2 Syntax: has-tags?(=E2=80=9CTAG1=E2=80=9D =E2=80=9CTAG2=E2=80= =9D ...) + + Blocks the source heading if any of the target headings have one or +more of the given tags. + + * TODO Task 1 = :tag1: + * TODO Task 2 := tag3:tag2: + * TODO Task 3 + :PROPERTIES: + :BLOCKER: rest-of-siblings-wrap has-tags?("tag1" "tag2") + :END: + + In the above example, Tasks 1 and 2 will block Task 3. Task 1 will +block it because it contains =E2=80=9Ctag1=E2=80=9D as one of its tags, = and likewise for +Task 2 and =E2=80=9Ctag2=E2=80=9D. + + Note that marking =E2=80=9CTask 1=E2=80=9D or =E2=80=9CTask 2=E2=80=9D= as DONE will not unblock =E2=80=9CTask +3=E2=80=9D. If you want to set up such a system, use the *note match:: = finder. + +=1F +File: org-edna.info, Node: Matching Headings, Next: Negating Condition= s, Prev: Checking Tags, Up: Conditions + +Matching Headings +----------------- + + =E2=80=A2 Syntax: matches?(=E2=80=9CMATCH-STRING=E2=80=9D) + + Blocks the source heading if any of the target headings match against +MATCH-STRING. + + MATCH-STRING is a string passed to =E2=80=98org-map-entries=E2=80=99. + + * TODO Task 1 + * TODO Task 2 + * TODO Task 3 + :PROPERTIES: + :BLOCKER: rest-of-siblings-wrap !matches?("TODO=3D=3D\"DONE\"") + :END: + + In the above example, Tasks 1 and 2 will block Task 3 until they=E2=80= =99re +marked as DONE. + +=1F +File: org-edna.info, Node: Negating Conditions, Prev: Matching Heading= s, Up: Conditions =20 Negating Conditions ------------------- @@ -1782,6 +1835,8 @@ File: org-edna.info, Node: 10, Next: 10beta8, Up= : Changelog =E2=80=A2 Added =E2=80=9Cbuffer=E2=80=9D option for match finder =E2=80=A2 Added timestamp sorting to relatives finder =E2=80=A2 Inverted meaning of consideration to avoid confusion + =E2=80=A2 Added *note has-tags?: Checking Tags. and *note matches?: M= atching + Headings. conditions =20 =1F File: org-edna.info, Node: 10beta8, Next: 10beta7, Prev: 10, Up: Cha= ngelog @@ -1898,81 +1953,83 @@ Big release here, with three new features. =1F Tag Table: Node: Top=7F225 -Node: Copying=7F4217 -Node: Introduction=7F5039 -Node: Installation and Setup=7F5987 -Node: Basic Operation=7F6711 -Node: Blockers=7F8562 -Node: Triggers=7F8848 -Node: Syntax=7F9110 -Node: Basic Features=7F9800 -Node: Finders=7F10154 -Node: ancestors=7F11919 -Node: children=7F12513 -Node: descendants=7F12923 -Node: file=7F13445 -Node: first-child=7F14194 -Node: ids=7F14454 -Node: match=7F15115 -Node: next-sibling=7F15753 -Node: next-sibling-wrap=7F16010 -Node: olp=7F16324 -Node: org-file=7F16736 -Node: parent=7F17381 -Node: previous-sibling=7F17579 -Node: previous-sibling-wrap=7F17840 -Node: relatives=7F18119 -Node: rest-of-siblings=7F21845 -Node: rest-of-siblings-wrap=7F22130 -Node: self=7F22479 -Node: siblings=7F22640 -Node: siblings-wrap=7F22877 -Node: Actions=7F23181 -Node: Scheduled/Deadline=7F23944 -Node: TODO State=7F27459 -Node: Archive=7F28184 -Node: Chain Property=7F28504 -Node: Clocking=7F29257 -Node: Property=7F29669 -Node: Priority=7F31842 -Node: Tag=7F32411 -Node: Effort=7F32628 -Node: Getting Help=7F33012 -Node: Advanced Features=7F33457 -Node: Finder Cache=7F33905 -Node: Conditions=7F34944 -Node: Heading is DONE=7F35621 -Node: File Has Headings=7F35827 -Node: Heading TODO State=7F36249 -Node: Lisp Variable Set=7F36543 -Node: Heading Has Property=7F37211 -Node: Regexp Search=7F37957 -Node: Negating Conditions=7F38337 -Node: Consideration=7F38728 -Node: Conditional Forms=7F40912 -Node: Setting the Properties=7F43600 -Node: Extending Edna=7F44684 -Node: Naming Conventions=7F45174 -Node: Finders 1=7F45966 -Node: Actions 1=7F46328 -Node: Conditions 1=7F46787 -Node: Contributing=7F47673 -Node: Bugs=7F48539 -Node: Working with EDE=7F48896 -Node: Compiling Edna=7F49980 -Node: Testing Edna=7F50849 -Node: Before Sending Changes=7F51830 -Node: Developing with Bazaar=7F52517 -Node: Documentation=7F53258 -Node: Changelog=7F53714 -Node: 10=7F53975 -Node: 10beta8=7F54377 -Node: 10beta7=7F54500 -Node: 10beta6=7F54794 -Node: 10beta5=7F55070 -Node: 10beta4=7F55457 -Node: 10beta3=7F55710 -Node: 10beta2=7F56149 +Node: Copying=7F4346 +Node: Introduction=7F5168 +Node: Installation and Setup=7F6116 +Node: Basic Operation=7F6840 +Node: Blockers=7F8691 +Node: Triggers=7F8977 +Node: Syntax=7F9239 +Node: Basic Features=7F9929 +Node: Finders=7F10283 +Node: ancestors=7F12048 +Node: children=7F12642 +Node: descendants=7F13052 +Node: file=7F13574 +Node: first-child=7F14323 +Node: ids=7F14583 +Node: match=7F15244 +Node: next-sibling=7F15882 +Node: next-sibling-wrap=7F16139 +Node: olp=7F16453 +Node: org-file=7F16865 +Node: parent=7F17510 +Node: previous-sibling=7F17708 +Node: previous-sibling-wrap=7F17969 +Node: relatives=7F18248 +Node: rest-of-siblings=7F21974 +Node: rest-of-siblings-wrap=7F22259 +Node: self=7F22608 +Node: siblings=7F22769 +Node: siblings-wrap=7F23006 +Node: Actions=7F23310 +Node: Scheduled/Deadline=7F24073 +Node: TODO State=7F27587 +Node: Archive=7F28312 +Node: Chain Property=7F28632 +Node: Clocking=7F29385 +Node: Property=7F29797 +Node: Priority=7F31970 +Node: Tag=7F32539 +Node: Effort=7F32756 +Node: Getting Help=7F33140 +Node: Advanced Features=7F33585 +Node: Finder Cache=7F34033 +Node: Conditions=7F35072 +Node: Heading is DONE=7F35878 +Node: File Has Headings=7F36084 +Node: Heading TODO State=7F36506 +Node: Lisp Variable Set=7F36800 +Node: Heading Has Property=7F37468 +Node: Regexp Search=7F38214 +Node: Checking Tags=7F38657 +Node: Matching Headings=7F39559 +Node: Negating Conditions=7F40156 +Node: Consideration=7F40551 +Node: Conditional Forms=7F42735 +Node: Setting the Properties=7F45423 +Node: Extending Edna=7F46507 +Node: Naming Conventions=7F46997 +Node: Finders 1=7F47789 +Node: Actions 1=7F48151 +Node: Conditions 1=7F48610 +Node: Contributing=7F49496 +Node: Bugs=7F50362 +Node: Working with EDE=7F50719 +Node: Compiling Edna=7F51803 +Node: Testing Edna=7F52672 +Node: Before Sending Changes=7F53653 +Node: Developing with Bazaar=7F54340 +Node: Documentation=7F55081 +Node: Changelog=7F55537 +Node: 10=7F55798 +Node: 10beta8=7F56300 +Node: 10beta7=7F56423 +Node: 10beta6=7F56717 +Node: 10beta5=7F56993 +Node: 10beta4=7F57380 +Node: 10beta3=7F57633 +Node: 10beta2=7F58072 =1F End Tag Table =20 diff --git a/org-edna.org b/org-edna.org index 2188f53..89c32aa 100644 --- a/org-edna.org +++ b/org-edna.org @@ -699,7 +699,7 @@ Examples: - deadline!(copy) deadline!("+1h") :: Copy the source deadline to the ta= rget, then increment it by an hour. - scheduled!("+1wkdy") :: Set SCHEDULED to the next weekday - scheduled!("+1d +wkdy") :: Same as above -- deadline!("+1m -wkdy") :: Set SCHEDULED up one month, but move backwar= d to find a weekend +- deadline!("+1m -wkdy") :: Set DEADLINE up one month, but move backward= to find a weekend - scheduled!("float 2 Tue Feb") :: Set SCHEDULED to the second Tuesday i= n the following February - scheduled!("float 3 Thu") :: Set SCHEDULED to the third Thursday in th= e following month =20 @@ -1071,7 +1071,57 @@ Blocks the source heading if the regular expressio= n REGEXP is present in any of the targets. =20 The targets are expected to be files, although this will work with other= targets -as well. +as well. When given a target heading, the heading's file will be search= ed. +*** Checking Tags +:PROPERTIES: +:CUSTOM_ID: has-tags +:DESCRIPTION: Matching against a set of tags +:END: + +- Syntax: has-tags?("TAG1" "TAG2" ...) + +Blocks the source heading if any of the target headings have one or more= of the +given tags. + +#+begin_src org +,* TODO Task 1 = :tag1: +,* TODO Task 2 :tag3= :tag2: +,* TODO Task 3 + :PROPERTIES: + :BLOCKER: rest-of-siblings-wrap has-tags?("tag1" "tag2") + :END: +#+end_src + +In the above example, Tasks 1 and 2 will block Task 3. Task 1 will bloc= k it +because it contains "tag1" as one of its tags, and likewise for Task 2 a= nd +"tag2". + +Note that marking "Task 1" or "Task 2" as DONE will not unblock "Task 3"= . If +you want to set up such a system, use the [[#match][match]] finder. +*** Matching Headings +:PROPERTIES: +:CUSTOM_ID: matches +:DESCRIPTION: Matching against a match string +:END: + +- Syntax: matches?("MATCH-STRING") + +Blocks the source heading if any of the target headings match against +MATCH-STRING. + +MATCH-STRING is a string passed to ~org-map-entries~. + +#+begin_src org +,* TODO Task 1 +,* TODO Task 2 +,* TODO Task 3 + :PROPERTIES: + :BLOCKER: rest-of-siblings-wrap !matches?("TODO=3D=3D\"DONE\"") + :END: +#+end_src + +In the above example, Tasks 1 and 2 will block Task 3 until they're mark= ed as +DONE. =20 *** Negating Conditions :PROPERTIES: @@ -1544,6 +1594,7 @@ making any changes: - Added "buffer" option for match finder - Added timestamp sorting to relatives finder - Inverted meaning of consideration to avoid confusion +- Added [[#has-tags][has-tags?]] and [[#matches][matches?]] conditions =20 ** 1.0beta8 Quick fix for beta7. From MAILER-DAEMON Sun Nov 25 14:10:16 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gQznM-0007eC-A9 for mharc-emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:10:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzn9-0007Uj-U7 for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:10:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQzmw-0002kN-91 for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:10:03 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:36036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQzmv-0002k8-Uv for emacs-elpa-diffs@gnu.org; Sun, 25 Nov 2018 14:09:50 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 124102) id DAD39209C2; Sun, 25 Nov 2018 14:09:49 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 76ef9bf 13/13: Merge commit '2c5ac0cb808ae6953fbc74cc497245dafb51051f' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Ian Dunn In-Reply-To: <20181125190945.21052.33646@vcs0.savannah.gnu.org> References: <20181125190945.21052.33646@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 76ef9bf5f892c4c4f5145dcdfec84f922f906892 Auto-Submitted: auto-generated Message-Id: <20181125190949.DAD39209C2@vcs0.savannah.gnu.org> Date: Sun, 25 Nov 2018 14:09:49 -0500 (EST) From: dunni@gnu.org (Ian Dunn) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:10:15 -0000 branch: master commit 76ef9bf5f892c4c4f5145dcdfec84f922f906892 Merge: 7cacd8a 2c5ac0c Author: Ian Dunn Commit: Ian Dunn Merge commit '2c5ac0cb808ae6953fbc74cc497245dafb51051f' --- packages/org-edna/defaults.mk | 26 - packages/org-edna/org-edna-tests.el | 1416 ++++++++++++++++++++++++----= ------ packages/org-edna/org-edna-tests.org | 217 +++++- packages/org-edna/org-edna.el | 219 +++++- packages/org-edna/org-edna.info | 527 +++++++++---- packages/org-edna/org-edna.org | 300 +++++-- packages/org-edna/test.mk | 1 + 7 files changed, 2026 insertions(+), 680 deletions(-) diff --git a/packages/org-edna/defaults.mk b/packages/org-edna/defaults.m= k deleted file mode 100644 index f599ee4..0000000 --- a/packages/org-edna/defaults.mk +++ /dev/null @@ -1,26 +0,0 @@ -# This is part of org-edna -# -# Copyright (C) 2017-2018 Free Software Foundation, Inc. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -emacs =3D emacs - -prefix =3D /usr/share - -org_path =3D $(prefix)/emacs/site-lisp/org - -info_dir =3D $(prefix)/info - -lisp_dir =3D $(prefix)/emacs/site-lisp/ diff --git a/packages/org-edna/org-edna-tests.el b/packages/org-edna/org-= edna-tests.el index da766a9..b6adf15 100644 --- a/packages/org-edna/org-edna-tests.el +++ b/packages/org-edna/org-edna-tests.el @@ -3,9 +3,6 @@ ;; Copyright (C) 2017-2018 Free Software Foundation, Inc. =20 ;; Author: Ian Dunn -;; Keywords: convenience, text, org -;; Version: 1.0 -;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "8.0")) =20 ;; This file is NOT part of GNU Emacs. =20 @@ -29,6 +26,9 @@ (require 'ert) (require 'org-id) =20 +(defvar org-edna-test-inhibit-messages nil + "Whether to inhibit messages (apart from ERT messages).") + (defconst org-edna-test-dir (expand-file-name (file-name-directory (or load-file-name buffer-file-= name)))) =20 @@ -64,10 +64,87 @@ (defconst org-edna-test-relative-archived-child "a4b6131e-0560-4201-86d5= -f32b36363431") (defconst org-edna-test-relative-child-with-done "4a1d74a2-b032-47da-a82= 3-b32f5cab0aae") =20 +(defun org-edna-test-restore-test-file () + "Restore the test file back to its original state." + (with-current-buffer (get-file-buffer org-edna-test-file) + (revert-buffer nil t))) + +(defmacro org-edna-protect-test-file (&rest body) + (declare (indent 0)) + `(unwind-protect + (progn ,@body) + ;; Change the test file back to its original state. + (org-edna-test-restore-test-file))) + +(defmacro org-edna-test-setup (&rest body) + "Common settings for tests." + (declare (indent 0)) + ;; Override `current-time' so we can get a deterministic value + `(cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-= time)) + ;; Only use the test file in the agenda + (org-agenda-files `(,org-edna-test-file)) + ;; Ensure interactive modification of TODO states works. + (org-todo-keywords '((sequence "TODO" "|" "DONE"))) + ;; Only block based on Edna + (org-blocker-hook 'org-edna-blocker-function) + ;; Only trigger based on Edna + (org-trigger-hook 'org-edna-trigger-function) + ;; Inhibit messages if indicated + (inhibit-message org-edna-test-inhibit-messages)) + ,@body)) + +(defmacro org-edna-with-point-at-test-heading (heading-id &rest body) + (declare (indent 1)) + `(org-with-point-at (org-edna-find-test-heading ,heading-id) + ,@body)) + +(defmacro org-edna-with-test-heading (heading-id &rest body) + "Establish a test case with test heading HEADING-ID. + +HEADING-ID is a UUID string of a heading to use. + +Moves point to the heading, protects the test file, sets default +test settings, then runs BODY." + (declare (indent 1)) + `(org-edna-test-setup + (org-edna-protect-test-file + (org-edna-with-point-at-test-heading ,heading-id + ,@body)))) + (defun org-edna-find-test-heading (id) - "Find the test heading with id ID." + "Find the test heading with id ID. + +This avoids org-id digging into its internal database." (org-id-find-id-in-file id org-edna-test-file t)) =20 +;; _test exists to give more detailed reports in ERT output. +(defun org-edna-test-compare-todos (pom expected-state _test) + (string-equal (org-entry-get pom "TODO") expected-state)) + +(defun org-edna-test-change-todo-state (pom new-state) + (org-with-point-at pom (org-todo new-state))) + +(defun org-edna-test-check-block (pom _test) + "Check if the heading at point-or-marker POM is blocked." + (org-edna-test-change-todo-state pom "DONE") + (org-edna-test-compare-todos pom "TODO" _test)) + +(defun org-edna-test-mark-done (&rest poms) + "Mark all points-or-markers in POMS as DONE." + (dolist (pom poms) + (org-edna-test-change-todo-state pom "DONE"))) + +(defun org-edna-test-mark-todo (&rest poms) + "Mark all points-or-markers in POMS as TODO." + (dolist (pom poms) + (org-edna-test-change-todo-state pom "TODO"))) + +(defun org-edna-test-children-marks () + (org-edna-collect-descendants nil)) + +=0C +;;; Parser Tests + (ert-deftest org-edna-parse-form-no-arguments () (let* ((input-string "test-string") (parsed (org-edna-parse-string-form input-string))) @@ -437,48 +514,48 @@ (should (equal output-form expected-form)))) =20 =0C -;; Finders +;;; Finders =20 (defsubst org-edna-heading (pom) (org-with-point-at pom (org-get-heading t t t t))) =20 (ert-deftest org-edna-finder/match-single-arg () - (let* ((org-agenda-files `(,org-edna-test-file)) - (targets (org-edna-finder/match "test&1"))) - (should (=3D (length targets) 2)) - (should (string-equal (org-edna-heading (nth 0 targets)) "Tagged Hea= ding 1")) - (should (string-equal (org-edna-heading (nth 1 targets)) "Tagged Hea= ding 2")))) + (org-edna-test-setup + (let* ((targets (org-edna-finder/match "test&1"))) + (should (=3D (length targets) 2)) + (should (string-equal (org-edna-heading (nth 0 targets)) "Tagged H= eading 1")) + (should (string-equal (org-edna-heading (nth 1 targets)) "Tagged H= eading 2"))))) =20 (ert-deftest org-edna-finder/ids-single () - (let* ((org-agenda-files `(,org-edna-test-file)) - (test-id "caccd0a6-d400-410a-9018-b0635b07a37e") - (targets (org-edna-finder/ids test-id))) - (should (=3D (length targets) 1)) - (should (string-equal (org-edna-heading (nth 0 targets)) "Blocking T= est")) - (should (string-equal (org-entry-get (nth 0 targets) "ID") test-id))= )) + (org-edna-test-setup + (let* ((test-id "caccd0a6-d400-410a-9018-b0635b07a37e") + (targets (org-edna-finder/ids test-id))) + (should (=3D (length targets) 1)) + (should (string-equal (org-edna-heading (nth 0 targets)) "Blocking= Test")) + (should (string-equal (org-entry-get (nth 0 targets) "ID") test-id= ))))) =20 (ert-deftest org-edna-finder/ids-multiple () - (let* ((org-agenda-files `(,org-edna-test-file)) - (test-ids '("0d491588-7da3-43c5-b51a-87fbd34f79f7" - "b010cbad-60dc-46ef-a164-eb155e62cbb2")) - (targets (apply 'org-edna-finder/ids test-ids))) - (should (=3D (length targets) 2)) - (should (string-equal (org-edna-heading (nth 0 targets)) "ID Heading= 1")) - (should (string-equal (org-entry-get (nth 0 targets) "ID") (nth 0 te= st-ids))) - (should (string-equal (org-edna-heading (nth 1 targets)) "ID Heading= 2")) - (should (string-equal (org-entry-get (nth 1 targets) "ID") (nth 1 te= st-ids))))) + (org-edna-test-setup + (let* ((test-ids '("0d491588-7da3-43c5-b51a-87fbd34f79f7" + "b010cbad-60dc-46ef-a164-eb155e62cbb2")) + (targets (apply 'org-edna-finder/ids test-ids))) + (should (=3D (length targets) 2)) + (should (string-equal (org-edna-heading (nth 0 targets)) "ID Headi= ng 1")) + (should (string-equal (org-entry-get (nth 0 targets) "ID") (nth 0 = test-ids))) + (should (string-equal (org-edna-heading (nth 1 targets)) "ID Headi= ng 2")) + (should (string-equal (org-entry-get (nth 1 targets) "ID") (nth 1 = test-ids)))))) =20 (ert-deftest org-edna-finder/match-blocker () - (let* ((org-agenda-files `(,org-edna-test-file)) - (heading (org-id-find "caccd0a6-d400-410a-9018-b0635b07a37e" t)= ) - (blocker (org-entry-get heading "BLOCKER")) - blocking-entry) - (should (string-equal "match(\"test&1\")" blocker)) - (org-with-point-at heading - (setq blocking-entry (org-edna-process-form blocker 'condition))) - (should (string-equal (substring-no-properties blocking-entry) - "TODO Tagged Heading 1 :1:test:")))) + (org-edna-test-setup + (let* ((heading (org-edna-find-test-heading "caccd0a6-d400-410a-9018= -b0635b07a37e")) + (blocker (org-entry-get heading "BLOCKER")) + blocking-entry) + (should (string-equal "match(\"test&1\")" blocker)) + (org-with-point-at heading + (setq blocking-entry (org-edna-process-form blocker 'condition))= ) + (should (string-equal (substring-no-properties blocking-entry) + "TODO Tagged Heading 1 :1:test:"))))) =20 (ert-deftest org-edna-finder/file () (let* ((targets (org-edna-finder/file org-edna-test-file))) @@ -499,16 +576,16 @@ =20 (ert-deftest org-edna-finder/self () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find "82a4ac3d-9565-4f94-bc84-2bbfd8d7d96c" t)= ) + (current (org-edna-find-test-heading "82a4ac3d-9565-4f94-bc84-2= bbfd8d7d96c")) (targets (org-with-point-at current (org-edna-finder/self)))) (should (=3D (length targets) 1)) (should (equal current (nth 0 targets))))) =20 (ert-deftest org-edna-finder/siblings () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-one-id t)) + (current (org-edna-find-test-heading org-edna-test-sibling-one-= id)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-one-id ,org-edna-test-sibling-two-id ,org-edna-test-sibling-three-id))) @@ -518,9 +595,9 @@ =20 (ert-deftest org-edna-finder/siblings-wrap () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find "72534efa-e932-460b-ae2d-f044a0074815" t)= ) + (current (org-edna-find-test-heading "72534efa-e932-460b-ae2d-f= 044a0074815")) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) '("06aca55e-ce09-46df-80d7-5b52e55d6505" "82a4ac3d-9565-4f94-bc84-2bbfd8d7d96c"))) (targets (org-with-point-at current @@ -530,9 +607,9 @@ =20 (ert-deftest org-edna-finder/rest-of-siblings () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find "72534efa-e932-460b-ae2d-f044a0074815" t)= ) + (current (org-edna-find-test-heading "72534efa-e932-460b-ae2d-f= 044a0074815")) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) '("06aca55e-ce09-46df-80d7-5b52e55d6505"))) (targets (org-with-point-at current (org-edna-finder/rest-of-siblings)))) @@ -541,9 +618,9 @@ =20 (ert-deftest org-edna-finder/next-sibling () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find "72534efa-e932-460b-ae2d-f044a0074815" t)= ) + (current (org-edna-find-test-heading "72534efa-e932-460b-ae2d-f= 044a0074815")) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) '("06aca55e-ce09-46df-80d7-5b52e55d6505"))) (targets (org-with-point-at current (org-edna-finder/next-sibling)))) @@ -552,9 +629,9 @@ =20 (ert-deftest org-edna-finder/next-sibling-wrap-next () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-two-id t)) + (current (org-edna-find-test-heading org-edna-test-sibling-two-= id)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-three-id))) (targets (org-with-point-at current (org-edna-finder/next-sibling-wrap)))) @@ -563,9 +640,9 @@ =20 (ert-deftest org-edna-finder/next-sibling-wrap-wrap () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-three-id t)) + (current (org-edna-find-test-heading org-edna-test-sibling-thre= e-id)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-one-id))) (targets (org-with-point-at current (org-edna-finder/next-sibling-wrap)))) @@ -574,9 +651,9 @@ =20 (ert-deftest org-edna-finder/previous-sibling () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find "06aca55e-ce09-46df-80d7-5b52e55d6505" t)= ) + (current (org-edna-find-test-heading "06aca55e-ce09-46df-80d7-5= b52e55d6505")) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) '("72534efa-e932-460b-ae2d-f044a0074815"))) (targets (org-with-point-at current (org-edna-finder/previous-sibling)))) @@ -585,8 +662,8 @@ =20 (ert-deftest org-edna-finder/first-child () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-parent-id t)) - (first-child (list (org-id-find org-edna-test-sibling-one-id t)= )) + (current (org-edna-find-test-heading org-edna-test-parent-id)) + (first-child (list (org-edna-find-test-heading org-edna-test-si= bling-one-id))) (targets (org-with-point-at current (org-edna-finder/first-child)))) (should (=3D (length targets) 1)) @@ -594,9 +671,9 @@ =20 (ert-deftest org-edna-finder/children () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-parent-id t)) + (current (org-edna-find-test-heading org-edna-test-parent-id)) (children (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-one-id ,org-edna-test-sibling-two-id ,org-edna-test-sibling-three-id))) @@ -607,8 +684,8 @@ =20 (ert-deftest org-edna-finder/parent () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-one-id t)) - (parent (list (org-id-find org-edna-test-parent-id t))) + (current (org-edna-find-test-heading org-edna-test-sibling-one-= id)) + (parent (list (org-edna-find-test-heading org-edna-test-parent-= id))) (targets (org-with-point-at current (org-edna-finder/parent)))) (should (=3D (length targets) 1)) @@ -616,9 +693,9 @@ =20 (ert-deftest org-edna-relatives/from-top () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-one-id t)) + (current (org-edna-find-test-heading org-edna-test-sibling-one-= id)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-one-id))) (targets (org-with-point-at current (org-edna-finder/relatives 'from-top 1)))) @@ -626,9 +703,9 @@ =20 (ert-deftest org-edna-relatives/from-bottom () (let* ((org-agenda-files `(,org-edna-test-file)) - (current (org-id-find org-edna-test-sibling-one-id t)) + (current (org-edna-find-test-heading org-edna-test-sibling-one-= id)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) `(,org-edna-test-sibling-three-id))) (targets (org-with-point-at current (org-edna-finder/relatives 'from-bottom 1)))) @@ -639,9 +716,9 @@ (target-list `(,org-edna-test-sibling-two-id)) (arg 'forward-wrap) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -652,9 +729,9 @@ (target-list `(,org-edna-test-sibling-one-id)) (arg 'forward-wrap) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -665,9 +742,9 @@ (target-list `(,org-edna-test-sibling-two-id)) (arg 'forward-no-wrap) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -678,9 +755,9 @@ (target-list nil) (arg 'forward-no-wrap) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg)))) @@ -692,9 +769,9 @@ (arg 'backward-wrap) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -706,9 +783,9 @@ (arg 'backward-wrap) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -720,9 +797,9 @@ (arg 'backward-no-wrap) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -734,9 +811,9 @@ (arg 'backward-no-wrap) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -748,9 +825,9 @@ (arg 'walk-up) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -761,9 +838,9 @@ (target-list `(,org-edna-test-sibling-one-id)) (arg 'walk-up-with-self) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -774,9 +851,9 @@ (target-list `(,org-edna-test-sibling-one-id)) (arg 'walk-down) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -787,9 +864,9 @@ (target-list `(,org-edna-test-parent-id)) (arg 'walk-down-with-self) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -800,9 +877,9 @@ (target-list `(,org-edna-test-sibling-one-id)) (arg 'walk-down) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 1)))) @@ -821,9 +898,9 @@ (arg 'walk-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -840,9 +917,9 @@ (arg 'step-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg size)))) @@ -853,9 +930,9 @@ (target-list `(,org-edna-test-relative-child-with-todo)) (arg 'step-down) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 'todo-only)))) @@ -867,9 +944,9 @@ ,org-edna-test-relative-child-with-done)) (arg 'step-down) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg 'todo-and-done-only))= )) @@ -886,9 +963,9 @@ (filter 'no-comment) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg filter size)))) @@ -905,9 +982,9 @@ (filter 'no-archive) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg filter size)))) @@ -920,9 +997,9 @@ (filter "+ARCHIVE") (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg filter size)))) @@ -939,9 +1016,9 @@ (filter "-ARCHIVE") (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg filter size)))) @@ -956,9 +1033,9 @@ (filter "Child Heading With .*") (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg filter size)))) @@ -976,9 +1053,9 @@ (sort 'reverse-sort) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets (org-with-point-at current (org-edna-finder/relatives arg sort size)))) @@ -995,9 +1072,9 @@ (arg 'step-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list)) (targets )) (should (equal siblings @@ -1018,9 +1095,9 @@ (arg 'step-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list))) (should (equal siblings (org-with-point-at current @@ -1040,9 +1117,9 @@ (arg 'step-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list))) (should (equal siblings (org-with-point-at current @@ -1062,9 +1139,9 @@ (arg 'step-down) (size (length target-list)) (org-agenda-files `(,org-edna-test-file)) - (current (org-id-find start-marker t)) + (current (org-edna-find-test-heading start-marker)) (siblings (mapcar - (lambda (uuid) (org-id-find uuid t)) + (lambda (uuid) (org-edna-find-test-heading uuid)) target-list))) (should (equal siblings (org-with-point-at current @@ -1073,6 +1150,28 @@ (org-with-point-at current (org-edna-finder/relatives arg 'deadline-down size)= ))))) =20 +(ert-deftest org-edna-relatives/sort-timestamp () + (let* ((start-marker org-edna-test-relative-parent-one) + (target-list `(,org-edna-test-relative-child-with-todo + ,org-edna-test-relative-child-with-done + ,org-edna-test-relative-commented-child + ,org-edna-test-relative-child-with-children + ,org-edna-test-relative-standard-child + ,org-edna-test-relative-archived-child)) + (arg 'step-down) + (size (length target-list)) + (org-agenda-files `(,org-edna-test-file)) + (current (org-edna-find-test-heading start-marker)) + (siblings (mapcar + (lambda (uuid) (org-edna-find-test-heading uuid)) + target-list))) + (should (equal siblings + (org-with-point-at current + (org-edna-finder/relatives arg 'timestamp-up size))= )) + (should (equal (nreverse siblings) + (org-with-point-at current + (org-edna-finder/relatives arg 'timestamp-down size= )))))) + (ert-deftest org-edna-cache/no-entry () (let* ((org-edna-finder-use-cache t) (org-edna--finder-cache (make-hash-table :test 'equal))) @@ -1129,44 +1228,38 @@ (should (not (org-edna--get-cache-entry 'org-edna-finder/match '= ("test&1")))))))) =20 =0C -;; Actions +;;; Actions =20 (ert-deftest org-edna-action/todo-test () - (let* ((org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "0d491588-7da3-43c5-b51a-87fbd34f79f7" t))= ) - (org-with-point-at target - (org-edna-action/todo! nil "DONE") - (should (string-equal (org-entry-get nil "TODO") "DONE")) - (org-edna-action/todo! nil "TODO") - (should (string-equal (org-entry-get nil "TODO") "TODO")) - (org-edna-action/todo! nil 'DONE) - (should (string-equal (org-entry-get nil "TODO") "DONE")) - (org-edna-action/todo! nil 'TODO) - (should (string-equal (org-entry-get nil "TODO") "TODO"))))) + (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7" + (org-edna-action/todo! nil "DONE") + (should (string-equal (org-entry-get nil "TODO") "DONE")) + (org-edna-action/todo! nil "TODO") + (should (string-equal (org-entry-get nil "TODO") "TODO")) + (org-edna-action/todo! nil 'DONE) + (should (string-equal (org-entry-get nil "TODO") "DONE")) + (org-edna-action/todo! nil 'TODO) + (should (string-equal (org-entry-get nil "TODO") "TODO")))) + +;; Scheduled =20 (ert-deftest org-edna-action-scheduled/wkdy () - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "0d491588-7da3-43c5-b51a-87fbd34f79f7"= t))) - (org-with-point-at target - (org-edna-action/scheduled! nil "Mon") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-17 Mon>")) - (org-edna-action/scheduled! nil 'rm) - (should (not (org-entry-get nil "SCHEDULED"))) - (org-edna-action/scheduled! nil "Mon 9:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-17 Mon 09:00>")) - (org-edna-action/scheduled! nil 'rm) - (should (not (org-entry-get nil "SCHEDULED")))))) + (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7" + (org-edna-action/scheduled! nil "Mon") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-17 Mon>")) + (org-edna-action/scheduled! nil 'rm) + (should (not (org-entry-get nil "SCHEDULED"))) + (org-edna-action/scheduled! nil "Mon 9:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-17 Mon 09:00>")) + (org-edna-action/scheduled! nil 'rm) + (should (not (org-entry-get nil "SCHEDULED"))))) =20 (ert-deftest org-edna-action-scheduled/cp () - (let* ((org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "0d491588-7da3-43c5-b51a-87fbd34f79f7" t)) - (source (org-id-find "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" t)) - (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "rem= ove")))) - (org-with-point-at target + (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7" + (let* ((source (org-edna-find-test-heading "97e6b0f0-40c4-464f-b760-= 6e5ca9744eb5")) + (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "r= emove")))) (dolist (pair pairs) (org-edna-action/scheduled! source (car pair)) (should (string-equal (org-entry-get nil "SCHEDULED") @@ -1175,226 +1268,355 @@ (should (not (org-entry-get nil "SCHEDULED"))))))) =20 (ert-deftest org-edna-action-scheduled/inc () - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "97e6b0f0-40c4-464f-b760-6e5ca9744eb5"= t))) - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; Increment 1 minute - (org-edna-action/scheduled! nil "+1M") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:01>")) - ;; Decrement 1 minute - (org-edna-action/scheduled! nil "-1M") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; +1 day - (org-edna-action/scheduled! nil "+1d") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-16 Sun 00:00>")) - ;; +1 hour from current time - (org-edna-action/scheduled! nil "++1h") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 01:00>")) - ;; Back to Saturday - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; -1 day to Friday - (org-edna-action/scheduled! nil "-1d") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-14 Fri 00:00>")) - ;; Increment two days to the next weekday - (org-edna-action/scheduled! nil "+2wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-17 Mon 00:00>")) - ;; Increment one day, expected to land on a weekday - (org-edna-action/scheduled! nil "+1wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-18 Tue 00:00>")) - ;; Move forward 8 days, then backward until we find a weekend - (org-edna-action/scheduled! nil "+8d -wknd") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-23 Sun 00:00>")) - ;; Move forward one week, then forward until we find a weekday - ;; (org-edna-action/scheduled! nil "+1w +wkdy") - ;; (should (string-equal (org-entry-get nil "SCHEDULED") - ;; "<2000-01-31 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>"))))) + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; Increment 1 minute + (org-edna-action/scheduled! nil "+1M") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:01>")) + ;; Decrement 1 minute + (org-edna-action/scheduled! nil "-1M") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; +1 day + (org-edna-action/scheduled! nil "+1d") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-16 Sun 00:00>")) + ;; +1 hour from current time + (org-edna-action/scheduled! nil "++1h") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 01:00>")) + ;; Back to Saturday + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; -1 day to Friday + (org-edna-action/scheduled! nil "-1d") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-14 Fri 00:00>")) + ;; Increment two days to the next weekday + (org-edna-action/scheduled! nil "+2wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-17 Mon 00:00>")) + ;; Increment one day, expected to land on a weekday + (org-edna-action/scheduled! nil "+1wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-18 Tue 00:00>")) + ;; Move forward 8 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+8d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + ;; (org-edna-action/scheduled! nil "+1w +wkdy") + ;; (should (string-equal (org-entry-get nil "SCHEDULED") + ;; "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")))) =20 (ert-deftest org-edna-action-scheduled/landing () "Test landing arguments to scheduled increment." - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "97e6b0f0-40c4-464f-b760-6e5ca9744eb5"= t))) - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; Move forward 10 days, then backward until we find a weekend - (org-edna-action/scheduled! nil "+10d -wknd") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-23 Sun 00:00>")) - ;; Move forward one week, then forward until we find a weekday - (org-edna-action/scheduled! nil "+1w +wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-31 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>"))))) + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/scheduled! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")))) =20 (ert-deftest org-edna-action-scheduled/landing-no-hour () "Test landing arguments to scheduled increment, without hour." - ;; Override `current-time' so we can get a deterministic value - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "caf27724-0887-4565-9765-ed2f1edcfb16"= t))) - (org-with-point-at target - ;; Time starts at Jan 1, 2017 - (org-edna-action/scheduled! nil "2017-01-01 Sun") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-01 Sun>")) - ;; Move forward 10 days, then backward until we find a weekend - (org-edna-action/scheduled! nil "+10d -wknd") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-08 Sun>")) - ;; Move forward one week, then forward until we find a weekday - (org-edna-action/scheduled! nil "+1w +wkdy") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-16 Mon>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2017-01-01 Sun") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2017-01-01 Sun>"))))) + (org-edna-with-test-heading "caf27724-0887-4565-9765-ed2f1edcfb16" + ;; Time starts at Jan 1, 2017 + (org-edna-action/scheduled! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-01 Sun>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/scheduled! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-08 Sun>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/scheduled! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-16 Mon>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2017-01-01 Sun>")))) =20 (ert-deftest org-edna-action-scheduled/float () - (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-t= ime)) - (org-agenda-files `(,org-edna-test-file)) - (target (org-id-find "97e6b0f0-40c4-464f-b760-6e5ca9744eb5"= t))) - (org-with-point-at target - ;; Time starts at Jan 15, 2000 - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>")) - ;; The third Tuesday of next month (Feb 15th) - (org-edna-action/scheduled! nil "float 3 Tue") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-02-15 Tue 00:00>")) - ;; The second Friday of the following May (May 12th) - (org-edna-action/scheduled! nil "float 2 5 May") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-05-12 Fri 00:00>")) - ;; Move forward to the second Wednesday of the next month (June 14= th) - (org-edna-action/scheduled! nil "float 2 Wednesday") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-06-14 Wed 00:00>")) - ;; Move forward to the first Thursday in the following Jan (Jan 4t= h, 2001) - (org-edna-action/scheduled! nil "float 1 4 Jan") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2001-01-04 Thu 00:00>")) - ;; The fourth Monday in Feb, 2000 (Feb 28th) - (org-edna-action/scheduled! nil "float ++4 monday") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-02-28 Mon 00:00>")) - ;; The second Monday after Mar 12th, 2000 (Mar 20th) - (org-edna-action/scheduled! nil "float 2 monday Mar 12") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-03-20 Mon 00:00>")) - ;; Back to Saturday for other tests - (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") - (should (string-equal (org-entry-get nil "SCHEDULED") - "<2000-01-15 Sat 00:00>"))))) + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")) + ;; The third Tuesday of next month (Feb 15th) + (org-edna-action/scheduled! nil "float 3 Tue") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-02-15 Tue 00:00>")) + ;; The second Friday of the following May (May 12th) + (org-edna-action/scheduled! nil "float 2 5 May") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-05-12 Fri 00:00>")) + ;; Move forward to the second Wednesday of the next month (June 14th= ) + (org-edna-action/scheduled! nil "float 2 Wednesday") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-06-14 Wed 00:00>")) + ;; Move forward to the first Thursday in the following Jan (Jan 4th,= 2001) + (org-edna-action/scheduled! nil "float 1 4 Jan") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2001-01-04 Thu 00:00>")) + ;; The fourth Monday in Feb, 2000 (Feb 28th) + (org-edna-action/scheduled! nil "float ++4 monday") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-02-28 Mon 00:00>")) + ;; The second Monday after Mar 12th, 2000 (Mar 20th) + (org-edna-action/scheduled! nil "float 2 monday Mar 12") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-03-20 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "SCHEDULED") + "<2000-01-15 Sat 00:00>")))) + +(ert-deftest org-edna-action-deadline/wkdy () + (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7" + (org-edna-action/deadline! nil "Mon") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-17 Mon>")) + (org-edna-action/deadline! nil 'rm) + (should (not (org-entry-get nil "DEADLINE"))) + (org-edna-action/deadline! nil "Mon 9:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-17 Mon 09:00>")) + (org-edna-action/deadline! nil 'rm) + (should (not (org-entry-get nil "DEADLINE"))))) + +(ert-deftest org-edna-action-deadline/cp () + (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7" + (let* ((source (org-edna-find-test-heading "97e6b0f0-40c4-464f-b760-= 6e5ca9744eb5")) + (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . "r= emove")))) + (dolist (pair pairs) + (org-edna-action/deadline! source (car pair)) + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + (org-edna-action/deadline! source (cdr pair)) + (should (not (org-entry-get nil "DEADLINE"))))))) + +(ert-deftest org-edna-action-deadline/inc () + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; Increment 1 minute + (org-edna-action/deadline! nil "+1M") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:01>")) + ;; Decrement 1 minute + (org-edna-action/deadline! nil "-1M") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; +1 day + (org-edna-action/deadline! nil "+1d") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-16 Sun 00:00>")) + ;; +1 hour from current time + (org-edna-action/deadline! nil "++1h") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 01:00>")) + ;; Back to Saturday + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; -1 day to Friday + (org-edna-action/deadline! nil "-1d") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-14 Fri 00:00>")) + ;; Increment two days to the next weekday + (org-edna-action/deadline! nil "+2wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-17 Mon 00:00>")) + ;; Increment one day, expected to land on a weekday + (org-edna-action/deadline! nil "+1wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-18 Tue 00:00>")) + ;; Move forward 8 days, then backward until we find a weekend + (org-edna-action/deadline! nil "+8d -wknd") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + ;; (org-edna-action/deadline! nil "+1w +wkdy") + ;; (should (string-equal (org-entry-get nil "DEADLINE") + ;; "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")))) + +(ert-deftest org-edna-action-deadline/landing () + "Test landing arguments to deadline increment." + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/deadline! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-23 Sun 00:00>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/deadline! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-31 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")))) + +(ert-deftest org-edna-action-deadline/landing-no-hour () + "Test landing arguments to deadline increment, without hour." + (org-edna-with-test-heading "caf27724-0887-4565-9765-ed2f1edcfb16" + ;; Time starts at Jan 1, 2017 + (org-edna-action/deadline! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-01 Sun>")) + ;; Move forward 10 days, then backward until we find a weekend + (org-edna-action/deadline! nil "+10d -wknd") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-08 Sun>")) + ;; Move forward one week, then forward until we find a weekday + (org-edna-action/deadline! nil "+1w +wkdy") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-16 Mon>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2017-01-01 Sun") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2017-01-01 Sun>")))) + +(ert-deftest org-edna-action-deadline/float () + (org-edna-with-test-heading "97e6b0f0-40c4-464f-b760-6e5ca9744eb5" + ;; Time starts at Jan 15, 2000 + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")) + ;; The third Tuesday of next month (Feb 15th) + (org-edna-action/deadline! nil "float 3 Tue") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-02-15 Tue 00:00>")) + ;; The second Friday of the following May (May 12th) + (org-edna-action/deadline! nil "float 2 5 May") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-05-12 Fri 00:00>")) + ;; Move forward to the second Wednesday of the next month (June 14th= ) + (org-edna-action/deadline! nil "float 2 Wednesday") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-06-14 Wed 00:00>")) + ;; Move forward to the first Thursday in the following Jan (Jan 4th,= 2001) + (org-edna-action/deadline! nil "float 1 4 Jan") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2001-01-04 Thu 00:00>")) + ;; The fourth Monday in Feb, 2000 (Feb 28th) + (org-edna-action/deadline! nil "float ++4 monday") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-02-28 Mon 00:00>")) + ;; The second Monday after Mar 12th, 2000 (Mar 20th) + (org-edna-action/deadline! nil "float 2 monday Mar 12") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-03-20 Mon 00:00>")) + ;; Back to Saturday for other tests + (org-edna-action/deadline! nil "2000-01-15 Sat 00:00") + (should (string-equal (org-entry-get nil "DEADLINE") + "<2000-01-15 Sat 00:00>")))) =20 (ert-deftest org-edna-action-tag () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/tag! nil "tag") - (should (equal (org-get-tags) '("tag"))) - (org-edna-action/tag! nil "") - (should (equal (org-get-tags) '("")))))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/tag! nil "tag") + (should (equal (org-get-tags) '("tag"))) + (org-edna-action/tag! nil "") + (should (equal (org-get-tags) '(""))))) =20 (ert-deftest org-edna-action-property () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/set-property! nil "TEST" "1") - (should (equal (org-entry-get nil "TEST") "1")) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST"))))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/set-property! nil "TEST" "1") + (should (equal (org-entry-get nil "TEST") "1")) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST")))) =20 (ert-deftest org-edna-action-property/inc-dec () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/set-property! nil "TEST" "1") - (should (equal (org-entry-get nil "TEST") "1")) - (org-edna-action/set-property! nil "TEST" 'inc) - (should (equal (org-entry-get nil "TEST") "2")) - (org-edna-action/set-property! nil "TEST" 'dec) - (should (equal (org-entry-get nil "TEST") "1")) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST")) - (should-error (org-edna-action/set-property! nil "TEST" 'inc)) - (should-error (org-edna-action/set-property! nil "TEST" 'dec)) - (org-edna-action/set-property! nil "TEST" "a") - (should (equal (org-entry-get nil "TEST") "a")) - (should-error (org-edna-action/set-property! nil "TEST" 'inc)) - (should-error (org-edna-action/set-property! nil "TEST" 'dec)) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST"))))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/set-property! nil "TEST" "1") + (should (equal (org-entry-get nil "TEST") "1")) + (org-edna-action/set-property! nil "TEST" 'inc) + (should (equal (org-entry-get nil "TEST") "2")) + (org-edna-action/set-property! nil "TEST" 'dec) + (should (equal (org-entry-get nil "TEST") "1")) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST")) + (should-error (org-edna-action/set-property! nil "TEST" 'inc)) + (should-error (org-edna-action/set-property! nil "TEST" 'dec)) + (org-edna-action/set-property! nil "TEST" "a") + (should (equal (org-entry-get nil "TEST") "a")) + (should-error (org-edna-action/set-property! nil "TEST" 'inc)) + (should-error (org-edna-action/set-property! nil "TEST" 'dec)) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST")))) =20 (ert-deftest org-edna-action-property/next-prev () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/set-property! nil "TEST" "a") - (should (equal (org-entry-get nil "TEST") "a")) - (should-error (org-edna-action/set-property! nil "TEST" 'next)) - (should-error (org-edna-action/set-property! nil "TEST" 'prev)) - (should-error (org-edna-action/set-property! nil "TEST" 'previous)= ) - (org-edna-action/delete-property! nil "TEST") - (should-not (org-entry-get nil "TEST")) - ;; Test moving forwards - (org-edna-action/set-property! nil "COUNTER" "a") - (should (equal (org-entry-get nil "COUNTER") "a")) - (org-edna-action/set-property! nil "COUNTER" 'next) - (should (equal (org-entry-get nil "COUNTER") "b")) - ;; Test moving forwards past the last one - (org-edna-action/set-property! nil "COUNTER" "d") - (should (equal (org-entry-get nil "COUNTER") "d")) - (org-edna-action/set-property! nil "COUNTER" 'next) - (should (equal (org-entry-get nil "COUNTER") "a")) - ;; Test moving backwards past the first one - (org-edna-action/set-property! nil "COUNTER" 'prev) - (should (equal (org-entry-get nil "COUNTER") "d")) - ;; Test moving backwards normally - (org-edna-action/set-property! nil "COUNTER" 'previous) - (should (equal (org-entry-get nil "COUNTER") "c")) - (org-edna-action/delete-property! nil "COUNTER") - (should-not (org-entry-get nil "COUNTER"))))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/set-property! nil "TEST" "a") + (should (equal (org-entry-get nil "TEST") "a")) + (should-error (org-edna-action/set-property! nil "TEST" 'next)) + (should-error (org-edna-action/set-property! nil "TEST" 'prev)) + (should-error (org-edna-action/set-property! nil "TEST" 'previous)) + (org-edna-action/delete-property! nil "TEST") + (should-not (org-entry-get nil "TEST")) + ;; Test moving forwards + (org-edna-action/set-property! nil "COUNTER" "a") + (should (equal (org-entry-get nil "COUNTER") "a")) + (org-edna-action/set-property! nil "COUNTER" 'next) + (should (equal (org-entry-get nil "COUNTER") "b")) + ;; Test moving forwards past the last one + (org-edna-action/set-property! nil "COUNTER" "d") + (should (equal (org-entry-get nil "COUNTER") "d")) + (org-edna-action/set-property! nil "COUNTER" 'next) + (should (equal (org-entry-get nil "COUNTER") "a")) + ;; Test moving backwards past the first one + (org-edna-action/set-property! nil "COUNTER" 'prev) + (should (equal (org-entry-get nil "COUNTER") "d")) + ;; Test moving backwards normally + (org-edna-action/set-property! nil "COUNTER" 'previous) + (should (equal (org-entry-get nil "COUNTER") "c")) + (org-edna-action/delete-property! nil "COUNTER") + (should-not (org-entry-get nil "COUNTER")))) =20 (ert-deftest org-edna-action-clock () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/clock-in! nil) - (should (org-clocking-p)) - (should (equal org-clock-hd-marker pom)) - (org-edna-action/clock-out! nil) - (should-not (org-clocking-p))))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/clock-in! nil) + (should (org-clocking-p)) + (should (equal org-clock-hd-marker (point-marker))) + (org-edna-action/clock-out! nil) + (should-not (org-clocking-p)))) =20 (ert-deftest org-edna-action-priority () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)) - (org-lowest-priority ?C) - (org-highest-priority ?A) - (org-default-priority ?B)) - (org-with-point-at pom + (org-edna-with-test-heading org-edna-test-id-heading-one + (let ((org-lowest-priority ?C) + (org-highest-priority ?A) + (org-default-priority ?B)) (org-edna-action/set-priority! nil "A") (should (equal (org-entry-get nil "PRIORITY") "A")) (org-edna-action/set-priority! nil 'down) @@ -1407,45 +1629,49 @@ (should (equal (org-entry-get nil "PRIORITY") "B"))))) =20 (ert-deftest org-edna-action-effort () - (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))) - (org-with-point-at pom - (org-edna-action/set-effort! nil "0:01") - (should (equal (org-entry-get nil "EFFORT") "0:01")) - (org-edna-action/set-effort! nil 'increment) - (should (equal (org-entry-get nil "EFFORT") "0:02")) - (org-entry-delete nil "EFFORT")))) + (org-edna-with-test-heading org-edna-test-id-heading-one + (org-edna-action/set-effort! nil "0:01") + (should (equal (org-entry-get nil "EFFORT") "0:01")) + (org-edna-action/set-effort! nil 'increment) + (should (equal (org-entry-get nil "EFFORT") "0:02")) + (org-entry-delete nil "EFFORT"))) =20 (ert-deftest org-edna-action-archive () - (let ((org-archive-save-context-info '(todo)) - (pom (org-edna-find-test-heading org-edna-test-archive-heading)) - ;; Archive it to the same location - (org-archive-location "::** Archive") - (org-edna-prompt-for-archive nil)) - (org-with-point-at pom + (org-edna-with-test-heading org-edna-test-archive-heading + (let* ((org-archive-save-context-info '(todo)) + ;; Archive it to the same location + (org-archive-location "::** Archive") + ;; We're non-interactive, so no prompt. + (org-edna-prompt-for-archive nil)) (org-edna-action/archive! nil) (should (equal (org-entry-get nil "ARCHIVE_TODO") "TODO")) (org-entry-delete nil "ARCHIVE_TODO")))) =20 (ert-deftest org-edna-action-chain () - (let ((old-pom (org-edna-find-test-heading org-edna-test-id-heading-on= e)) - (new-pom (org-edna-find-test-heading org-edna-test-id-heading-tw= o))) - (org-entry-put old-pom "TEST" "1") - (org-with-point-at new-pom - (org-edna-action/chain! old-pom "TEST") - (should (equal (org-entry-get nil "TEST") "1"))) - (org-entry-delete old-pom "TEST") - (org-entry-delete new-pom "TEST"))) + (org-edna-test-setup + (let ((old-pom (org-edna-find-test-heading org-edna-test-id-heading-= one)) + (new-pom (org-edna-find-test-heading org-edna-test-id-heading-= two))) + (org-edna-protect-test-file + (org-entry-put old-pom "TEST" "1") + (org-with-point-at new-pom + (org-edna-action/chain! old-pom "TEST") + (should (equal (org-entry-get nil "TEST") "1"))) + (org-entry-delete old-pom "TEST") + (org-entry-delete new-pom "TEST"))))) =20 =0C -;; Conditions +;;; Conditions =20 (defun org-edna-test-condition-form (func-sym pom-true pom-false block-t= rue block-false &rest args) - (org-with-point-at pom-true - (should-not (apply func-sym t args)) - (should (equal (apply func-sym nil args) block-true))) - (org-with-point-at pom-false - (should (equal (apply func-sym t args) block-false)) - (should-not (apply func-sym nil args)))) + (org-edna-test-setup + (let* ((block-true (or block-true (org-with-point-at pom-true (org-g= et-heading)))) + (block-false (or block-false (org-with-point-at pom-false (or= g-get-heading))))) + (org-with-point-at pom-true + (should-not (apply func-sym t args)) + (should (equal (apply func-sym nil args) block-true))) + (org-with-point-at pom-false + (should (equal (apply func-sym t args) block-false)) + (should-not (apply func-sym nil args)))))) =20 (ert-deftest org-edna-condition-done () (let* ((pom-done (org-edna-find-test-heading org-edna-test-id-heading-= four)) @@ -1522,30 +1748,444 @@ block-true block-false string))) =20 +(ert-deftest org-edna-condition/has-tags () + (let* ((pom-true (org-edna-find-test-heading "0fa0d4dd-40f2-4251-a558-= 4c6e2898c2df")) + (pom-false (org-edna-find-test-heading org-edna-test-id-heading= -one)) + (block-true (org-with-point-at pom-true (org-get-heading))) + (block-false (org-with-point-at pom-false (org-get-heading)))) + (org-edna-test-condition-form 'org-edna-condition/has-tags? + pom-true pom-false + block-true block-false + "test"))) + +(ert-deftest org-edna-condition/matches-tags () + (org-edna-test-condition-form + 'org-edna-condition/matches? + (org-edna-find-test-heading "0fa0d4dd-40f2-4251-a558-4c6e2898c2df") + (org-edna-find-test-heading org-edna-test-id-heading-one) + nil nil + "1&test") + (org-edna-test-condition-form + 'org-edna-condition/matches? + (org-edna-find-test-heading org-edna-test-id-heading-four) + (org-edna-find-test-heading "0fa0d4dd-40f2-4251-a558-4c6e2898c2df") + nil nil + "TODO=3D=3D\"DONE\"")) + =0C -;; Consideration +;;; Consideration + +(ert-deftest org-edna-consideration/any () + (let ((blocks-all-blocking `("a" "c" "b")) + (blocks-some-blocking `("a" nil "b")) + (blocks-no-blocking `(nil nil nil))) + (should (string-equal (org-edna-handle-consideration 'any blocks-all= -blocking) "a")) + (should (string-equal (org-edna-handle-consideration 'any blocks-som= e-blocking) "a")) + (should (not (org-edna-handle-consideration 'any blocks-no-blocking)= )))) =20 (ert-deftest org-edna-consideration/all () - (let ((blocks-blocking `("a" nil "b")) + (let ((blocks-all-blocking `("a" "c" "b")) + (blocks-some-blocking `(nil "c" nil)) (blocks-no-blocking `(nil nil nil))) - (should (string-equal (org-edna-handle-consideration 'all blocks-blo= cking) "a")) + (should (string-equal (org-edna-handle-consideration 'all blocks-all= -blocking) "a")) + (should (not (org-edna-handle-consideration 'all blocks-some-blockin= g))) (should (not (org-edna-handle-consideration 'all blocks-no-blocking)= )))) =20 (ert-deftest org-edna-consideration/integer () - (let ((blocks-blocking `("a" "c" "b")) - (blocks-no-blocking `("a" nil "b")) - (blocks-empty `(nil nil nil))) - (should (string-equal (org-edna-handle-consideration 1 blocks-blocki= ng) "a")) - (should (not (org-edna-handle-consideration 1 blocks-no-blocking))) - (should (not (org-edna-handle-consideration 1 blocks-empty))))) + (let ((blocks-all-blocking `("a" "c" "b")) + (blocks-some-blocking `("a" nil "b")) + (blocks-no-blocking `(nil nil nil))) + (should (string-equal (org-edna-handle-consideration 2 blocks-all-bl= ocking) "a")) + (should (string-equal (org-edna-handle-consideration 2 blocks-some-b= locking) "a")) + (should (not (org-edna-handle-consideration 2 blocks-no-blocking))))= ) =20 (ert-deftest org-edna-consideration/float () - (let ((blocks-blocking `("a" "c" "b")) - (blocks-no-blocking `("a" nil "b")) - (blocks-empty `(nil nil nil))) - (should (string-equal (org-edna-handle-consideration 0.25 blocks-blo= cking) "a")) - (should (not (org-edna-handle-consideration 0.25 blocks-no-blocking)= )) - (should (not (org-edna-handle-consideration 0.25 blocks-empty))))) + (let ((blocks-all-blocking `("a" "c" "b")) + (blocks-some-blocking `("a" nil "b")) + (blocks-no-blocking `(nil nil nil))) + (should (string-equal (org-edna-handle-consideration 0.25 blocks-all= -blocking) "a")) + (should (string-equal (org-edna-handle-consideration 0.25 blocks-som= e-blocking) "a")) + (should (not (org-edna-handle-consideration 0.25 blocks-no-blocking)= )))) + +=0C +;;; Full Run-through Tests from the Documentation + +(defmacro org-edna-doc-test-setup (heading-id &rest body) + (declare (indent 1)) + `(org-edna-with-test-heading ,heading-id + (save-restriction + ;; Only allow operating on the current tree + (org-narrow-to-subtree) + ;; Show the entire subtree + (outline-show-all) + ,@body))) + +(ert-deftest org-edna-doc-test/ancestors () + (org-edna-doc-test-setup "24a0c3bb-7e69-4e9e-bb98-5aba2ff17bb1" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading4-= pom ,heading5-pom) + (org-edna-test-children-marks))) + ;; Verify that we can't change the TODO state to DONE + (should (org-edna-test-check-block heading5-pom "Initial state of = heading 5")) + ;; Change the state at 4 to DONE + (org-edna-test-mark-done heading4-pom) + ;; Verify that ALL ancestors need to be changed + (should (org-edna-test-check-block heading5-pom "Heading 5 after p= arent changed")) + (org-edna-test-mark-done heading1-pom heading3-pom) + ;; Only need 1, 3, and 4 to change 5 + (should (not (org-edna-test-check-block heading5-pom + "Heading 5 after all parents= changed"))) + ;; Change the state back to TODO on all of them + (org-edna-test-mark-todo heading1-pom heading3-pom heading4-pom he= ading5-pom)))) + +(ert-deftest org-edna-doc-test/ancestors-cache () + (let ((org-edna-finder-use-cache t)) + (org-edna-doc-test-setup "24a0c3bb-7e69-4e9e-bb98-5aba2ff17bb1" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading= 4-pom ,heading5-pom) + (org-edna-test-children-marks))) + ;; Verify that we can't change the TODO state to DONE + (should (org-edna-test-check-block heading5-pom "Initial state o= f heading 5")) + ;; Change the state at 4 to DONE + (org-edna-test-mark-done heading4-pom) + ;; Verify that ALL ancestors need to be changed + (should (org-edna-test-check-block heading5-pom "Heading 5 after= parent changed")) + (org-edna-test-mark-done heading1-pom heading3-pom) + ;; Only need 1, 3, and 4 to change 5 + (should (not (org-edna-test-check-block heading5-pom + "Heading 5 after all paren= ts changed"))) + ;; Change the state back to TODO on all of them + (org-edna-test-mark-todo heading1-pom heading3-pom heading4-pom = heading5-pom))))) + +(ert-deftest org-edna-doc-test/descendants () + (org-edna-doc-test-setup "cc18dc74-00e8-4081-b46f-e36800041fe7" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading4-= pom ,heading5-pom) + (org-edna-test-children-marks))) + (should (org-edna-test-check-block heading1-pom "Heading 1 initial= state")) + ;; Change the state at 2 to DONE + (org-edna-test-mark-done heading2-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after c= hanging 2")) + ;; Try 3 + (org-edna-test-mark-done heading3-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after c= hanging 3")) + ;; Try 4 + (org-edna-test-mark-done heading4-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after c= hanging 4")) + ;; Try 5 + (org-edna-test-mark-done heading5-pom) + ;; Verify that ALL descendants need to be changed + (should (not (org-edna-test-check-block heading1-pom "Heading 1 af= ter changing 5")))))) + +(ert-deftest org-edna-doc-test/descendants-cache () + (let ((org-edna-finder-use-cache t)) + (org-edna-doc-test-setup "cc18dc74-00e8-4081-b46f-e36800041fe7" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading= 4-pom ,heading5-pom) + (org-edna-test-children-marks))) + (should (org-edna-test-check-block heading1-pom "Heading 1 initi= al state")) + ;; Change the state at 2 to DONE + (org-edna-test-mark-done heading2-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after= changing 2")) + ;; Try 3 + (org-edna-test-mark-done heading3-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after= changing 3")) + ;; Try 4 + (org-edna-test-mark-done heading4-pom) + ;; Verify that ALL descendants need to be changed + (should (org-edna-test-check-block heading1-pom "Heading 1 after= changing 4")) + ;; Try 5 + (org-edna-test-mark-done heading5-pom) + ;; Verify that ALL descendants need to be changed + (should (not (org-edna-test-check-block heading1-pom "Heading 1 = after changing 5"))))))) + +(ert-deftest org-edna-doc-test/laundry () + "Test for the \"laundry\" example in the documentation." + (org-edna-doc-test-setup "e57ce099-9f37-47f4-a6bb-61a84eb1fbbe" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading4-= pom) + (org-edna-test-children-marks))) + ;; Verify that headings 2, 3, and 4 are all blocked + (should (org-edna-test-check-block heading2-pom + "Initial attempt to change head= ing 2")) + (should (org-edna-test-check-block heading3-pom + "Initial attempt to change head= ing 3")) + (should (org-edna-test-check-block heading4-pom + "Initial attempt to change head= ing 4")) + ;; Mark heading 1 as DONE + (should (not (org-edna-test-check-block heading1-pom + "Set heading 1 to DONE"))) + ;; Only heading 2 should have a scheduled time + (should (string-equal (org-entry-get heading2-pom "SCHEDULED") + "<2000-01-15 Sat 01:00>")) + (should (not (org-entry-get heading3-pom "SCHEDULED"))) + (should (not (org-entry-get heading4-pom "SCHEDULED"))) + ;; The others should still be blocked. + (should (org-edna-test-check-block heading3-pom + "Second attempt to change headi= ng 3")) + (should (org-edna-test-check-block heading4-pom + "Second attempt to change headi= ng 4")) + ;; Try changing heading 2 + (should (not (org-edna-test-check-block heading2-pom + "Set heading 2 to DONE"))) + (should (string-equal (org-entry-get heading3-pom "SCHEDULED") + "<2000-01-16 Sun 09:00>")) + ;; 4 should still be blocked + (should (org-edna-test-check-block heading4-pom + "Second attempt to change headi= ng 4"))))) + +(ert-deftest org-edna-doc-test/laundry-cache () + "Test for the \"laundry\" example in the documentation. + +This version enables cache, ensuring that the repeated calls to +the relative finders all still work while cache is enabled." + (let ((org-edna-finder-use-cache t)) + (org-edna-doc-test-setup "e57ce099-9f37-47f4-a6bb-61a84eb1fbbe" + (pcase-let* ((`(,heading1-pom ,heading2-pom ,heading3-pom ,heading= 4-pom) + (org-edna-test-children-marks))) + ;; Verify that headings 2, 3, and 4 are all blocked + (should (org-edna-test-check-block heading2-pom + "Initial attempt to change he= ading 2")) + (should (org-edna-test-check-block heading3-pom + "Initial attempt to change he= ading 3")) + (should (org-edna-test-check-block heading4-pom + "Initial attempt to change he= ading 4")) + ;; Mark heading 1 as DONE + (should (not (org-edna-test-check-block heading1-pom + "Set heading 1 to DONE"))) + ;; Only heading 2 should have a scheduled time + (should (string-equal (org-entry-get heading2-pom "SCHEDULED") + "<2000-01-15 Sat 01:00>")) + (should (not (org-entry-get heading3-pom "SCHEDULED"))) + (should (not (org-entry-get heading4-pom "SCHEDULED"))) + ;; The others should still be blocked. + (should (org-edna-test-check-block heading3-pom + "Second attempt to change hea= ding 3")) + (should (org-edna-test-check-block heading4-pom + "Second attempt to change hea= ding 4")) + ;; Try changing heading 2 + (should (not (org-edna-test-check-block heading2-pom + "Set heading 2 to DONE"))) + (should (string-equal (org-entry-get heading3-pom "SCHEDULED") + "<2000-01-16 Sun 09:00>")) + ;; 4 should still be blocked + (should (org-edna-test-check-block heading4-pom + "Second attempt to change hea= ding 4")))))) + +(ert-deftest org-edna-doc-test/nightly () + (org-edna-doc-test-setup "8b6d9820-d943-4622-85c9-4a346e033453" + (pcase-let* ((`(,nightly-pom ,lunch-pom ,door-pom ,dog-pom) + (org-edna-test-children-marks))) + ;; Verify that Nightly is blocked + (should (org-edna-test-check-block nightly-pom "Initial Nightly Ch= eck")) + ;; Check off Lunch, and verify that nightly is still blocked + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-check-block nightly-pom "Nightly after Lunc= h")) + ;; Check off Door, and verify that nightly is still blocked + (org-edna-test-mark-done door-pom) + (should (org-edna-test-check-block nightly-pom "Nightly after Door= ")) + ;; Check off Dog. This should trigger the others. + (org-edna-test-mark-done dog-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch after= Nightly Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after N= ightly Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after Nig= htly Trigger")) + (should (string-equal (org-entry-get nightly-pom "DEADLINE") + "<2000-01-16 Sun +1d>"))))) + +(ert-deftest org-edna-doc-test/nightly-cache () + (let ((org-edna-finder-use-cache t)) + (org-edna-doc-test-setup "8b6d9820-d943-4622-85c9-4a346e033453" + (pcase-let* ((`(,nightly-pom ,lunch-pom ,door-pom ,dog-pom) + (org-edna-test-children-marks))) + ;; Verify that Nightly is blocked + (should (org-edna-test-check-block nightly-pom "Initial Nightly = Check")) + ;; Check off Lunch, and verify that nightly is still blocked + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-check-block nightly-pom "Nightly after Lu= nch")) + ;; Check off Door, and verify that nightly is still blocked + (org-edna-test-mark-done door-pom) + (should (org-edna-test-check-block nightly-pom "Nightly after Do= or")) + ;; Check off Dog. This should trigger the others. + (org-edna-test-mark-done dog-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch aft= er Nightly Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after= Nightly Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after N= ightly Trigger")) + (should (string-equal (org-entry-get nightly-pom "DEADLINE") + "<2000-01-16 Sun +1d>")))))) + +(ert-deftest org-edna-doc-test/daily () + (org-edna-doc-test-setup "630805bb-a864-4cdc-9a6f-0f126e887c66" + (pcase-let* ((`(,daily-pom ,lunch-pom ,door-pom ,dog-pom) + (org-edna-test-children-marks))) + ;; Check off Lunch. This should trigger the others. + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch after= Daily Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after D= aily Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after Dai= ly Trigger")) + (should (string-equal (org-entry-get daily-pom "DEADLINE") + "<2000-01-16 Sun +1d>")) + ;; Check off Door. This should trigger the others. + (org-edna-test-mark-done door-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch after= Door Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after D= oor Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after Doo= r Trigger")) + (should (string-equal (org-entry-get daily-pom "DEADLINE") + "<2000-01-17 Mon +1d>")) + ;; Check off Dog. This should trigger the others. + (org-edna-test-mark-done dog-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch after= Dog Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after D= og Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after Dog= Trigger")) + (should (string-equal (org-entry-get daily-pom "DEADLINE") + "<2000-01-18 Tue +1d>"))))) + +(ert-deftest org-edna-doc-test/weekly () + (org-edna-doc-test-setup "cf529a5e-1b0c-40c3-8f85-fe2fc4df0ffd" + (pcase-let* ((`(,weekly-pom ,lunch-pom ,door-pom ,dog-pom) + (org-edna-test-children-marks))) + ;; Check off Lunch. This should trigger the others. + (org-edna-test-mark-done lunch-pom) + (should (org-edna-test-compare-todos lunch-pom "TODO" "Lunch after= Weekly Trigger")) + (should (org-edna-test-compare-todos door-pom "TODO" "Door after W= eekly Trigger")) + (should (org-edna-test-compare-todos dog-pom "TODO" "Dog after Wee= kly Trigger")) + (should (string-equal (org-entry-get weekly-pom "DEADLINE") + "<2000-01-16 Sun +1d>"))))) + +(ert-deftest org-edna-doc-test/basic-shower () + (org-edna-doc-test-setup "34d67756-927b-4a21-a62d-7989bd138946" + (pcase-let* ((`(,shower-pom ,towels-pom) (org-edna-test-children-mar= ks))) + ;; Verify towels is blocked + (should (org-edna-test-check-block towels-pom "Initial Towels Chec= k")) + ;; Check off "Take Shower" and verify that it incremented the prop= erty + (org-edna-test-mark-done shower-pom) + (should (string-equal (org-entry-get shower-pom "COUNT") "1")) + ;; Verify towels is blocked + (should (org-edna-test-check-block towels-pom "Towels Check, Count= =3D1")) + ;; Check off "Take Shower" and verify that it incremented the prop= erty + (org-edna-test-mark-done shower-pom) + (should (string-equal (org-entry-get shower-pom "COUNT") "2")) + ;; Verify towels is blocked + (should (org-edna-test-check-block towels-pom "Towels Check, Count= =3D2")) + ;; Check off "Take Shower" and verify that it incremented the prop= erty + (org-edna-test-mark-done shower-pom) + (should (string-equal (org-entry-get shower-pom "COUNT") "3")) + ;; Verify that towels is no longer blocked. + (should (not (org-edna-test-check-block towels-pom "Towels Check, = Count=3D3"))) + ;; Verify that the property was reset. + (should (string-equal (org-entry-get shower-pom "COUNT") "0"))))) + +(ert-deftest org-edna-doc-test/snow-shoveling () + (org-edna-doc-test-setup "b1d89bd8-db96-486e-874c-98e2b3a8cbf2" + (pcase-let* ((`(,monday-pom ,tuesday-pom ,wednesday-pom ,shovel-pom) + (org-edna-test-children-marks))) + ;; Verify shovels is blocked + (should (org-edna-test-check-block shovel-pom "Initial Shovel Chec= k")) + + ;; Mark Monday as done + (org-edna-test-mark-done monday-pom) + (should (not (org-edna-test-check-block shovel-pom "Shovel after c= hanging Monday"))) + ;; Reset + (org-edna-test-mark-todo monday-pom tuesday-pom wednesday-pom shov= el-pom) + + ;; Mark Tuesday as done + (org-edna-test-mark-done tuesday-pom) + (should (not (org-edna-test-check-block shovel-pom "Shovel after c= hanging Tuesday"))) + + ;; Reset + (org-edna-test-mark-todo monday-pom tuesday-pom wednesday-pom shov= el-pom) + ;; Mark Wednesday as done + (org-edna-test-mark-done wednesday-pom) + (should (not (org-edna-test-check-block shovel-pom "Shovel after c= hanging Wednesday")))))) + +(ert-deftest org-edna-doc-test/consider-fraction () + (org-edna-doc-test-setup "7de5af8b-a226-463f-8360-edd88b99462a" + (pcase-let* ((`(,shovel-pom ,room-pom ,vacuum-pom ,lunch-pom ,edna-p= om) + (org-edna-test-children-marks))) + ;; Verify Edna is blocked + (should (org-edna-test-check-block edna-pom "Initial Edna Check")) + + ;; Mark Shovel snow as done + (org-edna-test-mark-done shovel-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check after Shov= el")) + + ;; Mark Vacuum as done + (org-edna-test-mark-done vacuum-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check after Vacu= um")) + + ;; Mark Room as done + (org-edna-test-mark-done room-pom) + ;; Verify Edna is no longer blocked + (should (not (org-edna-test-check-block edna-pom "Edna Check after= Room")))))) + +(ert-deftest org-edna-doc-test/consider-number () + (org-edna-doc-test-setup "b79279f7-be3c-45ac-96dc-6e962a5873d4" + (pcase-let* ((`(,shovel-pom ,room-pom ,vacuum-pom ,lunch-pom ,edna-p= om) + (org-edna-test-children-marks))) + ;; Verify Edna is blocked + (should (org-edna-test-check-block edna-pom "Initial Edna Check")) + + ;; Mark Shovel snow as done + (org-edna-test-mark-done shovel-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check after Shov= el")) + + ;; Mark Vacuum as done + (org-edna-test-mark-done vacuum-pom) + ;; Verify Edna is still blocked + (should (org-edna-test-check-block edna-pom "Edna Check after Vacu= um")) + + ;; Mark Room as done + (org-edna-test-mark-done room-pom) + ;; Verify Edna is no longer blocked + (should (not (org-edna-test-check-block edna-pom "Edna Check after= Room")))))) + +(ert-deftest org-edna-doc-test/has-tags () + (org-edna-doc-test-setup "6885e932-2c3e-4f20-ac22-5f5a0e791d67" + (pcase-let* ((`(,first-pom ,second-pom ,third-pom) + (org-edna-test-children-marks))) + ;; Verify that 3 is blocked + (should (org-edna-test-check-block third-pom "Initial Check")) + + ;; Remove the tag from Task 1 + (org-with-point-at first-pom + (org-set-tags-to "")) + + ;; Verify that 3 is still blocked + (should (org-edna-test-check-block third-pom "Check after removing= tag1")) + + ;; Remove the tag from Task 2 + (org-with-point-at second-pom + (org-set-tags-to "")) + + ;; Verify that 3 is no longer blocked + (should (not (org-edna-test-check-block third-pom "Check after rem= oving tag2")))))) + +(ert-deftest org-edna-doc-test/matches () + (org-edna-doc-test-setup "8170bf82-c2ea-49e8-bd79-97a95176783f" + (pcase-let* ((`(,first-pom ,second-pom ,third-pom) (org-edna-test-ch= ildren-marks))) + ;; Verify that 3 is blocked + (should (org-edna-test-check-block third-pom "Initial Check")) + + ;; Set 1 to DONE + (org-edna-test-mark-done first-pom) + + ;; Verify that 3 is still blocked + (should (org-edna-test-check-block third-pom "Check after First")) + + ;; Set 2 to DONE + (org-edna-test-mark-done second-pom) + + ;; Verify that 3 is no longer blocked + (should (not (org-edna-test-check-block third-pom "Check after Sec= ond")))))) + +(ert-deftest org-edna-doc-test/chain () + (org-edna-doc-test-setup "1bd282ea-9238-47ea-9b4d-dafba19d278b" + (pcase-let* ((`(,first-pom ,second-pom) (org-edna-test-children-mark= s))) + ;; Set 1 to DONE + (org-edna-test-mark-done first-pom) + (should (string-equal (org-entry-get second-pom "COUNT") "2"))))) =20 (provide 'org-edna-tests) =20 diff --git a/packages/org-edna/org-edna-tests.org b/packages/org-edna/org= -edna-tests.org index 5e20614..2819700 100644 --- a/packages/org-edna/org-edna-tests.org +++ b/packages/org-edna/org-edna-tests.org @@ -1,4 +1,5 @@ #+STARTUP: nologdone +#+STARTUP: indent #+PROPERTY: Effort_ALL 0:01 0:02 0:03 #+PROPERTY: COUNTER_ALL a b c d =20 @@ -21,7 +22,13 @@ along with this program. If not, see . #+END_QUOTE * Test Pool ** TODO Tagged Heading 1 :1:t= est: +:PROPERTIES: +:ID: 0fa0d4dd-40f2-4251-a558-4c6e2898c2df +:END: ** TODO Tagged Heading 2 :1:t= est: +:PROPERTIES: +:ID: 30957f69-8c31-4a13-86ff-f0c5026fb65d +:END: ** TODO ID Heading 1 :PROPERTIES: :ID: 0d491588-7da3-43c5-b51a-87fbd34f79f7 @@ -33,25 +40,28 @@ along with this program. If not, see . :LOGGING: nil :END: ** TODO ID Heading 3 -SCHEDULED: <2000-01-15 Sat 00:00> +DEADLINE: <2000-01-15 Sat 00:00> SCHEDULED: <2000-01-15 Sat 00:00> :PROPERTIES: :ID: 97e6b0f0-40c4-464f-b760-6e5ca9744eb5 :END: +<2000-01-15 Sat 00:00> ** DONE ID Heading 4 :PROPERTIES: :ID: 7d4d564b-18b2-445c-a0c8-b1b3fb9ad29e :END: ** Scheduled Headings *** TODO Scheduled Heading 1 -SCHEDULED: <2017-01-01 Sun> +DEADLINE: <2017-01-01 Sun> SCHEDULED: <2017-01-01 Sun> :PROPERTIES: :ID: caf27724-0887-4565-9765-ed2f1edcfb16 :END: +<2017-01-01 Sun> *** TODO Scheduled Heading 2 -SCHEDULED: <2017-01-01 Sun> +DEADLINE: <2017-01-01 Sun> SCHEDULED: <2017-01-01 Sun> :PROPERTIES: :ID: 5594d4f1-b1bb-400f-9f3d-e2f9b43e82c3 :END: +<2017-01-01 Sun> ** Sibling Headings :PROPERTIES: :ID: 21b8f1f5-14e8-4677-873d-69e0389fdc9e @@ -95,12 +105,14 @@ DEADLINE: <2017-01-07 Sat> SCHEDULED: <2017-01-02 Mo= n> :ID: 7c542695-8165-4c8b-b44d-4c12fa009548 :Effort: 0:01 :END: +<2017-01-02 Mon> *** [#B] Child Heading with Children DEADLINE: <2017-01-03 Tue> SCHEDULED: <2017-01-03 Tue> :PROPERTIES: :ID: c7a986df-8d89-4509-b086-6db429b5607b :Effort: 0:03 :END: +<2017-01-03 Tue> **** Child Heading One :PROPERTIES: :ID: 588bbd29-2e07-437f-b74d-f72459b545a1 @@ -115,25 +127,224 @@ DEADLINE: <2017-01-01 Sun> SCHEDULED: <2017-01-06 = Fri> :ID: 8c0b31a1-af49-473c-92ea-a5c1c3bace33 :Effort: 0:02 :END: +<2017-01-06 Fri> *** [#B] COMMENT Commented Child Heading DEADLINE: <2017-01-08 Sun> SCHEDULED: <2017-01-04 Wed> :PROPERTIES: :ID: 0a1b9508-17ce-49c5-8ff3-28a0076374f5 :Effort: 0:06 :END: +<2017-01-04 Wed> *** [#A] Archived Child Heading :ARCHI= VE: DEADLINE: <2017-01-02 Mon> SCHEDULED: <2017-01-01 Sun> :PROPERTIES: :ID: a4b6131e-0560-4201-86d5-f32b36363431 :Effort: 0:05 :END: +<2017-01-01 Sun> *** DONE [#C] Child Heading with DONE DEADLINE: <2017-01-05 Thu> SCHEDULED: <2017-01-05 Thu> :PROPERTIES: :ID: 4a1d74a2-b032-47da-a823-b32f5cab0aae :Effort: 0:08 :END: +<2017-01-05 Thu> ** Parent Sub Heading #2 :PROPERTIES: :ID: 4fe67f03-2b35-4708-8c38-54d2c4dfab81 :END: +* Documentation Tests +** Ancestors +:PROPERTIES: +:ID: 24a0c3bb-7e69-4e9e-bb98-5aba2ff17bb1 +:END: +*** TODO Heading 1 +**** TODO Heading 2 +**** TODO Heading 3 +***** TODO Heading 4 +****** TODO Heading 5 +:PROPERTIES: +:BLOCKER: ancestors +:END: +** Descendants +:PROPERTIES: +:ID: cc18dc74-00e8-4081-b46f-e36800041fe7 +:END: +*** TODO Heading 1 +:PROPERTIES: +:BLOCKER: descendants +:END: +**** TODO Heading 2 +**** TODO Heading 3 +***** TODO Heading 4 +****** TODO Heading 5 +** Laundry +:PROPERTIES: +:ID: e57ce099-9f37-47f4-a6bb-61a84eb1fbbe +:END: +*** TODO Put clothes in washer +SCHEDULED: <2000-01-15 Sat 00:00> +:PROPERTIES: +:TRIGGER: next-sibling scheduled!("++1h") +:END: +*** TODO Put clothes in dryer +:PROPERTIES: +:TRIGGER: next-sibling scheduled!("Sun 9:00") +:BLOCKER: previous-sibling +:END: +*** TODO Fold laundry +:PROPERTIES: +:TRIGGER: next-sibling scheduled!("++1h") +:BLOCKER: previous-sibling +:END: +*** TODO Put clothes away +:PROPERTIES: +:TRIGGER: next-sibling scheduled!("++1h") +:BLOCKER: previous-sibling +:END: +** Nightlies - Standard +:PROPERTIES: +:ID: 8b6d9820-d943-4622-85c9-4a346e033453 +:END: +*** TODO Nightly +DEADLINE: <2000-01-15 Sat +1d> +:PROPERTIES: +:ID: 2d94abf9-2d63-46fd-8dc5-cd396555bcfe +:BLOCKER: match("nightly") +:TRIGGER: match("nightly") todo!(TODO) +:END: +*** TODO Prepare Tomorrow's Lunch :night= ly: +:PROPERTIES: +:TRIGGER: if match("nightly") then ids(2d94abf9-2d63-46fd-8dc5-cd396555= bcfe) todo!(DONE) endif +:END: +*** TODO Lock Back Door :night= ly: +:PROPERTIES: +:TRIGGER: if match("nightly") then ids(2d94abf9-2d63-46fd-8dc5-cd396555= bcfe) todo!(DONE) endif +:END: +*** TODO Feed Dog :night= ly: +:PROPERTIES: +:TRIGGER: if match("nightly") then ids(2d94abf9-2d63-46fd-8dc5-cd396555= bcfe) todo!(DONE) endif +:END: +** Dailies - Consideration +:PROPERTIES: +:ID: 630805bb-a864-4cdc-9a6f-0f126e887c66 +:END: +*** TODO Daily +DEADLINE: <2000-01-15 Sat +1d> +:PROPERTIES: +:ID: 96f7e46c-40c3-4f5b-8f00-81a6e3cb122b +:TRIGGER: match("daily") todo!(TODO) +:END: +*** TODO Prepare Tomorrow's Lunch :dai= ly: +:PROPERTIES: +:TRIGGER: if consider(all) match("daily") then ids(96f7e46c-40c3-4f5b-8= f00-81a6e3cb122b) todo!(DONE) endif +:END: +*** TODO Lock Back Door :dai= ly: +:PROPERTIES: +:TRIGGER: if consider(3) match("daily") then ids(96f7e46c-40c3-4f5b-8f0= 0-81a6e3cb122b) todo!(DONE) endif +:END: +*** TODO Feed Dog :dai= ly: +:PROPERTIES: +:TRIGGER: if consider(0.9) match("daily") then ids(96f7e46c-40c3-4f5b-8= f00-81a6e3cb122b) todo!(DONE) endif +:END: +** Weeklies - Inverted Conditional +:PROPERTIES: +:ID: cf529a5e-1b0c-40c3-8f85-fe2fc4df0ffd +:END: +*** TODO Weekly +DEADLINE: <2000-01-15 Sat +1d> +:PROPERTIES: +:ID: 9a0c4b00-64be-4971-a93e-c530cbdd4b2b +:TRIGGER: match("weekly") todo!(TODO) +:END: +*** TODO Prepare Tomorrow's Lunch :weekl= y: +:PROPERTIES: +:TRIGGER: if match("weekly") then else ids(9a0c4b00-64be-4971-a93e-c530= cbdd4b2b) todo!(DONE) endif +:END: +*** TODO Lock Back Door :weekl= y: +:PROPERTIES: +:TRIGGER: if match("weekly") then else ids(9a0c4b00-64be-4971-a93e-c530= cbdd4b2b) todo!(DONE) endif +:END: +*** TODO Feed Dog :weekl= y: +:PROPERTIES: +:TRIGGER: if match("weekly") then else ids(9a0c4b00-64be-4971-a93e-c530= cbdd4b2b) todo!(DONE) endif +:END: +** Basic Shower - No Conditional +:PROPERTIES: +:ID: 34d67756-927b-4a21-a62d-7989bd138946 +:END: +*** TODO Take Shower +:PROPERTIES: +:COUNT: 0 +:TRIGGER: self set-property!("COUNT" inc) todo!("TODO") +:END: +*** TODO Wash Towels +:PROPERTIES: +:BLOCKER: previous-sibling !has-property?("COUNT" "3") +:TRIGGER: previous-sibling set-property!("COUNT" "0") +:END: +** Snow Shoveling +:PROPERTIES: +:ID: b1d89bd8-db96-486e-874c-98e2b3a8cbf2 +:END: +*** TODO Shovel on Monday +*** TODO Shovel on Tuesday +*** TODO Shovel on Wednesday +*** TODO Put shovel away +:PROPERTIES: +:BLOCKER: consider(all) rest-of-siblings-wrap +:END: +** Work I - Consider Fraction +:PROPERTIES: +:ID: 7de5af8b-a226-463f-8360-edd88b99462a +:END: +*** TODO Shovel Snow +*** TODO Clean room +*** TODO Vacuum +*** TODO Eat lunch +*** TODO Work on Edna +:PROPERTIES: +:BLOCKER: consider(0.5) rest-of-siblings-wrap +:END: +** Work II - Consider Number +:PROPERTIES: +:ID: b79279f7-be3c-45ac-96dc-6e962a5873d4 +:END: +*** TODO Shovel Snow +*** TODO Clean room +*** TODO Vacuum +*** TODO Eat lunch +*** TODO Work on Edna +:PROPERTIES: +:BLOCKER: consider(2) rest-of-siblings-wrap +:END: +** Has Tags +:PROPERTIES: +:ID: 6885e932-2c3e-4f20-ac22-5f5a0e791d67 +:END: +*** Task 1 :ta= g1: +*** Task 2 :tag3:ta= g2: +*** TODO Task 3 +:PROPERTIES: +:BLOCKER: rest-of-siblings-wrap has-tags?("tag1" "tag2") +:END: +** Matches +:PROPERTIES: +:ID: 8170bf82-c2ea-49e8-bd79-97a95176783f +:END: +*** TODO Task 1 +*** TODO Task 2 +*** TODO Task 3 +:PROPERTIES: +:BLOCKER: rest-of-siblings-wrap !matches?("TODO=3D=3D\"DONE\"") +:END: +** Chain +:PROPERTIES: +:ID: 1bd282ea-9238-47ea-9b4d-dafba19d278b +:END: +*** TODO Heading 1 +:PROPERTIES: +:COUNT: 2 +:TRIGGER: next-sibling chain!("COUNT") +:END: +*** TODO Heading 2 diff --git a/packages/org-edna/org-edna.el b/packages/org-edna/org-edna.e= l index e271cb0..486cd88 100644 --- a/packages/org-edna/org-edna.el +++ b/packages/org-edna/org-edna.el @@ -7,7 +7,7 @@ ;; Keywords: convenience, text, org ;; URL: https://savannah.nongnu.org/projects/org-edna-el/ ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5")) -;; Version: 1.0beta8 +;; Version: 1.0 =20 ;; This file is part of GNU Emacs. =20 @@ -96,7 +96,8 @@ Currently, the following are handled: =20 Everything else is returned as is." (pcase arg - ((and (pred symbolp) + ((and (pred symbolp) ;; Symbol + ;; Name matches `org-uuidgen-p' (let (pred org-uuidgen-p) (symbol-name arg))) (symbol-name arg)) (_ @@ -127,10 +128,12 @@ If KEY is an invalid Edna keyword, then return nil.= " (cond ;; Just return nil if it's not a symbol ((or (not key) - (not (symbolp key)))) + (not (symbolp key))) + nil) ((memq key '(consideration consider)) - ;; Function is ignored here - (cons 'consideration 'identity)) + ;; Function is ignored here, but `org-edna-describe-keyword' needs t= his + ;; function. + (cons 'consideration 'org-edna-handle-consideration)) ((string-suffix-p "!" (symbol-name key)) ;; Action (let ((func-sym (intern (format "org-edna-action/%s" key)))) @@ -396,7 +399,7 @@ correspond to internal variables." ,target-var ,considerati= on-var)))) ('consideration - `(setq ,consideration-var ,(nth 0 args)))))) + `(setq ,consideration-var ',(nth 0 args)))))) =20 (defun org-edna--expand-sexp-form (form &optional use-old-scope @@ -495,7 +498,7 @@ specific form were generated, the results will be reg= enerated and stored in cache. =20 Minor changes to an Org file, such as setting properties or -adding unrelated headlines, will be taken into account." +adding unrelated headings, will be taken into account." :group 'org-edna :type 'boolean) =20 @@ -504,6 +507,24 @@ adding unrelated headlines, will be taken into accou= nt." :group 'org-edna :type 'number) =20 +(defvar org-edna-finder-cache-enabled-finders + '(org-edna-finder/match + org-edna-finder/ids + org-edna-finder/olp + org-edna-finder/file + org-edna-finder/org-file) + "List of finders for which cache is enabled. + +Only edit this list if you've added custom finders. Many +finders, specifically relative finders, rely on the context in +which they're called. For these finders, cache will not work +properly. + +The default state of this list contains the built-in finders for +which context is irrelevant. + +Each entry is the function symbol for the finder.") + (defun org-edna--add-to-finder-cache (func-sym args) (let* ((results (apply func-sym args)) (input (make-org-edna--finder-input :func-sym func-sym @@ -547,8 +568,12 @@ following reasons: ;; We have an entry created within the allowed interval. (t entry)))) =20 +(defun org-edna--cache-is-enabled-for-finder (func-sym) + (memq func-sym org-edna-finder-cache-enabled-finders)) + (defun org-edna--handle-finder (func-sym args) - (if (not org-edna-finder-use-cache) + (if (or (not org-edna-finder-use-cache) + (not (org-edna--cache-is-enabled-for-finder func-sym))) ;; Not using cache, so use the function directly. (apply func-sym args) (let* ((entry (org-edna--get-cache-entry func-sym args))) @@ -558,6 +583,7 @@ following reasons: (org-edna--add-to-finder-cache func-sym args))))) =20 =0C +;;; Interactive Functions =20 (defmacro org-edna-run (change-plist &rest body) "Run a TODO state change. @@ -630,6 +656,7 @@ Remove Edna's workers from `org-trigger-hook' and (remove-hook 'org-blocker-hook 'org-edna-blocker-function)) =20 =0C +;;; Finders =20 ;; Tag Finder (defun org-edna-finder/match (match-spec &optional scope skip) @@ -641,7 +668,11 @@ MATCH-SPEC may be any valid match string; it is pass= ed straight into `org-map-entries'. =20 SCOPE and SKIP are their counterparts in `org-map-entries'. -SCOPE defaults to agenda, and SKIP defaults to nil. +SCOPE defaults to agenda, and SKIP defaults to nil. Because of +the different defaults in SCOPE, the symbol 'buffer may also be +used. This indicates that scope should be the current buffer, +honoring any restriction (the equivalent of the nil SCOPE in +`org-map-entries'.) =20 * TODO Test :PROPERTIES: @@ -650,7 +681,10 @@ SCOPE defaults to agenda, and SKIP defaults to nil. =20 \"Test\" will block until all entries tagged \"test\" and \"mine\" in the agenda files are marked DONE." + ;; Our default is agenda... (setq scope (or scope 'agenda)) + ;; ...but theirs is the buffer + (when (eq scope 'buffer) (setq scope nil)) (org-map-entries ;; Find all entries in the agenda files that match the given tag. (lambda nil (point-marker)) @@ -776,6 +810,14 @@ Return a list of markers for the descendants." (when-let* ((entry-tags (org-get-tags-at))) (seq-intersection tags entry-tags))) =20 +(defun org-edna--get-timestamp-time (pom &optional inherit) + "Get the timestamp time as a time tuple, of a format suitable +for calling org-schedule with, or if there is no timestamp, +returns nil." + (let ((time (org-entry-get pom "TIMESTAMP" inherit))) + (when time + (apply 'encode-time (org-parse-time-string time))))) + (defun org-edna-finder/relatives (&rest options) "Find some relative of the current heading. =20 @@ -841,7 +883,9 @@ All arguments are symbols, unless noted otherwise. - scheduled-up: Scheduled time, farthest first - scheduled-down: Scheduled time, closest first - deadline-up: Deadline time, farthest first -- deadline-down: Deadline time, closest first" +- deadline-down: Deadline time, closest first +- timestamp-up: Timestamp time, farthest first +- timestamp-down: Timestamp time, closest first" (let (targets sortfun reverse-sort @@ -994,6 +1038,18 @@ All arguments are symbols, unless noted otherwise. (lambda (lhs rhs) (let ((time-lhs (org-get-deadline-time lhs)) (time-rhs (org-get-deadline-time rhs))) + (time-less-p time-lhs time-rhs))))) + ('timestamp-up + (setq sortfun + (lambda (lhs rhs) + (let ((time-lhs (org-edna--get-timestamp-time lhs)) + (time-rhs (org-edna--get-timestamp-time rhs))) + (not (time-less-p time-lhs time-rhs)))))) + ('timestamp-down + (setq sortfun + (lambda (lhs rhs) + (let ((time-lhs (org-edna--get-timestamp-time lhs)) + (time-rhs (org-edna--get-timestamp-time rhs))) (time-less-p time-lhs time-rhs))))))) (setq filterfuns (nreverse filterfuns)) (when (and targets sortfun) @@ -1224,6 +1280,7 @@ which ones will and won't work." (list (point-min-marker)))) =20 =0C +;;; Actions =20 ;; Set TODO state (defun org-edna-action/todo! (_last-entry new-state) @@ -1250,11 +1307,18 @@ N is an integer. WHAT can be `day', `month', `ye= ar', `minute', (org-timestamp-change n what) (buffer-string))) =20 +(defun org-edna--property-for-planning-type (type) + (pcase type + ('scheduled "SCHEDULED") + ('deadline "DEADLINE") + ('timestamp "TIMESTAMP") + (_ ""))) + (defun org-edna--get-planning-info (what) "Get the planning info for WHAT. =20 -WHAT is either 'scheduled or 'deadline." - (org-entry-get nil (if (eq what 'scheduled) "SCHEDULED" "DEADLINE"))) +WHAT is one of 'scheduled, 'deadline, or 'timestamp." + (org-entry-get nil (org-edna--property-for-planning-type what))) =20 ;; Silence the byte-compiler (defvar parse-time-weekdays) @@ -1850,6 +1914,7 @@ Does nothing if the source heading has no property = PROPERTY." (org-entry-put nil property old-prop))) =20 =0C +;;; Conditions =20 ;; For most conditions, we return true if condition is true and neg is f= alse, or ;; if condition is false and neg is true: @@ -1952,57 +2017,104 @@ starting from target's position." (when (org-xor condition neg) (format "%s %s in %s" (if neg "Did Not Find" "Found") match (buffe= r-name))))) =20 +(defun org-edna-condition/has-tags? (neg &rest tags) + "Check if the target heading has tags. + +Edna Syntax: has-tags?(\"tag1\" \"tag2\"...) + +Block if the target heading has any of the tags tag1, tag2, etc." + (let* ((condition (apply 'org-edna-entry-has-tags-p tags))) + (when (org-xor condition neg) + (org-get-heading)))) + +(defun org-edna--heading-matches (match-string) + "Return non-nil if the current heading matches MATCH-STRING." + (let* ((matcher (cdr (org-make-tags-matcher match-string))) + (todo (org-entry-get nil "TODO")) + (tags (org-get-tags-at)) + (level (org-reduced-level (org-outline-level)))) + (funcall matcher todo tags level))) + +(defun org-edna-condition/matches? (neg match-string) + "Matches a heading against a match string. + +Edna Syntax: matches?(\"MATCH-STRING\") + +Blocks if the target heading matches MATCH-STRING. + +MATCH-STRING is a valid match string as passed to +`org-map-entries'." + (let* ((condition (org-edna--heading-matches match-string))) + (when (org-xor condition neg) + (org-get-heading)))) + =0C +;;; Consideration =20 (defun org-edna-handle-consideration (consideration blocks) "Handle consideration CONSIDERATION. =20 -Edna Syntax: consider(all) [1] +Edna Syntax: consider(any) [1] Edna Syntax: consider(N) [2] Edna Syntax: consider(P) [3] -Edna Syntax: consider(any) [4] +Edna Syntax: consider(all) [4] + +A blocker can be read as: +\"If ANY heading in TARGETS matches CONDITION, block this heading\" + +The consideration is \"ANY\". + +Form 1 blocks only if any target matches the condition. This is +the default. =20 -Form 1: consider all targets when evaluating conditions. -Form 2: consider the condition met if only N of the targets pass. -Form 3: consider the condition met if only P% of the targets pass. -Form 4: consider the condition met if any target meets it +Form 2 blocks only if at least N targets meet the condition. N=3D1 +is the same as 'any'. =20 -If CONSIDERATION is nil, default to 'all. +Form 3 blocks only if *at least* fraction P of the targets meet +the condition. This should be a decimal value between 0 and 1. + +Form 4 blocks only if all targets match the condition. + +The default consideration is \"any\". + +If CONSIDERATION is nil, default to 'any. =20 The \"consideration\" keyword is also provided. It functions the same as \"consider\"." - ;; BLOCKS is a list of blocking entries; if one isn't blocked, its ent= ry will - ;; be nil. - (let ((consideration (or consideration 'all)) - (first-block (seq-find #'identity blocks)) - (total-blocks (seq-length blocks)) - (fulfilled (seq-count #'not blocks))) + ;; BLOCKS is a list of entries that meets the blocking condition; if o= ne isn't + ;; blocked, its entry will be nil. + (let* ((consideration (or consideration 'any)) + (first-block (seq-find #'identity blocks)) + (total-blocks (seq-length blocks)) + (fulfilled (seq-count #'not blocks)) + (blocked (- total-blocks fulfilled))) (pcase consideration - ('all - ;; All of them must be fulfilled, so find the first one that isn'= t. - first-block) ('any - ;; Any of them can be fulfilled, so find the first one that is + ;; In order to pass, all of them must be fulfilled, so find the f= irst one + ;; that isn't. + first-block) + ('all + ;; All of them must be set to block, so if one of them doesn't bl= ock, the + ;; entire entry won't block. (if (> fulfilled 0) ;; Have one fulfilled nil ;; None of them are fulfilled first-block)) ((pred integerp) - ;; A fixed number of them must be fulfilled, so check how many ar= en't. - (let* ((fulfilled (seq-count #'not blocks))) - (if (>=3D fulfilled consideration) - nil - first-block))) + ;; A minimum number of them must meet the blocking condition, so = check + ;; how many block. + (if (>=3D blocked consideration) + first-block + nil)) ((pred floatp) - ;; A certain percentage of them must be fulfilled - (let* ((fulfilled (seq-count #'not blocks))) - (if (>=3D (/ (float fulfilled) (float total-blocks)) considerat= ion) - nil - first-block)))))) + ;; A certain percentage of them must block for the blocker to blo= ck. + (let* ((float-blocked (/ (float blocked) (float total-blocks)))) + (if (>=3D float-blocked consideration) + first-block + nil)))))) =20 =0C - ;;; Popout editing =20 (defvar org-edna-edit-original-marker nil) @@ -2183,7 +2295,7 @@ SUFFIX is an additional suffix to use when matching= keywords." "Return a list of all allowed Edna keywords for a blocker." `(,@(org-edna--collect-finders) ,@(org-edna--collect-conditions) - "consideration")) + "consideration" "consider")) =20 (defun org-edna-completions-for-trigger () "Return a list of all allowed Edna keywords for a trigger." @@ -2221,7 +2333,32 @@ PRED, and ACTION." (when-let* ((bounds (bounds-of-thing-at-point 'symbol))) (list (car bounds) (cdr bounds) 'org-edna-completion-table-function)= )) =20 +(defun org-edna-describe-keyword (keyword) + "Describe the Org Edna keyword KEYWORD. + +KEYWORD should be a string for a keyword recognized by edna. + +Displays help for KEYWORD in the Help buffer." + (interactive + (list + (completing-read + "Keyword: " + `(,@(org-edna--collect-finders) + ,@(org-edna--collect-actions) + ,@(org-edna--collect-conditions) + "consideration" "consider") + nil ;; No filter predicate + t))) ;; require match + ;; help-split-fundoc splits the usage info from the rest of the docume= ntation. + ;; This avoids having another usage line in the keyword documentation = that has + ;; nothing to do with how edna expects the function. + (pcase-let* ((`(,_type . ,func) (org-edna--function-for-key (intern ke= yword))) + (`(,_usage . ,doc) (help-split-fundoc (documentation func= t) func))) + (with-help-window (help-buffer) + (princ doc)))) + =0C +;;; Bug Reports =20 (declare-function lm-report-bug "lisp-mnt" (topic)) =20 diff --git a/packages/org-edna/org-edna.info b/packages/org-edna/org-edna= .info index 4f29ebe..abd1b88 100644 --- a/packages/org-edna/org-edna.info +++ b/packages/org-edna/org-edna.info @@ -36,6 +36,7 @@ Basic Features =20 * Finders:: How to find targets * Actions:: Next steps +* Getting Help:: Getting some help =20 Finders =20 @@ -84,12 +85,14 @@ Advanced Features =20 Conditions =20 -* done:: -* headings:: -* todo-state:: -* variable-set:: -* has-property:: -* re-search:: Search for a regular expression +* Heading is DONE:: +* File Has Headings:: +* Heading TODO State:: +* Lisp Variable Set:: +* Heading Has Property:: +* Regexp Search:: Search for a regular expression +* Checking Tags:: Matching against a set of tags +* Matching Headings:: Matching against a match string * Negating Conditions:: =20 =20 @@ -112,6 +115,7 @@ Contributing =20 Changelog =20 +* 1.0: 10. * 1.0beta8: 10beta8. * 1.0beta7: 10beta7. * 1.0beta6: 10beta6. @@ -314,6 +318,7 @@ The most basic features of Edna are *finders* and *ac= tions*. =20 * Finders:: How to find targets * Actions:: Next steps +* Getting Help:: Getting some help =20 =1F File: org-edna.info, Node: Finders, Next: Actions, Up: Basic Features @@ -666,6 +671,8 @@ and for similarity to org-depend. =E2=80=A2 scheduled-down: Scheduled time, closest first =E2=80=A2 deadline-up: Deadline time, farthest first =E2=80=A2 deadline-down: Deadline time, closest first + =E2=80=A2 timestamp-up: Timestamp time, farthest first + =E2=80=A2 timestamp-down: Timestamp time, closest first =20 Many of the other finders are shorthand for argument combinations of relative: @@ -758,7 +765,7 @@ when it reaches the end. Identical to the *note rest-of-siblings-wrap:: finder. =20 =1F -File: org-edna.info, Node: Actions, Prev: Finders, Up: Basic Features +File: org-edna.info, Node: Actions, Next: Getting Help, Prev: Finders= , Up: Basic Features =20 Actions =3D=3D=3D=3D=3D=3D=3D @@ -863,19 +870,23 @@ following, PLANNING is either scheduled or deadline= . =20 Examples: =20 - =E2=80=A2 scheduled!(=E2=80=9CMon 09:00=E2=80=9D) -> Set SCHEDULED to= the following Monday at - 9:00 - =E2=80=A2 deadline!(=E2=80=9C++2h=E2=80=9D) -> Set DEADLINE to two ho= urs from now. - =E2=80=A2 deadline!(copy) deadline!(=E2=80=9C+1h=E2=80=9D) -> Copy th= e source deadline to the - target, then increment it by an hour. - =E2=80=A2 scheduled!(=E2=80=9C+1wkdy=E2=80=9D) -> Set SCHEDULED to th= e next weekday - =E2=80=A2 scheduled!(=E2=80=9C+1d +wkdy=E2=80=9D) -> Same as above - =E2=80=A2 deadline!(=E2=80=9C+1m -wkdy=E2=80=9D) -> Set SCHEDULED up = one month, but move - backward to find a weekend - =E2=80=A2 scheduled!(=E2=80=9Cfloat 2 Tue Feb=E2=80=9D) -> Set SCHEDU= LED to the second - Tuesday in the following February - =E2=80=A2 scheduled!(=E2=80=9Cfloat 3 Thu=E2=80=9D) -> Set SCHEDULED = to the third Thursday in - the following month +scheduled!(=E2=80=9CMon 09:00=E2=80=9D) + Set SCHEDULED to the following Monday at 9:00 +deadline!(=E2=80=9C++2h=E2=80=9D) + Set DEADLINE to two hours from now. +deadline!(copy) deadline!(=E2=80=9C+1h=E2=80=9D) + Copy the source deadline to the target, then increment it by an + hour. +scheduled!(=E2=80=9C+1wkdy=E2=80=9D) + Set SCHEDULED to the next weekday +scheduled!(=E2=80=9C+1d +wkdy=E2=80=9D) + Same as above +deadline!(=E2=80=9C+1m -wkdy=E2=80=9D) + Set DEADLINE up one month, but move backward to find a weekend +scheduled!(=E2=80=9Cfloat 2 Tue Feb=E2=80=9D) + Set SCHEDULED to the second Tuesday in the following February +scheduled!(=E2=80=9Cfloat 3 Thu=E2=80=9D) + Set SCHEDULED to the third Thursday in the following month =20 =1F File: org-edna.info, Node: TODO State, Next: Archive, Prev: Scheduled= /Deadline, Up: Actions @@ -891,6 +902,23 @@ TODO State state. It can also be the empty string, in which case the TODO state is removed. =20 + Example: + + * TODO Heading 1 + :PROPERTIES: + :TRIGGER: next-sibling todo!(DONE) + :END: + * TODO Heading 2 + + In this example, when =E2=80=9CHeading 1=E2=80=9D is marked as DONE, = it will also +mark =E2=80=9CHeading 2=E2=80=9D as DONE: + + * DONE Heading 1 + :PROPERTIES: + :TRIGGER: next-sibling todo!(DONE) + :END: + * DONE Heading 2 + =1F File: org-edna.info, Node: Archive, Next: Chain Property, Prev: TODO = State, Up: Actions =20 @@ -915,6 +943,28 @@ Chain Property Copies PROPERTY from the source entry to all targets. Does nothing if the source heading has no property PROPERTY. =20 + Example: + + * TODO Heading 1 + :PROPERTIES: + :COUNTER: 2 + :TRIGGER: next-sibling chain!("COUNTER") + :END: + * TODO Heading 2 + + In this example, when =E2=80=9CHeading 1=E2=80=9D is marked as DONE, = it will copy its +COUNTER property to =E2=80=9CHeading 2=E2=80=9D: + + * DONE Heading 1 + :PROPERTIES: + :COUNTER: 2 + :TRIGGER: next-sibling chain!("COUNTER") + :END: + * TODO Heading 2 + :PROPERTIES: + :COUNTER: 2 + :END: + =1F File: org-edna.info, Node: Clocking, Next: Property, Prev: Chain Prop= erty, Up: Actions =20 @@ -985,7 +1035,7 @@ already set: =20 * TODO Test :PROPERTIES: - :TRIGGER: self set-property("TEST" inc) + :TRIGGER: self set-property!("TEST" inc) :END: =20 In the above example, if =E2=80=9CTest=E2=80=9D is set to DONE, Edna = will fail to @@ -997,10 +1047,11 @@ increment the TEST property, since it doesn=E2=80=99= t exist. =20 Examples: =20 - =E2=80=A2 set-property!(=E2=80=9CCOUNTER=E2=80=9D =E2=80=9C1=E2=80=9D= ) -> Sets the property COUNTER to 1 on - all targets - =E2=80=A2 set-property!(=E2=80=9CCOUNTER=E2=80=9D inc) -> Increments = the property COUNTER by - 1. Following the previous example, it would be 2. +set-property!(=E2=80=9CCOUNTER=E2=80=9D =E2=80=9C1=E2=80=9D) + Sets the property COUNTER to 1 on all targets +set-property!(=E2=80=9CCOUNTER=E2=80=9D inc) + Increments the property COUNTER by 1. Following the previous + example, it would be 2. =20 =1F File: org-edna.info, Node: Priority, Next: Tag, Prev: Property, Up: = Actions @@ -1045,14 +1096,32 @@ File: org-edna.info, Node: Effort, Prev: Tag, = Up: Actions Effort ------ =20 - =E2=80=A2 Syntax: set-effort!(VALUE) +Modifies the effort of all targets. =20 - Sets the effort of all targets according to VALUE: + =E2=80=A2 Syntax: set-effort!(=E2=80=9CVALUE=E2=80=9D) =20 - =E2=80=A2 If VALUE is a string, then the effort is set to VALUE - =E2=80=A2 If VALUE is an integer, then set the value to the VALUE=E2=80= =99th allowed - effort property - =E2=80=A2 If VALUE is the symbol =E2=80=99increment, increment effort + Set the effort of all targets to =E2=80=9CVALUE=E2=80=9D. + + =E2=80=A2 Syntax: set-effort!(NUMBER) + + Sets the effort to the NUMBER=E2=80=99th allowed effort property. + + =E2=80=A2 Syntax: set-effort!(increment) + + Increment the effort value. + +=1F +File: org-edna.info, Node: Getting Help, Prev: Actions, Up: Basic Fea= tures + +Getting Help +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Edna provides help for any keyword with =E2=80=98M-x org-edna-describe-k= eyword=E2=80=99. +When invoked, a list of keywords (finders, actions, etc.) known to Edna +will be provided. Select any one to get its description. + + This description includes the syntax and an explanation of what the +keyword does. Some descriptions also contain examples. =20 =1F File: org-edna.info, Node: Advanced Features, Next: Extending Edna, P= rev: Basic Features, Up: Top @@ -1109,29 +1178,31 @@ means block if any target heading isn=E2=80=99t d= one. =20 * Menu: =20 -* done:: -* headings:: -* todo-state:: -* variable-set:: -* has-property:: -* re-search:: Search for a regular expression +* Heading is DONE:: +* File Has Headings:: +* Heading TODO State:: +* Lisp Variable Set:: +* Heading Has Property:: +* Regexp Search:: Search for a regular expression +* Checking Tags:: Matching against a set of tags +* Matching Headings:: Matching against a match string * Negating Conditions:: =20 =1F -File: org-edna.info, Node: done, Next: headings, Up: Conditions +File: org-edna.info, Node: Heading is DONE, Next: File Has Headings, = Up: Conditions =20 -done ----- +Heading is DONE +--------------- =20 =E2=80=A2 Syntax: done? =20 Blocks the source heading if any target heading is DONE. =20 =1F -File: org-edna.info, Node: headings, Next: todo-state, Prev: done, U= p: Conditions +File: org-edna.info, Node: File Has Headings, Next: Heading TODO State= , Prev: Heading is DONE, Up: Conditions =20 -headings --------- +File Has Headings +----------------- =20 =E2=80=A2 Syntax: headings? =20 @@ -1143,10 +1214,10 @@ Org heading. This means that target does not hav= e to be a heading. The above example blocks if refile.org has any headings. =20 =1F -File: org-edna.info, Node: todo-state, Next: variable-set, Prev: head= ings, Up: Conditions +File: org-edna.info, Node: Heading TODO State, Next: Lisp Variable Set= , Prev: File Has Headings, Up: Conditions =20 -todo-state ----------- +Heading TODO State +------------------ =20 =E2=80=A2 Syntax: todo-state?(STATE) =20 @@ -1155,10 +1226,10 @@ todo-state STATE may be a string or a symbol. =20 =1F -File: org-edna.info, Node: variable-set, Next: has-property, Prev: to= do-state, Up: Conditions +File: org-edna.info, Node: Lisp Variable Set, Next: Heading Has Proper= ty, Prev: Heading TODO State, Up: Conditions =20 -variable-set ------------- +Lisp Variable Set +----------------- =20 =E2=80=A2 Syntax: variable-set?(VARIABLE VALUE) =20 @@ -1167,24 +1238,45 @@ against VALUE. Block the source heading if VARIAB= LE =3D VALUE. =20 VARIABLE should be a symbol, and VALUE is any valid lisp expression. =20 - self variable-set?(test-variable 12) + Examples: + +self variable-set?(test-variable 12) + Blocks if the variable =E2=80=98test-variable=E2=80=99 is set to 12= . +self variable-set?(buffer-file-name =E2=80=9Corg-edna.org=E2=80=9D) + Blocks if the variable =E2=80=98buffer-file-name=E2=80=99 is set to= =E2=80=9Corg-edna.org=E2=80=9D. =20 =1F -File: org-edna.info, Node: has-property, Next: re-search, Prev: varia= ble-set, Up: Conditions +File: org-edna.info, Node: Heading Has Property, Next: Regexp Search, = Prev: Lisp Variable Set, Up: Conditions =20 -has-property ------------- +Heading Has Property +-------------------- =20 =E2=80=A2 Syntax: has-property?(=E2=80=9CPROPERTY=E2=80=9D =E2=80=9CV= ALUE=E2=80=9D) =20 Tests each target for the property PROPERTY, and blocks if it=E2=80=99= s set to VALUE. =20 + Example: + + * TODO Take Shower + :PROPERTIES: + :COUNT: 1 + :TRIGGER: self set-property!("COUNT" inc) todo!("TODO") + :END: + * TODO Wash Towels + :PROPERTIES: + :BLOCKER: previous-sibling !has-property?("COUNT" "3") + :TRIGGER: previous-sibling set-property!("COUNT" "0") + :END: + + In this example, =E2=80=9CWash Towels=E2=80=9D can=E2=80=99t be compl= eted until the user has +showered at least three times. + =1F -File: org-edna.info, Node: re-search, Next: Negating Conditions, Prev= : has-property, Up: Conditions +File: org-edna.info, Node: Regexp Search, Next: Checking Tags, Prev: = Heading Has Property, Up: Conditions =20 -re-search ---------- +Regexp Search +------------- =20 =E2=80=A2 Syntax: re-search?(=E2=80=9CREGEXP=E2=80=9D) =20 @@ -1192,10 +1284,59 @@ re-search in any of the targets. =20 The targets are expected to be files, although this will work with -other targets as well. +other targets as well. When given a target heading, the heading=E2=80=99= s file +will be searched. + +=1F +File: org-edna.info, Node: Checking Tags, Next: Matching Headings, Pr= ev: Regexp Search, Up: Conditions + +Checking Tags +------------- + + =E2=80=A2 Syntax: has-tags?(=E2=80=9CTAG1=E2=80=9D =E2=80=9CTAG2=E2=80= =9D ...) + + Blocks the source heading if any of the target headings have one or +more of the given tags. + + * TODO Task 1 = :tag1: + * TODO Task 2 := tag3:tag2: + * TODO Task 3 + :PROPERTIES: + :BLOCKER: rest-of-siblings-wrap has-tags?("tag1" "tag2") + :END: + + In the above example, Tasks 1 and 2 will block Task 3. Task 1 will +block it because it contains =E2=80=9Ctag1=E2=80=9D as one of its tags, = and likewise for +Task 2 and =E2=80=9Ctag2=E2=80=9D. + + Note that marking =E2=80=9CTask 1=E2=80=9D or =E2=80=9CTask 2=E2=80=9D= as DONE will not unblock =E2=80=9CTask +3=E2=80=9D. If you want to set up such a system, use the *note match:: = finder. + +=1F +File: org-edna.info, Node: Matching Headings, Next: Negating Condition= s, Prev: Checking Tags, Up: Conditions + +Matching Headings +----------------- + + =E2=80=A2 Syntax: matches?(=E2=80=9CMATCH-STRING=E2=80=9D) + + Blocks the source heading if any of the target headings match against +MATCH-STRING. + + MATCH-STRING is a string passed to =E2=80=98org-map-entries=E2=80=99. + + * TODO Task 1 + * TODO Task 2 + * TODO Task 3 + :PROPERTIES: + :BLOCKER: rest-of-siblings-wrap !matches?("TODO=3D=3D\"DONE\"") + :END: + + In the above example, Tasks 1 and 2 will block Task 3 until they=E2=80= =99re +marked as DONE. =20 =1F -File: org-edna.info, Node: Negating Conditions, Prev: re-search, Up: = Conditions +File: org-edna.info, Node: Negating Conditions, Prev: Matching Heading= s, Up: Conditions =20 Negating Conditions ------------------- @@ -1213,45 +1354,74 @@ File: org-edna.info, Node: Consideration, Next:= Conditional Forms, Prev: Cond Consideration =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -=E2=80=9CConsideration=E2=80=9D is a special keyword that=E2=80=99s only= valid for blockers. +=E2=80=9CConsideration=E2=80=9D and =E2=80=9Cconsider=E2=80=9D are speci= al keywords that are only valid +for blockers. =20 - This says =E2=80=9CAllow a task to complete if CONSIDERATION of its t= argets -pass the given condition=E2=80=9D. + A blocker says =E2=80=9CIf ANY heading in TARGETS meets CONDITION, bl= ock this +task=E2=80=9D. =20 - This keyword can allow specifying only a portion of tasks to -consider: + In order to modify the ANY part of that statement, the =E2=80=98consi= der=E2=80=99 +keyword may be used: =20 - 1. consider(PERCENT) - 2. consider(NUMBER) - 3. consider(all) (Default) - 4. consider(any) + 1. consider(any) + 2. consider(all) + 3. consider(FRACTION) + 4. consider(NUMBER) =20 - (1) tells the blocker to only consider some portion of the targets. -If at least PERCENT of them are in a DONE state, allow the task to be -set to DONE. PERCENT must be a decimal, and doesn=E2=80=99t need to incl= ude a -%-sign. + (1) blocks the current task if any target meets the blocking +condition. This is the default case. =20 - (2) tells the blocker to only consider NUMBER of the targets. + (2) blocks the current task only if all targets meet the blocking +condition. =20 - (3) tells the blocker to consider all following targets. + * Shovel Snow + ** TODO Shovel on Monday + ** TODO Shovel on Tuesday + ** TODO Shovel on Wednesday + ** TODO Put shovel away + :PROPERTIES: + :BLOCKER: consider(all) rest-of-siblings-wrap + :END: =20 - (4) tells the blocker to allow passage if any of the targets pass. + The above example blocks =E2=80=9CPut shovel away=E2=80=9D so long as= all of the +siblings are still marked TODO. =20 - A consideration must be specified before the conditions to which it -applies: + (3) blocks the current task if at least FRACTION of the targets meet +the blocking condition. =20 - consider(0.5) siblings match("find_me") consider(all) !done? + * Work + ** TODO Shovel Snow + ** TODO Clean room + ** TODO Vacuum + ** TODO Eat lunch + ** TODO Work on Edna + :PROPERTIES: + :BLOCKER: consider(0.5) rest-of-siblings-wrap + :END: + + The above example blocks =E2=80=9CWork on Edna=E2=80=9D so long as at= least half of +the siblings are marked TODO. This means that three of them must be +completed before development can begin on Edna. =20 - The above code will allow task completion if at least half the -siblings are complete, and all tasks tagged =E2=80=9Cfind_me=E2=80=9D ar= e complete. + (4) blocks the current task if at least NUMBER of the targets meet +the blocking condition. =20 - consider(1) ids(ID1 ID2 ID3) consider(2) ids(ID3 ID4 ID5 ID6) + * Work + ** TODO Shovel Snow + ** TODO Clean room + ** TODO Vacuum + ** TODO Eat lunch + ** TODO Work on Edna + :PROPERTIES: + :BLOCKER: consider(2) rest-of-siblings-wrap + :END: =20 - The above code will allow task completion if at least one of ID1, -ID2, and ID3 are complete, and at least two of ID3, ID4, ID5, and ID6 -are complete. + The above example blocks =E2=80=9CWork on Edna=E2=80=9D so long as tw= o of the +siblings are marked TODO. This means that NUMBER=3D1 is the same as +specifying =E2=80=98any=E2=80=99. =20 - If no consideration is given, ALL is assumed. + A consideration must be specified before the conditions to which it +applies. =20 Both =E2=80=9Cconsider=E2=80=9D and =E2=80=9Cconsideration=E2=80=9D a= re valid keywords; they both mean the same thing. @@ -1305,18 +1475,18 @@ it won=E2=80=99t trigger the original until the l= ast one is marked DONE. Occasionally, you may find that you=E2=80=99d rather execute a form i= f the condition *would* block. There are two options. =20 - The first is confusing: use =E2=80=98consider(any)=E2=80=99. This wi= ll tell Edna to -pass so long as one of the targets meets the condition. This is the -opposite of Edna=E2=80=99s standard operation, which only allows passage= if all -targets meet the condition. + The first is to use =E2=80=98consider(all)=E2=80=99. This will tell = Edna to block +only if all of the targets meets the condition, and thus not block if at +least one of them does not meet the condition. This is the opposite of +Edna=E2=80=99s standard operation, which only allows passage if all targ= ets meet +the condition. =20 * TODO Prepare Tomorrow's Lunch = :nightly: :PROPERTIES: - :TRIGGER: if consider(any) match("nightly") then ids(12345) todo= !(DONE) endif + :TRIGGER: if consider(all) match("nightly") then ids(12345) todo= !(DONE) endif :END: =20 - The second is a lot easier to understand: just switch the then and -else clauses: + The second is to switch the then and else clauses: =20 * TODO Prepare Tomorrow's Lunch = :nightly: :PROPERTIES: @@ -1388,6 +1558,12 @@ predicates with =E2=80=99?=E2=80=99. Thus, one can have an action that files a target, and a finder that finds a file. =20 + We recommend that you don=E2=80=99t name a finder with a special char= acter at +the end of its name. As we devise new ideas, we consider using special +characters for additional categories of keywords. Thus, to avoid +complications in the future, it=E2=80=99s best if everyone avoids using +characters that may become reserved in the future. + =1F File: org-edna.info, Node: Finders 1, Next: Actions 1, Prev: Naming C= onventions, Up: Extending Edna =20 @@ -1637,6 +1813,7 @@ Changelog =20 * Menu: =20 +* 1.0: 10. * 1.0beta8: 10beta8. * 1.0beta7: 10beta7. * 1.0beta6: 10beta6. @@ -1646,7 +1823,23 @@ Changelog * 1.0beta2: 10beta2. =20 =1F -File: org-edna.info, Node: 10beta8, Next: 10beta7, Up: Changelog +File: org-edna.info, Node: 10, Next: 10beta8, Up: Changelog + +1.0 +=3D=3D=3D + + =E2=80=A2 Various bugs fixes + =E2=80=A2 Fixed parsing of consideration + =E2=80=A2 Limited cache to just the finders that don=E2=80=99t d= epend on current + position + =E2=80=A2 Added =E2=80=9Cbuffer=E2=80=9D option for match finder + =E2=80=A2 Added timestamp sorting to relatives finder + =E2=80=A2 Inverted meaning of consideration to avoid confusion + =E2=80=A2 Added *note has-tags?: Checking Tags. and *note matches?: M= atching + Headings. conditions + +=1F +File: org-edna.info, Node: 10beta8, Next: 10beta7, Prev: 10, Up: Cha= ngelog =20 1.0beta8 =3D=3D=3D=3D=3D=3D=3D=3D @@ -1760,79 +1953,83 @@ Big release here, with three new features. =1F Tag Table: Node: Top=7F225 -Node: Copying=7F4114 -Node: Introduction=7F4936 -Node: Installation and Setup=7F5884 -Node: Basic Operation=7F6608 -Node: Blockers=7F8459 -Node: Triggers=7F8745 -Node: Syntax=7F9007 -Node: Basic Features=7F9697 -Node: Finders=7F10000 -Node: ancestors=7F11765 -Node: children=7F12359 -Node: descendants=7F12769 -Node: file=7F13291 -Node: first-child=7F14040 -Node: ids=7F14300 -Node: match=7F14961 -Node: next-sibling=7F15599 -Node: next-sibling-wrap=7F15856 -Node: olp=7F16170 -Node: org-file=7F16582 -Node: parent=7F17227 -Node: previous-sibling=7F17425 -Node: previous-sibling-wrap=7F17686 -Node: relatives=7F17965 -Node: rest-of-siblings=7F21586 -Node: rest-of-siblings-wrap=7F21871 -Node: self=7F22220 -Node: siblings=7F22381 -Node: siblings-wrap=7F22618 -Node: Actions=7F22922 -Node: Scheduled/Deadline=7F23664 -Node: TODO State=7F27239 -Node: Archive=7F27607 -Node: Chain Property=7F27927 -Node: Clocking=7F28210 -Node: Property=7F28622 -Node: Priority=7F30809 -Node: Tag=7F31378 -Node: Effort=7F31595 -Node: Advanced Features=7F31984 -Node: Finder Cache=7F32432 -Node: Conditions=7F33471 -Node: done=7F34107 -Node: headings=7F34271 -Node: todo-state=7F34647 -Node: variable-set=7F34903 -Node: has-property=7F35332 -Node: re-search=7F35601 -Node: Negating Conditions=7F35961 -Node: Consideration=7F36348 -Node: Conditional Forms=7F37917 -Node: Setting the Properties=7F40573 -Node: Extending Edna=7F41657 -Node: Naming Conventions=7F42147 -Node: Finders 1=7F42608 -Node: Actions 1=7F42970 -Node: Conditions 1=7F43429 -Node: Contributing=7F44315 -Node: Bugs=7F45181 -Node: Working with EDE=7F45538 -Node: Compiling Edna=7F46622 -Node: Testing Edna=7F47491 -Node: Before Sending Changes=7F48472 -Node: Developing with Bazaar=7F49159 -Node: Documentation=7F49900 -Node: Changelog=7F50356 -Node: 10beta8=7F50606 -Node: 10beta7=7F50718 -Node: 10beta6=7F51012 -Node: 10beta5=7F51288 -Node: 10beta4=7F51675 -Node: 10beta3=7F51928 -Node: 10beta2=7F52367 +Node: Copying=7F4346 +Node: Introduction=7F5168 +Node: Installation and Setup=7F6116 +Node: Basic Operation=7F6840 +Node: Blockers=7F8691 +Node: Triggers=7F8977 +Node: Syntax=7F9239 +Node: Basic Features=7F9929 +Node: Finders=7F10283 +Node: ancestors=7F12048 +Node: children=7F12642 +Node: descendants=7F13052 +Node: file=7F13574 +Node: first-child=7F14323 +Node: ids=7F14583 +Node: match=7F15244 +Node: next-sibling=7F15882 +Node: next-sibling-wrap=7F16139 +Node: olp=7F16453 +Node: org-file=7F16865 +Node: parent=7F17510 +Node: previous-sibling=7F17708 +Node: previous-sibling-wrap=7F17969 +Node: relatives=7F18248 +Node: rest-of-siblings=7F21974 +Node: rest-of-siblings-wrap=7F22259 +Node: self=7F22608 +Node: siblings=7F22769 +Node: siblings-wrap=7F23006 +Node: Actions=7F23310 +Node: Scheduled/Deadline=7F24073 +Node: TODO State=7F27587 +Node: Archive=7F28312 +Node: Chain Property=7F28632 +Node: Clocking=7F29385 +Node: Property=7F29797 +Node: Priority=7F31970 +Node: Tag=7F32539 +Node: Effort=7F32756 +Node: Getting Help=7F33140 +Node: Advanced Features=7F33585 +Node: Finder Cache=7F34033 +Node: Conditions=7F35072 +Node: Heading is DONE=7F35878 +Node: File Has Headings=7F36084 +Node: Heading TODO State=7F36506 +Node: Lisp Variable Set=7F36800 +Node: Heading Has Property=7F37468 +Node: Regexp Search=7F38214 +Node: Checking Tags=7F38657 +Node: Matching Headings=7F39559 +Node: Negating Conditions=7F40156 +Node: Consideration=7F40551 +Node: Conditional Forms=7F42735 +Node: Setting the Properties=7F45423 +Node: Extending Edna=7F46507 +Node: Naming Conventions=7F46997 +Node: Finders 1=7F47789 +Node: Actions 1=7F48151 +Node: Conditions 1=7F48610 +Node: Contributing=7F49496 +Node: Bugs=7F50362 +Node: Working with EDE=7F50719 +Node: Compiling Edna=7F51803 +Node: Testing Edna=7F52672 +Node: Before Sending Changes=7F53653 +Node: Developing with Bazaar=7F54340 +Node: Documentation=7F55081 +Node: Changelog=7F55537 +Node: 10=7F55798 +Node: 10beta8=7F56300 +Node: 10beta7=7F56423 +Node: 10beta6=7F56717 +Node: 10beta5=7F56993 +Node: 10beta4=7F57380 +Node: 10beta3=7F57633 +Node: 10beta2=7F58072 =1F End Tag Table =20 diff --git a/packages/org-edna/org-edna.org b/packages/org-edna/org-edna.= org index 1f01709..89c32aa 100644 --- a/packages/org-edna/org-edna.org +++ b/packages/org-edna/org-edna.org @@ -526,6 +526,8 @@ All arguments are symbols, unless noted otherwise. - scheduled-down: Scheduled time, closest first - deadline-up: Deadline time, farthest first - deadline-down: Deadline time, closest first +- timestamp-up: Timestamp time, farthest first +- timestamp-down: Timestamp time, closest first =20 Many of the other finders are shorthand for argument combinations of rel= ative: =20 @@ -692,14 +694,15 @@ PLANNING is either scheduled or deadline. =20 Examples: =20 -- scheduled!("Mon 09:00") -> Set SCHEDULED to the following Monday at 9:= 00 -- deadline!("++2h") -> Set DEADLINE to two hours from now. -- deadline!(copy) deadline!("+1h") -> Copy the source deadline to the ta= rget, then increment it by an hour. -- scheduled!("+1wkdy") -> Set SCHEDULED to the next weekday -- scheduled!("+1d +wkdy") -> Same as above -- deadline!("+1m -wkdy") -> Set SCHEDULED up one month, but move backwar= d to find a weekend -- scheduled!("float 2 Tue Feb") -> Set SCHEDULED to the second Tuesday i= n the following February -- scheduled!("float 3 Thu") -> Set SCHEDULED to the third Thursday in th= e following month +- scheduled!("Mon 09:00") :: Set SCHEDULED to the following Monday at 9:= 00 +- deadline!("++2h") :: Set DEADLINE to two hours from now. +- deadline!(copy) deadline!("+1h") :: Copy the source deadline to the ta= rget, then increment it by an hour. +- scheduled!("+1wkdy") :: Set SCHEDULED to the next weekday +- scheduled!("+1d +wkdy") :: Same as above +- deadline!("+1m -wkdy") :: Set DEADLINE up one month, but move backward= to find a weekend +- scheduled!("float 2 Tue Feb") :: Set SCHEDULED to the second Tuesday i= n the following February +- scheduled!("float 3 Thu") :: Set SCHEDULED to the third Thursday in th= e following month + *** TODO State :PROPERTIES: :CUSTOM_ID: todo! @@ -713,6 +716,27 @@ Sets the TODO state of the target heading to NEW-STA= TE. NEW-STATE may either be a string or a symbol denoting the new TODO state= . It can also be the empty string, in which case the TODO state is removed. =20 +Example: + +#+BEGIN_SRC org +,* TODO Heading 1 + :PROPERTIES: + :TRIGGER: next-sibling todo!(DONE) + :END: +,* TODO Heading 2 +#+END_SRC + +In this example, when "Heading 1" is marked as DONE, it will also mark "= Heading +2" as DONE: + +#+BEGIN_SRC org +,* DONE Heading 1 + :PROPERTIES: + :TRIGGER: next-sibling todo!(DONE) + :END: +,* DONE Heading 2 +#+END_SRC + *** Archive :PROPERTIES: :CUSTOM_ID: archive! @@ -737,6 +761,32 @@ nil, Edna will not ask before archiving targets. Copies PROPERTY from the source entry to all targets. Does nothing if t= he source heading has no property PROPERTY. =20 +Example: + +#+BEGIN_SRC org +,* TODO Heading 1 + :PROPERTIES: + :COUNTER: 2 + :TRIGGER: next-sibling chain!("COUNTER") + :END: +,* TODO Heading 2 +#+END_SRC + +In this example, when "Heading 1" is marked as DONE, it will copy its CO= UNTER +property to "Heading 2": + +#+BEGIN_SRC org +,* DONE Heading 1 + :PROPERTIES: + :COUNTER: 2 + :TRIGGER: next-sibling chain!("COUNTER") + :END: +,* TODO Heading 2 + :PROPERTIES: + :COUNTER: 2 + :END: +#+END_SRC + *** Clocking :PROPERTIES: :CUSTOM_ID: clocking @@ -804,7 +854,7 @@ Additionally, all special forms will fail if the prop= erty is not already set: #+begin_src org ,* TODO Test :PROPERTIES: - :TRIGGER: self set-property("TEST" inc) + :TRIGGER: self set-property!("TEST" inc) :END: #+end_src =20 @@ -817,8 +867,8 @@ Deletes the property PROPERTY from all targets. =20 Examples: =20 -- set-property!("COUNTER" "1") -> Sets the property COUNTER to 1 on all = targets -- set-property!("COUNTER" inc) -> Increments the property COUNTER by 1. = Following the previous example, it would be 2. +- set-property!("COUNTER" "1") :: Sets the property COUNTER to 1 on all = targets +- set-property!("COUNTER" inc) :: Increments the property COUNTER by 1. = Following the previous example, it would be 2. =20 *** Priority :PROPERTIES: @@ -861,13 +911,32 @@ e.g. tag1:tag2 :DESCRIPTION: So much effort! :END: =20 -- Syntax: set-effort!(VALUE) +Modifies the effort of all targets. + +- Syntax: set-effort!("VALUE") + + Set the effort of all targets to "VALUE". + +- Syntax: set-effort!(NUMBER) + + Sets the effort to the NUMBER'th allowed effort property. + +- Syntax: set-effort!(increment) + + Increment the effort value. =20 -Sets the effort of all targets according to VALUE: +** Getting Help +:PROPERTIES: +:CUSTOM_ID: help +:DESCRIPTION: Getting some help +:END: + +Edna provides help for any keyword with ~M-x org-edna-describe-keyword~.= When +invoked, a list of keywords (finders, actions, etc.) known to Edna will = be +provided. Select any one to get its description. =20 -- If VALUE is a string, then the effort is set to VALUE -- If VALUE is an integer, then set the value to the VALUE'th allowed eff= ort property -- If VALUE is the symbol 'increment, increment effort +This description includes the syntax and an explanation of what the keyw= ord +does. Some descriptions also contain examples. =20 * Advanced Features :PROPERTIES: @@ -910,7 +979,7 @@ that target, then the source heading is blocked. If no condition is specified, ~!done?~ is used by default, which means b= lock if any target heading isn't done. =20 -*** done +*** Heading is DONE :PROPERTIES: :CUSTOM_ID: done :END: @@ -919,7 +988,7 @@ any target heading isn't done. =20 Blocks the source heading if any target heading is DONE. =20 -*** headings +*** File Has Headings :PROPERTIES: :CUSTOM_ID: headings :END: @@ -935,7 +1004,7 @@ org-file("refile.org") headings? =20 The above example blocks if refile.org has any headings. =20 -*** todo-state +*** Heading TODO State :PROPERTIES: :CUSTOM_ID: todo-state :END: @@ -946,7 +1015,7 @@ Blocks if any target heading has TODO state set to S= TATE. =20 STATE may be a string or a symbol. =20 -*** variable-set +*** Lisp Variable Set :PROPERTIES: :CUSTOM_ID: variable-set :END: @@ -958,11 +1027,12 @@ against VALUE. Block the source heading if VARIAB= LE =3D VALUE. =20 VARIABLE should be a symbol, and VALUE is any valid lisp expression. =20 -#+BEGIN_EXAMPLE -self variable-set?(test-variable 12) -#+END_EXAMPLE +Examples: =20 -*** has-property +- self variable-set?(test-variable 12) :: Blocks if the variable ~test-v= ariable~ is set to 12. +- self variable-set?(buffer-file-name "org-edna.org") :: Blocks if the v= ariable ~buffer-file-name~ is set to "org-edna.org". + +*** Heading Has Property :PROPERTIES: :CUSTOM_ID: has-property :END: @@ -971,7 +1041,25 @@ self variable-set?(test-variable 12) =20 Tests each target for the property PROPERTY, and blocks if it's set to V= ALUE. =20 -*** re-search +Example: + +#+begin_src org +,* TODO Take Shower + :PROPERTIES: + :COUNT: 1 + :TRIGGER: self set-property!("COUNT" inc) todo!("TODO") + :END: +,* TODO Wash Towels + :PROPERTIES: + :BLOCKER: previous-sibling !has-property?("COUNT" "3") + :TRIGGER: previous-sibling set-property!("COUNT" "0") + :END: +#+end_src + +In this example, "Wash Towels" can't be completed until the user has sho= wered at +least three times. + +*** Regexp Search :PROPERTIES: :CUSTOM_ID: re-search :DESCRIPTION: Search for a regular expression @@ -983,7 +1071,57 @@ Blocks the source heading if the regular expression= REGEXP is present in any of the targets. =20 The targets are expected to be files, although this will work with other= targets -as well. +as well. When given a target heading, the heading's file will be search= ed. +*** Checking Tags +:PROPERTIES: +:CUSTOM_ID: has-tags +:DESCRIPTION: Matching against a set of tags +:END: + +- Syntax: has-tags?("TAG1" "TAG2" ...) + +Blocks the source heading if any of the target headings have one or more= of the +given tags. + +#+begin_src org +,* TODO Task 1 = :tag1: +,* TODO Task 2 :tag3= :tag2: +,* TODO Task 3 + :PROPERTIES: + :BLOCKER: rest-of-siblings-wrap has-tags?("tag1" "tag2") + :END: +#+end_src + +In the above example, Tasks 1 and 2 will block Task 3. Task 1 will bloc= k it +because it contains "tag1" as one of its tags, and likewise for Task 2 a= nd +"tag2". + +Note that marking "Task 1" or "Task 2" as DONE will not unblock "Task 3"= . If +you want to set up such a system, use the [[#match][match]] finder. +*** Matching Headings +:PROPERTIES: +:CUSTOM_ID: matches +:DESCRIPTION: Matching against a match string +:END: + +- Syntax: matches?("MATCH-STRING") + +Blocks the source heading if any of the target headings match against +MATCH-STRING. + +MATCH-STRING is a string passed to ~org-map-entries~. + +#+begin_src org +,* TODO Task 1 +,* TODO Task 2 +,* TODO Task 3 + :PROPERTIES: + :BLOCKER: rest-of-siblings-wrap !matches?("TODO=3D=3D\"DONE\"") + :END: +#+end_src + +In the above example, Tasks 1 and 2 will block Task 3 until they're mark= ed as +DONE. =20 *** Negating Conditions :PROPERTIES: @@ -1002,45 +1140,76 @@ tagged "test" does *not* have the property PROP s= et to "1". :DESCRIPTION: Only some of them :END: =20 -"Consideration" is a special keyword that's only valid for blockers. +"Consideration" and "consider" are special keywords that are only valid = for +blockers. =20 -This says "Allow a task to complete if CONSIDERATION of its targets pass= the -given condition". +A blocker says "If ANY heading in TARGETS meets CONDITION, block this ta= sk". =20 -This keyword can allow specifying only a portion of tasks to consider: +In order to modify the ANY part of that statement, the ~consider~ keywor= d may be +used: =20 -1. consider(PERCENT) -2. consider(NUMBER) -3. consider(all) (Default) -4. consider(any) +1. consider(any) +2. consider(all) +3. consider(FRACTION) +4. consider(NUMBER) =20 -(1) tells the blocker to only consider some portion of the targets. If = at least -PERCENT of them are in a DONE state, allow the task to be set to DONE. = PERCENT -must be a decimal, and doesn't need to include a %-sign. +(1) blocks the current task if any target meets the blocking condition. = This is +the default case. =20 -(2) tells the blocker to only consider NUMBER of the targets. +(2) blocks the current task only if all targets meet the blocking condit= ion. =20 -(3) tells the blocker to consider all following targets. +#+begin_src org +,* Shovel Snow +,** TODO Shovel on Monday +,** TODO Shovel on Tuesday +,** TODO Shovel on Wednesday +,** TODO Put shovel away + :PROPERTIES: + :BLOCKER: consider(all) rest-of-siblings-wrap + :END: +#+end_src =20 -(4) tells the blocker to allow passage if any of the targets pass. +The above example blocks "Put shovel away" so long as all of the sibling= s are +still marked TODO. =20 -A consideration must be specified before the conditions to which it appl= ies: +(3) blocks the current task if at least FRACTION of the targets meet the +blocking condition. =20 -#+BEGIN_EXAMPLE -consider(0.5) siblings match("find_me") consider(all) !done? -#+END_EXAMPLE +#+begin_src org +,* Work +,** TODO Shovel Snow +,** TODO Clean room +,** TODO Vacuum +,** TODO Eat lunch +,** TODO Work on Edna + :PROPERTIES: + :BLOCKER: consider(0.5) rest-of-siblings-wrap + :END: +#+end_src =20 -The above code will allow task completion if at least half the siblings = are -complete, and all tasks tagged "find_me" are complete. +The above example blocks "Work on Edna" so long as at least half of the = siblings +are marked TODO. This means that three of them must be completed before +development can begin on Edna. =20 -#+BEGIN_SRC emacs-lisp -consider(1) ids(ID1 ID2 ID3) consider(2) ids(ID3 ID4 ID5 ID6) -#+END_SRC +(4) blocks the current task if at least NUMBER of the targets meet the b= locking +condition. + +#+begin_src org +,* Work +,** TODO Shovel Snow +,** TODO Clean room +,** TODO Vacuum +,** TODO Eat lunch +,** TODO Work on Edna + :PROPERTIES: + :BLOCKER: consider(2) rest-of-siblings-wrap + :END: +#+end_src =20 -The above code will allow task completion if at least one of ID1, ID2, a= nd ID3 -are complete, and at least two of ID3, ID4, ID5, and ID6 are complete. +The above example blocks "Work on Edna" so long as two of the siblings a= re +marked TODO. This means that NUMBER=3D1 is the same as specifying ~any~= . =20 -If no consideration is given, ALL is assumed. +A consideration must be specified before the conditions to which it appl= ies. =20 Both "consider" and "consideration" are valid keywords; they both mean t= he same thing. @@ -1099,18 +1268,19 @@ trigger the original until the last one is marked= DONE. Occasionally, you may find that you'd rather execute a form if the condi= tion *would* block. There are two options. =20 -The first is confusing: use ~consider(any)~. This will tell Edna to pas= s so -long as one of the targets meets the condition. This is the opposite of= Edna's -standard operation, which only allows passage if all targets meet the co= ndition. +The first is to use ~consider(all)~. This will tell Edna to block only = if all +of the targets meets the condition, and thus not block if at least one o= f them +does not meet the condition. This is the opposite of Edna's standard op= eration, +which only allows passage if all targets meet the condition. =20 #+begin_src org ,* TODO Prepare Tomorrow's Lunch :ni= ghtly: :PROPERTIES: - :TRIGGER: if consider(any) match("nightly") then ids(12345) todo!(DON= E) endif + :TRIGGER: if consider(all) match("nightly") then ids(12345) todo!(DON= E) endif :END: #+end_src =20 -The second is a lot easier to understand: just switch the then and else = clauses: +The second is to switch the then and else clauses: =20 #+begin_src org ,* TODO Prepare Tomorrow's Lunch :ni= ghtly: @@ -1174,6 +1344,12 @@ Scheme to suffix destructive functions with '!' an= d predicates with '?'. Thus, one can have an action that files a target, and a finder that find= s a file. =20 +We recommend that you don't name a finder with a special character at th= e end of +its name. As we devise new ideas, we consider using special characters = for +additional categories of keywords. Thus, to avoid complications in the = future, +it's best if everyone avoids using characters that may become reserved i= n the +future. + ** Finders :PROPERTIES: :DESCRIPTION: Making a new finder @@ -1410,6 +1586,16 @@ making any changes: :PROPERTIES: :DESCRIPTION: List of changes by version :END: +** 1.0 + +- Various bugs fixes + - Fixed parsing of consideration + - Limited cache to just the finders that don't depend on current posit= ion +- Added "buffer" option for match finder +- Added timestamp sorting to relatives finder +- Inverted meaning of consideration to avoid confusion +- Added [[#has-tags][has-tags?]] and [[#matches][matches?]] conditions + ** 1.0beta8 Quick fix for beta7. ** 1.0beta7 diff --git a/packages/org-edna/test.mk b/packages/org-edna/test.mk index 29e31e5..4b6590c 100644 --- a/packages/org-edna/test.mk +++ b/packages/org-edna/test.mk @@ -23,6 +23,7 @@ test: compile -L "." \ -l "ert" \ -l "org-edna-tests.el" \ + --eval "(setq org-edna-test-inhibit-messages t)" \ -f ert-run-tests-batch-and-exit =20 include Makefile From MAILER-DAEMON Tue Nov 27 15:34:35 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gRk43-000530-B7 for mharc-emacs-elpa-diffs@gnu.org; Tue, 27 Nov 2018 15:34:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRk41-00051J-Ct for emacs-elpa-diffs@gnu.org; Tue, 27 Nov 2018 15:34:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRk3z-0004id-DN for emacs-elpa-diffs@gnu.org; Tue, 27 Nov 2018 15:34:33 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:50205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRk3w-0004hG-Nw for emacs-elpa-diffs@gnu.org; Tue, 27 Nov 2018 15:34:29 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 131183) id 7B42C2044D; Tue, 27 Nov 2018 15:34:28 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master c0c44c3: [gnorb] Move location of gnorb-gnus-summary-mode-hook, bump to 1.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Eric Abrahamsen In-Reply-To: <20181127203427.21825.92614@vcs0.savannah.gnu.org> References: <20181127203427.21825.92614@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: c0c44c3c0ded215e5bc60da74e2aaa090a35617b Auto-Submitted: auto-generated Message-Id: <20181127203428.7B42C2044D@vcs0.savannah.gnu.org> Date: Tue, 27 Nov 2018 15:34:27 -0500 (EST) From: eric@ericabrahamsen.net (Eric Abrahamsen) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 20:34:34 -0000 branch: master commit c0c44c3c0ded215e5bc60da74e2aaa090a35617b Author: Eric Abrahamsen Commit: Eric Abrahamsen [gnorb] Move location of gnorb-gnus-summary-mode-hook, bump to 1.6.1 =20 * packages/gnorb/gnorb-gnus.el: Since I messed with Gnus modes, the `gnus-summary-mode-hook' no longer has access to the current newsgroup name. Move the hook to `gnus-summary-prepared-hook', whic= h does. * packages/gnorb/gnorb.el: Bump and flush. --- packages/gnorb/gnorb-gnus.el | 2 +- packages/gnorb/gnorb.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/gnorb/gnorb-gnus.el b/packages/gnorb/gnorb-gnus.el index 07d61f6..a531002 100644 --- a/packages/gnorb/gnorb-gnus.el +++ b/packages/gnorb/gnorb-gnus.el @@ -941,7 +941,7 @@ error." (when (string-match-p "Gnorb" (cadr method)) (gnorb-summary-minor-mode)))) =20 -(add-hook 'gnus-summary-mode-hook #'gnorb-gnus-summary-mode-hook) +(add-hook 'gnus-summary-prepared-hook #'gnorb-gnus-summary-mode-hook) =20 ;;; Automatic noticing of relevant messages =20 diff --git a/packages/gnorb/gnorb.el b/packages/gnorb/gnorb.el index bd0f0b9..6bf9665 100644 --- a/packages/gnorb/gnorb.el +++ b/packages/gnorb/gnorb.el @@ -2,7 +2,7 @@ =20 ;; Copyright (C) 2018 Free Software Foundation, Inc. =20 -;; Version: 1.6.0 +;; Version: 1.6.1 ;; Package-Requires: ((cl-lib "0.5")) =20 ;; Maintainer: Eric Abrahamsen From MAILER-DAEMON Thu Nov 29 03:33:34 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSHlO-0004r5-Lq for mharc-emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 03:33:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSFNN-0002zN-Kv for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 01:00:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSFNB-0000y1-Ry for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 01:00:37 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:49783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSFNA-0000vi-TZ for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 01:00:25 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 159576) id CCA54204F1; Thu, 29 Nov 2018 01:00:23 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] externals/ssh-deploy b692b66: Merged changes from GitHub MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Christian Johansson In-Reply-To: <20181129060022.28604.13375@vcs0.savannah.gnu.org> References: <20181129060022.28604.13375@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/externals/ssh-deploy X-Git-Reftype: branch X-Git-Rev: b692b668520d1682253ff5cbb6bbce0d96243be8 Auto-Submitted: auto-generated Message-Id: <20181129060024.CCA54204F1@vcs0.savannah.gnu.org> Date: Thu, 29 Nov 2018 01:00:22 -0500 (EST) From: christian@cvj.se (Christian Johansson) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-Mailman-Approved-At: Thu, 29 Nov 2018 03:33:33 -0500 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:00:50 -0000 branch: externals/ssh-deploy commit b692b668520d1682253ff5cbb6bbce0d96243be8 Author: Christian Johansson Commit: Christian Johansson Merged changes from GitHub =20 * pre-defined hydra * pre-defined prefix map * fixed issue with boolean fallbacks on nil by using integer instead --- README.md | 143 ++++----- ssh-deploy-diff-mode.el | 265 +++++++--------- ssh-deploy.el | 790 +++++++++++++++++++++++++-----------------= ------ 3 files changed, 589 insertions(+), 609 deletions(-) diff --git a/README.md b/README.md index ef8e619..5e5967a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# `emacs-ssh-deploy` [![MELPA](http://melpa.org/packages/ssh-deploy-badg= e.svg)](http://melpa.org/#/ssh-deploy) [![MELPA Stable](http://stable.mel= pa.org/packages/ssh-deploy-badge.svg)](http://stable.melpa.org/#/ssh-depl= oy) +# `emacs-ssh-deploy` +[![License GPL 3](https://img.shields.io/badge/license-GPL_3-green.svg)]= (https://www.gnu.org/licenses/gpl-3.0.txt) [![MELPA](https://melpa.org/pa= ckages/ssh-deploy-badge.svg)](https://melpa.org/#/ssh-deploy) [![MELPA St= able](https://stable.melpa.org/packages/ssh-deploy-badge.svg)](https://st= able.melpa.org/#/ssh-deploy) =20 The `ssh-deploy` plug-in for Emacs makes it possible to effortlessly dep= loy local files and directories to remote hosts via TRAMP (including but = not limited to SSH, SFTP, FTP). It tries to provide functions that can be= easily used by custom scripts. =20 @@ -16,7 +17,7 @@ The `ssh-deploy` plug-in for Emacs makes it possible to= effortlessly deploy loca * Open corresponding file on the remote host * Open SQL database-session on remote hosts * Run custom deployment scripts -* All operations support asynchronous mode if `(make-thread`) or `async.= el` is installed. (You need to setup an automatic authorization for this,= i.e. `~/.netrc`, `~/.authinfo` or `~/.authinfo.gpg` and/or key-based pas= sword-less authorization) +* All operations support asynchronous mode if `(make-thread`) or `async.= el` is installed. (You need to setup an automatic authorization for this,= i.e. `~/.authinfo.gpg` and/or key-based password-less authorization) =20 The idea for this plug-in was to mimic the behavior of **PhpStorm** depl= oyment functionality. =20 @@ -28,72 +29,75 @@ Here is a list of other variables you can set globall= y or per directory: =20 * `ssh-deploy-root-local` The local root that should be under deployment= *(string)* * `ssh-deploy-root-remote` The remote TRAMP root that is used for deploy= ment *(string)* -* `ssh-deploy-debug` Enables debugging messages *(boolean)* +* `ssh-deploy-debug` Enables debugging messages *(integer)* * `ssh-deploy-revision-folder` The folder used for storing local revisio= ns *(string)* -* `ssh-deploy-automatically-detect-remote-changes` Enables automatic det= ection of remote changes *(boolean)* -* `ssh-deploy-on-explicit-save` Enabled automatic uploads on save *(bool= ean)* +* `ssh-deploy-automatically-detect-remote-changes` Enables automatic det= ection of remote changes *(integer)* +* `ssh-deploy-on-explicit-save` Enabled automatic uploads on save *(inte= ger)* * `ssh-deploy-exclude-list` A list defining what paths to exclude from d= eployment *(list)* -* `ssh-deploy-async` Enables asynchronous transfers (you need to have `(= make-thread)` or `async.el` installed as well) *(boolean)* +* `ssh-deploy-async` Enables asynchronous transfers (you need to have `(= make-thread)` or `async.el` installed as well) *(integer)* * `ssh-deploy-remote-sql-database` Default database when connecting to r= emote SQL database *(string)* * `ssh-deploy-remote-sql-password` Default password when connecting to r= emote SQL database *(string)* * `ssh-deploy-remote-sql-port` - Default port when connecting to remote = SQL database *(integer)* * `ssh-deploy-remote-sql-server` Default server when connecting to remot= e SQL database *(string)* * `ssh-deploy-remote-sql-user` Default user when connecting to remote SQ= L database *(string)* * `ssh-deploy-remote-shell-executable` Default remote shell executable w= hen launching shell on remote host *(string)* -* `ssh-deploy-verbose` Show messages in message buffer when starting and= ending actions, default t *(boolean)* -* `ssh-deploy-script` - Your custom lambda function that will be called = using (funcall) when running deploy script handler +* `ssh-deploy-verbose` Show messages in message buffer when starting and= ending actions *(integer)* +* `ssh-deploy-script` - Your custom lambda function that will be called = using (funcall) when running deploy script handler *(function)* +* `ssh-deploy-async-with-threads` - Whether to use threads (make threads= ) instead of processes (async-start) for asynchronous operations *(intege= r)* + +When integers are used as booleans, above zero means true, zero means fa= lse and nil means unset and fallback to global settings. =20 ## Deployment configuration examples =20 -* Download ssh-deploy and place it at `~/.emacs.d/ssh-deploy/` or instal= l via `package.el` (`M-x list-packages` or `M-x package-install` + `ssh-d= eploy`) from the `MELPA` repository. +* Download ssh-deploy and place it at `~/.emacs.d/ssh-deploy/` or instal= l via `package.el` (`M-x list-packages` or `M-x package-install` + `ssh-d= eploy`) from the `ELPA` or `MELPA` repository. * So if you want to deploy `/Users/username/Web/MySite/` to create this = `DirectoryVariables` file in your project root at `/Users/username/Web/My= Site/.dir-locals.el`. =20 You really need to do a bit of research about how to connect via differe= nt protocols using TRAMP on your operating system, I think Windows users = should use `plink` for most protocols. Linux should work out of the box a= nd macOS requires a bit of tweaking to get FTP support. =20 -### SSH, automatic uploads, SQL +### SSH, with automatic uploads and SQL =20 ``` emacs-lisp ((nil . ( (ssh-deploy-root-local . "/Users/username/Web/MySite/") (ssh-deploy-root-remote . "/ssh:myuser@myserver.com:/var/www/MySite/") - (ssh-deploy-on-explicit-save . t) + (ssh-deploy-on-explicit-save . 1) (ssh-deploy-remote-sql-database . "myuser") (ssh-deploy-remote-sql-password . "mypassword") (ssh-deploy-remote-sql-user . "myuser") ))) ``` =20 -### SFTP, automatic uploads +### SFTP, with automatic uploads =20 ``` emacs-lisp ((nil . ( (ssh-deploy-root-local . "/Users/username/Web/MySite/") (ssh-deploy-root-remote . "/sftp:myuser@myserver.com:/var/www/MySite/"= ) - (ssh-deploy-on-explicit-save . t) + (ssh-deploy-on-explicit-save . 1) ))) ``` =20 -### SSH, custom port, not asynchronous, without automatic uploads +### SSH, custom port 2120, not asynchronous and without automatic upload= s =20 ``` emacs-lisp ((nil . ( (ssh-deploy-root-local . "/Users/username/Web/MySite/") (ssh-deploy-root-remote . "/ssh:myuser@myserver.com#2120:/var/www/MySi= te/") - (ssh-deploy-on-explicit-save . nil) - (ssh-deploy-async . nil) + (ssh-deploy-on-explicit-save . 0) + (ssh-deploy-async . 0) ))) ``` =20 You can pipe remote connections as well like this: =20 -### SSH, not asynchronous, automatic uploads, piped to other user on rem= ote server and with custom deployment script. +### SSH, not asynchronous, with automatic uploads, piped to other user o= n remote server and with custom deployment script. =20 ``` emacs-lisp ((nil . ( (ssh-deploy-root-local . "/Users/username/Web/MySite/") (ssh-deploy-root-remote . "/ssh:myuser@myserver.com|sudo:web@myserver.= com:/var/www/MySite/") - (ssh-deploy-async . nil) - (ssh-deploy-on-explicit-save . t) + (ssh-deploy-async . 0) + (ssh-deploy-on-explicit-save . 1) (ssh-deploy-script . (lambda() (let ((default-directory ssh-deploy-roo= t-remote))(shell-command "bash compile.sh")))) ))) ``` @@ -106,7 +110,7 @@ If you have a password-less sudo on your remote host = you should be to do this as ((nil . ( (ssh-deploy-root-local . "/Users/username/Web/MySite/") (ssh-deploy-root-remote . "/ftp:myuser@myserver.com:/MySite/") - (ssh-deploy-on-explicit-save . t) + (ssh-deploy-on-explicit-save . 1) ))) ``` =20 @@ -127,7 +131,7 @@ Host remote-host =20 ## Interaction-free password-based setup on *NIX systems =20 -For automatic **FTP** connections you need to setup `~/.netrc`, `~/.auth= info` or `~/.authinfo.gpg` with your login credentials. An example of con= tents: +For automatic **FTP** connections you need to setup `~/.authinfo.gpg` wi= th your login credentials. An example of contents: =20 ``` shell machine myserver.com login myuser port ftp password mypassword @@ -139,7 +143,7 @@ Set your user and group as owner and file permissions= to `600`. Emacs should now =20 ## Interaction-free SSH setup using public-key password-based authorizat= ion =20 -By combining a `~/.netrc`, `~/.authinfo` or `~/.authinfo.gpg` setup and = a `public-key` setup you should be able to have a interaction-free public= -key password-based authorization that can be used asynchronously. +By combining a `~/.authinfo.gpg` setup and a `public-key` setup you shou= ld be able to have a interaction-free public-key password-based authoriza= tion that can be used asynchronously. =20 ## Emacs configuration example =20 @@ -149,23 +153,16 @@ By combining a `~/.netrc`, `~/.authinfo` or `~/.aut= hinfo.gpg` setup and a `publi ;; ssh-deploy - prefix =3D C-c C-z, f =3D forced upload, u =3D upload, d= =3D download, x =3D diff, t =3D terminal, b =3D browse, h =3D shell (add-to-list 'load-path "~/.emacs.d/ssh-deploy/") (require 'ssh-deploy) -(add-hook 'after-save-hook (lambda() (if (and (boundp 'ssh-deploy-on-exp= licit-save) ssh-deploy-on-explicit-save) (ssh-deploy-upload-handler)) )) -(add-hook 'find-file-hook (lambda() (if (and (boundp 'ssh-deploy-automat= ically-detect-remote-changes) ssh-deploy-automatically-detect-remote-chan= ges) (ssh-deploy-remote-changes-handler)) )) -(global-set-key (kbd "C-c C-z f") (lambda() (interactive)(ssh-deploy-upl= oad-handler-forced) )) -(global-set-key (kbd "C-c C-z u") (lambda() (interactive)(ssh-deploy-upl= oad-handler) )) -(global-set-key (kbd "C-c C-z D") (lambda() (interactive)(ssh-deploy-del= ete-handler) )) -(global-set-key (kbd "C-c C-z d") (lambda() (interactive)(ssh-deploy-dow= nload-handler) )) -(global-set-key (kbd "C-c C-z x") (lambda() (interactive)(ssh-deploy-dif= f-handler) )) -(global-set-key (kbd "C-c C-z t") (lambda() (interactive)(ssh-deploy-rem= ote-terminal-eshell-base-handler) )) -(global-set-key (kbd "C-c C-z T") (lambda() (interactive)(ssh-deploy-rem= ote-terminal-eshell-handler) )) -(global-set-key (kbd "C-c C-z h") (lambda() (interactive)(ssh-deploy-rem= ote-terminal-shell-base-handler) )) -(global-set-key (kbd "C-c C-z H") (lambda() (interactive)(ssh-deploy-rem= ote-terminal-shell-handler) )) -(global-set-key (kbd "C-c C-z R") (lambda() (interactive)(ssh-deploy-ren= ame-handler) )) -(global-set-key (kbd "C-c C-z e") (lambda() (interactive)(ssh-deploy-rem= ote-changes-handler) )) -(global-set-key (kbd "C-c C-z b") (lambda() (interactive)(ssh-deploy-bro= wse-remote-base-handler) )) -(global-set-key (kbd "C-c C-z o") (lambda() (interactive)(ssh-deploy-ope= n-remote-file-handler) )) -(global-set-key (kbd "C-c C-z m") (lambda() (interactive)(ssh-deploy-rem= ote-sql-mysql-handler) )) -(global-set-key (kbd "C-c C-z s") (lambda() (interactive)(ssh-deploy-run= -deploy-script-handler) )) +(ssh-deploy-line-mode) ;; If you want mode-line feature +(ssh-deploy-add-menu) ;; If you want menu-bar feature +(ssh-deploy-add-after-save-hook) ;; If you want automatic upload support +(ssh-deploy-add-find-file-hook) ;; If you want detecting remote changes = support +(global-set-key (kbd "C-c C-z") 'ssh-deploy-prefix-map) +``` + +If you want to use the pre-defined hydra you can use this key-binding in= stead: +``` elisp +(global-set-key (kbd "C-c C-z") 'ssh-deploy-hydra/body) ``` =20 * Or use the `use-package` and `hydra-script` I'm using: @@ -174,51 +171,36 @@ By combining a `~/.netrc`, `~/.authinfo` or `~/.aut= hinfo.gpg` setup and a `publi (use-package ssh-deploy :ensure t :demand - :bind (("C-c C-z" . hydra-ssh-deploy/body)) - :hook ((after-save . (lambda() (if (and (boundp 'ssh-deploy-on-e= xplicit-save) ssh-deploy-on-explicit-save) (ssh-deploy-upload-handler)) )= ) - (find-file . (lambda() (if (and (boundp 'ssh-deploy-autom= atically-detect-remote-changes) ssh-deploy-automatically-detect-remote-ch= anges) (ssh-deploy-remote-changes-handler)) ))) + :bind (("C-c C-z" . ssh-deploy-hydra/body)) + :hook ((after-save . ssh-deploy-after-save) + (find-file . ssh-deploy-find-file)) :config - (defhydra hydra-ssh-deploy (:color red :hint nil) - " - _u_: Upload _f_: Force Upload - _d_: Download - _D_: Delete - _x_: Difference - _t_: Eshell Base Terminal _T_: Eshell Relative Termin= al - _h_: Shell Base Terminal _H_: Shell Relative Termina= l - _e_: Detect Remote Changes - _R_: Rename - _b_: Browse Base _B_: Browse Relative - _o_: Open current file on remote _m_: Open sql-mysql on remo= te - _s_: Run deploy script - " - ("f" ssh-deploy-upload-handler-forced) - ("u" ssh-deploy-upload-handler) - ("d" ssh-deploy-download-handler) - ("D" ssh-deploy-delete-handler) - ("x" ssh-deploy-diff-handler) - ("t" ssh-deploy-remote-terminal-eshell-base-handler) - ("T" ssh-deploy-remote-terminal-eshell-handler) - ("h" ssh-deploy-remote-terminal-shell-base-handler) - ("H" ssh-deploy-remote-terminal-shell-handler) - ("e" ssh-deploy-remote-changes-handler) - ("R" ssh-deploy-rename-handler) - ("b" ssh-deploy-browse-remote-base-handler) - ("B" ssh-deploy-browse-remote-handler) - ("o" ssh-deploy-open-remote-file-handler) - ("m" ssh-deploy-remote-sql-mysql-handler) - ("s" ssh-deploy-run-deploy-script-handler))) + (ssh-deploy-line-mode) ;; If you want mode-line feature + (ssh-deploy-add-menu) ;; If you want menu-bar feature + ) ``` =20 -(1) You can remove the `(add-to-list)` and `(require)` lines if you inst= alled via `MELPA` repository. +(1) You can remove the `(add-to-list)` and `(require)` lines if you inst= alled via `ELPA` or `MELPA` repository. =20 * Restart Emacs or re-evaluate your *emacs-init-script* =20 ## Example usage =20 +File contents `/Users/username/Web/MySite/.dir-locals.el`: + +``` emacs-lisp +((nil . ( + (ssh-deploy-root-local . "/Users/username/Web/MySite/") + (ssh-deploy-root-remote . "/ssh:myuser@myserver.com|sudo:web@myserver.= com:/var/www/MySite/") + (ssh-deploy-async . 1) + (ssh-deploy-on-explicit-save . 1) + (ssh-deploy-script . (lambda() (let ((default-directory ssh-deploy-roo= t-remote))(shell-command "bash compile.sh")))) +))) +``` + * Now when you save a file somewhere under the directory `/Users/usernam= e/Web/MySite/`, the script will launch and deploy the file with the remot= e server. * If you press `C-c C-z x` and the current buffer is a file, you will la= unch a `ediff` session showing differences between local file and remote = file via TRAMP, or if current buffer is a directory it will open a buffer= showing directory differences -* If you press `C-c C-z f` you will **force** upload local file or direc= tory to remote host even if they have external changes. +w* If you press `C-c C-z f` you will **force** upload local file or dire= ctory to remote host even if they have external changes. * If you press `C-c C-z u` you will upload local file or directory to re= mote host. * If you press `C-c C-z d` you will download the current file or directo= ry from remote host and then reload current buffer. * If you press `C-c C-z D` you will delete the current file or directory= after a confirmation on local and remote host. @@ -248,9 +230,18 @@ macOS 10.13 removed the Darwin port of BSD `ftp` whi= ch is needed for `ange-ftp`, 4. Type `./configure` then `make` and then `sudo make install` 5. Type `mv ./src/ftp /usr/local/bin/ftp` =20 +## TRAMP FTP doesn't read my ~/.authinfo.gpg + +Ange-FTP defaults to `~/.netrc` so you need to add this to your init scr= ipt: + +``` elisp +(setq ange-ftp-netrc-filename "~/.authinfo.gpg") +``` + ## Read more -* -* +* +* +* * * * diff --git a/ssh-deploy-diff-mode.el b/ssh-deploy-diff-mode.el index e6e077a..c6db269 100644 --- a/ssh-deploy-diff-mode.el +++ b/ssh-deploy-diff-mode.el @@ -1,12 +1,12 @@ -;;; ssh-deploy-diff-mode.el --- Mode for interactive directory differenc= es +;;; ssh-deploy-diff-mode.el --- Mode for interactive directory differenc= es -*- lexical-binding:t -*- =20 ;; Copyright (C) 2017-2018 Free Software Foundation, Inc. =20 -;; Author: Christian Johansson -;; Maintainer: Christian Johansson +;; Author: Christian Johansson +;; Maintainer: Christian Johansson ;; Created: 1 Feb 2018 -;; Modified: 23 Feb 2018 -;; Version: 1.14 +;; Modified: 28 Nov 2018 +;; Version: 2.0 ;; Keywords: tools, convenience ;; URL: https://github.com/cjohansson/emacs-ssh-deploy =20 @@ -34,45 +34,34 @@ ;;; Code: =20 =20 -(defvar ssh-deploy-diff-mode nil) - -(defconst ssh-deploy-diff-mode--section-directory-a 0 "Section for direc= tory a.") -(defconst ssh-deploy-diff-mode--section-directory-b 1 "Section for direc= tory b.") -(defconst ssh-deploy-diff-mode--section-exclude-list 2 "Section for excl= ude-list.") -(defconst ssh-deploy-diff-mode--section-only-in-a 3 "Section for only in= a.") -(defconst ssh-deploy-diff-mode--section-only-in-b 4 "Section for only in= b.") -(defconst ssh-deploy-diff-mode--section-in-both 5 "Section for in both."= ) - -(defconst ssh-deploy-diff-mode--action-copy 0 "Action for copy.") -(defconst ssh-deploy-diff-mode--action-copy-a 1 "Action for copy A.") -(defconst ssh-deploy-diff-mode--action-copy-b 2 "Action for copy B.") -(defconst ssh-deploy-diff-mode--action-delete 3 "Action for delete.") -(defconst ssh-deploy-diff-mode--action-difference 4 "Action for differen= ce.") -(defconst ssh-deploy-diff-mode--action-refresh 5 "Action for refreshing = differences.") -(defconst ssh-deploy-diff-mode--action-open 6 "Action for open file.") +(autoload 'ssh-deploy-diff-directories "ssh-deploy") +(autoload 'ssh-deploy-upload "ssh-deploy") +(autoload 'ssh-deploy-download "ssh-deploy") +(autoload 'ssh-deploy-delete-both "ssh-deploy") +(autoload 'ssh-deploy-delete "ssh-deploy") +(autoload 'ssh-deploy-diff-files "ssh-deploy") =20 (defconst ssh-deploy-diff-mode--keywords - (list - "DIRECTORY A" - "DIRECTORY B" - "EXCLUDE-LIST" - "FILES ONLY IN A" - "FILES ONLY IN B" - "FILES IN BOTH BUT DIFFERS" - "HELP" - ) + '( + "DIRECTORY A" + "DIRECTORY B" + "EXCLUDE-LIST" + "FILES ONLY IN A" + "FILES ONLY IN B" + "FILES IN BOTH BUT DIFFERS" + "HELP" + ) "Use list of keywords to build regular expression for syntax highlight= ing.") =20 -(let ((regex (concat "\\<" (regexp-opt ssh-deploy-diff-mode--keywords t)= "\\>"))) - (defconst ssh-deploy-diff-mode--font-lock-keywords +(defconst ssh-deploy-diff-mode--font-lock-keywords + (let ((regex (concat "\\<" (regexp-opt ssh-deploy-diff-mode--keywords = t) "\\>"))) (list `(,regex . font-lock-builtin-face) - '("\\('\\w*'\\)" . font-lock-variable-name-face)) - "Minimal highlighting expressions for SSH Deploy Diff major mode.")) + '("\\('\\w*'\\)" . font-lock-variable-name-face))) + "Minimal highlighting expressions for SSH Deploy Diff major mode.") =20 -(defvar ssh-deploy-diff-mode--map +(defvar ssh-deploy-diff-mode-map (let ((map (make-keymap))) - (define-key map "q" 'quit-window) (define-key map "C" 'ssh-deploy-diff-mode-copy-handler) (define-key map "a" 'ssh-deploy-diff-mode-copy-a-handler) (define-key map "b" 'ssh-deploy-diff-mode-copy-b-handler) @@ -84,13 +73,13 @@ map) "Key-map for SSH Deploy Diff major mode.") =20 -(defun ssh-deploy-diff-mode-copy-handler() "Start the copy action." (int= eractive)(ssh-deploy-diff-mode--action-handler ssh-deploy-diff-mode--acti= on-copy)) -(defun ssh-deploy-diff-mode-copy-a-handler() "Start the copy A action." = (interactive)(ssh-deploy-diff-mode--action-handler ssh-deploy-diff-mode--= action-copy-a)) -(defun ssh-deploy-diff-mode-copy-b-handler() "Start the copy B action." = (interactive)(ssh-deploy-diff-mode--action-handler ssh-deploy-diff-mode--= action-copy-b)) -(defun ssh-deploy-diff-mode-delete-handler() "Start the delete action." = (interactive)(ssh-deploy-diff-mode--action-handler ssh-deploy-diff-mode--= action-delete)) -(defun ssh-deploy-diff-mode-difference-handler() "Start the difference a= ction." (interactive)(ssh-deploy-diff-mode--action-handler ssh-deploy-dif= f-mode--action-difference)) -(defun ssh-deploy-diff-mode-refresh-handler() "Start the refresh action.= " (interactive)(ssh-deploy-diff-mode--action-handler ssh-deploy-diff-mode= --action-refresh)) -(defun ssh-deploy-diff-mode-open-handler() "Start the open action." (int= eractive)(ssh-deploy-diff-mode--action-handler ssh-deploy-diff-mode--acti= on-open)) +(defun ssh-deploy-diff-mode-copy-handler() "Start the copy action." (int= eractive)(ssh-deploy-diff-mode--action-handler #'ssh-deploy-diff-mode--co= py)) +(defun ssh-deploy-diff-mode-copy-a-handler() "Start the copy A action." = (interactive)(ssh-deploy-diff-mode--action-handler #'ssh-deploy-diff-mode= --copy-a)) +(defun ssh-deploy-diff-mode-copy-b-handler() "Start the copy B action." = (interactive)(ssh-deploy-diff-mode--action-handler #'ssh-deploy-diff-mode= --copy-b)) +(defun ssh-deploy-diff-mode-delete-handler() "Start the delete action." = (interactive)(ssh-deploy-diff-mode--action-handler #'ssh-deploy-diff-mode= --delete)) +(defun ssh-deploy-diff-mode-difference-handler() "Start the difference a= ction." (interactive)(ssh-deploy-diff-mode--action-handler #'ssh-deploy-d= iff-mode--difference)) +(defun ssh-deploy-diff-mode-refresh-handler() "Start the refresh action.= " (interactive)(ssh-deploy-diff-mode--action-handler #'ssh-deploy-diff-mo= de--refresh)) +(defun ssh-deploy-diff-mode-open-handler() "Start the open action." (int= eractive)(ssh-deploy-diff-mode--action-handler #'ssh-deploy-diff-mode--op= en)) =20 (defun ssh-deploy-diff-mode--get-parts () "Return current file and section if any." @@ -109,14 +98,17 @@ (let* ((start (line-beginning-position)) (end (line-end-position)) (section (buffer-substring-no-properties start end))) - (setq section (replace-regexp-in-string ": ([0-9]+)$" "" sec= tion)) - (cond ((string=3D section "DIRECTORY A") (setq section ssh-d= eploy-diff-mode--section-directory-a)) - ((string=3D section "DIRECTORY B") (setq section ssh-d= eploy-diff-mode--section-directory-b)) - ((string=3D section "EXCLUDE-LIST") (setq section ssh-= deploy-diff-mode--section-exclude-list)) - ((string=3D section "FILES ONLY IN A") (setq section s= sh-deploy-diff-mode--section-only-in-a)) - ((string=3D section "FILES ONLY IN B") (setq section s= sh-deploy-diff-mode--section-only-in-b)) - ((string=3D section "FILES IN BOTH BUT DIFFERS") (setq= section ssh-deploy-diff-mode--section-in-both)) - (t (message "Could not find section %s" section))) + (setq section (replace-regexp-in-string ": ([0-9]+)\\'" "" s= ection)) + (setq section + (pcase section + ("DIRECTORY A" 'directory-a) + ("DIRECTORY B" 'directory-b) + ("EXCLUDE-LIST" 'exclude-list) + ("FILES ONLY IN A" 'only-in-a) + ("FILES ONLY IN B" 'only-in-b) + ("FILES IN BOTH BUT DIFFERS" 'in-both) + (_ (message "Could not find section %s" section) + section))) (while (and (> (line-number-at-pos) 1) (not (looking-at "^DIRECTORY B:"))) (forward-line -1)) @@ -141,68 +133,50 @@ (interactive) (let ((parts (ssh-deploy-diff-mode--get-parts))) (if (not (eq parts nil)) - (cond ((and (not (null (nth 0 parts))) (=3D action ssh-deploy-di= ff-mode--action-copy)) (ssh-deploy-diff-mode--copy parts)) - ((and (not (null (nth 0 parts))) (=3D action ssh-deploy-di= ff-mode--action-copy-a)) (ssh-deploy-diff-mode--copy-a parts)) - ((and (not (null (nth 0 parts))) (=3D action ssh-deploy-di= ff-mode--action-copy-b)) (ssh-deploy-diff-mode--copy-b parts)) - ((and (not (null (nth 0 parts))) (=3D action ssh-deploy-di= ff-mode--action-delete)) (ssh-deploy-diff-mode--delete parts)) - ((and (not (null (nth 0 parts))) (=3D action ssh-deploy-di= ff-mode--action-difference)) (ssh-deploy-diff-mode--difference parts)) - ((and (not (null (nth 0 parts))) (=3D action ssh-deploy-di= ff-mode--action-open)) (ssh-deploy-diff-mode--open parts)) - ((=3D action ssh-deploy-diff-mode--action-refresh) (ssh-de= ploy-diff-mode--refresh parts)) - (t (message "Found nothing to do in the section for action= %s" action))) - (message "Found nothing to do")))) + (cond + ((null parts) (message "Found nothing to do")) + ((not (or (nth 0 parts) + ;; FIXME: Comparing equality of functions is bad karm= a! + (eq action #'ssh-deploy-diff-mode--refresh))) + (message "Found nothing to do in the section for action %s" + (replace-regexp-in-string "ssh-deploy-diff-mode--" "" + (format "%s" action)))) + (t (funcall action parts)))))) =20 (defun ssh-deploy-diff-mode--refresh (parts) "Refresh current difference query based on PARTS." (interactive) - (require 'ssh-deploy) - (if (and (boundp 'ssh-deploy-root-local) - (boundp 'ssh-deploy-root-remote) - (fboundp 'ssh-deploy-diff-directories)) - (let ((root-local (nth 2 parts)) - (root-remote (nth 3 parts)) - (async (cond ((boundp 'ssh-deploy-async) ssh-deploy-async)(t= nil))) - (exclude-list (cond ((boundp 'ssh-deploy-exclude-list) ssh-d= eploy-exclude-list)(t nil)))) - (progn - (kill-this-buffer) - (ssh-deploy-diff-directories root-local root-remote exclude-li= st async))))) + (let ((root-local (nth 2 parts)) + (root-remote (nth 3 parts))) + (kill-this-buffer) + (ssh-deploy-diff-directories root-local root-remote))) =20 (defun ssh-deploy-diff-mode--copy (parts) "Perform an upload or download depending on section in PARTS." - (require 'ssh-deploy) (let* ((file-name (nth 0 parts)) (root-local (file-truename (nth 2 parts))) (root-remote (nth 3 parts)) - (path-local (file-truename (concat root-local file-name))) - (path-remote (concat root-remote file-name)) - (section (nth 1 parts)) - (async (cond ((boundp 'ssh-deploy-async) ssh-deploy-async)(t ni= l))) - (revision-folder (cond ((boundp 'ssh-deploy-revision-folder) ss= h-deploy-revision-folder)(t nil)))) - (if (and (fboundp 'ssh-deploy-download) - (fboundp 'ssh-deploy-upload)) - (cond ((=3D section ssh-deploy-diff-mode--section-only-in-a) - (ssh-deploy-upload path-local path-remote t async revisio= n-folder)) - ((=3D section ssh-deploy-diff-mode--section-only-in-b) - (ssh-deploy-download path-remote path-local async revisio= n-folder)) - (t (message "Copy is not available in this section"))) - (display-warning 'ssh-deploy "Function ssh-deploy-download or ssh-= deploy-upload is missing" :warning)))) + (path-local (file-truename (expand-file-name file-name root-loc= al))) + (path-remote (expand-file-name file-name root-remote)) + (section (nth 1 parts))) + (pcase section + ('only-in-a + (ssh-deploy-upload path-local path-remote 1)) + ('only-in-b + (ssh-deploy-download path-remote path-local)) + (_ (message "Copy is not available in this section"))))) =20 (defun ssh-deploy-diff-mode--copy-a (parts) "Perform a upload of local-path to remote-path based on PARTS from sec= tion A or section BOTH." - (require 'ssh-deploy) (let* ((section (nth 1 parts)) (file-name (nth 0 parts)) (root-local (file-truename (nth 2 parts))) (root-remote (nth 3 parts)) - (path-local (file-truename (concat root-local file-name))) - (path-remote (concat root-remote file-name)) - (async (cond ((boundp 'ssh-deploy-async) ssh-deploy-async)(t ni= l))) - (revision-folder (cond ((boundp 'ssh-deploy-revision-folder) ss= h-deploy-revision-folder)(t nil)))) - (if (fboundp 'ssh-deploy-upload) - (cond ((or (=3D section ssh-deploy-diff-mode--section-only-in-a) - (=3D section ssh-deploy-diff-mode--section-in-both)) - (ssh-deploy-upload path-local path-remote t async revisio= n-folder)) - (t "Copy A is not available in this section")) - (display-warning 'ssh-deploy "Function ssh-deploy-upload is missin= g" :warning)))) + (path-local (file-truename (expand-file-name file-name root-loc= al))) + (path-remote (expand-file-name file-name root-remote))) + (cond ((memq section '(only-in-a in-both)) + (ssh-deploy-upload path-local path-remote 1)) + (t (message "Copy A is not available in this section"))))) =20 (defun ssh-deploy-diff-mode--copy-b (parts) "Perform an download of remote-path to local-path based on PARTS from = section B or section BOTH." @@ -211,56 +185,42 @@ (file-name (nth 0 parts)) (root-local (file-truename (nth 2 parts))) (root-remote (nth 3 parts)) - (path-local (file-truename (concat root-local file-name))) - (path-remote (concat root-remote file-name)) - (async (cond ((boundp 'ssh-deploy-async) ssh-deploy-async)(t ni= l))) - (revision-folder (cond ((boundp 'ssh-deploy-revision-folder) ss= h-deploy-revision-folder)(t nil)))) - (if (fboundp 'ssh-deploy-download) - (cond ((or (=3D section ssh-deploy-diff-mode--section-only-in-b) - (=3D section ssh-deploy-diff-mode--section-in-both)) - (ssh-deploy-download path-remote path-local async revisio= n-folder)) - (t "Copy B is not available in this section")) - (display-warning 'ssh-deploy "Function ssh-deploy-download is miss= ing" :warning)))) + (path-local (file-truename (expand-file-name file-name root-loc= al))) + (path-remote (expand-file-name file-name root-remote))) + (cond ((memq section '(only-in-b in-both)) + (ssh-deploy-download path-remote path-local)) + (t (message "Copy B is not available in this section"))))) =20 (defun ssh-deploy-diff-mode--delete (parts) "Delete path in both, only in a or only in b based on PARTS from secti= on A, B or BOTH." - (require 'ssh-deploy) (let* ((section (nth 1 parts)) (file-name (nth 0 parts)) (root-local (nth 2 parts)) (root-remote (nth 3 parts)) - (path-local (file-truename (concat root-local file-name))) - (path-remote (file-truename (concat root-remote file-name))) - (async (cond ((boundp 'ssh-deploy-async) ssh-deploy-async)(t ni= l))) - (debug (cond ((boundp 'ssh-deploy-debug) ssh-deploy-debug)(t ni= l))) - (exclude-list (cond ((boundp 'ssh-deploy-exclude-list) ssh-depl= oy-exclude-list)(t nil))) - (revision-folder (cond ((boundp 'ssh-deploy-revision-folder) ss= h-deploy-revision-folder)(t nil)))) - (if (and (fboundp 'ssh-deploy-delete) - (fboundp 'ssh-deploy-delete-both)) - (cond ((=3D section ssh-deploy-diff-mode--section-in-both) - (let ((yes-no-prompt (read-string (format "Type 'yes' to = confirm that you want to delete the file '%s': " file-name)))) - (if (string=3D yes-no-prompt "yes") - (ssh-deploy-delete-both path-local root-local root-= remote async debug exclude-list)))) - ((=3D section ssh-deploy-diff-mode--section-only-in-a) (ss= h-deploy-delete path-local async debug)) - ((=3D section ssh-deploy-diff-mode--section-only-in-b) (ss= h-deploy-delete path-remote async debug)) - ((=3D section ssh-deploy-diff-mode--section-in-both) (ssh-= deploy-delete-both path-local root-local root-remote async debug exclude-= list)) - (t (message "Delete is not available in this section"))) - (display-warning 'ssh-deploy "Function ssh-deploy-delete or ssh-de= ploy-delete-both is missing" :warning)))) + (path-local (file-truename (expand-file-name file-name root-loc= al))) + (path-remote (expand-file-name file-name root-remote))) + (pcase section + ('in-both + (let ((yes-no-prompt (read-string (format "Type 'yes' to confirm = that you want to delete the file '%s': " file-name)))) + (if (string=3D yes-no-prompt "yes") + (ssh-deploy-delete-both path-local)))) + ('only-in-a + (ssh-deploy-delete path-local)) + ('only-in-b + (ssh-deploy-delete path-remote)) + (_ (message "Delete is not available in this section"))))) =20 (defun ssh-deploy-diff-mode--difference (parts) "If file exists in both start a difference session based on PARTS." - (require 'ssh-deploy) (let ((section (nth 1 parts))) - (if (=3D section ssh-deploy-diff-mode--section-in-both) - (if (fboundp 'ssh-deploy-diff-files) - (let* ((file-name (nth 0 parts)) - (root-local (file-truename (nth 2 parts))) - (root-remote (nth 3 parts)) - (path-local (file-truename (concat root-local file-na= me))) - (path-remote (concat root-remote file-name))) - (ssh-deploy-diff-files path-local path-remote))) - (display-warning 'ssh-deploy "Function ssh-deploy-diff-files is mi= ssing" :warning)) - (message "File must exists in both roots to perform a difference act= ion."))) + (if (eq section 'in-both) + (let* ((file-name (nth 0 parts)) + (root-local (file-truename (nth 2 parts))) + (root-remote (nth 3 parts)) + (path-local (file-truename (expand-file-name file-name ro= ot-local))) + (path-remote (expand-file-name file-name root-remote))) + (ssh-deploy-diff-files path-local path-remote)) + (message "File must exists in both roots to perform a difference a= ction.")))) =20 (defun ssh-deploy-diff-mode--open (parts) "Perform a open file action based on PARTS from section A or section B= ." @@ -269,28 +229,21 @@ (file-name (nth 0 parts)) (root-local (file-truename (nth 2 parts))) (root-remote (nth 3 parts)) - (path-local (file-truename (concat root-local file-name))) - (path-remote (concat root-remote file-name))) - (cond ((=3D section ssh-deploy-diff-mode--section-only-in-a) - (progn - (message "Opening file '%s'" path-local) - (find-file path-local))) - ((=3D section ssh-deploy-diff-mode--section-only-in-b) - (progn - (message "Opening file '%s'" path-remote) - (find-file path-remote))) - (t (message "Open is not available in this section"))))) - -(defun ssh-deploy-diff-mode () + (path-local (file-truename (expand-file-name file-name root-loc= al))) + (path-remote (expand-file-name file-name root-remote))) + (pcase section + ('only-in-a + (message "Opening file '%s'" path-local) + (find-file path-local)) + ('only-in-b + (message "Opening file '%s'" path-remote) + (find-file path-remote)) + (_ (message "Open is not available in this section"))))) + +(define-derived-mode ssh-deploy-diff-mode special-mode "SSH-Deploy-Diff" "Major mode for SSH Deploy interactive directory differences." - (interactive) - (kill-all-local-variables) - (use-local-map ssh-deploy-diff-mode--map) - (set (make-local-variable 'font-lock-defaults) '(ssh-deploy-diff-mode-= -font-lock-keywords)) - (setq major-mode 'ssh-deploy-diff-mode) - (setq mode-name "SSH-Deploy-Diff") - (read-only-mode t) - (run-hooks 'ssh-deploy-diff-mode-hook)) + (set (make-local-variable 'font-lock-defaults) + '(ssh-deploy-diff-mode--font-lock-keywords))) =20 (provide 'ssh-deploy-diff-mode) =20 diff --git a/ssh-deploy.el b/ssh-deploy.el index c965879..1ee612d 100644 --- a/ssh-deploy.el +++ b/ssh-deploy.el @@ -2,11 +2,11 @@ =20 ;; Copyright (C) 2017-2018 Free Software Foundation, Inc. =20 -;; Author: Christian Johansson +;; Author: Christian Johansson ;; Maintainer: Christian Johansson ;; Created: 5 Jul 2016 -;; Modified: 19 Aug 2018 -;; Version: 2.0 +;; Modified: 28 Nov 2018 +;; Version: 3.0 ;; Keywords: tools, convenience ;; URL: https://github.com/cjohansson/emacs-ssh-deploy =20 @@ -40,98 +40,63 @@ ;; ssh-deploy-root-local,ssh-deploy-root-remote, ssh-deploy-on-explicit-= save ;; you can setup a directory for TRAMP deployment. ;; -;; For asynchronous transfers you need to setup ~/.netrc, ~/.authinfo or= ~/.authinfo.gpg or key-based authorization or equivalent for automatic a= uthentication. +;; For asynchronous transfers you need to setup ~/.authinfo.gpg or key-b= ased authorization or equivalent for automatic authentication. ;; -;; Example contents of ~/.netrc, ~/.authinfo or ~/.authinfo.gpg for pass= word-based interaction-free authentication: +;; Example contents of ~/.authinfo.gpg for password-based interaction-fr= ee authentication: ;; machine myserver.com login myuser port ftp password mypassword ;; machine myserver2.com login myuser2 port ssh password mypassword2 ;; machine myserver3.com login myuser3 port sftp password mypassword3 ;; ;; Set permissions to this file to 600 with your user as the owner. ;; -;; - To setup an upload hook on save do this: -;; (add-hook 'after-save-hook -;; (lambda () (if (bound-and-true-p ssh-deploy-on-explicit= -save) -;; (ssh-deploy-upload-handler)))) +;; If your not using ~/.netrc for FTP information you need to specify wh= at file your using with: +;; (setq ange-ftp-netrc-filename "~/.authinfo.gpg") +;; +;; - To setup a upload hook on save do this: +;; Add to init-script: (ssh-deploy-add-after-save-hook) ;; ;; - To setup automatic storing of base revisions and detection of remot= e changes do this: -;; (add-hook 'find-file-hook -;; (lambda () -;; (if (bound-and-true-p ssh-deploy-automatically-detect= -remote-changes) -;; (ssh-deploy-remote-changes-handler)) )) +;; Add to init-script: (ssh-deploy-add-find-file-hook) +;; +;; - To enable mode-line feature do this: +;; (ssh-deploy-line-mode) ;; -;; - To set key-bindings do something like this: +;; - To enable menu-bar feature do this: +;; (ssh-deploy-add-menu) ;; -;; (global-set-key (kbd "C-c C-z f") 'ssh-deploy-upload-handler-forc= ed) -;; (global-set-key (kbd "C-c C-z u") 'ssh-deploy-upload-handler) -;; (global-set-key (kbd "C-c C-z D") 'ssh-deploy-delete-handler) -;; (global-set-key (kbd "C-c C-z d") 'ssh-deploy-download-handler) -;; (global-set-key (kbd "C-c C-z x") 'ssh-deploy-diff-handler) -;; (global-set-key (kbd "C-c C-z t") 'ssh-deploy-remote-terminal-esh= ell-base-handler) -;; (global-set-key (kbd "C-c C-z T") 'ssh-deploy-remote-terminal-esh= ell-handler) -;; (global-set-key (kbd "C-c C-z h") 'ssh-deploy-remote-terminal-she= ll-base-handler) -;; (global-set-key (kbd "C-c C-z H") 'ssh-deploy-remote-terminal-she= ll-handler) -;; (global-set-key (kbd "C-c C-z R") 'ssh-deploy-rename-handler) -;; (global-set-key (kbd "C-c C-z e") 'ssh-deploy-remote-changes-hand= ler) -;; (global-set-key (kbd "C-c C-z b") 'ssh-deploy-browse-remote-base-= handler) -;; (global-set-key (kbd "C-c C-z B") 'ssh-deploy-browse-remote-handl= er) -;; (global-set-key (kbd "C-c C-z o") 'ssh-deploy-open-remote-file-ha= ndler) -;; (global-set-key (kbd "C-c C-z m") 'ssh-deploy-remote-sql-mysql-ha= ndler) -;; (global-set-key (kbd "C-c C-z s") 'ssh-deploy-run-deploy-script-h= andler) +;; - To set global key-bindings do something like this: +;; (global-set-key (kbd "C-c C-z") 'ssh-deploy-prefix-map) +;; +;; - To set global key-bindings for the pre-defined hydra do something l= ike this: +;; (global-set-key (kbd "C-c C-z") 'ssh-deploy-hydra/body) ;; ;; - To install and set-up using use-package and hydra do this: ;; (use-package ssh-deploy ;; :ensure t ;; :demand -;; :bind (("C-c C-z" . hydra-ssh-deploy/body)) -;; :hook ((after-save . (lambda () (if (bound-and-true-p ssh-deploy-= on-explicit-save) (ssh-deploy-upload-handler)) )) -;; (find-file . (lambda () (if (bound-and-true-p ssh-deploy-a= utomatically-detect-remote-changes) (ssh-deploy-remote-changes-handler)) = ))) +;; :bind (("C-c C-z" . ssh-deploy-hydra/body)) +;; :hook ((after-save . ssh-deploy-after-save) +;; (find-file . ssh-deploy-find-file)) ;; :config -;; (defhydra hydra-ssh-deploy (:color red :hint nil) -;; " -;; _u_: Upload _f_: Force Upload -;; _d_: Download -;; _D_: Delete -;; _x_: Difference -;; _t_: Eshell Base Terminal _T_: Eshell Relative Termina= l -;; _h_: Shell Base Terminal _H_: Shell Relative Terminal -;; _e_: Detect Remote Changes -;; _R_: Rename -;; _b_: Browse Base _B_: Browse Relative -;; _o_: Open current file on remote _m_: Open sql-mysql on remot= e -;; _s_: Run deploy script -;; " -;; ("f" ssh-deploy-upload-handler-forced) -;; ("u" ssh-deploy-upload-handler) -;; ("d" ssh-deploy-download-handler) -;; ("D" ssh-deploy-delete-handler) -;; ("x" ssh-deploy-diff-handler) -;; ("t" ssh-deploy-remote-terminal-eshell-base-handler) -;; ("T" ssh-deploy-remote-terminal-eshell-handler) -;; ("h" ssh-deploy-remote-terminal-shell-base-handler) -;; ("H" ssh-deploy-remote-terminal-shell-handler) -;; ("e" ssh-deploy-remote-changes-handler) -;; ("R" ssh-deploy-rename-handler) -;; ("b" ssh-deploy-browse-remote-base-handler) -;; ("B" ssh-deploy-browse-remote-handler) -;; ("o" ssh-deploy-open-remote-file-handler) -;; ("m" ssh-deploy-remote-sql-mysql-handler) -;; ("s" ssh-deploy-run-deploy-script-handler))) +;; (ssh-deploy-line-mode) ;; If you want mode-line feature +;; (ssh-deploy-add-menu) ;; If you want menu-bar feature +;; ) +;; ;; ;; Here is an example for SSH deployment, /Users/Chris/Web/Site1/.dir-lo= cals.el: ;; ((nil . ( ;; (ssh-deploy-root-local . "/Users/Chris/Web/Site1/") ;; (ssh-deploy-root-remote . "/ssh:myuser@myserver.com:/var/www/site1/= ") -;; (ssh-deploy-on-explicit-save . t) -;; (ssh-deploy-async . t) +;; (ssh-deploy-on-explicit-save . 1) +;; (ssh-deploy-async . 1) ;; ))) ;; ;; Here is an example for SFTP deployment, /Users/Chris/Web/Site2/.dir-l= ocals.el: ;; ((nil . ( ;; (ssh-deploy-root-local . "/Users/Chris/Web/Site2/") ;; (ssh-deploy-root-remote . "/sftp:myuser@myserver.com:/var/www/site2= /") -;; (ssh-deploy-on-explicit-save . nil) -;; (ssh-deploy-async . nil) +;; (ssh-deploy-on-explicit-save . 0) +;; (ssh-deploy-async . 0) ;; (ssh-deploy-script . (lambda() (let ((default-directory ssh-deploy-= root-remote))(shell-command "bash compile.sh")))) ;; ))) ;; @@ -142,33 +107,34 @@ ;; ))) ;; ;; -;; Now when you are in a directory which is configured for deployment. -;; ;; Here is a list of other variables you can set globally or per directo= ry: =20 ;; * `ssh-deploy-root-local' - The local root that should be under deplo= yment *(string)* ;; * `ssh-deploy-root-remote' - The remote TRAMP root that is used for d= eployment *(string)* -;; * `ssh-deploy-debug' - Enables debugging messages *(boolean)* +;; * `ssh-deploy-debug' - Enables debugging messages *(integer)* ;; * `ssh-deploy-revision-folder' - The folder used for storing local re= visions *(string)* -;; * `ssh-deploy-automatically-detect-remote-changes' - Enables automati= c detection of remote changes *(boolean)* -;; * `ssh-deploy-on-explicit-save' - Enabled automatic uploads on save *= (boolean)* -;; * `ssh-deploy-exclude-list' - A list defining what paths to exclude f= rom deployment *(list)* -;; * `ssh-deploy-async' - Enables asynchronous transfers (you need to ha= ve `(make-thread)` or `async.el` available as well) *(boolean)* +;; * `ssh-deploy-automatically-detect-remote-changes' - Enables automati= c detection of remote changes *(integer)* +;; * `ssh-deploy-on-explicit-save' - Enabled automatic uploads on save *= (integer)* +;; * `ssh-deploy-exclude-list' - A list defining what file names to excl= ude from deployment *(list)* +;; * `ssh-deploy-async' - Enables asynchronous transfers (you need to ha= ve `(make-thread)` or `async.el` available as well) *(integer)* ;; * `ssh-deploy-remote-sql-database' - Default database when connecting= to remote SQL database *(string)* ;; * `ssh-deploy-remote-sql-password' - Default password when connecting= to remote SQL database *(string)* ;; * `ssh-deploy-remote-sql-port' - Default port when connecting to remo= te SQL database *(integer)* ;; * `ssh-deploy-remote-sql-server' - Default server when connecting to = remote SQL database *(string)* ;; * `ssh-deploy-remote-sql-user' - Default user when connecting to remo= te SQL database *(string)* -;; * `ssh-deploy-remote-shell-executable' - Default shell executable whe= n launching shell on remote host -;; * `ssh-deploy-verbose' - Show messages in message buffer when startin= g and ending actions, default t *(boolean)* -;; * `ssh-deploy-script' - Our custom lambda function that will be calle= d using (funcall) when running deploy script +;; * `ssh-deploy-remote-shell-executable' - Default shell executable whe= n launching shell on remote host *(string)* +;; * `ssh-deploy-verbose' - Show messages in message buffer when startin= g and ending actions *(integer)* +;; * `ssh-deploy-script' - Our custom lambda function that will be calle= d using (funcall) when running deploy script *(function)* +;; * `ssh-deploy-async-with-threads' - Whether to use threads (make thre= ads) instead of processes (async-start) for asynchronous operations *(int= eger)* +;; +;; When integers are used as booleans, above zero means true, zero means= false and nil means unset and fallback to global settings. ;; -;; Please see README.md from the same repository for extended documentat= ion. +;; Please see README.md from the same repository for more extended docum= entation. =20 ;;; Code: =20 -(autoload 'ssh-deploy-diff-mode "ssh-deploy-diff-mode" - "Major mode for SSH Deploy interactive directory differences.") + +(autoload 'ssh-deploy-diff-mode "ssh-deploy-diff-mode") =20 (defgroup ssh-deploy nil "Upload, download, difference, browse and terminal handler for files a= nd directories on remote hosts via TRAMP." @@ -187,45 +153,57 @@ (put 'ssh-deploy-root-remote 'permanent-local t) (put 'ssh-deploy-root-remote 'safe-local-variable 'stringp) =20 -(defcustom ssh-deploy-on-explicit-save t - "Boolean variable if deploy should be made on explicit save, t by defa= ult." +(defcustom ssh-deploy-on-explicit-save 1 + "Boolean variable if deploy should be made on explicit save, 1 by defa= ult." :type 'boolean) (put 'ssh-deploy-on-explicit-save 'permanent-local t) -(put 'ssh-deploy-on-explicit-save 'safe-local-variable 'booleanp) +(put 'ssh-deploy-on-explicit-save 'safe-local-variable 'integerp) =20 -(defcustom ssh-deploy-debug nil - "Boolean variable if debug messages should be shown, nil by default." +(defcustom ssh-deploy-debug 0 + "Boolean variable if debug messages should be shown, 0 by default." :type 'boolean) (put 'ssh-deploy-debug 'permanent-local t) -(put 'ssh-deploy-debug 'safe-local-variable 'booleanp) +(put 'ssh-deploy-debug 'safe-local-variable 'integerp) =20 ;; TODO This flag needs to work better, you should not miss any useful n= otifications when this is on -(defcustom ssh-deploy-verbose t - "Boolean variable if debug messages should be shown, t by default." +(defcustom ssh-deploy-verbose 1 + "Boolean variable if debug messages should be shown, 1 by default." :type 'boolean) (put 'ssh-deploy-verbose 'permanent-local t) -(put 'ssh-deploy-verbose 'safe-local-variable 'booleanp) +(put 'ssh-deploy-verbose 'safe-local-variable 'integerp) =20 -(defcustom ssh-deploy-async t - "Boolean variable if asynchronous method for transfers should be used,= t by default." +(defcustom ssh-deploy-async 0 + "Boolean variable if asynchronous method for transfers should be used,= 0 by default." :type 'boolean) (put 'ssh-deploy-async 'permanent-local t) -(put 'ssh-deploy-async 'safe-local-variable 'booleanp) +(put 'ssh-deploy-async 'safe-local-variable 'integerp) + +(defcustom ssh-deploy-async-with-threads 0 + "Boolean variable if asynchronous method should use threads if availab= le, 0 by default." + :type 'boolean) +(put 'ssh-deploy-async-with-threads 'permanent-local t) +(put 'ssh-deploy-async-with-threads 'safe-local-variable 'integerp) + +(defcustom ssh-deploy-async-with-threads 0 + "Boolean variable if asynchronous method should use threads if availab= le, 0 by default." + :type 'boolean) +(put 'ssh-deploy-async-with-threads 'permanent-local t) +(put 'ssh-deploy-async-with-threads 'safe-local-variable 'integerp) =20 (defcustom ssh-deploy-revision-folder "~/.ssh-deploy-revisions/" - "String variable with path to revisions with trailing slash." + "String variable with file name to revisions with trailing slash." :type 'string) (put 'ssh-deploy-revision-folder 'permanent-local t) (put 'ssh-deploy-revision-folder 'safe-local-variable 'stringp) =20 -(defcustom ssh-deploy-automatically-detect-remote-changes t - "Detect remote changes and store base revisions automatically, t by de= fault." +(defcustom ssh-deploy-automatically-detect-remote-changes 1 + "Detect remote changes and store base revisions automatically, 1 by de= fault." :type 'boolean) (put 'ssh-deploy-automatically-detect-remote-changes 'permanent-local t) -(put 'ssh-deploy-automatically-detect-remote-changes 'safe-local-variabl= e 'booleanp) +(put 'ssh-deploy-automatically-detect-remote-changes 'safe-local-variabl= e 'integerp) =20 (defcustom ssh-deploy-exclude-list '(".git/" ".dir-locals.el") - "List of strings that if found in paths will exclude paths from sync, = '(\"/.git\"/' \".dir-locals.el\") by default." + "List of strings that if found in file name will exclude it from sync,= '(\"/.git\"/' \".dir-locals.el\") by default." :type 'list) (put 'ssh-deploy-exclude-list 'permanent-local t) (put 'ssh-deploy-exclude-list 'safe-local-variable 'listp) @@ -250,7 +228,8 @@ =20 (defcustom ssh-deploy-remote-sql-server nil "String variable of remote sql server, nil by default." - :type 'string) + :type 'string + :group 'ssh-deploy) (put 'ssh-deploy-remote-sql-server 'permanent-local t) (put 'ssh-deploy-remote-sql-server 'safe-local-variable 'stringp) =20 @@ -261,14 +240,14 @@ (put 'ssh-deploy-remote-sql-user 'safe-local-variable 'stringp) =20 (defcustom ssh-deploy-remote-shell-executable nil - "String variable of remote shell executable server, nil by default." + "String variable of remote server shell executable, nil by default." :type 'string) (put 'ssh-deploy-remote-shell-executable 'permanent-local t) (put 'ssh-deploy-remote-shell-executable 'safe-local-variable 'stringp) =20 (defcustom ssh-deploy-script nil "Lambda function to run with `funcall' when `ssh-deploy-run-deploy-scr= ipt-handler' is executed." - :type 'lambda) + :type 'function) (put 'ssh-deploy-script 'permanent-local t) (put 'ssh-deploy-script 'safe-local-variable 'functionp) =20 @@ -306,12 +285,27 @@ ;; these functions MUST not use module variables in any way. =20 =20 -(defun ssh-deploy--async-process (start &optional finish) - "Asynchronously do START and then optionally do FINISH." - (if (fboundp 'make-thread) - (make-thread (lambda () (funcall finish (funcall start)))) +(defun ssh-deploy--async-process (start &optional finish async-with-thre= ads) + "Asynchronously do START and then optionally do FINISH, use multi-trea= ding if ASYNC-WITH-THREADS is above 0 otherwise use multi processes via a= sync.el." + (if (and (fboundp 'make-thread) + async-with-threads + (> async-with-threads 0)) + (make-thread (lambda() + (if start + (let ((result (funcall start))) + (if finish + (funcall finish result)))))) (if (fboundp 'async-start) - (async-start start finish) + (if start + (let ((ftp-netrc nil)) + (when (boundp 'ange-ftp-netrc-filename) + (setq ftp-netrc ange-ftp-netrc-filename)) + (async-start + (lambda() + (if ftp-netrc + (defvar ange-ftp-netrc-filename ftp-netrc)) + (funcall start)) + finish))) (display-warning 'ssh-deploy "Neither make-thread nor async-start = functions are available!")))) =20 (defun ssh-deploy--mode-line-set-status-and-update (status &optional fil= ename) @@ -320,26 +314,20 @@ (let ((buffer (find-buffer-visiting filename))) (when buffer (with-current-buffer buffer - (unless (listp ssh-deploy--mode-line-status) - (setq ssh-deploy--mode-line-status '())) (push status ssh-deploy--mode-line-status) ;; (message "SSH Deploy - Updated status to: %s" ssh-deploy-= -mode-line-status) (ssh-deploy--mode-line-status-refresh)))) (progn - (unless (listp ssh-deploy--mode-line-status) - (setq ssh-deploy--mode-line-status '())) (push status ssh-deploy--mode-line-status) ;; (message "SSH Deploy - Updated status to: %s" ssh-deploy--mode-= line-status) (ssh-deploy--mode-line-status-refresh)))) =20 (defun ssh-deploy--mode-line-status-refresh () "Refresh the status text based on the status variable." - (unless (listp ssh-deploy--mode-line-status) - ;; (message "Resetting status: %s" ssh-deploy--mode-line-status) - (setq ssh-deploy--mode-line-status '())) (let ((status (pop ssh-deploy--mode-line-status))) ;; (message "SSH Deploy - Refreshing status based on: %s" status) - (ssh-deploy--mode-line-status-update status))) + (when status + (ssh-deploy--mode-line-status-update status)))) =20 (defun ssh-deploy--mode-line-status-update (&optional status) "Update the local status text variable to a text representation based = on STATUS." @@ -356,7 +344,7 @@ (setq status-text "ul..")) =20 ((=3D status ssh-deploy--status-deleting) - (setq status-text "..")) + (setq status-text "rm..")) =20 ((=3D status ssh-deploy--status-renaming) (setq status-text "mv..")) @@ -364,6 +352,9 @@ ((=3D status ssh-deploy--status-detecting-remote-changes) (setq status-text "diff..")) =20 + ((and ssh-deploy-root-local ssh-deploy-root-remote) + (setq status-text "idle")) + (t (setq status-text "")) =20 ) @@ -377,7 +368,7 @@ "Return a formatted string based on TEXT." (if (string=3D text "") "" - (format " [DPL:%s] " text))) + (format " {DPLY:%s} " text))) =20 (defun ssh-deploy--insert-keyword (text) "Insert TEXT as bold text." @@ -388,7 +379,7 @@ "Generate revision-path for PATH in ROOT." (if (not (file-exists-p root)) (make-directory root)) - (concat root (replace-regexp-in-string "\\(/\\|@\\|:\\)" "_" path))) + (expand-file-name (replace-regexp-in-string "\\(/\\|@\\|:\\)" "_" path= ) root)) =20 (defun ssh-deploy--file-is-in-path (file path) "Return non-nil if FILE is in the path PATH." @@ -412,18 +403,18 @@ (and (not (null string)) (not (zerop (length string))))) =20 -(defun ssh-deploy--upload-via-tramp-async (path-local path-remote force = revision-folder) - "Upload PATH-LOCAL to PATH-REMOTE via TRAMP asynchronously and FORCE u= pload despite remote change, check for revisions in REVISION-FOLDER." +(defun ssh-deploy--upload-via-tramp-async (path-local path-remote force = revision-folder async-with-threads) + "Upload PATH-LOCAL to PATH-REMOTE via TRAMP asynchronously and FORCE u= pload despite remote change, check for revisions in REVISION-FOLDER. Use= multi-treaded async if ASYNC-WITH-THREADS is specified." (let ((file-or-directory (not (file-directory-p path-local)))) (ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-uplo= ading path-local) (if file-or-directory (let ((revision-path (ssh-deploy--get-revision-path path-local r= evision-folder))) (when ssh-deploy-verbose (message "Uploading file '%s' to '%s'= .. (asynchronously)" path-local path-remote)) (ssh-deploy--async-process - (lambda () + (lambda() (require 'ediff-util) (if (fboundp 'ediff-same-file-contents) - (if (or (eq t force) (not (file-exists-p path-remote)) = (and (file-exists-p revision-path) (ediff-same-file-contents revision-pat= h path-remote))) + (if (or (> force 0) (not (file-exists-p path-remote)) (= and (file-exists-p revision-path) (ediff-same-file-contents revision-path= path-remote))) (progn (if (not (file-directory-p (file-name-directory p= ath-remote))) (make-directory (file-name-directory path-rem= ote) t)) @@ -432,15 +423,16 @@ (list 0 (format "Completed upload of file '%s'. (= asynchronously)" path-remote) path-local)) (list 1 (format "Remote file '%s' has changed please = download or diff. (asynchronously)" path-remote) path-local)) (list 1 "Function 'ediff-same-file-contents' is missing. = (asynchronously)" path-local))) - (lambda (return) + (lambda(return) (ssh-deploy--mode-line-set-status-and-update ssh-deploy--st= atus-idle (nth 2 return)) (if (=3D (nth 0 return) 0) (when ssh-deploy-verbose (message (nth 1 return))) - (display-warning 'ssh-deploy (nth 1 return) :warning))))) + (display-warning 'ssh-deploy (nth 1 return) :warning))) + async-with-threads)) (progn (when ssh-deploy-verbose (message "Uploading directory '%s' to '= %s'.. (asynchronously)" path-local path-remote)) (ssh-deploy--async-process - (lambda () + (lambda() (copy-directory path-local path-remote t t t) path-local) (lambda(return-path) @@ -456,7 +448,7 @@ (progn (require 'ediff-util) (if (fboundp 'ediff-same-file-contents) - (if (or (eq t force) + (if (or (> force 0) (not (file-exists-p path-remote)) (and (file-exists-p revision-path) (ediff-same-fil= e-contents revision-path path-remote))) (progn @@ -475,13 +467,13 @@ (ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-= idle) (when ssh-deploy-verbose (message "Completed upload of '%s'. (sy= nchronously)" path-local)))))) =20 -(defun ssh-deploy--download-via-tramp-async (path-remote path-local revi= sion-folder) - "Download PATH-REMOTE to PATH-LOCAL via TRAMP asynchronously and make = a copy in REVISION-FOLDER." +(defun ssh-deploy--download-via-tramp-async (path-remote path-local revi= sion-folder async-with-threads) + "Download PATH-REMOTE to PATH-LOCAL via TRAMP asynchronously and make = a copy in REVISION-FOLDER, use multi-threading if ASYNC-WITH-THREADS is a= bove zero." (let ((revision-path (ssh-deploy--get-revision-path path-local revisio= n-folder))) (ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-down= loading path-local) (when ssh-deploy-verbose (message "Downloading '%s' to '%s'.. (async= hronously)" path-remote path-local)) (ssh-deploy--async-process - (lambda () + (lambda() (let ((file-or-directory (not (file-directory-p path-remote)))) (if file-or-directory (progn @@ -497,7 +489,8 @@ (let ((local-buffer (find-buffer-visiting return-path))) (when local-buffer (with-current-buffer local-buffer - (revert-buffer t t t)))))))) + (revert-buffer t t t))))) + async-with-threads))) =20 (defun ssh-deploy--download-via-tramp (path-remote path-local revision-f= older) "Download PATH-REMOTE to PATH-LOCAL via TRAMP synchronously and store = a copy in REVISION-FOLDER." @@ -623,17 +616,10 @@ (display-warning 'ssh-deploy "Both directories need to exist to = perform difference generation." :warning)) (display-warning 'ssh-deploy "Function 'string-remove-prefix' is mis= sing." :warning))) =20 -(defun ssh-deploy--diff-directories-present (diff) - "Present difference data for directories from DIFF." - (let ((buffer (generate-new-buffer "ssh-deploy diff")) - (old-ssh-deploy-root-local ssh-deploy-root-local) - (old-ssh-deploy-root-remote ssh-deploy-root-remote) - (old-ssh-deploy-on-explicit-save ssh-deploy-on-explicit-save) - (old-ssh-deploy-debug ssh-deploy-debug) - (old-ssh-deploy-async ssh-deploy-async) - (old-ssh-deploy-revision-folder ssh-deploy-revision-folder) - (old-ssh-deploy-automatically-detect-remote-changes ssh-deploy-a= utomatically-detect-remote-changes) - (old-ssh-deploy-exclude-list ssh-deploy-exclude-list)) +(defun ssh-deploy--diff-directories-present (diff root-local root-remote= on-explicit-save debug async async-with-threads revision-folder remote-c= hanges exclude-list) + "Present difference data for directories from the DIFF, ROOT-LOCAL def= ines local root, ROOT-REMOTE defined remote root, ON-EXPLICIT-SAVE define= s automatic uploads, DEBUG is the debug flag, ASYNC is for asynchronous, = ASYNC-WITH-THREADS for threads instead of processes, REVISION-FOLDER is f= or revisions, REMOTE-CHANGES are whether to look for remote change, EXCLU= DE-LIST is what files to exclude." + + (let ((buffer (generate-new-buffer "*SSH Deploy diff*"))) (switch-to-buffer buffer) =20 (ssh-deploy--insert-keyword "DIRECTORY A: ") @@ -678,14 +664,15 @@ (ssh-deploy-diff-mode) =20 ;; Set local variables same as current directories - (set (make-local-variable 'ssh-deploy-root-local) old-ssh-deploy-roo= t-local) - (set (make-local-variable 'ssh-deploy-root-remote) old-ssh-deploy-ro= ot-remote) - (set (make-local-variable 'ssh-deploy-on-explicit-save) old-ssh-depl= oy-on-explicit-save) - (set (make-local-variable 'ssh-deploy-debug) old-ssh-deploy-debug) - (set (make-local-variable 'ssh-deploy-async) old-ssh-deploy-async) - (set (make-local-variable 'ssh-deploy-revision-folder) old-ssh-deplo= y-revision-folder) - (set (make-local-variable 'ssh-deploy-automatically-detect-remote-ch= anges) old-ssh-deploy-automatically-detect-remote-changes) - (set (make-local-variable 'ssh-deploy-exclude-list) old-ssh-deploy-e= xclude-list))) + (set (make-local-variable 'ssh-deploy-root-local) root-local) + (set (make-local-variable 'ssh-deploy-root-remote) root-remote) + (set (make-local-variable 'ssh-deploy-on-explicit-save) on-explicit-= save) + (set (make-local-variable 'ssh-deploy-debug) debug) + (set (make-local-variable 'ssh-deploy-async) async) + (set (make-local-variable 'ssh-deploy-async-with-threads) async-with= -threads) + (set (make-local-variable 'ssh-deploy-revision-folder) revision-fold= er) + (set (make-local-variable 'ssh-deploy-automatically-detect-remote-ch= anges) remote-changes) + (set (make-local-variable 'ssh-deploy-exclude-list) exclude-list))) =20 =20 ;; PUBLIC functions @@ -707,45 +694,48 @@ (display-warning 'ssh-deploy "Function 'ediff-same-file-contents' is= missing." :warning))) =20 ;;;###autoload -(defun ssh-deploy-diff-directories (directory-a directory-b &optional ex= clude-list async) - "Find difference between DIRECTORY-A and DIRECTORY-B but exclude paths= matching EXCLUDE-LIST, do it asynchronously is ASYNC is true." - ;; FIXME: These next 4 lines don't do anything because the optional ar= gs - ;; are always "bound" (to nil if the arg was not passed). - ;; (if (not (boundp 'async)) - ;; (setq async ssh-deploy-async)) - ;; (if (not (boundp 'exclude-list)) - ;; (setq exclude-list ssh-deploy-exclude-list)) - (if async - (let ((script-filename (file-name-directory (symbol-file 'ssh-depl= oy-diff-directories)))) - (message "Calculating differences between directory '%s' and '%s= '.. (asynchronously)" directory-a directory-b) - (ssh-deploy--async-process - (lambda () - (add-to-list 'load-path script-filename) - (require 'ssh-deploy) - (ssh-deploy--diff-directories-data directory-a directory-b ex= clude-list)) - (lambda(diff) - (message "Completed calculation of differences between direct= ory '%s' and '%s'. Result: %s only in A, %s only in B, %s differs. (async= hronously)" (nth 0 diff) (nth 1 diff) (length (nth 4 diff)) (length (nth = 5 diff)) (length (nth 7 diff))) - (if (or (> (length (nth 4 diff)) 0) (> (length (nth 5 diff)) = 0) (> (length (nth 7 diff)) 0)) - (ssh-deploy--diff-directories-present diff))))) - (progn - (message "Calculating differences between directory '%s' and '%s'.= . (synchronously)" directory-a directory-b) - (let ((diff (ssh-deploy--diff-directories-data directory-a directo= ry-b exclude-list))) - (message "Completed calculation of differences between directory= '%s' and '%s'. Result: %s only in A, %s only in B, %s differs. (synchron= ously)" (nth 0 diff) (nth 1 diff) (length (nth 4 diff)) (length (nth 5 di= ff)) (length (nth 7 diff))) - (if (or (> (length (nth 4 diff)) 0) (> (length (nth 5 diff)) 0) = (> (length (nth 7 diff)) 0)) - (ssh-deploy--diff-directories-present diff)))))) +(defun ssh-deploy-diff-directories (directory-a directory-b &optional on= -explicit-save debug async async-with-threads revision-folder remote-chan= ges exclude-list) + "Find difference between DIRECTORY-A and DIRECTORY-B but exclude, ON-E= XPLICIT-SAVE defines automatic uploads, DEBUG is the debug flag, ASYNC is= for asynchronous, ASYNC-WITH-THREADS for threads instead of processes, R= EVISION-FOLDER is for revisions, REMOTE-CHANGES are whether to look for r= emote change, EXCLUDE-LIST is what files to exclude." + (let ((on-explicit-save (or on-explicit-save ssh-deploy-on-explicit-sa= ve)) + (debug (or debug ssh-deploy-debug)) + (async (or async ssh-deploy-async)) + (async-with-threads (or async-with-threads ssh-deploy-async-with= -threads)) + (revision-folder (or revision-folder ssh-deploy-revision-folder)= ) + (remote-changes (or remote-changes ssh-deploy-automatically-dete= ct-remote-changes)) + (exclude-list (or exclude-list ssh-deploy-exclude-list))) + (if (> async 0) + (let ((script-filename (file-name-directory (symbol-file 'ssh-de= ploy-diff-directories)))) + (message "Calculating differences between directory '%s' and '= %s'.. (asynchronously)" directory-a directory-b) + (ssh-deploy--async-process + (lambda() + (add-to-list 'load-path script-filename) + (require 'ssh-deploy) + (ssh-deploy--diff-directories-data directory-a directory-b = exclude-list)) + (lambda(diff) + (message "Completed calculation of differences between dire= ctory '%s' and '%s'. Result: %s only in A %s only in B %s differs. (async= hronously)" (nth 0 diff) (nth 1 diff) (length (nth 4 diff)) (length (nth = 5 diff)) (length (nth 7 diff))) + (if (or (> (length (nth 4 diff)) 0) (> (length (nth 5 diff)= ) 0) (> (length (nth 7 diff)) 0)) + (ssh-deploy--diff-directories-present diff directory-a = directory-b on-explicit-save debug async async-with-threads revision-fold= er remote-changes exclude-list))) + async-with-threads)) + (progn + (message "Calculating differences between directory '%s' and '%s= '.. (synchronously)" directory-a directory-b) + (let ((diff (ssh-deploy--diff-directories-data directory-a direc= tory-b exclude-list))) + (message "Completed calculation of differences between directo= ry '%s' and '%s'. Result: %s only in A, %s only in B, %s differs. (synchr= onously)" (nth 0 diff) (nth 1 diff) (length (nth 4 diff)) (length (nth 5 = diff)) (length (nth 7 diff))) + (if (or (> (length (nth 4 diff)) 0) (> (length (nth 5 diff)) 0= ) (> (length (nth 7 diff)) 0)) + (ssh-deploy--diff-directories-present diff directory-a dir= ectory-b on-explicit-save debug async async-with-threads revision-folder = remote-changes exclude-list))))))) =20 ;;;###autoload -(defun ssh-deploy-remote-changes (path-local &optional root-local root-r= emote async revision-folder exclude-list) - "Check if a local revision for PATH-LOCAL on ROOT-LOCAL and if remote = file has changed on ROOT-REMOTE, do it optionally asynchronously if ASYNC= is true, check for copies in REVISION-FOLDER and skip if path is in EXCL= UDE-LIST." +(defun ssh-deploy-remote-changes (path-local &optional root-local root-r= emote async revision-folder exclude-list async-with-threads) + "Check if a local revision for PATH-LOCAL on ROOT-LOCAL and if remote = file has changed on ROOT-REMOTE, do it optionally asynchronously if ASYNC= is true, check for copies in REVISION-FOLDER and skip if path is in EXCL= UDE-LIST. Use multi-threading if ASYNC-WITH-THREADS is above zero." (let ((root-local (or root-local ssh-deploy-root-local)) - (root-remote (or root-remote ssh-deploy-root-remote))) + (root-remote (or root-remote ssh-deploy-root-remote)) + (exclude-list (or exclude-list ssh-deploy-exclude-list))) =20 ;; Is the file inside the local-root and should it not be excluded? (if (and (ssh-deploy--file-is-in-path path-local root-local) (ssh-deploy--file-is-included path-local exclude-list)) (let* ((revision-folder (or revision-folder ssh-deploy-revision-= folder)) (revision-path (ssh-deploy--get-revision-path path-local = revision-folder)) - (path-remote (concat root-remote (ssh-deploy--get-relativ= e-path root-local path-local)))) + (path-remote (expand-file-name (ssh-deploy--get-relative-= path root-local path-local) root-remote))) =20 ;; Is the file a regular file? (if (not (file-directory-p path-local)) @@ -755,7 +745,7 @@ (if (file-exists-p revision-path) =20 ;; Local revision exist. Is async enabled? - (if async + (if (> async 0) (progn =20 ;; Update buffer status @@ -774,7 +764,7 @@ (progn (copy-file path-local rev= ision-path t t t t) (list 0 (format "Remote f= ile '%s' is identical to local file '%s' but different to local revision.= Updated local revision. (asynchronously)" path-remote path-local) path-l= ocal)) - (list 1 (format "Remote file = '%s' has changed, please download or diff. (asynchronously)" path-remote)= path-local))) + (list 1 (format "Remote file = '%s' has changed please download or diff. (asynchronously)" path-remote) = path-local))) (list 1 "Function 'ediff-same-file-= contents' is missing. (asynchronously)" path-local))) (list 0 (format "Remote file '%s' doesn't= exist. (asynchronously)" path-remote) path-local))) (lambda(return) @@ -784,7 +774,8 @@ =20 (if (=3D (nth 0 return) 0) (when ssh-deploy-verbose (message (nth = 1 return))) - (display-warning 'ssh-deploy (nth 1 retur= n) :warning))))) + (display-warning 'ssh-deploy (nth 1 retur= n) :warning))) + async-with-threads)) =20 ;; Async is not enabled - synchronous logic here (progn @@ -807,7 +798,7 @@ (ssh-deploy--mode-line-set-status-and-update ssh= -deploy--status-idle))) =20 ;; Does not have local revision. Is async enabled? - (if async + (if (> async 0) (progn =20 ;; Update buffer status @@ -815,7 +806,8 @@ =20 ;; Asynchronous logic here (ssh-deploy--async-process - (lambda () + (lambda() + ;; Does remote file exist? (if (file-exists-p path-remote) (progn @@ -825,7 +817,7 @@ (progn (copy-file path-local revisio= n-path t t t t) (list 0 (format "Remote file = '%s' has not changed, created base revision. (asynchronously)" path-remot= e) path-local)) - (list 1 (format "Remote file '%s'= has changed, please download or diff. (asynchronously)" path-remote) pat= h-local)) + (list 1 (format "Remote file '%s'= has changed please download or diff. (asynchronously)" path-remote) path= -local)) (list 1 "Function ediff-file-same-con= tents is missing. (asynchronously)" path-local))) (list 0 (format "Remote file '%s' doesn't e= xist. (asynchronously)" path-remote) path-local))) (lambda(return) @@ -835,7 +827,8 @@ =20 (if (=3D (nth 0 return) 0) (when ssh-deploy-verbose (message (nth 1 = return))) - (display-warning 'ssh-deploy (nth 1 return)= :warning))))) + (display-warning 'ssh-deploy (nth 1 return)= :warning))) + async-with-threads)) =20 ;; Async is not enabled - synchronous logic here (progn @@ -860,81 +853,81 @@ (ssh-deploy--mode-line-set-status-and-update ssh-d= eploy--status-idle))))) =20 ;; File is a directory - (when ssh-deploy-debug (message "File %s is a directory, ign= oring remote changes check." path-local)))) + (when (> ssh-deploy-debug 0) (message "File %s is a director= y, ignoring remote changes check." path-local)))) =20 ;; File is not inside root or is excluded from it - (when ssh-deploy-debug (message "File %s is not in root or is excl= uded from it." path-local))))) + (when (> ssh-deploy-debug 0) (message "File %s is not in root or i= s excluded from it." path-local))))) =20 -(defun ssh-deploy-delete (path &optional async _debug buffer) - "Delete PATH and use flags ASYNC and DEBUG, set status in BUFFER." - (if async - (progn - (when buffer - (ssh-deploy--mode-line-set-status-and-update ssh-deploy--statu= s-deleting buffer)) - (ssh-deploy--async-process - (lambda () - (if (file-exists-p path) - (let ((file-or-directory (not (file-directory-p path)))) - (progn - (if file-or-directory - (delete-file path t) - (delete-directory path t t)) - (list path 0 buffer))) - (list path 1 buffer))) - (lambda(response) - (when (nth 2 response) - (ssh-deploy--mode-line-set-status-and-update ssh-deploy--st= atus-idle (nth 2 response)) - (let ((local-buffer (find-buffer-visiting (nth 2 response))= )) - (when local-buffer - (kill-buffer local-buffer)))) - (cond ((=3D 0 (nth 1 response)) (message "Completed deletion = of '%s'. (asynchronously)" (nth 0 response))) - (t (display-warning 'ssh-deploy (format "Did not find '= %s' for deletion. (asynchronously)" (nth 0 response)) :warning)))))) - (if (file-exists-p path) - (ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-= deleting buffer) - (let ((file-or-directory (not (file-directory-p path)))) - (when buffer - (ssh-deploy--mode-line-set-status-and-update ssh-deploy--statu= s-deleting buffer)) +(defun ssh-deploy-delete (path &optional async async-with-threads) + "Delete PATH and use flags ASYNC. Use multi-threading if ASYNC-WITH-T= HREADS is above zero." + (let ((async (or async ssh-deploy-async)) + (async-with-threads (or async-with-threads ssh-deploy-async-with= -threads))) + (if (> async 0) (progn - (if file-or-directory - (delete-file path t) - (delete-directory path t t)) - (when buffer - (ssh-deploy--mode-line-set-status-and-update ssh-deploy--sta= tus-idle buffer) - (let ((local-buffer (find-buffer-visiting buffer))) - (when local-buffer - (kill-buffer local-buffer)))) - (message "Completed deletion of '%s'. (synchronously)" path))) - (display-warning 'ssh-deploy (format "Did not find '%s' for deleti= on. (synchronously)" path) :warning)))) + (ssh-deploy--mode-line-set-status-and-update ssh-deploy--statu= s-deleting path) + (ssh-deploy--async-process + (lambda() + (if (file-exists-p path) + (let ((file-or-directory (not (file-directory-p path)))= ) + (progn + (if file-or-directory + (delete-file path t) + (delete-directory path t t)) + (list path 0))) + (list path 1))) + (lambda(response) + (ssh-deploy--mode-line-set-status-and-update ssh-deploy--st= atus-idle (nth 0 response)) + (let ((local-buffer (find-buffer-visiting (nth 0 response))= )) + (when local-buffer + (kill-buffer local-buffer))) + (cond ((=3D 0 (nth 1 response)) (message "Completed deletio= n of '%s'. (asynchronously)" (nth 0 response))) + (t (display-warning 'ssh-deploy (format "Did not find= '%s' for deletion. (asynchronously)" (nth 0 response)) :warning)))) + async-with-threads)) + (if (file-exists-p path) + (let ((file-or-directory (not (file-directory-p path)))) + (ssh-deploy--mode-line-set-status-and-update ssh-deploy--sta= tus-deleting path) + (progn + (if file-or-directory + (delete-file path t) + (delete-directory path t t)) + (ssh-deploy--mode-line-set-status-and-update ssh-deploy--s= tatus-idle path) + (let ((local-buffer (find-buffer-visiting path))) + (when local-buffer + (kill-buffer local-buffer))) + (message "Completed deletion of '%s'. (synchronously)" pat= h))) + (display-warning 'ssh-deploy (format "Did not find '%s' for dele= tion. (synchronously)" path) :warning))))) =20 ;;;###autoload -(defun ssh-deploy-delete-both (path-local &optional root-local root-remo= te async debug exclude-list) - "Delete PATH-LOCAL relative to ROOT-LOCAL as well as on ROOT-REMOTE, d= o it asynchronously if ASYNC is non-nil, debug if DEBUG is non-nil, check= if path is excluded in EXCLUDE-LIST." +(defun ssh-deploy-delete-both (path-local &optional root-local root-remo= te async debug exclude-list async-with-threads) + "Delete PATH-LOCAL relative to ROOT-LOCAL as well as on ROOT-REMOTE, d= o it asynchronously if ASYNC is non-nil, debug if DEBUG is non-nil, check= if path is excluded in EXCLUDE-LIST. Use async threads is ASYNC-WITH-TH= READS is above zero." (let ((root-local (or root-local ssh-deploy-root-local)) - (root-remote (or root-remote ssh-deploy-root-remote))) + (root-remote (or root-remote ssh-deploy-root-remote)) + (async (or async ssh-deploy-async)) + (debug (or debug ssh-deploy-debug)) + (exclude-list (or exclude-list ssh-deploy-exclude-list)) + (async-with-threads (or async async-with-threads))) (if (and (ssh-deploy--file-is-in-path path-local root-local) (ssh-deploy--file-is-included path-local exclude-list)) - ;; FIXME: Why `concat' instead of `expand-file-name'? - (let ((path-remote (concat root-remote (ssh-deploy--get-relative= -path root-local path-local)))) - (ssh-deploy-delete path-local async debug path-local) - (ssh-deploy-delete path-remote async debug path-local)) - (when debug (message "Path '%s' is not in the root '%s' or is excl= uded from it." path-local root-local))))) + (let ((path-remote (expand-file-name (ssh-deploy--get-relative-p= ath root-local path-local) root-remote))) + (ssh-deploy-delete path-local async async-with-threads) + (ssh-deploy-delete path-remote async async-with-threads)) + (when (> debug 0) (message "Path '%s' is not in the root '%s' or i= s excluded from it." path-local root-local))))) =20 ;;;###autoload -(defun ssh-deploy-rename (old-path-local new-path-local &optional root-l= ocal root-remote async debug exclude-list) - "Rename OLD-PATH-LOCAL to NEW-PATH-LOCAL under ROOT-LOCAL as well as o= n ROOT-REMOTE, do it asynchronously if ASYNC is non-nil, debug if DEBUG i= s non-nil but check if path is excluded in EXCLUDE-LIST first." - ;; FIXME: Next 4 lines don't do anything! - ;; (if (not (boundp 'debug)) - ;; (setq debug ssh-deploy-debug)) - ;; (if (not (boundp 'async)) - ;; (setq async ssh-deploy-async)) +(defun ssh-deploy-rename (old-path-local new-path-local &optional root-l= ocal root-remote async debug exclude-list async-with-threads) + "Rename OLD-PATH-LOCAL to NEW-PATH-LOCAL under ROOT-LOCAL as well as o= n ROOT-REMOTE, do it asynchronously if ASYNC is non-nil, debug if DEBUG i= s non-nil but check if path is excluded in EXCLUDE-LIST first. Use multi= -threading if ASYNC-WITH-THREADS is above zero." (let ((root-local (or root-local ssh-deploy-root-local)) - (root-remote (or root-remote ssh-deploy-root-remote))) + (root-remote (or root-remote ssh-deploy-root-remote)) + (async (or async ssh-deploy-async)) + (debug (or debug ssh-deploy-debug)) + (exclude-list (or exclude-list ssh-deploy-exclude-list)) + (async-with-threads (or async-with-threads ssh-deploy-async-with= -threads))) (if (and (ssh-deploy--file-is-in-path old-path-local root-local) (ssh-deploy--file-is-in-path new-path-local root-local) (ssh-deploy--file-is-included old-path-local exclude-list) (ssh-deploy--file-is-included new-path-local exclude-list)) - (let ((old-path-remote (concat root-remote (ssh-deploy--get-rela= tive-path root-local old-path-local))) - (new-path-remote (concat root-remote (ssh-deploy--get-rela= tive-path root-local new-path-local)))) + (let ((old-path-remote (expand-file-name (ssh-deploy--get-relati= ve-path root-local old-path-local) root-remote)) + (new-path-remote (expand-file-name (ssh-deploy--get-relati= ve-path root-local new-path-local) root-remote))) (ssh-deploy--mode-line-set-status-and-update ssh-deploy--statu= s-renaming) (rename-file old-path-local new-path-local t) (if (not (file-directory-p new-path-local)) @@ -944,19 +937,20 @@ (set-buffer-modified-p nil)) (dired new-path-local)) (message "Renamed '%s' to '%s'." old-path-local new-path-local= ) - (if async + (if (> async 0) (ssh-deploy--async-process - (lambda () + (lambda() (rename-file old-path-remote new-path-remote t) (list old-path-remote new-path-remote new-path-local)) (lambda(files) (ssh-deploy--mode-line-set-status-and-update ssh-deploy= --status-idle (nth 2 files)) - (message "Renamed '%s' to '%s'. (asynchronously)" (nth = 0 files) (nth 1 files)))) + (message "Renamed '%s' to '%s'. (asynchronously)" (nth = 0 files) (nth 1 files))) + async-with-threads) (progn (rename-file old-path-remote new-path-remote t) (ssh-deploy--mode-line-set-status-and-update ssh-deploy--s= tatus-idle) (message "Renamed '%s' to '%s'. (synchronously)" old-path-= remote new-path-remote)))) - (if debug + (if (> debug 0) (message "Path '%s' or '%s' is not in the root '%s' or is excl= uded from it." old-path-local new-path-local root-local))))) =20 ;;;###autoload @@ -986,24 +980,24 @@ ;;;###autoload (defun ssh-deploy-browse-remote (path-local &optional root-local root-re= mote exclude-list) "Browse PATH-LOCAL in `dired-mode' on remote where it is inside ROOT-L= OCAL and mirrored on ROOT-REMOTE and not in EXCLUDE-LIST." - (let ((exclude-list (or exclude-list ssh-deploy-exclude-list)) - (root-local (or root-local ssh-deploy-root-local)) - (root-remote (or root-remote ssh-deploy-root-remote))) + (let ((root-local (or root-local ssh-deploy-root-local)) + (root-remote (or root-remote ssh-deploy-root-remote)) + (exclude-list (or exclude-list ssh-deploy-exclude-list))) (if (and (ssh-deploy--file-is-in-path path-local root-local) (ssh-deploy--file-is-included path-local exclude-list)) - (let ((path-remote (concat root-remote (ssh-deploy--get-relative= -path root-local path-local)))) + (let ((path-remote (expand-file-name (ssh-deploy--get-relative-p= ath root-local path-local) root-remote))) (message "Opening '%s' for browsing on remote host.." path-rem= ote) (dired path-remote))))) =20 ;;;###autoload (defun ssh-deploy-remote-terminal-eshell (path-local &optional root-loca= l root-remote exclude-list) "Browse PATH-LOCAL inside ROOT-LOCAL on ROOT-REMOTE in `eshell-mode' i= f not in EXCLUDE-LIST." - (let ((exclude-list (or exclude-list ssh-deploy-exclude-list)) - (root-local (or root-local ssh-deploy-root-local)) - (root-remote (or root-remote ssh-deploy-root-remote))) + (let ((root-local (or root-local ssh-deploy-root-local)) + (root-remote (or root-remote ssh-deploy-root-remote)) + (exclude-list (or exclude-list ssh-deploy-exclude-list))) (when (and (ssh-deploy--file-is-in-path path-local root-local) (ssh-deploy--file-is-included path-local exclude-list)) - (let ((path-remote (concat root-remote (ssh-deploy--get-relative-p= ath root-local path-local)))) + (let ((path-remote (expand-file-name (ssh-deploy--get-relative-pat= h root-local path-local) root-remote))) (require 'eshell) (message "Opening eshell on '%s'.." path-remote) (let ((default-directory path-remote)) @@ -1014,18 +1008,18 @@ ;;;###autoload (defun ssh-deploy-remote-terminal-shell (path-local &optional root-local= root-remote exclude-list) "Browse PATH-LOCAL inside ROOT-LOCAL on ROOT-REMOTE in `eshell-mode' i= f not in EXCLUDE-LIST." - (let ((exclude-list (or exclude-list ssh-deploy-exclude-list)) - (root-local (or root-local ssh-deploy-root-local)) - (root-remote (or root-remote ssh-deploy-root-remote))) + (let ((root-local (or root-local ssh-deploy-root-local)) + (root-remote (or root-remote ssh-deploy-root-remote)) + (exclude-list (or exclude-list ssh-deploy-exclude-list))) (when (and (ssh-deploy--file-is-in-path path-local root-local) (ssh-deploy--file-is-included path-local exclude-list)) - (let ((path-remote (concat root-remote (ssh-deploy--get-relative-p= ath root-local path-local)))) + (let ((path-remote (expand-file-name (ssh-deploy--get-relative-pat= h root-local path-local) root-remote))) (require 'shell) - (defvar explicit-shell-file-name) (message "Opening eshell on '%s'.." path-remote) (let ((default-directory path-remote) (explicit-shell-file-name ssh-deploy-remote-shell-executab= le)) - (shell path-remote)))))) + (when explicit-shell-file-name ;; NOTE This is only to trick f= lycheck to ignore unused error + (shell path-remote))))))) =20 ;;;###autoload (defun ssh-deploy-store-revision (path &optional root) @@ -1037,46 +1031,43 @@ (copy-file path revision-path t t t t)))) =20 ;;;###autoload -(defun ssh-deploy-diff (path-local path-remote &optional root-local debu= g exclude-list async) - "Find differences between PATH-LOCAL and PATH-REMOTE, where PATH-LOCAL= is inside ROOT-LOCAL. DEBUG enables feedback message, check if PATH-LOC= AL is not in EXCLUDE-LIST. ASYNC make the process work asynchronously." +(defun ssh-deploy-diff (path-local path-remote &optional root-local debu= g exclude-list async async-with-threads on-explicit-save revision-folder = remote-changes) + "Find differences between PATH-LOCAL and PATH-REMOTE, where PATH-LOCAL= is inside ROOT-LOCAL. DEBUG enables feedback message, check if PATH-LOC= AL is not in EXCLUDE-LIST. ASYNC make the process work asynchronously, = if ASYNC-WITH-THREADS is above zero use threads, ON-EXPLICIT-SAVE for aut= omatic uploads, REVISION-FOLDER for revision-folder, REMOTE-CHANGES for a= utomatic notification of remote change." (let ((file-or-directory (not (file-directory-p path-local))) - (exclude-list (or exclude-list ssh-deploy-exclude-list))) - ;; FIXME: next 6 lines don't do anything! - ;; (if (not (boundp 'root-local)) - ;; (setq root-local ssh-deploy-root-local)) - ;; (if (not (boundp 'debug)) - ;; (setq debug ssh-deploy-debug)) - ;; (if (not (boundp 'async)) - ;; (setq async ssh-deploy-async)) + (root-local (or root-local ssh-deploy-root-local)) + (debug (or debug ssh-deploy-debug)) + (exclude-list (or exclude-list ssh-deploy-exclude-list)) + (async (or async ssh-deploy-async)) + (async-with-threads (or async-with-threads ssh-deploy-async-with= -threads)) + (on-explicit-save (or on-explicit-save ssh-deploy-on-explicit-sa= ve)) + (revision-folder (or revision-folder ssh-deploy-revision-folder)= ) + (remote-changes (or remote-changes ssh-deploy-automatically-dete= ct-remote-changes))) (if (and (ssh-deploy--file-is-in-path path-local root-local) (ssh-deploy--file-is-included path-local exclude-list)) (if file-or-directory (ssh-deploy-diff-files path-local path-remote) - (ssh-deploy-diff-directories path-local path-remote exclude-li= st async)) + (ssh-deploy-diff-directories path-local path-remote on-explici= t-save debug async async-with-threads revision-folder remote-changes excl= ude-list)) (when debug (message "Path '%s' is not in the root '%s' or is excl= uded from it." path-local root-local))))) =20 ;;;###autoload -(defun ssh-deploy-upload (path-local path-remote &optional force async r= evision-folder) - "Upload PATH-LOCAL to PATH-REMOTE and ROOT-LOCAL via TRAMP, FORCE uplo= ads despite remote change, ASYNC determines if transfer should be asynchr= onously, check version in REVISION-FOLDER." - ;; FIXME: Next 4 lines don't do anything! - ;; (if (not (boundp 'async)) - ;; (setq async ssh-deploy-async)) - ;; (if (not (boundp 'force)) - ;; (setq force nil)) - (let ((revision-folder (or revision-folder ssh-deploy-revision-folder)= )) - (if async - (ssh-deploy--upload-via-tramp-async path-local path-remote force= revision-folder) +(defun ssh-deploy-upload (path-local path-remote &optional force async r= evision-folder async-with-threads) + "Upload PATH-LOCAL to PATH-REMOTE and ROOT-LOCAL via TRAMP, FORCE uplo= ads despite remote change, ASYNC determines if transfer should be asynchr= onously, check version in REVISION-FOLDER. If you want asynchronous thre= ads pass ASYNC-WITH-THREADS above zero." + (let ((force (or force 0)) + (async (or async ssh-deploy-async)) + (revision-folder (or revision-folder ssh-deploy-revision-folder)= ) + (async-with-threads (or async-with-threads ssh-deploy-async-with= -threads))) + (if (> async 0) + (ssh-deploy--upload-via-tramp-async path-local path-remote force= revision-folder async-with-threads) (ssh-deploy--upload-via-tramp path-local path-remote force revisio= n-folder)))) =20 ;;;###autoload -(defun ssh-deploy-download (path-remote path-local &optional async revis= ion-folder) - "Download PATH-REMOTE to PATH-LOCAL via TRAMP, ASYNC determines if tra= nsfer should be asynchrous or not, check for revisions in REVISION-FOLDER= ." - ;; FIXME: Next 2 lines don't do anything! - ;; (if (not (boundp 'async)) - ;; (setq async ssh-deploy-async)) - (let ((revision-folder (or revision-folder ssh-deploy-revision-folder)= )) - (if async - (ssh-deploy--download-via-tramp-async path-remote path-local rev= ision-folder) +(defun ssh-deploy-download (path-remote path-local &optional async revis= ion-folder async-with-threads) + "Download PATH-REMOTE to PATH-LOCAL via TRAMP, ASYNC determines if tra= nsfer should be asynchrous or not, check for revisions in REVISION-FOLDER= . If you want asynchronous threads pass ASYNC-WITH-THREADS above zero." + (let ((async (or async ssh-deploy-async)) + (revision-folder (or revision-folder ssh-deploy-revision-folder)= ) + (async-with-threads (or async-with-threads ssh-deploy-async-with= -threads))) + (if (> async 0) + (ssh-deploy--download-via-tramp-async path-remote path-local rev= ision-folder async-with-threads) (ssh-deploy--download-via-tramp path-remote path-local revision-fo= lder)))) =20 =20 @@ -1093,10 +1084,8 @@ (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local) (ssh-deploy--is-not-empty-string ssh-deploy-root-remote)) (let ((root-local (file-truename ssh-deploy-root-local)) + (force (or force 0)) path-local) - ;; FIXME: Next 2 lines don't do anything! - ;; (if (not (boundp 'force)) - ;; (setq force nil)) (if (and (ssh-deploy--is-not-empty-string buffer-file-name) (file-exists-p buffer-file-name)) (setq path-local (file-truename buffer-file-name)) @@ -1106,15 +1095,15 @@ (if (and (ssh-deploy--is-not-empty-string path-local) (ssh-deploy--file-is-in-path path-local root-local) (ssh-deploy--file-is-included path-local ssh-deploy-exc= lude-list)) - (let ((path-remote (concat ssh-deploy-root-remote (ssh-deplo= y--get-relative-path root-local path-local)))) - (ssh-deploy-upload path-local path-remote force ssh-deploy= -async ssh-deploy-revision-folder)) - (when ssh-deploy-debug (message "Ignoring upload, path '%s' is= empty, not in the root '%s' or is excluded from it." path-local root-loc= al)))))) + (let ((path-remote (expand-file-name (ssh-deploy--get-relati= ve-path root-local path-local) ssh-deploy-root-remote))) + (ssh-deploy-upload path-local path-remote force ssh-deploy= -async ssh-deploy-revision-folder ssh-deploy-async-with-threads)) + (when (> ssh-deploy-debug 0) (message "Ignoring upload, path '= %s' is empty, not in the root '%s' or is excluded from it." path-local ro= ot-local)))))) =20 ;;;###autoload (defun ssh-deploy-upload-handler-forced () "Upload current path to remote host if it is configured for deployment= ." (interactive) - (ssh-deploy-upload-handler t)) + (ssh-deploy-upload-handler 1)) =20 ;;;###autoload (defun ssh-deploy-remote-changes-handler() @@ -1124,9 +1113,9 @@ (ssh-deploy--is-not-empty-string ssh-deploy-root-remote) (ssh-deploy--is-not-empty-string buffer-file-name)) (progn - (when ssh-deploy-debug (message "Detecting remote-changes..")) - (ssh-deploy-remote-changes (file-truename buffer-file-name) (fil= e-truename ssh-deploy-root-local) ssh-deploy-root-remote ssh-deploy-async= ssh-deploy-revision-folder ssh-deploy-exclude-list)) - (when ssh-deploy-debug (message "Ignoring remote-changes check since= a root is empty or the current buffer lacks a file-name.")))) + (when (> ssh-deploy-debug 0) (message "Detecting remote-changes.= .")) + (ssh-deploy-remote-changes (file-truename buffer-file-name) (fil= e-truename ssh-deploy-root-local) ssh-deploy-root-remote ssh-deploy-async= ssh-deploy-revision-folder ssh-deploy-exclude-list ssh-deploy-async-with= -threads)) + (when (> ssh-deploy-debug 0) (message "Ignoring remote-changes check= since a root is empty or the current buffer lacks a file-name.")))) =20 ;;;###autoload (defun ssh-deploy-remote-sql-mysql-handler() @@ -1135,6 +1124,7 @@ (when (ssh-deploy--is-not-empty-string ssh-deploy-root-remote) (ssh-deploy-remote-sql ssh-deploy-root-remote "mysql"))) =20 +;;;###autoload (defun ssh-deploy-remote-sql-postgres-handler() "Open `sql-postgres' on remote path if path is configured for deployme= nt." (interactive) @@ -1150,7 +1140,7 @@ (ssh-deploy--is-not-empty-string buffer-file-name)) (let* ((root-local (file-truename ssh-deploy-root-local)) (path-local (file-truename buffer-file-name)) - (path-remote (concat ssh-deploy-root-remote (ssh-deploy--ge= t-relative-path root-local path-local)))) + (path-remote (expand-file-name (ssh-deploy--get-relative-pa= th root-local path-local) ssh-deploy-root-remote))) (when ssh-deploy-verbose (message "Opening file on remote '%s'" = path-remote)) (find-file path-remote)))) =20 @@ -1171,9 +1161,9 @@ (if (and (ssh-deploy--is-not-empty-string path-local) (ssh-deploy--file-is-in-path path-local root-local) (ssh-deploy--file-is-included path-local ssh-deploy-exc= lude-list)) - (let ((path-remote (concat ssh-deploy-root-remote (ssh-deplo= y--get-relative-path root-local path-local)))) - (ssh-deploy-download path-remote path-local ssh-deploy-asy= nc ssh-deploy-revision-folder)) - (when ssh-deploy-debug (message "Ignoring upload, path '%s' is= empty, not in the root '%s' or is excluded from it." path-local root-loc= al)))))) + (let ((path-remote (expand-file-name (ssh-deploy--get-relati= ve-path root-local path-local) ssh-deploy-root-remote))) + (ssh-deploy-download path-remote path-local ssh-deploy-asy= nc ssh-deploy-revision-folder ssh-deploy-async-with-threads)) + (when (> ssh-deploy-debug 0) (message "Ignoring upload, path '= %s' is empty, not in the root '%s' or is excluded from it." path-local ro= ot-local)))))) =20 ;;;###autoload (defun ssh-deploy-diff-handler () @@ -1185,14 +1175,14 @@ (file-exists-p buffer-file-name)) (let* ((path-local (file-truename buffer-file-name)) (root-local (file-truename ssh-deploy-root-local)) - (path-remote (concat ssh-deploy-root-remote (ssh-deploy= --get-relative-path root-local path-local)))) - (ssh-deploy-diff path-local path-remote root-local ssh-deplo= y-debug ssh-deploy-exclude-list ssh-deploy-async)) + (path-remote (expand-file-name (ssh-deploy--get-relativ= e-path root-local path-local) ssh-deploy-root-remote))) + (ssh-deploy-diff path-local path-remote root-local ssh-deplo= y-debug ssh-deploy-exclude-list ssh-deploy-async ssh-deploy-async-with-th= reads ssh-deploy-on-explicit-save ssh-deploy-revision-folder ssh-deploy-a= utomatically-detect-remote-changes)) (if (and (ssh-deploy--is-not-empty-string default-directory) (file-exists-p default-directory)) (let* ((path-local (file-truename default-directory)) (root-local (file-truename ssh-deploy-root-local)) - (path-remote (concat ssh-deploy-root-remote (ssh-depl= oy--get-relative-path root-local path-local)))) - (ssh-deploy-diff path-local path-remote root-local ssh-dep= loy-debug ssh-deploy-exclude-list ssh-deploy-async)))))) + (path-remote (expand-file-name (ssh-deploy--get-relat= ive-path root-local path-local) ssh-deploy-root-remote))) + (ssh-deploy-diff path-local path-remote root-local ssh-dep= loy-debug ssh-deploy-exclude-list ssh-deploy-async ssh-deploy-async-with-= threads ssh-deploy-on-explicit-save ssh-deploy-revision-folder ssh-deploy= -automatically-detect-remote-changes)))))) =20 ;;;###autoload (defun ssh-deploy-delete-handler () @@ -1206,14 +1196,14 @@ (root-local (file-truename ssh-deploy-root-local)) (yes-no-prompt (read-string (format "Type 'yes' to conf= irm that you want to delete the file '%s': " path-local)))) (if (string=3D yes-no-prompt "yes") - (ssh-deploy-delete-both path-local root-local ssh-deploy= -root-remote ssh-deploy-async ssh-deploy-debug))) + (ssh-deploy-delete-both path-local root-local ssh-deploy= -root-remote ssh-deploy-async ssh-deploy-debug ssh-deploy-exclude-list ss= h-deploy-async-with-threads))) (if (and (ssh-deploy--is-not-empty-string default-directory) (file-exists-p default-directory)) (let* ((path-local (file-truename default-directory)) (root-local (file-truename ssh-deploy-root-local)) (yes-no-prompt (read-string (format "Type 'yes' to co= nfirm that you want to delete the directory '%s': " path-local)))) (if (string=3D yes-no-prompt "yes") - (ssh-deploy-delete-both path-local root-local ssh-depl= oy-root-remote ssh-deploy-async ssh-deploy-debug ssh-deploy-exclude-list)= )))))) + (ssh-deploy-delete-both path-local root-local ssh-depl= oy-root-remote ssh-deploy-async ssh-deploy-debug ssh-deploy-exclude-list = ssh-deploy-async-with-threads))))))) =20 ;;;###autoload (defun ssh-deploy-rename-handler () @@ -1229,7 +1219,7 @@ (new-path-local-tmp (read-file-name "New file name:" (f= ile-name-directory old-path-local) basename nil basename)) (new-path-local (file-truename new-path-local-tmp))) (if (not (string=3D old-path-local new-path-local)) - (ssh-deploy-rename old-path-local new-path-local root-lo= cal ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug))) + (ssh-deploy-rename old-path-local new-path-local root-lo= cal ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug ssh-deploy-e= xclude-list ssh-deploy-async-with-threads))) (if (and (ssh-deploy--is-not-empty-string default-directory) (file-exists-p default-directory)) (let* ((old-path-local (file-truename default-directory)) @@ -1238,7 +1228,7 @@ (new-path-local-tmp (read-file-name "New directory na= me:" (file-name-directory old-path-local) basename nil basename)) (new-path-local (file-truename new-path-local-tmp))) (if (not (string=3D old-path-local new-path-local)) - (ssh-deploy-rename old-path-local new-path-local root-= local ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug ssh-deploy= -exclude-list))))))) + (ssh-deploy-rename old-path-local new-path-local root-= local ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug ssh-deploy= -exclude-list ssh-deploy-async-with-threads))))))) =20 ;;;###autoload (defun ssh-deploy-remote-terminal-eshell-handler () @@ -1305,23 +1295,20 @@ "Run `ssh-deploy-script' with `funcall'." (interactive) (if ssh-deploy-script - (if ssh-deploy-async + (if (> ssh-deploy-async 0) (progn (message "Executing of deployment-script starting... (asynch= ronously)") (ssh-deploy--async-process - (let ((local ssh-deploy-root-local) - (remote ssh-deploy-root-remote) - (script ssh-deploy-script)) - (lambda () - (let ((ssh-deploy-root-local local) - (ssh-deploy-root-remote remote)) - (funcall script)))) - (lambda(result) (message "Completed execution of deployment= -script. '%s'(asynchronously)" result)))) + `(lambda() (let ((ssh-deploy-root-local ,ssh-deploy-root-lo= cal) + (ssh-deploy-root-remote ,ssh-deploy-root-r= emote)) + (funcall ,ssh-deploy-script))) + (lambda(result) (message "Completed execution of deployment= -script. Return: '%s' (asynchronously)" result)) + ssh-deploy-async-with-threads)) (progn (message "Executing of deployment-script starting... (synchron= ously)") - (funcall ssh-deploy-script) - (message "Completed execution of deployment-script. (synchrono= usly)"))) - (display-warning 'ssh-deploy (format "ssh-deploy-script lacks defini= tion!") :warning))) + (let ((ret (funcall ssh-deploy-script))) + (message "Completed execution of deployment-script. Return: = '%s' (synchronously)" ret)))) + (display-warning 'ssh-deploy "ssh-deploy-script lacks definition!" := warning))) =20 =20 ;;; Menu-bar @@ -1330,64 +1317,45 @@ ;; This is particularly useful when key-bindings are not working because= of some mode ;; overriding them. =20 + (defvar ssh-deploy-menu-map (let ((map (make-sparse-keymap "Menu for SSH Deploy"))) - (define-key map [pq] - '("PostgreSQL" . ssh-deploy-remote-sql-postgres-handler)) - (define-key map [mq] - '("MySQL" . ssh-deploy-remote-sql-mysql-handler)) + (define-key map [pq] '("PostgreSQL" . ssh-deploy-remote-sql-postgres= -handler)) + (define-key map [mq] '("MySQL" . ssh-deploy-remote-sql-mysql-handler= )) (define-key map [sep1] '("--")) - - (define-key map [sb] - '("Shell Base" . ssh-deploy-remote-terminal-shell-base-handler)) - (define-key map [ss] - '("Shell" . ssh-deploy-remote-terminal-shell-handler)) + (define-key map [sb] '("Shell Base" . ssh-deploy-remote-terminal-she= ll-base-handler)) + (define-key map [ss] '("Shell" . ssh-deploy-remote-terminal-shell-ha= ndler)) (define-key map [sep2] '("--")) - - (define-key map [eb] - '("Eshell Base" . ssh-deploy-remote-terminal-eshell-base-handler)) - (define-key map [es] - '("Eshell" . ssh-deploy-remote-terminal-eshell-handler)) - (define-key map [sep3] - '("--")) - - (define-key map [bb] - '("Browse Base" . ssh-deploy-browse-remote-base-handler)) - (define-key map [br] - '("Browse" . ssh-deploy-browse-remote-handler)) + (define-key map [eb] '("Eshell Base" . ssh-deploy-remote-terminal-es= hell-base-handler)) + (define-key map [es] '("Eshell" . ssh-deploy-remote-terminal-eshell-= handler)) + (define-key map [sep3] '("--")) + (define-key map [bb] '("Browse Base" . ssh-deploy-browse-remote-base= -handler)) + (define-key map [br] '("Browse" . ssh-deploy-browse-remote-handler)) (define-key map [sep4] '("--")) - - (define-key map [df] - '("Difference" . ssh-deploy-diff-handler)) - (define-key map [rc] - '("Detect Remote Changes" . ssh-deploy-remote-changes-handler)) + (define-key map [df] '("Difference" . ssh-deploy-diff-handler)) + (define-key map [rc] '("Detect Remote Changes" . ssh-deploy-remote-c= hanges-handler)) (define-key map [sep5] '("--")) - - (define-key map [de] - '("Delete" . ssh-deploy-delete-handler)) - (define-key map [rn] - '("Rename" . ssh-deploy-rename-handler)) - (define-key map [op] - '("Open" . ssh-deploy-open-remote-file-handler)) + (define-key map [de] '("Delete" . ssh-deploy-delete-handler)) + (define-key map [rn] '("Rename" . ssh-deploy-rename-handler)) + (define-key map [op] '("Open" . ssh-deploy-open-remote-file-handler)= ) (define-key map [sep6] '("--")) - - (define-key map [sc] - '("Run script" . ssh-deploy-run-deploy-script-handler)) + (define-key map [sc] '("Run script" . ssh-deploy-run-deploy-script-h= andler)) (define-key map [sep7] '("--")) - - (define-key map [ulf] - '("Forced Upload" . ssh-deploy-upload-handler-forced)) - (define-key map [ul] - '("Upload" . ssh-deploy-upload-handler)) - (define-key map [dl] - '("Download" . ssh-deploy-download-handler)) + (define-key map [ulf] '("Forced Upload" . ssh-deploy-upload-handler-= forced)) + (define-key map [ul] '("Upload" . ssh-deploy-upload-handler)) + (define-key map [dl] '("Download" . ssh-deploy-download-handler)) map)) =20 -(define-key-after - global-map - [menu-bar sshdeploy] - (cons "Deployment" ssh-deploy-menu-map) - 'tools) +(defun ssh-deploy-menu-map-update () + "Update menu map and only show menu if deployment is active." + (if (and ssh-deploy-root-local ssh-deploy-root-remote) + (define-key-after global-map [menu-bar sshdeploy] (cons "Deploymen= t" ssh-deploy-menu-map) 'tools) + (define-key-after global-map [menu-bar sshdeploy] 'undefined 'tools)= )) + +(defun ssh-deploy-add-menu () + "Add menu-bar support." + (add-hook 'menu-bar-update-hook 'ssh-deploy-menu-map-update)) + =20 ;;; Mode Line =20 @@ -1395,15 +1363,83 @@ (define-minor-mode ssh-deploy-line-mode "Show SSH Deploy status in mode line" :global t + :group 'ssh-deploy (add-to-list 'global-mode-string 'ssh-deploy--mode-line-status-text t)= ) + (ssh-deploy--mode-line-status-refresh) =20 -;; Start mode line by default -;; FIXME: By convention, loading an Elisp file should not affect -;; Emacs's behavior! -(ssh-deploy-line-mode) + +;;; Usability shortcuts + + +(defun ssh-deploy-after-save () "Logic for automatic uploads." + (when (and (boundp 'ssh-deploy-on-explicit-save) ssh-deploy-on-ex= plicit-save (> ssh-deploy-on-explicit-save 0)) (ssh-deploy-upload-handler= ))) + +(defun ssh-deploy-add-after-save-hook () "Add the `after-save-hook'." + (when (fboundp 'ssh-deploy-after-save) + (add-hook 'after-save-hook 'ssh-deploy-after-save))) + +(defun ssh-deploy-find-file () "Logic for detecting remote change." + (when (and (boundp 'ssh-deploy-automatically-detect-remote-change= s) ssh-deploy-automatically-detect-remote-changes (> ssh-deploy-automatic= ally-detect-remote-changes 0)) (ssh-deploy-remote-changes-handler))) + +(defun ssh-deploy-add-find-file-hook () "Add the `find-file-hook'." + (when (fboundp 'ssh-deploy-find-file) (add-hook 'find-file-hook '= ssh-deploy-find-file))) + +(when (fboundp 'defhydra) + (defhydra ssh-deploy-hydra (:color red :hint nil) + " + SSH Deploy Menu + =20 + _u_: Upload _f_: Force Upload + _d_: Download + _D_: Delete + _x_: Difference + _t_: Eshell Base Terminal _T_: Eshell Relative Termin= al + _h_: Shell Base Terminal _H_: Shell Relative Termina= l + _e_: Detect Remote Changes + _R_: Rename + _b_: Browse Base _B_: Browse Relative + _o_: Open current file on remote _m_: Open sql-mysql on remo= te + _s_: Run deploy script + " + ("f" ssh-deploy-upload-handler-forced) + ("u" ssh-deploy-upload-handler) + ("d" ssh-deploy-download-handler) + ("D" ssh-deploy-delete-handler) + ("x" ssh-deploy-diff-handler) + ("t" ssh-deploy-remote-terminal-eshell-base-handler) + ("T" ssh-deploy-remote-terminal-eshell-handler) + ("h" ssh-deploy-remote-terminal-shell-base-handler) + ("H" ssh-deploy-remote-terminal-shell-handler) + ("e" ssh-deploy-remote-changes-handler) + ("R" ssh-deploy-rename-handler) + ("b" ssh-deploy-browse-remote-base-handler) + ("B" ssh-deploy-browse-remote-handler) + ("o" ssh-deploy-open-remote-file-handler) + ("m" ssh-deploy-remote-sql-mysql-handler) + ("s" ssh-deploy-run-deploy-script-handler))) + +(defvar ssh-deploy-prefix-map + (let ((map (make-sparse-keymap))) + (define-key map "f" 'ssh-deploy-upload-handler-force) + (define-key map "u" 'ssh-deploy-upload-handle) + (define-key map "D" 'ssh-deploy-delete-handler) + (define-key map "d" 'ssh-deploy-download-handler) + (define-key map "x" 'ssh-deploy-diff-handler) + (define-key map "t" 'ssh-deploy-remote-terminal-eshell-base-handler) + (define-key map "T" 'ssh-deploy-remote-terminal-eshell-handler) + (define-key map "h" 'ssh-deploy-remote-terminal-shell-base-handler) + (define-key map "H" 'ssh-deploy-remote-terminal-shell-handler) + (define-key map "R" 'ssh-deploy-rename-handler) + (define-key map "e" 'ssh-deploy-remote-changes-handler) + (define-key map "b" 'ssh-deploy-browse-remote-base-handler) + (define-key map "B" 'ssh-deploy-browse-remote-handler) + (define-key map "o" 'ssh-deploy-open-remote-file-handler) + (define-key map "m" 'ssh-deploy-remote-sql-mysql-handler) + (define-key map "s" 'ssh-deploy-run-deploy-script-handler) + map)) +(fset 'ssh-deploy-prefix-map ssh-deploy-prefix-map) =20 =20 (provide 'ssh-deploy) ;;; ssh-deploy.el ends here - From MAILER-DAEMON Thu Nov 29 10:49:22 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSOZ8-0001Vm-40 for mharc-emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ5-0001TU-Kn for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSOZ5-0007Pd-0D for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:19 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:58227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ4-0007PH-PC for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:18 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 3A8FB209DD; Thu, 29 Nov 2018 10:49:18 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master updated (c0c44c3 -> 40280d3) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <20181129154916.17888.69265@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: c0c44c3c0ded215e5bc60da74e2aaa090a35617b X-Git-Newrev: 40280d3cceef564f0938183ad7df923319284ac2 Auto-Submitted: auto-generated Date: Thu, 29 Nov 2018 10:49:17 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:49:20 -0000 monnier pushed a change to branch master. from c0c44c3 [gnorb] Move location of gnorb-gnus-summary-mode-ho= ok, bump to 1.6.1 new e217607 Initial commit new 2f05824 Set comment-prefix, clear c-opt-cpp-prefix new d9afdff Don't reset syntax properties of ?{ and ?} new 94745f4 New function: vcl-match-paren new d6bba7c Require cl prior to requiring cc-langs. Bump versio= n number. new 40280d3 Add 'packages/vcl-mode/' from commit 'd6bba7c13e0d7= 2936001f5adea155256151339ac' Summary of changes: packages/vcl-mode/vcl-mode.el | 446 ++++++++++++++++++++++++++++++++++++= ++++++ 1 file changed, 446 insertions(+) create mode 100644 packages/vcl-mode/vcl-mode.el From MAILER-DAEMON Thu Nov 29 10:49:23 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSOZ9-0001Ww-8E for mharc-emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ7-0001Ue-AZ for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSOZ5-0007Q3-CA for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:21 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:58234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ5-0007Pt-3Y for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:19 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 08D74209DD; Thu, 29 Nov 2018 10:49:19 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master d9afdff 3/6: Don't reset syntax properties of ?{ and ?} MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Sergey Poznyakoff In-Reply-To: <20181129154916.17888.69265@vcs0.savannah.gnu.org> References: <20181129154916.17888.69265@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: d9afdff58c67b1d3e9fd7e59d12a98dddc58482f Auto-Submitted: auto-generated Message-Id: <20181129154919.08D74209DD@vcs0.savannah.gnu.org> Date: Thu, 29 Nov 2018 10:49:18 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:49:22 -0000 branch: master commit d9afdff58c67b1d3e9fd7e59d12a98dddc58482f Author: Sergey Poznyakoff Commit: Sergey Poznyakoff Don't reset syntax properties of ?{ and ?} --- vcl-mode.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/vcl-mode.el b/vcl-mode.el index 97f66b1..449252c 100644 --- a/vcl-mode.el +++ b/vcl-mode.el @@ -58,8 +58,6 @@ (modify-syntax-entry ?_ "_" st) (modify-syntax-entry ?\' "." st) (modify-syntax-entry ?\" "." st) - (modify-syntax-entry ?{ "." st) - (modify-syntax-entry ?} "." st) st) "Syntax table in use in VCL Mode buffers.") =20 From MAILER-DAEMON Thu Nov 29 10:49:23 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSOZ9-0001X9-F0 for mharc-emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ7-0001Uf-BK for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSOZ5-0007QR-LF for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:21 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:58238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ5-0007QF-GD for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:19 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 6DDF1209DD; Thu, 29 Nov 2018 10:49:19 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master d6bba7c 5/6: Require cl prior to requiring cc-langs. Bump version number. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Sergey Poznyakoff In-Reply-To: <20181129154916.17888.69265@vcs0.savannah.gnu.org> References: <20181129154916.17888.69265@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: d6bba7c13e0d72936001f5adea155256151339ac Auto-Submitted: auto-generated Message-Id: <20181129154919.6DDF1209DD@vcs0.savannah.gnu.org> Date: Thu, 29 Nov 2018 10:49:19 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:49:22 -0000 branch: master commit d6bba7c13e0d72936001f5adea155256151339ac Author: Sergey Poznyakoff Commit: Sergey Poznyakoff Require cl prior to requiring cc-langs. Bump version number. --- vcl-mode.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vcl-mode.el b/vcl-mode.el index 90e1ce6..0f31178 100644 --- a/vcl-mode.el +++ b/vcl-mode.el @@ -1,10 +1,10 @@ ;;; vcl-mode.el --- major mode for editing VCL sources =20 -;; Authors: 2015 Sergey Poznyakoff -;; Version: 0.1 +;; Authors: 2015-2018 Sergey Poznyakoff +;; Version: 1.0 ;; Keywords: Varnish, VCL =20 -;; Copyright (C) 2015 Sergey Poznyakoff +;; Copyright (C) 2015-2018 Free Software Foundation, Inc. =20 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ ;; (autoload 'vcl-mode "vcl-mode" "Major mode for Varnish VCL sources" = t) ;; (add-to-list 'auto-mode-alist (cons (purecopy "\\.vcl\\'") 'vcl-mod= e)) =20 +(require 'cl) (require 'cc-langs) =20 (defvar vcl-mode-map () From MAILER-DAEMON Thu Nov 29 10:49:24 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSOZA-0001Y8-F7 for mharc-emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ5-0001Td-TR for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSOZ5-0007Pp-2d for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:19 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:58232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ4-0007PT-TY for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:18 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id CC25920A0E; Thu, 29 Nov 2018 10:49:18 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 2f05824 2/6: Set comment-prefix, clear c-opt-cpp-prefix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Sergey Poznyakoff In-Reply-To: <20181129154916.17888.69265@vcs0.savannah.gnu.org> References: <20181129154916.17888.69265@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 2f0582451af081f8181b796132950431baf061d6 Auto-Submitted: auto-generated Message-Id: <20181129154918.CC25920A0E@vcs0.savannah.gnu.org> Date: Thu, 29 Nov 2018 10:49:18 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:49:22 -0000 branch: master commit 2f0582451af081f8181b796132950431baf061d6 Author: Sergey Poznyakoff Commit: Sergey Poznyakoff Set comment-prefix, clear c-opt-cpp-prefix --- vcl-mode.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcl-mode.el b/vcl-mode.el index c6ea5e1..97f66b1 100644 --- a/vcl-mode.el +++ b/vcl-mode.el @@ -66,8 +66,7 @@ (defvar vcl-mode-abbrev-table nil "Abbreviation table used in vcl-mode buffers.") (c-define-abbrev-table 'vcl-mode-abbrev-table - '(("else" "else" c-electric-continued-statement 0) - ("while" "while" c-electric-continued-statement 0))) + '(("else" "else" c-electric-continued-statement 0))) =20 ;; Font locking (defconst vcl-font-lock-keywords-1 @@ -308,7 +307,7 @@ =20 (defvar vcl-font-lock-keywords vcl-font-lock-keywords-3) =20 -(put 'vcl-mode 'c-mode-prefix "vcl-") +(put 'vcl-mode 'c-mode-prefix "vcl-") =20 (defun vcl-sharp-comment-syntax () (save-excursion @@ -360,9 +359,10 @@ Key bindings: (set (make-local-variable 'syntax-propertize-function) vcl-syntax-propertize-function) (set (make-local-variable 'parse-sexp-lookup-properties) t) - (set (make-local-variable 'comment-start) "# ") =20 (c-initialize-cc-mode t) + (c-lang-setvar comment-start "# ") + (setq c-opt-cpp-prefix nil) (set-syntax-table vcl-mode-syntax-table) (setq local-abbrev-table vcl-mode-abbrev-table abbrev-mode t) From MAILER-DAEMON Thu Nov 29 10:49:24 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSOZA-0001YG-KI for mharc-emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ7-0001Ug-BM for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSOZ5-0007QB-Dy for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:21 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:58236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ5-0007Pz-9F for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:19 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 39603209E7; Thu, 29 Nov 2018 10:49:19 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 94745f4 4/6: New function: vcl-match-paren MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Sergey Poznyakoff In-Reply-To: <20181129154916.17888.69265@vcs0.savannah.gnu.org> References: <20181129154916.17888.69265@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 94745f4df6a77e9e36dc47a1b48f434c1fe03f5e Auto-Submitted: auto-generated Message-Id: <20181129154919.39603209E7@vcs0.savannah.gnu.org> Date: Thu, 29 Nov 2018 10:49:19 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:49:22 -0000 branch: master commit 94745f4df6a77e9e36dc47a1b48f434c1fe03f5e Author: Sergey Poznyakoff Commit: Sergey Poznyakoff New function: vcl-match-paren --- vcl-mode.el | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++--- 1 file changed, 74 insertions(+), 3 deletions(-) diff --git a/vcl-mode.el b/vcl-mode.el index 449252c..90e1ce6 100644 --- a/vcl-mode.el +++ b/vcl-mode.el @@ -24,11 +24,12 @@ ;; run: ;; emacs -batch -f batch-byte-compile vcl-mode.el ;; Install the file vcl-mode.elc (and, optionally, vcl-mode.el) to -;; any directory in your Emacs load-path. +;; a directory in your Emacs load-path. =20 ;; Customization: ;; To your .emacs or site-start.el add: -;; (autoload 'vcl-mode "vcl-mode") +;; (autoload 'vcl-mode "vcl-mode" "Major mode for Varnish VCL sources" = t) +;; (add-to-list 'auto-mode-alist (cons (purecopy "\\.vcl\\'") 'vcl-mod= e)) =20 (require 'cc-langs) =20 @@ -36,7 +37,8 @@ "Keymap used in vcl-mode buffers.") (if vcl-mode-map nil - (setq vcl-mode-map (c-make-inherited-keymap))) + (setq vcl-mode-map (c-make-inherited-keymap)) + (define-key vcl-mode-map "\C-c%" 'vcl-match-paren)) =20 (defvar vcl-mode-syntax-table (let ((st (make-syntax-table))) @@ -344,6 +346,75 @@ (1 (ignore (vcl-sharp-comment-syntax)))) )) =20 +(defun vcl-match-paren (&optional arg) + "If point is on a parenthesis (including VCL multi-line string delimit= er), +find the matching one and move point to it. +With ARG, do it that many times. +" + (interactive "p") + (let ((n (or arg 1)) + (matcher (cond + ((looking-at "\\s\(") + (cons + (lexical-let ((s (buffer-substring + (match-beginning 0) + (match-end 0)))) + (lambda () + (search-forward s) + (backward-char))) + (lambda () + (forward-list) + (backward-char)))) + ((looking-at "\\s\)") + (cons + (lexical-let ((s (buffer-substring + (match-beginning 0) + (match-end 0)))) + (lambda () + (search-backward s))) + (lambda () + (forward-char) + (backward-list)))) + ((or (looking-at "{\"") + (save-excursion + (backward-char) + (looking-at "{\""))) + (cons + (lambda () + (search-forward "{\"")) + (lambda () + (search-forward-regexp "\"}") + (backward-char)))) + ((or (looking-at "\"}") + (save-excursion + (backward-char) + (looking-at "\"}"))) + (cons + (lambda () + (search-backward "\"}")) + (lambda () + (search-backward-regexp "{\""))))))) + (if (not matcher) + (message "Point not at parenthesis") + (condition-case err + (let ((fx (car matcher)) + (fn (cdr matcher))) + (catch 'stop + (while t + (funcall fn) + (setq n (1- n)) + (if (=3D n 0) + (throw 'stop t) + (condition-case e + (funcall fx) + (search-failed + (message "Not enough groups to satisfy the request") + (throw 'stop t))))))) + =20 + (scan-error (goto-char (nth 2 err)) + (message "%s" (nth 1 err))) + (search-failed (message "Unbalanced %s" (cdr err))))))) + ;;;###autoload (add-to-list 'auto-mode-alist (cons (purecopy "\\.vcl\\'") 'vcl-mode)) =20 From MAILER-DAEMON Thu Nov 29 10:49:25 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSOZB-0001Ys-23 for mharc-emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ7-0001Uh-BV for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSOZ5-0007Pj-1A for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:21 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:58229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ4-0007PP-PE for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:18 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 9C465209E7; Thu, 29 Nov 2018 10:49:18 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master e217607 1/6: Initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Sergey Poznyakoff In-Reply-To: <20181129154916.17888.69265@vcs0.savannah.gnu.org> References: <20181129154916.17888.69265@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: e217607915ae4d3a486a4b4e0fafeb34b8247d0f Auto-Submitted: auto-generated Message-Id: <20181129154918.9C465209E7@vcs0.savannah.gnu.org> Date: Thu, 29 Nov 2018 10:49:18 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:49:22 -0000 branch: master commit e217607915ae4d3a486a4b4e0fafeb34b8247d0f Author: Sergey Poznyakoff Commit: Sergey Poznyakoff Initial commit --- vcl-mode.el | 376 ++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++ 1 file changed, 376 insertions(+) diff --git a/vcl-mode.el b/vcl-mode.el new file mode 100644 index 0000000..c6ea5e1 --- /dev/null +++ b/vcl-mode.el @@ -0,0 +1,376 @@ +;;; vcl-mode.el --- major mode for editing VCL sources + +;; Authors: 2015 Sergey Poznyakoff +;; Version: 0.1 +;; Keywords: Varnish, VCL + +;; Copyright (C) 2015 Sergey Poznyakoff +=20 +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3 of the License, or +;; (at your option) any later version. +=20 +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;; Installation: +;; You may wish to use precompiled version of the mode. To create it +;; run: +;; emacs -batch -f batch-byte-compile vcl-mode.el +;; Install the file vcl-mode.elc (and, optionally, vcl-mode.el) to +;; any directory in your Emacs load-path. + +;; Customization: +;; To your .emacs or site-start.el add: +;; (autoload 'vcl-mode "vcl-mode") + +(require 'cc-langs) + +(defvar vcl-mode-map () + "Keymap used in vcl-mode buffers.") +(if vcl-mode-map + nil + (setq vcl-mode-map (c-make-inherited-keymap))) + +(defvar vcl-mode-syntax-table + (let ((st (make-syntax-table))) + (modify-syntax-entry ?\n "> b" st) + (modify-syntax-entry ?\r "> " st) + (modify-syntax-entry ?\f "> " st) +; (modify-syntax-entry ?\# "<" st) + (modify-syntax-entry ?/ ". 124b" st) + (modify-syntax-entry ?* ". 23" st) + (modify-syntax-entry ?+ "." st) + (modify-syntax-entry ?- "." st) + (modify-syntax-entry ?~ "." st) + (modify-syntax-entry ?=3D "." st) + (modify-syntax-entry ?% "." st) + (modify-syntax-entry ?< "." st) + (modify-syntax-entry ?> "." st) + (modify-syntax-entry ?& "." st) + (modify-syntax-entry ?| "." st) + (modify-syntax-entry ?_ "_" st) + (modify-syntax-entry ?\' "." st) + (modify-syntax-entry ?\" "." st) + (modify-syntax-entry ?{ "." st) + (modify-syntax-entry ?} "." st) + st) + "Syntax table in use in VCL Mode buffers.") + +(defvar vcl-mode-abbrev-table nil + "Abbreviation table used in vcl-mode buffers.") +(c-define-abbrev-table 'vcl-mode-abbrev-table + '(("else" "else" c-electric-continued-statement 0) + ("while" "while" c-electric-continued-statement 0))) + +;; Font locking +(defconst vcl-font-lock-keywords-1 + (eval-when-compile + (list + ;; Version declaration + '("^[ \t]*\\(vcl\\)\\>[ \t]*\\([[:digit:]]+\\.[[:digit:]]+\\)" + (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) + ;; Built-ins + (cons + (concat "\\<" + (regexp-opt + '("vcl_init" + "vcl_recv" + "vcl_pipe" + "vcl_pass" + "vcl_hash" + "vcl_hit" + "vcl_miss" + "vcl_fetch" + "vcl_deliver" + "vcl_error" + "vcl_fini" + "vcl_synth" + "vcl_backend_fetch" + "vcl_backend_response" + "vcl_backend_error") t) + "\\>") + 'font-lock-builtin-face) + ;; Keywords + (cons + (concat "\\<" + (regexp-opt + '("sub" + "import" + "include" + "backend")) + "\\>") + 'font-lock-keyword-face) + )) + "Subdued level highlighting for VCL buffers.") + =20 +(defconst vcl-font-lock-keywords-2 + (append vcl-font-lock-keywords-1 + (eval-when-compile + (list + ;; Keywords + (cons + (concat "\\<" + (regexp-opt + '("acl" + "if" + "else" + "return" + "call" + "set" + "remove" + "unset" + "director" + "probe") t) + "\\>") + 'font-lock-keyword-face) + ;; Return values + (cons + (concat "\\<" + (regexp-opt + '("error" + "fetch" + "hash" + "hit_for_pass" + "lookup" + "ok" + "pass" + "pipe" + "deliver" + "restart" + "true" + "false") t) + "\\>") + 'font-lock-constant-face) + ;; Functions + (cons + (concat "\\<" + (regexp-opt + '("ban" + "call" + "hash_data" + "new" + "synth" + "synthetic" + "regsub" + "regsuball") t) + "\\>") + 'font-lock-function-name-face) + =20 + ;; Objects and variables + ;; See https://www.varnish-cache.org/docs/4.0/reference/vcl.html#v= ariables + (list (concat "\\<" + (regexp-opt + '("req" + "resp" + "bereq" + "beresp" + "obj") t) + "\\.\\(http\\)\\(\\.\\([a-zA-Z_-][a-zA-Z_0-9-]*\\)\\)?") + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face) + '(4 font-lock-string-face nil t)) + (list (concat "\\<\\(bereq\\)\\." + (regexp-opt + '("backend" + "between_bytes_timeout" + "connect_timeout" + "first_byte_timeout" + "method" + "proto" + "retries" + "uncacheable" + "url" + "xid") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(beresp\\)\\.\\(backend\\)\\." + (regexp-opt + '("name" + "ip") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face) + '(3 font-lock-builtin-face)) + (list (concat "\\<\\(beresp\\)\\." + (regexp-opt + '("do_esi" + "do_gunzip" + "do_gzip" + "do_stream" + "grace" + "keep" + "proto" + "reason" + "status" + "storage_hint" + "ttl" + "uncacheable") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(client\\)\\." + (regexp-opt + '("identity" + "ip") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(obj\\)\\." + (regexp-opt + '("grace" + "hits" + "keep" + "proto" + "reason" + "status" + "ttl" + "uncacheable") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(req\\)\\." + (regexp-opt + '("backend_hint" + "can_gzip" + "esi" + "esi_level" + "hash_always_miss" + "hash_ignore_busy" + "method" + "proto" + "restarts" + "ttl" + "url" + "xid") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(resp\\)\\." + (regexp-opt + '("proto" + "reason" + "status") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(server\\)\\." + (regexp-opt + '("hostname" + "identity" + "ip") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(storage\\)\\.\\(\\sw+\\)\\." + (regexp-opt + '("free_space" + "used_space" + "happy") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-variahle-name-face) + '(3 font-lock-builtin-face)) + =20 + (cons + (concat "\\<" + (regexp-opt + '("req" + "resp" + "bereq" + "beresp" + "client" + "server" + "obj" + "now") t) + "\\>") + 'font-lock-builtin-face) + + ;; Function calls + '("\\<\\(\\(\\sw+\\)\\.\\)*\\(\\sw+\\)[ \t]*(" + (2 font-lock-variable-name-face nil t) + (3 font-lock-function-name-face)) + ;; '("\\<\\(\\sw+\\)\\(\\.\\(\\sw+\\)\\)*[ \t]*(" + ;; (1 font-lock-function-name-face) + ;; (3 font-lock-function-name-face nil t)) + =20 + ;; Constants + '("\\<\\([[:digit:]]+\\(\\.[[:digit:]]+\\)?\\)[ \t]*\\(ms\\|[smhdw= y]\\)?\\>" + (1 font-lock-constant-face) (3 font-lock-builtin-face nil t))))) + "Medium level highlighting for VCL buffers.") + +(defconst vcl-font-lock-keywords-3 + (append vcl-font-lock-keywords-2 + (eval-when-compile + (list + ;; User function names. + '("^[ \t]*\\(sub\\)\\>[ \t]*\\(\\sw+\\)?" + (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t= ))))) + "Gaudy level highlighting for VCL buffers.") + +(defvar vcl-font-lock-keywords vcl-font-lock-keywords-3) + +(put 'vcl-mode 'c-mode-prefix "vcl-") + +(defun vcl-sharp-comment-syntax () + (save-excursion + (goto-char (match-beginning 0)) =20 + (let ((syntax (save-match-data (syntax-ppss)))) + (cond + ((not (or (nth 3 syntax) (nth 4 syntax))) + (put-text-property (match-beginning 1) (match-end 1) + 'syntax-table (string-to-syntax "<")) + (end-of-line) + (put-text-property (point) (+ (point) 1) + 'syntax-table (string-to-syntax ">"))))))) + +(defconst vcl-syntax-propertize-function + (syntax-propertize-rules + ("\\({\\)\"" + (1 "|")) + ("\\({\\)[^\"]" + (1 "(}")) + ("\"\\(}\\)" + (1 "|")) + ("\\(^\\|[^\"]\\)\\(}\\)" + (2 "){")) + ("\\(\"\\)[^}]" + (1 (let ((syntax (save-match-data (syntax-ppss)))) + (string-to-syntax + (cond ((nth 4 syntax) + ".") + ((eq (nth 3 syntax) t) + (backward-char) + ".") + (t + (backward-char) + "\"")))))) + ("\\(#\\)" + (1 (ignore (vcl-sharp-comment-syntax)))) + )) + +;;;###autoload +(add-to-list 'auto-mode-alist (cons (purecopy "\\.vcl\\'") 'vcl-mode)) + +;;;###autoload +(define-derived-mode vcl-mode prog-mode "VCL" + "Major mode for editing VCL code. + +Key bindings: +\\{vcl-mode-map}" + + (set (make-local-variable 'syntax-propertize-function) + vcl-syntax-propertize-function) + (set (make-local-variable 'parse-sexp-lookup-properties) t) + (set (make-local-variable 'comment-start) "# ") + =20 + (c-initialize-cc-mode t) + (set-syntax-table vcl-mode-syntax-table) + (setq local-abbrev-table vcl-mode-abbrev-table + abbrev-mode t) + (use-local-map vcl-mode-map) + (c-init-language-vars vcl-mode) + (c-common-init 'vcl-mode) + + (c-run-mode-hooks 'c-mode-common-hook 'vcl-mode-hook) + (c-update-modeline)) + =20 +(provide 'vcl-mode) From MAILER-DAEMON Thu Nov 29 10:49:26 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSOZC-0001aF-Ak for mharc-emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ7-0001Um-EV for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSOZ5-0007Qe-TU for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:21 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:58240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOZ5-0007QY-Mr for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:49:19 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id A0DA6209DD; Thu, 29 Nov 2018 10:49:19 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 40280d3 6/6: Add 'packages/vcl-mode/' from commit 'd6bba7c13e0d72936001f5adea155256151339ac' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181129154916.17888.69265@vcs0.savannah.gnu.org> References: <20181129154916.17888.69265@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 40280d3cceef564f0938183ad7df923319284ac2 Auto-Submitted: auto-generated Message-Id: <20181129154919.A0DA6209DD@vcs0.savannah.gnu.org> Date: Thu, 29 Nov 2018 10:49:19 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:49:23 -0000 branch: master commit 40280d3cceef564f0938183ad7df923319284ac2 Merge: c0c44c3 d6bba7c Author: Stefan Monnier Commit: Stefan Monnier Add 'packages/vcl-mode/' from commit 'd6bba7c13e0d72936001f5adea15525= 6151339ac' =20 git-subtree-dir: packages/vcl-mode git-subtree-mainline: c0c44c3c0ded215e5bc60da74e2aaa090a35617b git-subtree-split: d6bba7c13e0d72936001f5adea155256151339ac --- packages/vcl-mode/vcl-mode.el | 446 ++++++++++++++++++++++++++++++++++++= ++++++ 1 file changed, 446 insertions(+) diff --git a/packages/vcl-mode/vcl-mode.el b/packages/vcl-mode/vcl-mode.e= l new file mode 100644 index 0000000..0f31178 --- /dev/null +++ b/packages/vcl-mode/vcl-mode.el @@ -0,0 +1,446 @@ +;;; vcl-mode.el --- major mode for editing VCL sources + +;; Authors: 2015-2018 Sergey Poznyakoff +;; Version: 1.0 +;; Keywords: Varnish, VCL + +;; Copyright (C) 2015-2018 Free Software Foundation, Inc. +=20 +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3 of the License, or +;; (at your option) any later version. +=20 +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;; Installation: +;; You may wish to use precompiled version of the mode. To create it +;; run: +;; emacs -batch -f batch-byte-compile vcl-mode.el +;; Install the file vcl-mode.elc (and, optionally, vcl-mode.el) to +;; a directory in your Emacs load-path. + +;; Customization: +;; To your .emacs or site-start.el add: +;; (autoload 'vcl-mode "vcl-mode" "Major mode for Varnish VCL sources" = t) +;; (add-to-list 'auto-mode-alist (cons (purecopy "\\.vcl\\'") 'vcl-mod= e)) + +(require 'cl) +(require 'cc-langs) + +(defvar vcl-mode-map () + "Keymap used in vcl-mode buffers.") +(if vcl-mode-map + nil + (setq vcl-mode-map (c-make-inherited-keymap)) + (define-key vcl-mode-map "\C-c%" 'vcl-match-paren)) + +(defvar vcl-mode-syntax-table + (let ((st (make-syntax-table))) + (modify-syntax-entry ?\n "> b" st) + (modify-syntax-entry ?\r "> " st) + (modify-syntax-entry ?\f "> " st) +; (modify-syntax-entry ?\# "<" st) + (modify-syntax-entry ?/ ". 124b" st) + (modify-syntax-entry ?* ". 23" st) + (modify-syntax-entry ?+ "." st) + (modify-syntax-entry ?- "." st) + (modify-syntax-entry ?~ "." st) + (modify-syntax-entry ?=3D "." st) + (modify-syntax-entry ?% "." st) + (modify-syntax-entry ?< "." st) + (modify-syntax-entry ?> "." st) + (modify-syntax-entry ?& "." st) + (modify-syntax-entry ?| "." st) + (modify-syntax-entry ?_ "_" st) + (modify-syntax-entry ?\' "." st) + (modify-syntax-entry ?\" "." st) + st) + "Syntax table in use in VCL Mode buffers.") + +(defvar vcl-mode-abbrev-table nil + "Abbreviation table used in vcl-mode buffers.") +(c-define-abbrev-table 'vcl-mode-abbrev-table + '(("else" "else" c-electric-continued-statement 0))) + +;; Font locking +(defconst vcl-font-lock-keywords-1 + (eval-when-compile + (list + ;; Version declaration + '("^[ \t]*\\(vcl\\)\\>[ \t]*\\([[:digit:]]+\\.[[:digit:]]+\\)" + (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) + ;; Built-ins + (cons + (concat "\\<" + (regexp-opt + '("vcl_init" + "vcl_recv" + "vcl_pipe" + "vcl_pass" + "vcl_hash" + "vcl_hit" + "vcl_miss" + "vcl_fetch" + "vcl_deliver" + "vcl_error" + "vcl_fini" + "vcl_synth" + "vcl_backend_fetch" + "vcl_backend_response" + "vcl_backend_error") t) + "\\>") + 'font-lock-builtin-face) + ;; Keywords + (cons + (concat "\\<" + (regexp-opt + '("sub" + "import" + "include" + "backend")) + "\\>") + 'font-lock-keyword-face) + )) + "Subdued level highlighting for VCL buffers.") + =20 +(defconst vcl-font-lock-keywords-2 + (append vcl-font-lock-keywords-1 + (eval-when-compile + (list + ;; Keywords + (cons + (concat "\\<" + (regexp-opt + '("acl" + "if" + "else" + "return" + "call" + "set" + "remove" + "unset" + "director" + "probe") t) + "\\>") + 'font-lock-keyword-face) + ;; Return values + (cons + (concat "\\<" + (regexp-opt + '("error" + "fetch" + "hash" + "hit_for_pass" + "lookup" + "ok" + "pass" + "pipe" + "deliver" + "restart" + "true" + "false") t) + "\\>") + 'font-lock-constant-face) + ;; Functions + (cons + (concat "\\<" + (regexp-opt + '("ban" + "call" + "hash_data" + "new" + "synth" + "synthetic" + "regsub" + "regsuball") t) + "\\>") + 'font-lock-function-name-face) + =20 + ;; Objects and variables + ;; See https://www.varnish-cache.org/docs/4.0/reference/vcl.html#v= ariables + (list (concat "\\<" + (regexp-opt + '("req" + "resp" + "bereq" + "beresp" + "obj") t) + "\\.\\(http\\)\\(\\.\\([a-zA-Z_-][a-zA-Z_0-9-]*\\)\\)?") + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face) + '(4 font-lock-string-face nil t)) + (list (concat "\\<\\(bereq\\)\\." + (regexp-opt + '("backend" + "between_bytes_timeout" + "connect_timeout" + "first_byte_timeout" + "method" + "proto" + "retries" + "uncacheable" + "url" + "xid") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(beresp\\)\\.\\(backend\\)\\." + (regexp-opt + '("name" + "ip") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face) + '(3 font-lock-builtin-face)) + (list (concat "\\<\\(beresp\\)\\." + (regexp-opt + '("do_esi" + "do_gunzip" + "do_gzip" + "do_stream" + "grace" + "keep" + "proto" + "reason" + "status" + "storage_hint" + "ttl" + "uncacheable") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(client\\)\\." + (regexp-opt + '("identity" + "ip") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(obj\\)\\." + (regexp-opt + '("grace" + "hits" + "keep" + "proto" + "reason" + "status" + "ttl" + "uncacheable") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(req\\)\\." + (regexp-opt + '("backend_hint" + "can_gzip" + "esi" + "esi_level" + "hash_always_miss" + "hash_ignore_busy" + "method" + "proto" + "restarts" + "ttl" + "url" + "xid") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(resp\\)\\." + (regexp-opt + '("proto" + "reason" + "status") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(server\\)\\." + (regexp-opt + '("hostname" + "identity" + "ip") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-builtin-face)) + (list (concat "\\<\\(storage\\)\\.\\(\\sw+\\)\\." + (regexp-opt + '("free_space" + "used_space" + "happy") t)) + '(1 font-lock-builtin-face) + '(2 font-lock-variahle-name-face) + '(3 font-lock-builtin-face)) + =20 + (cons + (concat "\\<" + (regexp-opt + '("req" + "resp" + "bereq" + "beresp" + "client" + "server" + "obj" + "now") t) + "\\>") + 'font-lock-builtin-face) + + ;; Function calls + '("\\<\\(\\(\\sw+\\)\\.\\)*\\(\\sw+\\)[ \t]*(" + (2 font-lock-variable-name-face nil t) + (3 font-lock-function-name-face)) + ;; '("\\<\\(\\sw+\\)\\(\\.\\(\\sw+\\)\\)*[ \t]*(" + ;; (1 font-lock-function-name-face) + ;; (3 font-lock-function-name-face nil t)) + =20 + ;; Constants + '("\\<\\([[:digit:]]+\\(\\.[[:digit:]]+\\)?\\)[ \t]*\\(ms\\|[smhdw= y]\\)?\\>" + (1 font-lock-constant-face) (3 font-lock-builtin-face nil t))))) + "Medium level highlighting for VCL buffers.") + +(defconst vcl-font-lock-keywords-3 + (append vcl-font-lock-keywords-2 + (eval-when-compile + (list + ;; User function names. + '("^[ \t]*\\(sub\\)\\>[ \t]*\\(\\sw+\\)?" + (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t= ))))) + "Gaudy level highlighting for VCL buffers.") + +(defvar vcl-font-lock-keywords vcl-font-lock-keywords-3) + +(put 'vcl-mode 'c-mode-prefix "vcl-") + +(defun vcl-sharp-comment-syntax () + (save-excursion + (goto-char (match-beginning 0)) =20 + (let ((syntax (save-match-data (syntax-ppss)))) + (cond + ((not (or (nth 3 syntax) (nth 4 syntax))) + (put-text-property (match-beginning 1) (match-end 1) + 'syntax-table (string-to-syntax "<")) + (end-of-line) + (put-text-property (point) (+ (point) 1) + 'syntax-table (string-to-syntax ">"))))))) + +(defconst vcl-syntax-propertize-function + (syntax-propertize-rules + ("\\({\\)\"" + (1 "|")) + ("\\({\\)[^\"]" + (1 "(}")) + ("\"\\(}\\)" + (1 "|")) + ("\\(^\\|[^\"]\\)\\(}\\)" + (2 "){")) + ("\\(\"\\)[^}]" + (1 (let ((syntax (save-match-data (syntax-ppss)))) + (string-to-syntax + (cond ((nth 4 syntax) + ".") + ((eq (nth 3 syntax) t) + (backward-char) + ".") + (t + (backward-char) + "\"")))))) + ("\\(#\\)" + (1 (ignore (vcl-sharp-comment-syntax)))) + )) + +(defun vcl-match-paren (&optional arg) + "If point is on a parenthesis (including VCL multi-line string delimit= er), +find the matching one and move point to it. +With ARG, do it that many times. +" + (interactive "p") + (let ((n (or arg 1)) + (matcher (cond + ((looking-at "\\s\(") + (cons + (lexical-let ((s (buffer-substring + (match-beginning 0) + (match-end 0)))) + (lambda () + (search-forward s) + (backward-char))) + (lambda () + (forward-list) + (backward-char)))) + ((looking-at "\\s\)") + (cons + (lexical-let ((s (buffer-substring + (match-beginning 0) + (match-end 0)))) + (lambda () + (search-backward s))) + (lambda () + (forward-char) + (backward-list)))) + ((or (looking-at "{\"") + (save-excursion + (backward-char) + (looking-at "{\""))) + (cons + (lambda () + (search-forward "{\"")) + (lambda () + (search-forward-regexp "\"}") + (backward-char)))) + ((or (looking-at "\"}") + (save-excursion + (backward-char) + (looking-at "\"}"))) + (cons + (lambda () + (search-backward "\"}")) + (lambda () + (search-backward-regexp "{\""))))))) + (if (not matcher) + (message "Point not at parenthesis") + (condition-case err + (let ((fx (car matcher)) + (fn (cdr matcher))) + (catch 'stop + (while t + (funcall fn) + (setq n (1- n)) + (if (=3D n 0) + (throw 'stop t) + (condition-case e + (funcall fx) + (search-failed + (message "Not enough groups to satisfy the request") + (throw 'stop t))))))) + =20 + (scan-error (goto-char (nth 2 err)) + (message "%s" (nth 1 err))) + (search-failed (message "Unbalanced %s" (cdr err))))))) + +;;;###autoload +(add-to-list 'auto-mode-alist (cons (purecopy "\\.vcl\\'") 'vcl-mode)) + +;;;###autoload +(define-derived-mode vcl-mode prog-mode "VCL" + "Major mode for editing VCL code. + +Key bindings: +\\{vcl-mode-map}" + + (set (make-local-variable 'syntax-propertize-function) + vcl-syntax-propertize-function) + (set (make-local-variable 'parse-sexp-lookup-properties) t) + =20 + (c-initialize-cc-mode t) + (c-lang-setvar comment-start "# ") + (setq c-opt-cpp-prefix nil) + (set-syntax-table vcl-mode-syntax-table) + (setq local-abbrev-table vcl-mode-abbrev-table + abbrev-mode t) + (use-local-map vcl-mode-map) + (c-init-language-vars vcl-mode) + (c-common-init 'vcl-mode) + + (c-run-mode-hooks 'c-mode-common-hook 'vcl-mode-hook) + (c-update-modeline)) + =20 +(provide 'vcl-mode) From MAILER-DAEMON Thu Nov 29 10:51:05 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSOaj-0002QQ-Di for mharc-emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:51:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOah-0002Pc-O6 for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:51:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSOag-00007d-Q5 for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:50:59 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:58278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSOag-00007U-MP for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 10:50:58 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 9AE10209DD; Thu, 29 Nov 2018 10:50:58 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master b1da287: * externals-list (vcl-mode): Add entry. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181129155057.19326.23540@vcs0.savannah.gnu.org> References: <20181129155057.19326.23540@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: b1da28785831990f1d95457ecb2e227eb338a35f Auto-Submitted: auto-generated Message-Id: <20181129155058.9AE10209DD@vcs0.savannah.gnu.org> Date: Thu, 29 Nov 2018 10:50:58 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:51:00 -0000 branch: master commit b1da28785831990f1d95457ecb2e227eb338a35f Author: Stefan Monnier Commit: Stefan Monnier * externals-list (vcl-mode): Add entry. --- externals-list | 1 + 1 file changed, 1 insertion(+) diff --git a/externals-list b/externals-list index 8271e4d..6f7d623 100644 --- a/externals-list +++ b/externals-list @@ -111,6 +111,7 @@ ("temp-buffer-browse" :subtree "https://github.com/leoliu/temp-buffer-= browse") ("test-simple" :subtree "https://github.com/rocky/emacs-test-si= mple") ("vdiff" :subtree "https://github.com/justbur/emacs-vdiff= ") + ("vcl-mode" :subtree "git://git.gnu.org.ua/vcl-mode") ;;("tramp" :core ;; (;; FIXME: elpa.gnu.org doesn't know where to get from ;; ;;"README.md" From MAILER-DAEMON Thu Nov 29 18:03:44 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSVLU-0007hH-OI for mharc-emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 18:03:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSVLP-0007h2-5B for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 18:03:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSVLI-0006KI-1E for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 18:03:35 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:35601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSVLA-0006If-9i for emacs-elpa-diffs@gnu.org; Thu, 29 Nov 2018 18:03:26 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 072C5209E7; Thu, 29 Nov 2018 18:03:23 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master 8dc6aef: * vcl-mode.el: Update header and fix last line; improve commentary MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181129230321.22659.53134@vcs0.savannah.gnu.org> References: <20181129230321.22659.53134@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 8dc6aef339954520923c333a028f01f01ccab68c Auto-Submitted: auto-generated Message-Id: <20181129230324.072C5209E7@vcs0.savannah.gnu.org> Date: Thu, 29 Nov 2018 18:03:23 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 23:03:42 -0000 branch: master commit 8dc6aef339954520923c333a028f01f01ccab68c Author: Stefan Monnier Commit: Stefan Monnier * vcl-mode.el: Update header and fix last line; improve commentary --- packages/vcl-mode/vcl-mode.el | 40 ++++++++++++++++++++++++++++---------= --- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/packages/vcl-mode/vcl-mode.el b/packages/vcl-mode/vcl-mode.e= l index 0f31178..c3b5dee 100644 --- a/packages/vcl-mode/vcl-mode.el +++ b/packages/vcl-mode/vcl-mode.el @@ -1,16 +1,16 @@ -;;; vcl-mode.el --- major mode for editing VCL sources +;;; vcl-mode.el --- Major mode for Varnish Configuration Language =20 -;; Authors: 2015-2018 Sergey Poznyakoff +;; Author: Sergey Poznyakoff ;; Version: 1.0 ;; Keywords: Varnish, VCL =20 ;; Copyright (C) 2015-2018 Free Software Foundation, Inc. -=20 + ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 3 of the License, or ;; (at your option) any later version. -=20 + ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -19,6 +19,19 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . =20 +;;; Commentary: + +;; Emacs support for Varnish's configuration language: +;; https://varnish-cache.org/docs/trunk/users-guide/vcl.html +;; This version of vcl-mode supports VCL-4.0. + +;; The features provided are auto-indentation (based on CC-mode's +;; engine), keyword highlighting, and matching of {"..."} multi-line +;; string delimiters. + +;; If you need support for VCL-2.0, you might have more luck with the ol= der +;; package: https://github.com/ssm/elisp/blob/master/vcl-mode.el + ;; Installation: ;; You may wish to use precompiled version of the mode. To create it ;; run: @@ -31,6 +44,8 @@ ;; (autoload 'vcl-mode "vcl-mode" "Major mode for Varnish VCL sources" = t) ;; (add-to-list 'auto-mode-alist (cons (purecopy "\\.vcl\\'") 'vcl-mod= e)) =20 +;;; Code: + (require 'cl) (require 'cc-langs) =20 @@ -109,7 +124,7 @@ 'font-lock-keyword-face) )) "Subdued level highlighting for VCL buffers.") - =20 + (defconst vcl-font-lock-keywords-2 (append vcl-font-lock-keywords-1 (eval-when-compile @@ -162,7 +177,7 @@ "regsuball") t) "\\>") 'font-lock-function-name-face) - =20 + ;; Objects and variables ;; See https://www.varnish-cache.org/docs/4.0/reference/vcl.html#v= ariables (list (concat "\\<" @@ -269,7 +284,7 @@ '(1 font-lock-builtin-face) '(2 font-lock-variahle-name-face) '(3 font-lock-builtin-face)) - =20 + (cons (concat "\\<" (regexp-opt @@ -291,7 +306,7 @@ ;; '("\\<\\(\\sw+\\)\\(\\.\\(\\sw+\\)\\)*[ \t]*(" ;; (1 font-lock-function-name-face) ;; (3 font-lock-function-name-face nil t)) - =20 + ;; Constants '("\\<\\([[:digit:]]+\\(\\.[[:digit:]]+\\)?\\)[ \t]*\\(ms\\|[smhdw= y]\\)?\\>" (1 font-lock-constant-face) (3 font-lock-builtin-face nil t))))) @@ -312,7 +327,7 @@ =20 (defun vcl-sharp-comment-syntax () (save-excursion - (goto-char (match-beginning 0)) =20 + (goto-char (match-beginning 0)) (let ((syntax (save-match-data (syntax-ppss)))) (cond ((not (or (nth 3 syntax) (nth 4 syntax))) @@ -411,7 +426,7 @@ With ARG, do it that many times. (search-failed (message "Not enough groups to satisfy the request") (throw 'stop t))))))) - =20 + (scan-error (goto-char (nth 2 err)) (message "%s" (nth 1 err))) (search-failed (message "Unbalanced %s" (cdr err))))))) @@ -429,7 +444,7 @@ Key bindings: (set (make-local-variable 'syntax-propertize-function) vcl-syntax-propertize-function) (set (make-local-variable 'parse-sexp-lookup-properties) t) - =20 + (c-initialize-cc-mode t) (c-lang-setvar comment-start "# ") (setq c-opt-cpp-prefix nil) @@ -442,5 +457,6 @@ Key bindings: =20 (c-run-mode-hooks 'c-mode-common-hook 'vcl-mode-hook) (c-update-modeline)) - =20 + (provide 'vcl-mode) +;;; vcl-mode.el ends here From MAILER-DAEMON Fri Nov 30 11:36:57 2018 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gSlmj-0002KO-Qg for mharc-emacs-elpa-diffs@gnu.org; Fri, 30 Nov 2018 11:36:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSlmh-0002KI-DG for emacs-elpa-diffs@gnu.org; Fri, 30 Nov 2018 11:36:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSlmf-0005ml-UZ for emacs-elpa-diffs@gnu.org; Fri, 30 Nov 2018 11:36:55 -0500 Received: from vcs0.savannah.gnu.org ([208.118.235.201]:49537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSlmf-0005lt-IN for emacs-elpa-diffs@gnu.org; Fri, 30 Nov 2018 11:36:53 -0500 Received: by vcs0.savannah.gnu.org (Postfix, from userid 69711) id 3A8872064E; Fri, 30 Nov 2018 11:36:53 -0500 (EST) To: emacs-elpa-diffs@gnu.org Subject: [elpa] master e1fd22f: * vcl-mode/vcl-mode.el: Simplify syntax handling; plus cosmetics MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier In-Reply-To: <20181130163652.12730.79987@vcs0.savannah.gnu.org> References: <20181130163652.12730.79987@vcs0.savannah.gnu.org> X-Git-Repo: elpa X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: e1fd22fec8de80e6ef3303641c01edb49502cf69 Auto-Submitted: auto-generated Message-Id: <20181130163653.3A8872064E@vcs0.savannah.gnu.org> Date: Fri, 30 Nov 2018 11:36:52 -0500 (EST) From: monnier@iro.umontreal.ca (Stefan Monnier) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.201 X-BeenThere: emacs-elpa-diffs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:36:56 -0000 branch: master commit e1fd22fec8de80e6ef3303641c01edb49502cf69 Author: Stefan Monnier Commit: Stefan Monnier * vcl-mode/vcl-mode.el: Simplify syntax handling; plus cosmetics =20 Use lexical-binding. Don't require `cl`. (vcl-mode-map): Move initialization into declaration. Don't rely on CC-mode's c-make-inherited-keymap. (vcl-mode-syntax-table): Use comment style b for `#` and mark `"` as a string delimiter. (vcl-mode-abbrev-table): Simplify definition. (vcl-font-lock-keywords-2): Don't request explicit subgroups if not u= sed. (vcl-sharp-comment-syntax): Remove function. (vcl-syntax-propertize-function): Remove special cases for `#` and `"= `. Refine `{"` and `"}` to filter out false positives. (vcl-match-paren): Use match-string. (vcl-mode): Let define-derived-mode set syntax-table, local-map, and abbrev-table. Use run-mode-hooks. --- packages/vcl-mode/vcl-mode.el | 149 ++++++++++++++++--------------------= ------ 1 file changed, 55 insertions(+), 94 deletions(-) diff --git a/packages/vcl-mode/vcl-mode.el b/packages/vcl-mode/vcl-mode.e= l index c3b5dee..ed50877 100644 --- a/packages/vcl-mode/vcl-mode.el +++ b/packages/vcl-mode/vcl-mode.el @@ -1,7 +1,7 @@ -;;; vcl-mode.el --- Major mode for Varnish Configuration Language +;;; vcl-mode.el --- Major mode for Varnish Configuration Language -*- l= exical-binding:t -*- =20 ;; Author: Sergey Poznyakoff -;; Version: 1.0 +;; Version: 1.1 ;; Keywords: Varnish, VCL =20 ;; Copyright (C) 2015-2018 Free Software Foundation, Inc. @@ -32,36 +32,23 @@ ;; If you need support for VCL-2.0, you might have more luck with the ol= der ;; package: https://github.com/ssm/elisp/blob/master/vcl-mode.el =20 -;; Installation: -;; You may wish to use precompiled version of the mode. To create it -;; run: -;; emacs -batch -f batch-byte-compile vcl-mode.el -;; Install the file vcl-mode.elc (and, optionally, vcl-mode.el) to -;; a directory in your Emacs load-path. - -;; Customization: -;; To your .emacs or site-start.el add: -;; (autoload 'vcl-mode "vcl-mode" "Major mode for Varnish VCL sources" = t) -;; (add-to-list 'auto-mode-alist (cons (purecopy "\\.vcl\\'") 'vcl-mod= e)) - ;;; Code: =20 -(require 'cl) +(require 'cc-mode) (require 'cc-langs) =20 -(defvar vcl-mode-map () +(defvar vcl-mode-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map c-mode-base-map) + (define-key map "\C-c%" 'vcl-match-paren) + map) "Keymap used in vcl-mode buffers.") -(if vcl-mode-map - nil - (setq vcl-mode-map (c-make-inherited-keymap)) - (define-key vcl-mode-map "\C-c%" 'vcl-match-paren)) =20 (defvar vcl-mode-syntax-table (let ((st (make-syntax-table))) (modify-syntax-entry ?\n "> b" st) - (modify-syntax-entry ?\r "> " st) - (modify-syntax-entry ?\f "> " st) -; (modify-syntax-entry ?\# "<" st) + ;; Use comment style `b' to match the style used for \n! + (modify-syntax-entry ?\# "< b" st) (modify-syntax-entry ?/ ". 124b" st) (modify-syntax-entry ?* ". 23" st) (modify-syntax-entry ?+ "." st) @@ -75,14 +62,13 @@ (modify-syntax-entry ?| "." st) (modify-syntax-entry ?_ "_" st) (modify-syntax-entry ?\' "." st) - (modify-syntax-entry ?\" "." st) + (modify-syntax-entry ?\" "\"" st) st) "Syntax table in use in VCL Mode buffers.") =20 -(defvar vcl-mode-abbrev-table nil +(define-abbrev-table 'vcl-mode-abbrev-table + '(("else" "else" c-electric-continued-statement :system t)) "Abbreviation table used in vcl-mode buffers.") -(c-define-abbrev-table 'vcl-mode-abbrev-table - '(("else" "else" c-electric-continued-statement 0))) =20 ;; Font locking (defconst vcl-font-lock-keywords-1 @@ -142,7 +128,7 @@ "remove" "unset" "director" - "probe") t) + "probe")) "\\>") 'font-lock-keyword-face) ;; Return values @@ -160,7 +146,7 @@ "deliver" "restart" "true" - "false") t) + "false")) "\\>") 'font-lock-constant-face) ;; Functions @@ -174,7 +160,7 @@ "synth" "synthetic" "regsub" - "regsuball") t) + "regsuball")) "\\>") 'font-lock-function-name-face) =20 @@ -186,7 +172,8 @@ "resp" "bereq" "beresp" - "obj") t) + "obj") + t) "\\.\\(http\\)\\(\\.\\([a-zA-Z_-][a-zA-Z_0-9-]*\\)\\)?") '(1 font-lock-builtin-face) '(2 font-lock-builtin-face) @@ -202,13 +189,15 @@ "retries" "uncacheable" "url" - "xid") t)) + "xid") + t)) '(1 font-lock-builtin-face) '(2 font-lock-builtin-face)) (list (concat "\\<\\(beresp\\)\\.\\(backend\\)\\." (regexp-opt '("name" - "ip") t)) + "ip") + t)) '(1 font-lock-builtin-face) '(2 font-lock-builtin-face) '(3 font-lock-builtin-face)) @@ -225,13 +214,15 @@ "status" "storage_hint" "ttl" - "uncacheable") t)) + "uncacheable") + t)) '(1 font-lock-builtin-face) '(2 font-lock-builtin-face)) (list (concat "\\<\\(client\\)\\." (regexp-opt '("identity" - "ip") t)) + "ip") + t)) '(1 font-lock-builtin-face) '(2 font-lock-builtin-face)) (list (concat "\\<\\(obj\\)\\." @@ -243,7 +234,8 @@ "reason" "status" "ttl" - "uncacheable") t)) + "uncacheable") + t)) '(1 font-lock-builtin-face) '(2 font-lock-builtin-face)) (list (concat "\\<\\(req\\)\\." @@ -259,28 +251,32 @@ "restarts" "ttl" "url" - "xid") t)) + "xid") + t)) '(1 font-lock-builtin-face) '(2 font-lock-builtin-face)) (list (concat "\\<\\(resp\\)\\." (regexp-opt '("proto" "reason" - "status") t)) + "status") + t)) '(1 font-lock-builtin-face) '(2 font-lock-builtin-face)) (list (concat "\\<\\(server\\)\\." (regexp-opt '("hostname" "identity" - "ip") t)) + "ip") + t)) '(1 font-lock-builtin-face) '(2 font-lock-builtin-face)) (list (concat "\\<\\(storage\\)\\.\\(\\sw+\\)\\." (regexp-opt '("free_space" "used_space" - "happy") t)) + "happy") + t)) '(1 font-lock-builtin-face) '(2 font-lock-variahle-name-face) '(3 font-lock-builtin-face)) @@ -295,7 +291,7 @@ "client" "server" "obj" - "now") t) + "now")) "\\>") 'font-lock-builtin-face) =20 @@ -303,9 +299,6 @@ '("\\<\\(\\(\\sw+\\)\\.\\)*\\(\\sw+\\)[ \t]*(" (2 font-lock-variable-name-face nil t) (3 font-lock-function-name-face)) - ;; '("\\<\\(\\sw+\\)\\(\\.\\(\\sw+\\)\\)*[ \t]*(" - ;; (1 font-lock-function-name-face) - ;; (3 font-lock-function-name-face nil t)) =20 ;; Constants '("\\<\\([[:digit:]]+\\(\\.[[:digit:]]+\\)?\\)[ \t]*\\(ms\\|[smhdw= y]\\)?\\>" @@ -325,67 +318,38 @@ =20 (put 'vcl-mode 'c-mode-prefix "vcl-") =20 -(defun vcl-sharp-comment-syntax () - (save-excursion - (goto-char (match-beginning 0)) - (let ((syntax (save-match-data (syntax-ppss)))) - (cond - ((not (or (nth 3 syntax) (nth 4 syntax))) - (put-text-property (match-beginning 1) (match-end 1) - 'syntax-table (string-to-syntax "<")) - (end-of-line) - (put-text-property (point) (+ (point) 1) - 'syntax-table (string-to-syntax ">"))))))) - (defconst vcl-syntax-propertize-function (syntax-propertize-rules ("\\({\\)\"" - (1 "|")) - ("\\({\\)[^\"]" - (1 "(}")) + (1 (when (null (nth 8 (save-excursion + (syntax-ppss (match-beginning 0))))) + (string-to-syntax "|")))) ("\"\\(}\\)" - (1 "|")) - ("\\(^\\|[^\"]\\)\\(}\\)" - (2 "){")) - ("\\(\"\\)[^}]" - (1 (let ((syntax (save-match-data (syntax-ppss)))) - (string-to-syntax - (cond ((nth 4 syntax) - ".") - ((eq (nth 3 syntax) t) - (backward-char) - ".") - (t - (backward-char) - "\"")))))) - ("\\(#\\)" - (1 (ignore (vcl-sharp-comment-syntax)))) - )) + (1 (when (eq t (nth 3 (save-excursion + (syntax-ppss (match-beginning 0))))) + (string-to-syntax "|")))))) =20 (defun vcl-match-paren (&optional arg) + ;; FIXME: Assuming syntax-propertize works correctly, forward-sexp and + ;; backward-sexp should do the trick! "If point is on a parenthesis (including VCL multi-line string delimit= er), find the matching one and move point to it. -With ARG, do it that many times. -" +With ARG, do it that many times." (interactive "p") (let ((n (or arg 1)) (matcher (cond - ((looking-at "\\s\(") + ((looking-at "\\s(") (cons - (lexical-let ((s (buffer-substring - (match-beginning 0) - (match-end 0)))) + (let ((s (match-string 0))) (lambda () (search-forward s) (backward-char))) (lambda () (forward-list) (backward-char)))) - ((looking-at "\\s\)") + ((looking-at "\\s)") (cons - (lexical-let ((s (buffer-substring - (match-beginning 0) - (match-end 0)))) + (let ((s (match-string 0))) (lambda () (search-backward s))) (lambda () @@ -421,7 +385,7 @@ With ARG, do it that many times. (setq n (1- n)) (if (=3D n 0) (throw 'stop t) - (condition-case e + (condition-case nil (funcall fx) (search-failed (message "Not enough groups to satisfy the request") @@ -436,11 +400,11 @@ With ARG, do it that many times. =20 ;;;###autoload (define-derived-mode vcl-mode prog-mode "VCL" - "Major mode for editing VCL code. + "Major mode for editing Varnish Configuration Language code. =20 Key bindings: \\{vcl-mode-map}" - + :abbrev-table vcl-mode-abbrev-table (set (make-local-variable 'syntax-propertize-function) vcl-syntax-propertize-function) (set (make-local-variable 'parse-sexp-lookup-properties) t) @@ -448,14 +412,11 @@ Key bindings: (c-initialize-cc-mode t) (c-lang-setvar comment-start "# ") (setq c-opt-cpp-prefix nil) - (set-syntax-table vcl-mode-syntax-table) - (setq local-abbrev-table vcl-mode-abbrev-table - abbrev-mode t) - (use-local-map vcl-mode-map) + (setq abbrev-mode t) (c-init-language-vars vcl-mode) (c-common-init 'vcl-mode) =20 - (c-run-mode-hooks 'c-mode-common-hook 'vcl-mode-hook) + (run-mode-hooks 'c-mode-common-hook 'vcl-mode-hook) (c-update-modeline)) =20 (provide 'vcl-mode)