[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pdf-tools 70865fb38d 8/8: Fix: Keep cursor on the same lin
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pdf-tools 70865fb38d 8/8: Fix: Keep cursor on the same line when reopening list of annots |
Date: |
Sat, 10 Jun 2023 16:02:07 -0400 (EDT) |
branch: elpa/pdf-tools
commit 70865fb38ddf97023e7d23a7cc8ff22b13b643b0
Author: Pedro Ribeiro Mendes JĂșnior <pedrormjunior@gmail.com>
Commit: Vedang Manerikar <ved.manerikar@gmail.com>
Fix: Keep cursor on the same line when reopening list of annots
Check if the buffer of the list of annotations already exists. In that
case, avoid calling `tabulated-list-print` because the call to that
function makes the cursor move to the beginning of the buffer.
Tested for:
- the buffer of the list of annotations already exists;
- a new note is created;
- that buffer is reopened with the cursor on the same position as
previous left;
and the newly inserted note appears as expected.
Closes: #211
---
lisp/pdf-annot.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/lisp/pdf-annot.el b/lisp/pdf-annot.el
index 078f132cad..344a5c0d27 100644
--- a/lisp/pdf-annot.el
+++ b/lisp/pdf-annot.el
@@ -1722,16 +1722,19 @@ pretty-printed output."
\\{pdf-annot-list-mode-map}"
(interactive)
(pdf-util-assert-pdf-buffer)
- (let ((buffer (current-buffer)))
- (with-current-buffer (get-buffer-create
- (format "*%s's annots*"
- (file-name-sans-extension
- (buffer-name))))
+ (let* ((buffer (current-buffer))
+ (name (format "*%s's annots*"
+ (file-name-sans-extension
+ (buffer-name))))
+ (annots-existed (and (get-buffer name)
+ pdf-annot-list-buffer)))
+ (with-current-buffer (get-buffer-create name)
(delay-mode-hooks
(unless (derived-mode-p 'pdf-annot-list-mode)
(pdf-annot-list-mode))
(setq pdf-annot-list-document-buffer buffer)
- (tabulated-list-print)
+ (unless annots-existed
+ (tabulated-list-print))
(setq tablist-context-window-function
(lambda (id) (pdf-annot-list-context-function id buffer))
tablist-operations-function #'pdf-annot-list-operation-function)
- [nongnu] elpa/pdf-tools updated (a9c9a12c3e -> 70865fb38d), ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 70865fb38d 8/8: Fix: Keep cursor on the same line when reopening list of annots,
ELPA Syncer <=
- [nongnu] elpa/pdf-tools fb6616c15e 2/8: Add an FAQ on re-compiling epdfinfo, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools c451c0e3db 1/8: Auto enable pdf-view-dark-minor-mode if the theme is dark, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 154e31dc3c 4/8: Display a header line when editing annotation contents, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 0822f438de 7/8: Update NEWS with recent contributions, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 5b58c6bcc3 3/8: Add command and submenu to switch between selection styles, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 6a86b29140 5/8: Use 'C-c C-k' to abandon edits of annotation contents, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 97cffdd1b2 6/8: Allow creation of markup annotations without a text selection, ELPA Syncer, 2023/06/10