[elpa] master 2cf727a: Fix starting a search with `el-search-this-sexp'

2017-12-04 Thread Michael Heerdegen
branch: master
commit 2cf727ad7822e72bc27b997fbad4ca9170286296
Author: Michael Heerdegen 
Commit: Michael Heerdegen 

Fix starting a search with `el-search-this-sexp'

Improve behavior of `el-search-jump-to-search-head' and
`el-search-query-replace' called directly after `el-search-this-sexp'.
---
 packages/el-search/el-search.el | 4 
 1 file changed, 4 insertions(+)

diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index 728e384..e9f8b9c 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -2274,6 +2274,8 @@ Use the normal search commands to seize the search."
(lambda () (stream (list current-buffer
  'from-here)
 (el-search--next-buffer el-search--current-search)
+(setf (el-search-head-position (el-search-object-head 
el-search--current-search))
+  (copy-marker (point)))
 (setq this-command 'el-search-pattern
   el-search--success t)
 (el-search-hl-other-matches (el-search--current-matcher))
@@ -3201,6 +3203,8 @@ query-replace all matches following point in the current 
buffer."
   (eq (el-search-head-buffer search-head) (current-buffer))
   (equal from-pattern (el-search-object-pattern el-search--current-search))
   (eq last-command 'el-search-pattern)
+  ;; A `el-search-this-sexp' that wasn't activated doesn't count
+  (el-search-object-last-match el-search--current-search)
   (prog1 t
 (el-search--message-no-log "Using the current search to drive 
query-replace...")
 (sit-for 1.))



[elpa] master d272976: Display match count for *El Occur* buffers

2017-12-04 Thread Michael Heerdegen
branch: master
commit d272976d4c11f56e90d743a52f32d2eafb4dab56
Author: Michael Heerdegen 
Commit: Michael Heerdegen 

Display match count for *El Occur* buffers

Make `el-search-occur-next-match' and `el-search-occur-previous-match'
display an x/y-style match count.
---
 packages/el-search/el-search.el | 29 ++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index e9f8b9c..ef75a66 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.4.0.5
+;; Version: 1.4.0.6
 ;; Package-Requires: ((emacs "25") (stream "2.2.4"))
 
 
@@ -2396,9 +2396,31 @@ Prompt for a new pattern and revert the occur buffer."
  (cl-some (lambda (ov) (overlay-get ov 'el-search-match))
   (overlays-at pos)
 (if (memq pos (list (point-min) (point-max)))
-(el-search--message-no-log "No match %s this position" (if backwards 
"before" "after"))
+(progn
+  (el-search--message-no-log "No match %s this position" (if backwards 
"before" "after"))
+  (sit-for 1.5))
   (goto-char pos)
-  (save-excursion (hs-show-block)
+  (save-excursion (hs-show-block
+  (el-search-occur--show-match-count))
+
+(defvar el-search-occur--total-matches nil)
+
+(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-search-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)))
 
 (defun el-search-occur-next-match ()
   "Move point to the next match."
@@ -2617,6 +2639,7 @@ Prompt for a new pattern and revert the occur buffer."
 
   (save-excursion
 (goto-char insert-summary-position)
+(setq el-search-occur--total-matches overall-matches)
 (insert
  (if (zerop overall-matches)
  ";;; * No matches"



[elpa] master 1ff29ec: Fix resuming a single-buffer query-replace

2017-12-04 Thread Michael Heerdegen
branch: master
commit 1ff29ec6250cc6d2b4552ab0050e369a9ebeef56
Author: Michael Heerdegen 
Commit: Michael Heerdegen 

Fix resuming a single-buffer query-replace
---
 packages/el-search/el-search.el | 18 +++---
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index ef75a66..be58eae 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.4.0.6
+;; Version: 1.4.0.7
 ;; Package-Requires: ((emacs "25") (stream "2.2.4"))
 
 
@@ -3122,14 +3122,12 @@ the list's elements are inserted."))
   nbr-replaced
   (if (zerop nbr-skipped)  ""
 (format "   (%d skipped)" nbr-skipped
-  (if (not multiple)
-  (funcall replace-in-current-buffer)
-(while (and
-(not done)
-(progn (el-search-continue-search)
-   (and el-search--success (not el-search--wrap-flag
-  (funcall replace-in-current-buffer)
-  (unless replace-all-and-following (setq replace-all nil
+  (while (and
+  (not done)
+  (progn (el-search-continue-search)
+ (and el-search--success (not el-search--wrap-flag
+(funcall replace-in-current-buffer)
+(unless replace-all-and-following (setq replace-all nil)))
   (message "Replaced %d matches in %d buffers" nbr-replaced-total 
nbr-changed-buffers
 
 (defun el-search-query-replace--read-args ()
@@ -3226,8 +3224,6 @@ query-replace all matches following point in the current 
buffer."
   (eq (el-search-head-buffer search-head) (current-buffer))
   (equal from-pattern (el-search-object-pattern el-search--current-search))
   (eq last-command 'el-search-pattern)
-  ;; A `el-search-this-sexp' that wasn't activated doesn't count
-  (el-search-object-last-match el-search--current-search)
   (prog1 t
 (el-search--message-no-log "Using the current search to drive 
query-replace...")
 (sit-for 1.))



[elpa] master 59cbc41: Use local binding of `post-command-hook' to reset wrap flag

2017-12-04 Thread Michael Heerdegen
branch: master
commit 59cbc41e2bfff171c744123335bd1d3e2a2865e7
Author: Michael Heerdegen 
Commit: Michael Heerdegen 

Use local binding of `post-command-hook' to reset wrap flag

The current search is a global thing, so we must use the global value
of `post-command-hook' to reset the `el-search--wrap-flag'.
---
 packages/el-search/el-search.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index be58eae..95441d6 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.4.0.7
+;; Version: 1.4.0.8
 ;; Package-Requires: ((emacs "25") (stream "2.2.4"))
 
 
@@ -1905,12 +1905,12 @@ local binding of `window-scroll-functions'."
 (defun el-search--reset-wrap-flag ()
   (unless (or (eq this-command 'el-search-query-replace)
   (eq this-command 'el-search-pattern))
-(remove-hook 'post-command-hook 'el-search--reset-wrap-flag t)
+(remove-hook 'post-command-hook 'el-search--reset-wrap-flag)
 (setq el-search--wrap-flag nil)))
 
 (defun el-search--set-wrap-flag (value)
   (when value
-(add-hook 'post-command-hook #'el-search--reset-wrap-flag t t))
+(add-hook 'post-command-hook #'el-search--reset-wrap-flag t))
   (setq el-search--wrap-flag value))
 
 



[elpa] master a2c281e 1/5: Gnorb: New option gnorb-gnus-tick-all-tracked-messages

2017-12-04 Thread Eric Abrahamsen
branch: master
commit a2c281e26e3988327bf2ee64fc3c2b83f41e02ee
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Gnorb: New option gnorb-gnus-tick-all-tracked-messages

Fixes #34

* packages/gnorb/gnorb-gnus.el (gnorb-gnus-tick-all-tracked-messages):
  New option, does what it says.
* packages/gnorb/gnorb-gnus.el (gnorb-gnus-incoming-do-todo): Maybe
  tick messages here.
  (gnorb-gnus-quick-reply): And here.
* packages/gnorb/gnorb.info: Document.
---
 packages/gnorb/gnorb-gnus.el | 28 
 packages/gnorb/gnorb.info| 10 +++---
 packages/gnorb/gnorb.org |  3 +++
 packages/gnorb/gnorb.texi|  4 
 4 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/packages/gnorb/gnorb-gnus.el b/packages/gnorb/gnorb-gnus.el
index 0c21b58..abf0739 100644
--- a/packages/gnorb/gnorb-gnus.el
+++ b/packages/gnorb/gnorb-gnus.el
@@ -110,6 +110,13 @@ register."
   :group 'gnorb-gnus
   :type 'boolean)
 
+(defcustom gnorb-gnus-tick-all-tracked-messages nil
+  "When non-nil, add the tick mark to all tracked messages.
+This happens only once, at the time the association is created.
+Ticks can be safely removed later."
+  :group 'gnorb-gnus
+  :type 'boolean)
+
 (defcustom gnorb-gnus-summary-mark-format-letter "g"
   "Format letter to be used as part of your
   `gnus-summary-line-format', to indicate in the *Summary* buffer
@@ -528,14 +535,14 @@ work."
 
 ;;;###autoload
 (defun gnorb-gnus-incoming-do-todo (arg &optional id)
-  "Call this function from a received gnus message to store a
-link to the message, prompt for a related Org heading, visit the
-heading, and trigger an action on it \(see
-`gnorb-org-trigger-actions'\).
-
-If you've set up message tracking \(with
-`gnorb-tracking-initialize'\), Gnorb can guess which Org heading
-you probably want to trigger, which can save some time. It does
+  "Use the message under point to trigger an action on an Org heading.
+This function stores a link to the message, prompts for a related
+Org heading, visits the heading, and triggers an action on
+it (see `gnorb-org-trigger-actions').
+
+If you've set up message tracking (with
+`gnorb-tracking-initialize'), Gnorb can guess which Org heading
+you probably want to trigger, which can save some time.  It does
 this by looking in the References header, and seeing if any of
 the messages referenced there are already being tracked by any
 headings.
@@ -646,6 +653,8 @@ you'll stay in the Gnus summary buffer."
(message "Message text copied to kill ring"
  (with-current-buffer buf
(dolist (a articles)
+ (when gnorb-gnus-tick-all-tracked-messages
+   (gnus-summary-mark-article a gnus-ticked-mark))
  (gnus-summary-update-article a
   (error
;; If these are left populated after an error, it plays hell
@@ -686,6 +695,9 @@ reply."
(let ((ret (make-marker)))
  (setq gnorb-window-conf (current-window-configuration))
  (move-marker gnorb-return-marker (point))
+ (when gnorb-gnus-tick-all-tracked-messages
+   (gnus-summary-mark-article art-no gnus-ticked-mark))
+ (gnus-summary-update-article art-no)
  ;; Assume the first heading is the one we want.
  (gnorb-registry-make-entry
   msg-id from subject targ group)
diff --git a/packages/gnorb/gnorb.info b/packages/gnorb/gnorb.info
index c1a54f3..0d848db 100644
--- a/packages/gnorb/gnorb.info
+++ b/packages/gnorb/gnorb.info
@@ -663,6 +663,10 @@ File: gnorb.info,  Node: User Options 2,  Up: Misc Gnus
  Treat all capture templates as if they had the :gnus-attachments
  key set to “t”.  This only has any effect if you’re capturing from
  a Gnus summary or article buffer.
+‘gnorb-gnus-tick-all-tracked-messages’
+ When non-nil, always add the tick mark to messages when they are
+ first associated with an Org heading.  The mark can be safely
+ deleted afterwards.
 ‘gnorb-trigger-todo-default’
  Set to either ’note or ’todo to tell ‘gnorb-gnus-incoming-do-todo’
  what to do by default.  You can reach the non-default behavior by
@@ -775,9 +779,9 @@ Node: User Options22106
 Node: Misc Org23629
 Node: Inserting BBDB links23804
 Node: User Options 124060
-Node: Misc Gnus26958
-Node: User Options 227120
-Node: Default Keybindings30057
+Node: Misc Gnus26774
+Node: User Options 226936
+Node: Default Keybindings30078
 
 End Tag Table
 
diff --git a/packages/gnorb/gnorb.org b/packages/gnorb/gnorb.org
index b3f71fd..1d77eae 100644
--- a/packages/gnorb/gnorb.org
+++ b/packages/gnorb/gnorb.org
@@ -464,6 +464,9 @@ insert an Org link to that record at point.
  if they had the :gnus-attachments key set to "t". This only has
  any effect if you're capturing from a Gnus summary or article
  buffer.
+- `gnorb-gnus-tick-all-tracked-messages' :: When non-nil, always add
+ the tick mark to messages when they are first associated 

[elpa] master updated (59cbc41 -> 335dd95)

2017-12-04 Thread Eric Abrahamsen
girzel pushed a change to branch master.

  from  59cbc41   Use local binding of `post-command-hook' to reset wrap 
flag
   new  a2c281e   Gnorb: New option gnorb-gnus-tick-all-tracked-messages
   new  a60a0a2   Gnorb: Consolidate all after-capture functions into one
   new  9df5a40   Gnorb: Tweak manual a bit
   new  8ebb0e1   Gnorb: Tweaks to gnorb-org-extract-mail-tracking
   new  335dd95   Gnorb: Try harder to find the nngnorb server


Summary of changes:
 packages/gnorb/README.org|   2 +-
 packages/gnorb/gnorb-gnus.el | 138 +
 packages/gnorb/gnorb-org.el  |  14 +++-
 packages/gnorb/gnorb.info| 179 ++-
 packages/gnorb/gnorb.org | 104 +
 packages/gnorb/gnorb.texi| 115 ++-
 6 files changed, 308 insertions(+), 244 deletions(-)



[elpa] master 9df5a40 3/5: Gnorb: Tweak manual a bit

2017-12-04 Thread Eric Abrahamsen
branch: master
commit 9df5a40caf82034fc3df1e34d6d8907f17cfad14
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Gnorb: Tweak manual a bit

* packages/gnorb/gnorb.org: Move the "Likely Workflow" section higher,
  people probably want to read that first.
* packages/gnorb/README.org: Mention the manual in the README.
---
 packages/gnorb/README.org |   2 +-
 packages/gnorb/gnorb.info | 175 +++---
 packages/gnorb/gnorb.org  | 101 +-
 packages/gnorb/gnorb.texi | 111 +++--
 4 files changed, 199 insertions(+), 190 deletions(-)

diff --git a/packages/gnorb/README.org b/packages/gnorb/README.org
index 1ee55a6..f52340a 100644
--- a/packages/gnorb/README.org
+++ b/packages/gnorb/README.org
@@ -11,7 +11,7 @@ Probably the most interesting thing Gnorb does is tracking
 correspondences between Gnus email messages and Org headings. Rather
 than "turning your inbox into a TODO list", as some software puts it,
 Gnorb (kind of) does the opposite: turning your TODO headings into
-mini mailboxes.
+mini mailboxes. See the Info manual for details.
 
 *Note for previous users*: If you were using Gnorb from Github before
 it shifted to the Elpa repository, the email tracking mechanism has
diff --git a/packages/gnorb/gnorb.info b/packages/gnorb/gnorb.info
index 0d848db..f409266 100644
--- a/packages/gnorb/gnorb.info
+++ b/packages/gnorb/gnorb.info
@@ -30,6 +30,7 @@ Gnorb Manual
 
 Email Tracking
 
+* Likely Workflow::
 * Tracking Setup::
 * Beginning and Continuing the Tracking Process::
 * Trigger Actions::
@@ -37,7 +38,6 @@ Email Tracking
 * Hinting in Gnus::
 * Message Attachments::
 * Registry Usage::
-* Likely Workflow::
 
 Misc BBDB
 
@@ -135,6 +135,7 @@ agenda rather than in Gnus.
 
 * Menu:
 
+* Likely Workflow::
 * Tracking Setup::
 * Beginning and Continuing the Tracking Process::
 * Trigger Actions::
@@ -142,12 +143,66 @@ agenda rather than in Gnus.
 * Hinting in Gnus::
 * Message Attachments::
 * Registry Usage::
-* Likely Workflow::
 
 
-File: gnorb.info,  Node: Tracking Setup,  Next: Beginning and Continuing the 
Tracking Process,  Up: Email Tracking
+File: gnorb.info,  Node: Likely Workflow,  Next: Tracking Setup,  Up: Email 
Tracking
+
+4.1 Likely Workflow
+===
+
+First of all, here’s a hypothetical workflow to show you how tracking
+works.
+
+   Say you receive an email from Jimmy, who wants to rent a room in your
+house.  “I’ll respond to this later,” you think.
+
+   You capture an Org TODO from the email, writing a headline “Jimmy
+renting a room”, and give it a REPLY keyword.  Gnorb quietly records the
+correspondence between the email and the TODO, using the Gnus registry.
+
+   The next day, looking at your Agenda, you see the TODO and decide to
+respond to the email.  You hit “C-c t” on the heading, and Gnorb finds
+Jimmy’s email and starts a reply to it.
+
+   You tell Jimmy the room’s available in March, and send the message.
+Gnorb takes you back to the heading, and asks you to trigger an action
+on it.  You choose “todo state”, and change the heading keyword to WAIT.
+
+   Two days later, Jimmy replies to your message, saying that March is
+perfect.  When you open his response, Gnorb politely reminds you that
+the message is relevant to an existing TODO. You hit “C-c t” on the
+message, and are again taken to the TODO and asked to trigger an action.
+Again you choose “todo state”, and change the heading keyword back to
+REPLY.
+
+   You get another email, from Samantha, warning you not to rent the
+room to Jimmy.  She even attaches a picture of a room in her house, as
+it looked after Jimmy had stayed there for six months.  It’s bad.  You
+hit “C-c t” on her message, and pick the “Jimmy renting a room” heading.
+This time, you choose “take note” as the trigger action, and make a
+brief note about how bad that room looked.  Gnorb asks if you’d like to
+attach the picture to the Org heading.  You decide you will.
+
+   Now it’s time to write to Jimmy and say something noncommittal.
+Hitting “C-c t” on the heading would respond to Samantha’s email, the
+most recent of the associated messages, which isn’t what you want.
+Instead you hit “C-c v” on the heading, which opens up a Gnus *Summary*
+buffer containing all four messages: Jimmy’s first, your response, his
+response to that, and Samantha’s message.  You pick Jimmy’s second
+email, and reply to it normally.  Gnorb asks if you’d like to send the
+picture of the room as an attachment.  You would not.  When you send the
+reply Gnorb tracks that as well, and does the “trigger an action” trick
+again.
+
+   In this way Gnorb helps you manage an entire conversation, possibly
+with multiple threads and multiple participants.  Mostly all you need to
+do is hit “C-c t” on newly-received messages, and “C-c t” on the heading
+when it’s time to compose a new reply.
 
-4.1 Tracking Setup
+
+File: gnorb.info,  Node: Tracking Setup,  Next: Beg

[elpa] master a60a0a2 2/5: Gnorb: Consolidate all after-capture functions into one

2017-12-04 Thread Eric Abrahamsen
branch: master
commit a60a0a2249fcfe7544f373c23cd3bd981799a0f9
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Gnorb: Consolidate all after-capture functions into one

* packages/gnorb/gnorb-gnus.el (gnorb-gnus-after-capture-function):
  This new function replaces gnorb-gnus-capture-attach, and
  gnorb-gnus-capture-save-text. New: it also ticks the message as
  needed, and updates the summary line.
---
 packages/gnorb/gnorb-gnus.el | 89 +---
 1 file changed, 50 insertions(+), 39 deletions(-)

diff --git a/packages/gnorb/gnorb-gnus.el b/packages/gnorb/gnorb-gnus.el
index abf0739..0750261 100644
--- a/packages/gnorb/gnorb-gnus.el
+++ b/packages/gnorb/gnorb-gnus.el
@@ -244,47 +244,58 @@ save them into `gnorb-tmp-dir'."
(when (or capture-p store)
  (push filename gnorb-gnus-capture-attachments
 
-;;; Make the above work in the capture process
-
-(defun gnorb-gnus-capture-attach ()
-  (when (and (or gnorb-gnus-capture-always-attach
-(org-capture-get :gnus-attachments))
-(with-current-buffer
-(org-capture-get :original-buffer)
-  (memq major-mode '(gnus-summary-mode gnus-article-mode
-(require 'org-attach)
-(setq gnorb-gnus-capture-attachments nil)
-(gnorb-gnus-collect-all-attachments t)
-(map-y-or-n-p
- (lambda (a)
-   (format "Attach %s to capture heading? "
-  (file-name-nondirectory a)))
- (lambda (a) (org-attach-attach a nil 'mv))
- gnorb-gnus-capture-attachments
- '("file" "files" "attach"))
-(setq gnorb-gnus-capture-attachments nil)))
-
-(defun gnorb-gnus-capture-save-text ()
-  (when (and gnorb-gnus-copy-message-text
-(with-current-buffer
-(org-capture-get :original-buffer)
-  (memq major-mode '(gnus-summary-mode gnus-article-mode
+(defun gnorb-gnus-after-capture-function ()
+  "Do various things after starting the capture process.
+Currently includes:
+
+1. Offering to move all the attachments from the message we
+captured from onto the Org heading being captured.
+
+2. Possibly saving the text of the message we captured from (see
+`gnorb-gnus-copy-message-text').
+
+3. Possibly ticking the message we captured from (see
+`gnorb-gnus-tick-all-tracked-messages')."
+  (when (with-current-buffer
+   (org-capture-get :original-buffer)
+ (memq major-mode '(gnus-summary-mode gnus-article-mode)))
 (save-window-excursion
   (set-buffer (org-capture-get :original-buffer))
-  (gnus-with-article-buffer
-   (article-goto-body)
-   (if (numberp gnorb-gnus-copy-message-text)
-   (progn
- (copy-to-register
-  gnorb-gnus-copy-message-text
-  (point) (point-max))
- (message "Message text copied to register %c"
-  gnorb-gnus-copy-message-text))
- (kill-new (buffer-substring (point) (point-max)))
- (message "Message text copied to kill ring"))
-
-(add-hook 'org-capture-mode-hook 'gnorb-gnus-capture-attach)
-(add-hook 'org-capture-mode-hook 'gnorb-gnus-capture-save-text)
+  (let ((art-no (gnus-summary-article-number)))
+
+   (when gnorb-gnus-copy-message-text
+ (gnus-with-article-buffer
+   (article-goto-body)
+   (if (numberp gnorb-gnus-copy-message-text)
+   (progn
+ (copy-to-register
+  gnorb-gnus-copy-message-text
+  (point) (point-max))
+ (message "Message text copied to register %c"
+  gnorb-gnus-copy-message-text))
+ (kill-new (buffer-substring (point) (point-max)))
+ (message "Message text copied to kill ring"
+
+   (when (or gnorb-gnus-capture-always-attach
+ (org-capture-get :gnus-attachments))
+ (require 'org-attach)
+ (setq gnorb-gnus-capture-attachments nil)
+ (gnorb-gnus-collect-all-attachments t)
+ (map-y-or-n-p
+  (lambda (a)
+(format "Attach %s to capture heading? "
+(file-name-nondirectory a)))
+  (lambda (a) (org-attach-attach a nil 'mv))
+  gnorb-gnus-capture-attachments
+  '("file" "files" "attach"))
+ (setq gnorb-gnus-capture-attachments nil))
+
+   (when gnorb-gnus-tick-all-tracked-messages
+ (gnus-summary-mark-article art-no gnus-ticked-mark))
+
+   (gnus-summary-update-article art-no)
+
+(add-hook 'org-capture-mode-hook 'gnorb-gnus-after-capture-function)
 
 (defvar org-note-abort)
 



[elpa] master 335dd95 5/5: Gnorb: Try harder to find the nngnorb server

2017-12-04 Thread Eric Abrahamsen
branch: master
commit 335dd956d23eb6e981d76804564f94be33624823
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Gnorb: Try harder to find the nngnorb server

* packages/gnorb/gnorb-gnus.el (gnorb-gnus-search-messages): Check
  gnus-secondary-select-methods, gnus-server-alist, and
  gnus-server-method-cache.
---
 packages/gnorb/gnorb-gnus.el | 25 +++--
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/packages/gnorb/gnorb-gnus.el b/packages/gnorb/gnorb-gnus.el
index 0750261..dfef37a 100644
--- a/packages/gnorb/gnorb-gnus.el
+++ b/packages/gnorb/gnorb-gnus.el
@@ -731,20 +731,31 @@ reply."
 (defun gnorb-gnus-search-messages (str persist &optional head-text ret)
   "Initiate a search for gnus message links in an org subtree.
 The arg STR can be one of two things: an Org heading id value
-\(IDs should be prefixed with \"id+\"\), in which case links will
+\(IDs should be prefixed with \"id+\"), in which case links will
 be collected from that heading, or a string corresponding to an
 Org tags search, in which case links will be collected from all
 matching headings.
 
 In either case, once a collection of links have been made, they
 will all be displayed in an ephemeral group on the \"nngnorb\"
-server. There must be an active \"nngnorb\" server for this to
-work."
+server.  There must be an active \"nngnorb\" server for this to
+work.
+
+If PERSIST is non-nil, make a permanent group, and offer
+HEAD-TEXT, if present, as its name.  Otherwise create an
+ephemeral one, with RET as the value of its quit-config."
   (interactive)
   (require 'nnir)
   (let* ((nnir-address
  (or (catch 'found
-   (dolist (s gnus-server-method-cache)
+   ;; Try very hard to find the server.
+   (when (assoc 'nngnorb gnus-secondary-select-methods)
+ (throw 'found
+(format
+ "nngnorb:%s"
+ (nth 1 (assoc 'nngnorb
+   gnus-seconard-select-methods)
+   (dolist (s (append gnus-server-alist gnus-server-method-cache))
  (when (eq 'nngnorb (cadr s))
(throw 'found (car s)
  (user-error
@@ -756,8 +767,10 @@ work."
 (concat "gnorb-" str)))
 (method (list 'nnir nnir-address))
 (spec (list
-   (cons 'nnir-specs (list (cons 'nnir-query-spec `((query . 
,str)))
-   (cons 'nnir-group-spec `((,nnir-address 
,(list name))
+   (cons 'nnir-specs (list (cons 'nnir-query-spec
+ `((query . ,str)))
+   (cons 'nnir-group-spec
+ `((,nnir-address ,(list name))
(cons 'nnir-artlist nil
 (if persist
(progn



[elpa] master 8ebb0e1 4/5: Gnorb: Tweaks to gnorb-org-extract-mail-tracking

2017-12-04 Thread Eric Abrahamsen
branch: master
commit 8ebb0e128b143f2ac1366504bd11881c6db5743b
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Gnorb: Tweaks to gnorb-org-extract-mail-tracking

* packages/gnorb/gnorb-org.el (gnorb-org-extract-mail-tracking): Fix
  gratuitious logicking. Pretend I was going to update the docstring,
  anyway.
---
 packages/gnorb/gnorb-org.el | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/packages/gnorb/gnorb-org.el b/packages/gnorb/gnorb-org.el
index 324f646..5c2ee61 100644
--- a/packages/gnorb/gnorb-org.el
+++ b/packages/gnorb/gnorb-org.el
@@ -252,8 +252,17 @@ See the docstring of `gnorb-org-handle-mail' for details."
(user-mail-address
 (string-match-p user-mail-address addr
 
+;; FIXME: Why did I break this off from
+;; `gnorb-org-extract-mail-stuff'?  It's only called from there, and
+;; it's confusing to have them separate.
 (defun gnorb-org-extract-mail-tracking (assoc-msg-ids &optional arg region)
-
+  "Return tracked mail links for the current Org subtree.
+ASSOC-MSG-IDS is a list of message-ids that have already been
+determined to be tracked by the subtree.  Return the most recent
+of these, as a candidate for composing a reply.  If there are no
+tracked messages, or if ARG (a prefix arg from earlier) is
+non-nil, ignore these tracked ids and instead scan the
+subtree (or REGION) for links, and use those instead."
   (let* ((all-links (gnorb-org-extract-links nil region))
 ;; The latest (by the creation-time registry key) of all the
 ;; tracked messages that were not sent by our user.
@@ -264,8 +273,7 @@ See the docstring of `gnorb-org-handle-mail' for details."
  (cl-remove-if-not
   (lambda (m)
 (let ((from (car (gnus-registry-get-id-key m 'sender
-  (or (null from)
-  (null (gnorb-user-address-match-p from)
+  (not (and from (gnorb-user-address-match-p from)
   assoc-msg-ids)
  (lambda (r l)
(time-less-p