update packages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
;;; org-registry.el --- a registry for Org links
|
||||
;;; org-registry.el --- a registry for Org links -*- lexical-binding: t; -*-
|
||||
;;
|
||||
;; Copyright 2007-2021 Free Software Foundation, Inc.
|
||||
;;
|
||||
@@ -64,7 +64,9 @@
|
||||
;;; Code:
|
||||
|
||||
(eval-when-compile
|
||||
(require 'cl))
|
||||
(require 'cl-lib))
|
||||
(require 'org-agenda)
|
||||
(require 'ol)
|
||||
|
||||
(defgroup org-registry nil
|
||||
"A registry for Org."
|
||||
@@ -90,11 +92,12 @@
|
||||
buffer."
|
||||
(interactive "P")
|
||||
(org-registry-initialize)
|
||||
(let* ((blink (or (org-remember-annotation) ""))
|
||||
(link (when (string-match org-bracket-link-regexp blink)
|
||||
(let* ((blink (or (org-store-link nil) ""))
|
||||
(link (when (string-match org-link-bracket-re blink)
|
||||
(match-string-no-properties 1 blink)))
|
||||
(desc (or (and (string-match org-bracket-link-regexp blink)
|
||||
(match-string-no-properties 3 blink)) "No description"))
|
||||
;; FIXME: unused
|
||||
;; (desc (or (and (string-match org-link-bracket-re blink)
|
||||
;; (match-string-no-properties 3 blink)) "No description"))
|
||||
(files (org-registry-assoc-all link))
|
||||
file point selection tmphist)
|
||||
(cond ((and files visit)
|
||||
@@ -119,7 +122,9 @@ buffer."
|
||||
(funcall org-registry-find-file file)
|
||||
(goto-char point)
|
||||
(unless (org-before-first-heading-p)
|
||||
(org-show-context)))
|
||||
(if (fboundp 'org-fold-show-context)
|
||||
(org-fold-show-context)
|
||||
(with-no-warnings (org-show-context)))))
|
||||
((and files (not visit))
|
||||
;; result(s) to display
|
||||
(cond ((eq 1 (length files))
|
||||
@@ -198,21 +203,21 @@ Use with caution. This could slow down things a bit."
|
||||
|
||||
(defun org-registry-get-entries (file)
|
||||
"List Org links in FILE that will be put in the registry."
|
||||
(let (bufstr result)
|
||||
(let (result)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward org-angle-link-re nil t)
|
||||
(while (re-search-forward org-link-angle-re nil t)
|
||||
(let* ((point (match-beginning 0))
|
||||
(link (match-string-no-properties 0))
|
||||
(desc (match-string-no-properties 0)))
|
||||
(add-to-list 'result (list link desc point file))))
|
||||
(push (list link desc point file) result)))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward org-bracket-link-regexp nil t)
|
||||
(while (re-search-forward org-link-bracket-re nil t)
|
||||
(let* ((point (match-beginning 0))
|
||||
(link (match-string-no-properties 1))
|
||||
(desc (or (match-string-no-properties 3) "No description")))
|
||||
(add-to-list 'result (list link desc point file)))))
|
||||
(push (list link desc point file) result))))
|
||||
;; return the list of new entries
|
||||
result))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user