update packages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
;;; org-annotate-file.el --- Annotate a file with org syntax
|
||||
;;; org-annotate-file.el --- Annotate a file with org syntax -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2008-2014, 2021 Philip Jackson
|
||||
|
||||
@@ -111,7 +111,11 @@ The annotation will link to ANNOTATED-BUFFER if specified,
|
||||
otherwise the current buffer is used."
|
||||
(let ((filename (abbreviate-file-name (or annotated-buffer
|
||||
(buffer-file-name))))
|
||||
(line (buffer-substring-no-properties (point-at-bol) (point-at-eol)))
|
||||
(line
|
||||
(let ((inhibit-field-text-motion t))
|
||||
(buffer-substring-no-properties
|
||||
(line-beginning-position)
|
||||
(line-end-position))))
|
||||
(annotation-buffer (find-file-noselect storage-file)))
|
||||
(with-current-buffer annotation-buffer
|
||||
(org-annotate-file-annotate filename line))
|
||||
@@ -119,8 +123,8 @@ The annotation will link to ANNOTATED-BUFFER if specified,
|
||||
|
||||
(defun org-annotate-file-annotate (filename line)
|
||||
"Add annotation for FILENAME at LINE using current buffer."
|
||||
(let* ((link (org-make-link-string (concat "file:" filename) filename))
|
||||
(search-link (org-make-link-string
|
||||
(let* ((link (org-link-make-string (concat "file:" filename) filename))
|
||||
(search-link (org-link-make-string
|
||||
(concat "file:" filename "::" line)
|
||||
(org-annotate-file-ellipsify-desc line))))
|
||||
(unless (eq major-mode 'org-mode)
|
||||
@@ -128,7 +132,9 @@ The annotation will link to ANNOTATED-BUFFER if specified,
|
||||
(goto-char (point-min))
|
||||
(widen)
|
||||
(when org-annotate-file-always-open
|
||||
(show-all))
|
||||
(if (fboundp 'org-fold-show-all)
|
||||
(org-fold-show-all)
|
||||
(with-no-warnings (org-show-all))))
|
||||
(unless (search-forward-regexp
|
||||
(concat "^* " (regexp-quote link)) nil t)
|
||||
(org-annotate-file-add-upper-level link))
|
||||
@@ -148,7 +154,7 @@ The annotation will link to ANNOTATED-BUFFER if specified,
|
||||
|
||||
(defun org-annotate-file-add-second-level (link)
|
||||
"Add and link subheading to LINK."
|
||||
(goto-char (point-at-eol))
|
||||
(forward-line 0)
|
||||
(call-interactively 'org-insert-subheading)
|
||||
(insert link))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user