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

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

[elpa] externals/gnorb ac97c90 118/449: Let gnorb-org-view work in the A


From: Stefan Monnier
Subject: [elpa] externals/gnorb ac97c90 118/449: Let gnorb-org-view work in the Agenda as well
Date: Fri, 27 Nov 2020 23:15:21 -0500 (EST)

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

    Let gnorb-org-view work in the Agenda as well
    
    lisp/gnorb-org.el Function `gnorb-org-view' should work in the agenda.
                  Also, we wanted to use `org-reveal', not `widen'
---
 lisp/gnorb-org.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lisp/gnorb-org.el b/lisp/gnorb-org.el
index d1463d2..82a4ffa 100644
--- a/lisp/gnorb-org.el
+++ b/lisp/gnorb-org.el
@@ -821,8 +821,19 @@ then show them in an ephemeral group, in gnus.
 
 This won't work unless you've added a \"nngnorb\" server to
 your gnus select methods."
+  ;; this should also work on the active region, if there is one.
   (interactive)
   (setq gnorb-org-window-conf (current-window-configuration))
+  (when (eq major-mode 'org-agenda-mode)
+    (org-agenda-check-type t 'agenda 'timeline 'todo 'tags)
+    (org-agenda-check-no-diary)
+    (let* ((marker (or (org-get-at-bol 'org-hd-marker)
+                      (org-agenda-error)))
+          (buffer (marker-buffer marker))
+          (pos (marker-position marker)))
+      (switch-to-buffer buffer)
+      (goto-char pos)
+      (org-reveal)))
   (let (id)
     (save-excursion
       (org-back-to-heading)



reply via email to

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