Procházet zdrojové kódy

Allow to show backlinks directly from Org agenda buffers

This is more convenient than to first switch to the item in the corrsponding Org
mode buffer and then querying for its backlinks.
master
Daniel před 3 měsíci
rodič
revize
96638b09e4
V databázi nebyl nalezen žádný známý klíč pro tento podpis
1 změnil soubory, kde provedl 13 přidání a 6 odebrání
  1. 13
    6
      site-lisp/db-org.el

+ 13
- 6
site-lisp/db-org.el Zobrazit soubor

@@ -704,14 +704,21 @@ linking to any item."
704 704
   "Find links to current item.
705 705
 Only links using the ID or CUSTOM_ID property are considered.
706 706
 
707
-If ARG is given, or if not in an Org Mode buffer, interactively
708
-prompt for an item."
707
+If ARG is given, or if neither in an Org Mode buffer nor on a
708
+headline in an Org Agenda buffer, interactively prompt for an
709
+item."
709 710
   (interactive "P")
710 711
   (apply #'db/org-find-items-linking-by-id
711
-         (if (and (derived-mode-p 'org-mode) (not arg))
712
-             (list (org-id-get) (org-entry-get nil "CUSTOM_ID"))
713
-           (org-with-point-at (db/org--get-location)
714
-             (list (org-id-get) (org-entry-get nil "CUSTOM_ID"))))))
712
+         (cond ((and (not arg) (derived-mode-p 'org-mode))
713
+                (list (org-id-get) (org-entry-get nil "CUSTOM_ID")))
714
+               ((and (not arg)
715
+                     (derived-mode-p 'org-agenda-mode)
716
+                     (org-get-at-bol 'org-hd-marker))
717
+                (org-with-point-at (org-get-at-bol 'org-hd-marker)
718
+                  (list (org-id-get) (org-entry-get nil "CUSTOM_ID"))))
719
+               (t
720
+                (org-with-point-at (db/org--get-location)
721
+                  (list (org-id-get) (org-entry-get nil "CUSTOM_ID")))))))
715 722
 
716 723
 (defun db/org-add-link-to-other-item (arg)
717 724
   "Interactively query for item and add link to it at point.

Načítá se…
Zrušit
Uložit