[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pdf-tools 2ce06dd3e8 4/5: Address some byte-compiler warni
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pdf-tools 2ce06dd3e8 4/5: Address some byte-compiler warnings |
Date: |
Mon, 3 Oct 2022 05:59:04 -0400 (EDT) |
branch: elpa/pdf-tools
commit 2ce06dd3e8c6eac2bc579c2a73b7bf7f580ad6dc
Author: Vedang Manerikar <ved.manerikar@gmail.com>
Commit: Vedang Manerikar <ved.manerikar@gmail.com>
Address some byte-compiler warnings
* lisp/pdf-annot.el (pdf-annot-run-modified-hooks): Use cl-case
instead of cl-ecase, as the latter does not support t/otherwise
clauses. Remove nil clause which never matches.
See https://bugs.gnu.org/51368.
(pdf-annot-edit-contents-finalize):
* lisp/pdf-sync.el (pdf-sync-minor-mode): Mark up symbols
`like-this', to avoid having the apostrophe interpreted as a closing
single quote. Remove redundant backslashes.
(pdf-sync-synctex-file-name): Use line-beginning-position in place
of point-at-bol, which is deprecated in Emacs 29.
* lisp/pdf-util.el: Autoload list-colors-duplicates before its use
in pdf-util-color-completions, as facemenu is not preloaded since
Emacs 28.
(pdf-util-hexcolor): Use ash in place of lsh, which is deprecated in
Emacs 29.
(pdf-util-convert): Fix docstring markup and indentation.
* lisp/pdf-virtual.el (pdf-virtual-define-adapter): Refill generated
docstring to avoid exceeding 80 column warning threshold.
Relates to: #26
Relates to: #80
Closes: #150
---
lisp/pdf-sync.el | 12 ++++++------
lisp/pdf-util.el | 20 +++++++++++---------
lisp/pdf-virtual.el | 4 ++--
3 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/lisp/pdf-sync.el b/lisp/pdf-sync.el
index c5deebfe3e..cfbc2a3bc1 100644
--- a/lisp/pdf-sync.el
+++ b/lisp/pdf-sync.el
@@ -113,14 +113,14 @@ position in the original tex file."
\\<pdf-sync-minor-mode-map>
This works via SyncTeX, which means the TeX sources need to have
been compiled with `--synctex=1'. In AUCTeX this can be done by
-setting `TeX-source-correlate-method' to 'synctex \(before AUCTeX
-is loaded\) and enabling `TeX-source-correlate-mode'.
+setting `TeX-source-correlate-method' to `synctex' (before AUCTeX
+is loaded) and enabling `TeX-source-correlate-mode'.
-Then \\[pdf-sync-backward-search-mouse] in the PDF buffer will open the
-corresponding TeX location.
+Then \\[pdf-sync-backward-search-mouse] in the PDF buffer will
+open the corresponding TeX location.
If AUCTeX is your preferred tex-mode, this library arranges to
-bind `pdf-sync-forward-display-pdf-key' \(the default is `C-c C-g'\)
+bind `pdf-sync-forward-display-pdf-key' (the default is `C-c C-g')
to `pdf-sync-forward-search' in `TeX-source-correlate-map'. This
function displays the PDF page corresponding to the current
position in the TeX buffer. This function only works together
@@ -758,7 +758,7 @@ The first such filename is returned, or nil if none was
found."
(let ((syncname (match-string-no-properties 1)))
(when (and (file-exists-p syncname)
(file-equal-p filename syncname))
- (goto-char (point-at-bol))
+ (goto-char (line-beginning-position))
(throw 'found syncname))))
(setq end beg
beg (point-min))
diff --git a/lisp/pdf-util.el b/lisp/pdf-util.el
index 09788a2099..cfc77d3954 100644
--- a/lisp/pdf-util.el
+++ b/lisp/pdf-util.el
@@ -648,7 +648,7 @@ Signal an error, if color is invalid."
(unless values
(signal 'wrong-type-argument (list 'color-defined-p color)))
(apply #'format "#%02x%02x%02x"
- (mapcar (lambda (c) (lsh c -8))
+ (mapcar (lambda (c) (ash c -8))
values)))))
(defun pdf-util-highlight-regexp-in-string (regexp string &optional face)
@@ -669,6 +669,8 @@ string."
'face (or face 'match))))
(buffer-string)))
+(autoload 'list-colors-duplicates "facemenu")
+
(defun pdf-util-color-completions ()
"Return a fontified list of defined colors."
(let ((color-list (list-colors-duplicates))
@@ -1059,14 +1061,14 @@ replacement string.
IN-FILE coordinates. Each such rectangle triggers one execution
of the last commands given earlier in SPEC. E.g. a call like
-\(pdf-util-convert
- image-file out-file
- :foreground \"black\"
- :background \"white\"
- :commands '(\"-fill\" \"%f\" \"-draw\" \"rectangle %x,%y,%X,%Y\")
- :apply '((0 0 10 10) (10 10 20 20))
- :commands '(\"-fill\" \"%b\" \"-draw\" \"rectangle %x,%y,%X,%Y\")
- :apply '((10 0 20 10) (0 10 10 20)))
+ (pdf-util-convert
+ image-file out-file
+ :foreground \"black\"
+ :background \"white\"
+ :commands \\='(\"-fill\" \"%f\" \"-draw\" \"rectangle %x,%y,%X,%Y\")
+ :apply \\='((0 0 10 10) (10 10 20 20))
+ :commands \\='(\"-fill\" \"%b\" \"-draw\" \"rectangle %x,%y,%X,%Y\")
+ :apply \\='((10 0 20 10) (0 10 10 20)))
would draw a 4x4 checkerboard pattern in the left corner of the
image, while leaving the rest of it as it was.
diff --git a/lisp/pdf-virtual.el b/lisp/pdf-virtual.el
index 613a966db0..575f62229e 100644
--- a/lisp/pdf-virtual.el
+++ b/lisp/pdf-virtual.el
@@ -735,8 +735,8 @@ PAGE should be a page-number."
(defun ,fn ,(cons base-fn-arg arglist)
,(format "%sPDF virtual adapter to `%s'.
-This function delegates to `%s', unless the FILE-OR-BUFFER
-argument denotes a VPDF document."
+This function delegates to `%s',
+unless the FILE-OR-BUFFER argument denotes a VPDF document."
(if doc (concat doc "\n\n") "")
base-fn
base-fn)