[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 13bb840 302/449: Hint which heading will be trigg
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 13bb840 302/449: Hint which heading will be triggered |
Date: |
Fri, 27 Nov 2020 23:16:00 -0500 (EST) |
branch: externals/gnorb
commit 13bb8401dfab72406e2733987d7ef9344ccea916
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Hint which heading will be triggered
* gnorb-utils.el (gnorb-trigger-todo-action): Rearrange this function so
we can tell the user which heading we're going to trigger an action
on.
In fact, this change is by way of a bit of debugging for myself. It's
desirable in itself, but also should help flush out some weirdness with
triggering multiple headings.
---
gnorb-utils.el | 42 ++++++++++++++++++++++++------------------
1 file changed, 24 insertions(+), 18 deletions(-)
diff --git a/gnorb-utils.el b/gnorb-utils.el
index 424e7c5..a4e1471 100644
--- a/gnorb-utils.el
+++ b/gnorb-utils.el
@@ -213,24 +213,30 @@ window."
we were in the agenda when this was called, then keep us in the
agenda. Then let the user choose an action from the value of
`gnorb-org-trigger-actions'."
- (let ((agenda-p (eq major-mode 'org-agenda-mode))
- (action (cdr (assoc
- (org-completing-read
- "Action to take: "
- gnorb-org-trigger-actions nil t)
- gnorb-org-trigger-actions)))
- (root-marker (make-marker)))
- ;; Place the marker for the relevant TODO heading.
- (cond (agenda-p
- (setq root-marker
+ (let* ((agenda-p (eq major-mode 'org-agenda-mode))
+ (root-marker
+ (cond (agenda-p
(copy-marker
- (org-get-at-bol 'org-hd-marker))))
- ((derived-mode-p 'org-mode)
- (move-marker root-marker (point-at-bol)))
- (id
- (save-excursion
- (org-id-goto id)
- (move-marker root-marker (point-at-bol)))))
+ (org-get-at-bol 'org-hd-marker)))
+ ((derived-mode-p 'org-mode)
+ (save-excursion
+ (org-back-to-heading)
+ (point-marker)))
+ (id
+ (save-excursion
+ (org-id-goto id)
+ (org-back-to-heading)
+ (point-marker)))))
+ (id (or id
+ (org-with-point-at root-marker
+ (org-id-get-create))))
+ (action (cdr (assoc
+ (org-completing-read
+ (format
+ "Trigger action on %s: "
+ (gnorb-pretty-outline id))
+ gnorb-org-trigger-actions nil t)
+ gnorb-org-trigger-actions))))
(unless agenda-p
(org-reveal))
;; Query about attaching email attachments. No matter what
@@ -265,7 +271,7 @@ agenda. Then let the user choose an action from the value of
(if agenda-p
(progn
(org-with-point-at root-marker
- (make-entry (org-id-get-create)))
+ (make-entry (org-id-get-create)))
(call-interactively 'org-agenda-todo))
(org-with-point-at root-marker
(make-entry (org-id-get-create))
- [elpa] externals/gnorb 04ec3ab 264/449: Fix logic of choosing heading to trigger, (continued)
- [elpa] externals/gnorb 04ec3ab 264/449: Fix logic of choosing heading to trigger, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb de0dff5 274/449: Protection for message disassociation, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 321b23b 276/449: Remove gnus-interactive, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8a9c167 277/449: Fix the cl-lib loading stuff, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb fd91084 278/449: Remove incorrect "fix" for Gnus 5.13, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c8b80c5 282/449: Bugfix for gnorb-gnus-view, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9220a10 283/449: Docstring fix, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4b19c83 288/449: New function for pruning dead associations, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 819b1e5 293/449: Suggest binding gnorb-org-view in Org Agenda, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c13f4df 301/449: Better check for capture cleanup, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 13bb840 302/449: Hint which heading will be triggered,
Stefan Monnier <=
- [elpa] externals/gnorb 4f99dd7 304/449: Handle conditions where `registry-search' returns nil, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5897188 305/449: Capture to child/sibling is done, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b951675 303/449: Merge capture-to-child branch, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b0fe9ae 306/449: New command `gnorb-gnus-quick-reply', Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ce764a5 307/449: fixup with new quick reply command, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb acb91c5 315/449: Fix doc error, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4d3de61 316/449: Various documentation improvements, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 86fa893 318/449: Fix up all cl-lib calls, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 51439a1 323/449: Look in drawers for potential mail links, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 209b938 324/449: Attach outgoing message check to message-sent-hook, Stefan Monnier, 2020/11/27