Skip to content

Commit

Permalink
Display a header line when editing annotation contents
Browse files Browse the repository at this point in the history
  • Loading branch information
astoff authored and vedang committed Jun 10, 2023
1 parent 5b58c6b commit 154e31d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lisp/pdf-annot.el
Original file line number Diff line number Diff line change
Expand Up @@ -1453,9 +1453,9 @@ annotation's contents and otherwise `org-mode'."
"Active when editing the contents of annotations."
:group 'pdf-annot
(when pdf-annot-edit-contents-minor-mode
(message "%s"
(substitute-command-keys
"Press \\[pdf-annot-edit-contents-commit] to commit your changes, \\[pdf-annot-edit-contents-abort] to abandon them."))))
(setq-local header-line-format
(substitute-command-keys "\
Press \\[pdf-annot-edit-contents-commit] to commit your changes, \\[pdf-annot-edit-contents-abort] to abandon them."))))

(put 'pdf-annot-edit-contents-minor-mode 'permanent-local t)

Expand Down Expand Up @@ -1510,18 +1510,16 @@ At any given point of time, only one annotation can be in edit mode."
(pdf-annot-edit-contents-finalize 'ask)))
(unless (buffer-live-p pdf-annot-edit-contents--buffer)
(setq pdf-annot-edit-contents--buffer
(with-current-buffer (get-buffer-create
(format "*Edit Annotation %s*"
(buffer-name)))
(pdf-annot-edit-contents-minor-mode 1)
(current-buffer))))
(get-buffer-create
(format "*Edit Annotation %s*" (buffer-name)))))
(with-current-buffer pdf-annot-edit-contents--buffer
(let ((inhibit-read-only t))
(erase-buffer)
(save-excursion (insert (pdf-annot-get a 'contents)))
(set-buffer-modified-p nil))
(setq pdf-annot-edit-contents--annotation a)
(funcall pdf-annot-edit-contents-setup-function a)
(pdf-annot-edit-contents-minor-mode 1)
(current-buffer))))

(defun pdf-annot-edit-contents (a)
Expand Down

0 comments on commit 154e31d

Please sign in to comment.