From 5eabbf22bdd4523c922a30787e98ee66c24221aa Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 17 Sep 2023 13:20:41 +0300 Subject: [PATCH] * lisp/org-annotate-file.el: Fix compiler warnings (org-annotate-file-show-section): Do not use obsolete `point-at-bol' and `point-at-eol'. (org-annotate-file-annotate): Do no use obsolete function name. (org-annotate-file-add-second-level): Use `forward-line' instead of `point-at-eol'. --- lisp/org-annotate-file.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/org-annotate-file.el b/lisp/org-annotate-file.el index f932cac..24567d5 100644 --- a/lisp/org-annotate-file.el +++ b/lisp/org-annotate-file.el @@ -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,7 @@ The annotation will link to ANNOTATED-BUFFER if specified, (goto-char (point-min)) (widen) (when org-annotate-file-always-open - (show-all)) + (org-show-all)) (unless (search-forward-regexp (concat "^* " (regexp-quote link)) nil t) (org-annotate-file-add-upper-level link)) @@ -148,7 +152,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)) -- 2.45.2