emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnorb b0fe9ae 306/449: New command `gnorb-gnus-quick-re


From: Stefan Monnier
Subject: [elpa] externals/gnorb b0fe9ae 306/449: New command `gnorb-gnus-quick-reply'
Date: Fri, 27 Nov 2020 23:16:00 -0500 (EST)

branch: externals/gnorb
commit b0fe9ae4f5c7e6df654ede035d7d00c05c2499df
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    New command `gnorb-gnus-quick-reply'
    
    * gnorb-gnus.el (gnorb-gnus-quick-reply): New command for quick replies.
    * gnorb.info: Document same.
    * gnorb.org: Ibid
    * gnorb.texi: Ditto
---
 gnorb-gnus.el | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 gnorb.info    | 47 +++++++++++++++++++++++++++--------------------
 gnorb.org     |  7 +++++++
 gnorb.texi    |  9 ++++++++-
 4 files changed, 89 insertions(+), 21 deletions(-)

diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index 87087ab..b0d879c 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -589,6 +589,53 @@ you'll stay in the Gnus summary buffer."
       (signal (car err) (cdr err))))))
 
 ;;;###autoload
+(defun gnorb-gnus-quick-reply ()
+  "Compose a reply to the message under point, and associate both
+the original message and the reply with the selected heading.
+Take no other action.
+
+Use this when you want to compose a reply to a message on the
+spot, and track both messages, without having to go through the
+hassle of triggering an action on a heading, and then starting a
+reply."
+  (interactive)
+  (when (not (memq major-mode '(gnus-summary-mode gnus-article-mode)))
+    (user-error "Only works in gnus summary or article mode"))
+  (let* ((art-no (gnus-summary-article-number))
+        (headers (gnus-data-header
+                  (gnus-data-find art-no)))
+        (msg-id (mail-header-id headers))
+        (from (mail-header-from headers))
+        (subject (mail-header-subject headers))
+        (group (gnorb-get-real-group-name
+                gnus-newsgroup-name
+                art-no))
+        (ref-msg-ids (concat (mail-header-references headers) " "
+                             msg-id))
+        (related-headings
+         (when ref-msg-ids
+           (gnorb-find-tracked-headings headers t)))
+        (targ (car-safe related-headings)))
+    (if targ
+       (let ((ret (point-marker)))
+         ;; Assume the first heading is the one we want.
+         (gnorb-registry-make-entry
+          msg-id from subject targ group)
+         (gnus-summary-wide-reply-with-original 1)
+         (save-restriction
+           (widen)
+           (message-narrow-to-headers-or-head)
+           (goto-char (point-min))
+           (open-line 1)
+           (message-insert-header
+            (intern gnorb-mail-header) targ))
+         (goto-char ret)
+         (message
+          (format "Original message and reply will be associated with %s"
+                  (gnorb-pretty-outline targ))))
+      (message "No associated headings found"))))
+
+;;;###autoload
 (defun gnorb-gnus-search-messages (str &optional 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
diff --git a/gnorb.info b/gnorb.info
index 3de5a28..3d5141f 100644
--- a/gnorb.info
+++ b/gnorb.info
@@ -220,6 +220,13 @@ called in different modes, it can make sense to give each 
of them the
 same keybinding in the keymaps for Org mode, Gnus summary mode, and
 Message mode, respectively.
 
+   An additional convenience command is available for use in Gnus
+summary buffers: ‘gnorb-gnus-quick-reply’.  If you don’t want to go
+through the whole round trip of triggering an action and then starting a
+new reply, call this command on an incoming message to associate it with
+a heading, start a reply, and associate your reply with the same
+heading.
+
 
 File: gnorb.info,  Node: Trigger Actions,  Next: Viewing Tracked Messages in 
*Summary* Buffers,  Prev: Email-Related Commands,  Up: Email Tracking
 
@@ -698,26 +705,26 @@ Node: Installation2118
 Node: Setup2532
 Node: Email Tracking3899
 Node: Email-Related Commands5430
-Node: Trigger Actions8440
-Node: Viewing Tracked Messages in *Summary* Buffers9289
-Node: Hinting in Gnus10523
-Node: Message Attachments11531
-Node: Likely Workflow12713
-Node: Restoring Window Layout15518
-Node: Recent Mails From BBDB Contacts15882
-Node: BBDB posting styles16878
-Node: BBDB Org tagging17794
-Node: Misc BBDB18540
-Node: Searching for messages from BBDB contacts18753
-Node: Citing BBDB contacts19199
-Node: User Options19520
-Node: Misc Org21059
-Node: Inserting BBDB links21234
-Node: User Optionsx21489
-Node: Misc Gnus24226
-Node: Viewing Org headlines relevant to a message24439
-Node: User Optionsxx24754
-Node: Suggested Keybindings27518
+Node: Trigger Actions8801
+Node: Viewing Tracked Messages in *Summary* Buffers9650
+Node: Hinting in Gnus10884
+Node: Message Attachments11892
+Node: Likely Workflow13074
+Node: Restoring Window Layout15879
+Node: Recent Mails From BBDB Contacts16243
+Node: BBDB posting styles17239
+Node: BBDB Org tagging18155
+Node: Misc BBDB18901
+Node: Searching for messages from BBDB contacts19114
+Node: Citing BBDB contacts19560
+Node: User Options19881
+Node: Misc Org21420
+Node: Inserting BBDB links21595
+Node: User Optionsx21850
+Node: Misc Gnus24587
+Node: Viewing Org headlines relevant to a message24800
+Node: User Optionsxx25115
+Node: Suggested Keybindings27879
 
 End Tag Table
 
diff --git a/gnorb.org b/gnorb.org
index dc3028a..da0f101 100644
--- a/gnorb.org
+++ b/gnorb.org
@@ -135,6 +135,13 @@ Because these three commands all express a similar intent, 
but are
 called in different modes, it can make sense to give each of them the
 same keybinding in the keymaps for Org mode, Gnus summary mode, and
 Message mode, respectively.
+
+An additional convenience command is available for use in Gnus summary
+buffers: `gnorb-gnus-quick-reply'. If you don't want to go through the
+whole round trip of triggering an action and then starting a new
+reply, call this command on an incoming message to associate it with a
+heading, start a reply, and associate your reply with the same
+heading.
 ** Trigger Actions
 After calling `gnorb-gnus-incoming-do-todo' on a message, or after
 sending a message associated with an Org heading, you'll be taken to
diff --git a/gnorb.texi b/gnorb.texi
index b2b8d47..675af08 100644
--- a/gnorb.texi
+++ b/gnorb.texi
@@ -235,6 +235,13 @@ called in different modes, it can make sense to give each 
of them the
 same keybinding in the keymaps for Org mode, Gnus summary mode, and
 Message mode, respectively.
 
+An additional convenience command is available for use in Gnus summary
+buffers: `gnorb-gnus-quick-reply'. If you don't want to go through the
+whole round trip of triggering an action and then starting a new
+reply, call this command on an incoming message to associate it with a
+heading, start a reply, and associate your reply with the same
+heading.
+
 @node Trigger Actions
 @section Trigger Actions
 
@@ -673,5 +680,5 @@ line. Defaults to ``¡''.
      (define-key message-mode-map (kbd "C-c t") 'gnorb-gnus-outgoing-do-todo)))
 @end lisp
 
-@c Emacs 25.0.50.6 (Org mode 8.3beta)
+@c Emacs 25.0.50.7 (Org mode 8.3beta)
 @bye
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]