summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVedang Manerikar <ved.manerikar@gmail.com>2024-04-03 19:46:42 +0530
committerVedang Manerikar <ved.manerikar@gmail.com>2024-04-03 20:08:32 +0530
commitaee2f6d6413c3ed510baa5beeacb122a1ef406f7 (patch)
treecc2c9eca43167db63708042b5edbff4bad75c96e
parentf9ab15ee19f42f742a88b979a0fe6d097449645a (diff)
[pdf-annot] Fix: remove obsolete annotation-properties variables
Replace `pdf-annot-default-markup-annotation-properties` and `pdf-annot-default-text-annotation-properties` with the newer `pdf-annot-default-annotation-properties`, and remove their use in `pdf-annot-merge-alists`. As a side-effect, this fixes broken functionality when providing defaults for reading colors. Closes: #268
-rw-r--r--lisp/pdf-annot.el17
1 files changed, 7 insertions, 10 deletions
diff --git a/lisp/pdf-annot.el b/lisp/pdf-annot.el
index a5e36e6..7c63dd2 100644
--- a/lisp/pdf-annot.el
+++ b/lisp/pdf-annot.el
@@ -32,6 +32,7 @@
(require 'org) ;; org-create-formula-image
(require 'tablist)
(require 'cl-lib)
+(require 'seq)
;; * ================================================================== *
@@ -1099,7 +1100,7 @@ Adjust X and Y accordingly, if the position would render the
annotation off-page.
Merge ICON as a icon property with PROPERTY-ALIST and
-`pdf-annot-default-text-annotation-properties' and apply the
+`pdf-annot-default-annotation-properties' and apply the
result to the created annotation.
See also `pdf-annot-add-annotation'.
@@ -1136,7 +1137,6 @@ Return the new annotation."
(pdf-annot-merge-alists
(and icon `((icon . ,icon)))
property-alist
- pdf-annot-default-text-annotation-properties
(cdr (assq 'text pdf-annot-default-annotation-properties))
(cdr (assq t pdf-annot-default-annotation-properties))
`((color . ,(car pdf-annot-color-history))))))))
@@ -1166,7 +1166,7 @@ TYPE should be one of `squiggly', `underline', `strike-out' or
`highlight'.
Merge COLOR as a color property with PROPERTY-ALIST and
-`pdf-annot-default-markup-annotation-properties' and apply the
+`pdf-annot-default-annotation-properties' and apply the
result to the created annotation.
See also `pdf-annot-add-annotation'.
@@ -1186,7 +1186,6 @@ Return the new annotation."
(pdf-annot-merge-alists
(and color `((color . ,color)))
property-alist
- pdf-annot-default-markup-annotation-properties
(cdr (assq type pdf-annot-default-annotation-properties))
(cdr (assq t pdf-annot-default-annotation-properties))
(when pdf-annot-color-history
@@ -1239,12 +1238,10 @@ properties. See also `pdf-annot-add-markup-annotation'."
Offer `pdf-annot-color-history' as default values."
(let* ((defaults (append
- (delq nil
- (list
- (cdr (assq 'color
- pdf-annot-default-markup-annotation-properties))
- (cdr (assq 'color
- pdf-annot-default-text-annotation-properties))))
+ (seq-map #'cdr
+ (seq-filter (lambda (x) (eq 'color (car x)))
+ (seq-mapcat #'cdr
+ pdf-annot-default-annotation-properties)))
pdf-annot-color-history))
(prompt
(format "%s%s: "