summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan Hall <51188582+aidan-hall@users.noreply.github.com>2025-12-28 16:59:59 +0000
committerGitHub <noreply@github.com>2025-12-28 22:29:59 +0530
commit1266dd817965c6060b2f7cb70d6ef094d3f057d5 (patch)
tree1ce094e0da3ddd0c6b823d249a3075f5f37d6870
parent2fbb16b339e4ca73fccd7c8553f3c001adceab2a (diff)
feat: add pdf-metadata-buffer-mode
This makes the metadata buffer consistent with the annotations and outline buffer in having its own major mode, derived from special-mode. I mainly created this because it bugged me that I couldn't press q to close the metadata buffer.
-rw-r--r--lisp/pdf-misc.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/pdf-misc.el b/lisp/pdf-misc.el
index bcba8ae..229300f 100644
--- a/lisp/pdf-misc.el
+++ b/lisp/pdf-misc.el
@@ -212,6 +212,9 @@
(lookup-key pdf-misc-menu-bar-minor-mode-map
[menu-bar pdf\ tools]))))))
+(define-derived-mode pdf-metadata-buffer-mode special-mode "PDF Metadata"
+ "View and traverse the metadata of a PDF file.")
+
(defun pdf-misc-display-metadata ()
"Display all available metadata in a separate buffer."
(interactive)
@@ -219,6 +222,8 @@
(let* ((buffer (current-buffer))
(md (pdf-info-metadata)))
(with-current-buffer (get-buffer-create "*PDF-Metadata*")
+ (unless (derived-mode-p 'pdf-metadata-buffer-mode)
+ (pdf-metadata-buffer-mode))
(let* ((inhibit-read-only t)
(pad (apply' max (mapcar (lambda (d)
(length (symbol-name (car d))))