update packages

This commit is contained in:
2025-03-11 21:14:26 +01:00
parent 45d49daef0
commit 14dcaaddde
440 changed files with 13229 additions and 8718 deletions

View File

@@ -362,9 +362,12 @@ os_macos() {
PKGARGS=install
PACKAGES="pkg-config poppler autoconf automake"
PKG_INSTALL_AS_ROOT=
# brew installs libffi as keg-only, meaning we need to set
# PKG_CONFIG_PATH manually so configure can find it
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(brew --prefix libffi)/lib/pkgconfig/:$(brew --prefix zlib)/lib/pkgconfig/"
# We need to set PKG_CONFIG_PATH manually so configure can
# find these dependencies. I don't know why (one possible
# explanation has to do with 'keg-only' installs). If you do,
# please update:
# https://github.com/vedang/pdf-tools/issues/270
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(brew --prefix libffi)/lib/pkgconfig/:$(brew --prefix zlib)/lib/pkgconfig/:$(brew --prefix glib)/lib/pkgconfig/"
elif which port >/dev/null 2>&1; then
PKGCMD=port
PKGARGS=install
@@ -408,10 +411,10 @@ os_gentoo() {
PACKAGES="app-text/poppler
dev-util/pkgconf
media-libs/libpng
sys-devel/autoconf
sys-devel/automake
dev-build/autoconf
dev-build/automake
sys-devel/gcc
sys-devel/make
dev-build/make
sys-libs/glibc
sys-libs/zlib"
return 0

View File

@@ -26,11 +26,13 @@
(require 'pdf-info)
(require 'pdf-cache)
(require 'pdf-misc)
(require 'pdf-util)
(require 'facemenu) ;; list-colors-duplicates
(require 'faces) ;; color-values
(require 'org) ;; org-create-formula-image
(require 'tablist)
(require 'cl-lib)
(require 'seq)
;; * ================================================================== *
@@ -1098,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'.
@@ -1135,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))))))))
@@ -1165,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'.
@@ -1185,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
@@ -1238,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: "

View File

@@ -57,7 +57,7 @@ see."
(defun pdf-loader--load (&rest args)
(pdf-loader--uninstall)
(save-selected-window
(pdf-tools-install args)))
(apply #'pdf-tools-install args)))
(defun pdf-loader--install (loader)
(pdf-loader--uninstall)

View File

@@ -88,12 +88,12 @@ Set to nil to disable line wrapping."
(define-key kmap (kbd "p") #'previous-line)
(define-key kmap (kbd "n") #'next-line)
(define-key kmap (kbd "b") #'outline-backward-same-level)
(define-key kmap (kbd "d") #'hide-subtree)
(define-key kmap (kbd "a") #'show-all)
(define-key kmap (kbd "s") #'show-subtree)
(define-key kmap (kbd "d") #'outline-hide-subtree)
(define-key kmap (kbd "a") #'outline-show-all)
(define-key kmap (kbd "s") #'outline-show-subtree)
(define-key kmap (kbd "f") #'outline-forward-same-level)
(define-key kmap (kbd "u") #'pdf-outline-up-heading)
(define-key kmap (kbd "Q") #'hide-sublevels)
(define-key kmap (kbd "Q") #'outline-hide-sublevels)
(define-key kmap (kbd "<") #'beginning-of-buffer)
(define-key kmap (kbd ">") #'pdf-outline-end-of-buffer)
(define-key kmap (kbd "TAB") #'outline-toggle-children)
@@ -175,7 +175,7 @@ rebound to their respective last character.
(setq buffer-read-only t)
(when (> (count-lines 1 (point-max))
(* 1.5 (frame-height)))
(hide-sublevels 1))
(outline-hide-sublevels 1))
(message "%s"
(substitute-command-keys
(concat
@@ -405,8 +405,8 @@ Then quit the outline window."
(save-excursion
(outline-back-to-heading)
(if (not (outline-invisible-p (line-end-position)))
(hide-subtree)
(show-subtree))))
(outline-hide-subtree)
(outline-show-subtree))))
(defun pdf-outline-move-to-page (page)
"Move to an outline item corresponding to PAGE."

View File

@@ -1,8 +1,8 @@
(define-package "pdf-tools" "20230611.239" "Support library for PDF documents"
(define-package "pdf-tools" "20240429.407" "Support library for PDF documents"
'((emacs "26.3")
(tablist "1.0")
(let-alist "1.0.4"))
:commit "c69e7656a4678fe25afbd29f3503dd19ee7f9896" :authors
:commit "30b50544e55b8dbf683c2d932d5c33ac73323a16" :authors
'(("Andreas Politz" . "mail@andreas-politz.de"))
:maintainers
'(("Vedang Manerikar" . "vedang.manerikar@gmail.com"))

View File

@@ -212,11 +212,13 @@ PDF buffers."
(defcustom pdf-tools-installer-os nil
"Specifies which installer to use.
If nil the installer is chosen automatically. This variable is
If nil, the installer is chosen automatically. This variable is
useful if you have multiple installers present on your
system (e.g. nix on arch linux)"
:group 'pdf-tools
:type 'string)
:type '(choice
(const :tag "Choose automatically" nil)
string))
(defun pdf-tools-identify-build-directory (directory)
"Return non-nil, if DIRECTORY appears to contain the epdfinfo source.

View File

@@ -607,12 +607,18 @@ string."
;; requires us :-(
(defvar pdf-view-midnight-colors)
(when (and (> emacs-major-version 28)
(not (boundp 'x-gtk-use-system-tooltips)))
;; The x-gtk prefix has been dropped Emacs 29
(defvaralias 'x-gtk-use-system-tooltips 'use-system-tooltips))
(defun pdf-util-tooltip-arrow (image-top &optional timeout)
(pdf-util-assert-pdf-window)
(when (floatp image-top)
(setq image-top
(round (* image-top (cdr (pdf-view-image-size))))))
(let* (x-gtk-use-system-tooltips ;allow for display property in tooltip
(let* ((x-gtk-use-system-tooltips nil)
;; ^ allow for display text property in tooltip
(dx (+ (or (car (window-margins)) 0)
(car (window-fringes))))
(dy image-top)
@@ -901,21 +907,23 @@ frame's PPI is larger than 180. Otherwise, return 1."
(executable-find "convert"))
"Absolute path to the convert program."
:group 'pdf-tools
:type 'executable)
:type '(choice (const :tag "Unset" nil) file))
(defcustom pdf-util-fast-image-format nil
"An image format appropriate for fast displaying.
This should be a cons \(TYPE . EXT\) where type is the Emacs
image-type and EXT the appropriate file extension starting with a
dot. If nil, the value is determined automatically.
This should be a cons (TYPE . EXT) where type is the Emacs
`image-type' and EXT the appropriate file extension starting with
a dot. If nil, the value is determined automatically.
Different formats have different properties, with respect to
Emacs loading time, convert creation time and the file-size. In
general, uncompressed formats are faster, but may need a fair
amount of (temporary) disk space."
:group 'pdf-tools
:type '(cons symbol string))
:type '(choice
(const :tag "Determine automatically" nil)
(cons symbol string)))
(defun pdf-util-assert-convert-program ()
(unless (and pdf-util-convert-program

View File

@@ -466,20 +466,32 @@ PNG images in Emacs buffers."
"Read a password, if the document is encrypted and open it."
(interactive)
(when (pdf-info-encrypted-p)
(let ((prompt (format "Enter password for `%s': "
(abbreviate-file-name
(buffer-file-name))))
(key (concat "/pdf-tools" (buffer-file-name)))
(let ((fn (buffer-file-name))
(prompt "Enter password for pdf document: ")
(i 3)
password)
key password)
(when fn
(setq prompt (format "Enter password for `%s': "
(abbreviate-file-name fn)))
(setq key (concat "/pdf-tools" fn))
;; First, try with a cached password
(when (setq password (password-read-from-cache key))
(ignore-errors (pdf-info-open nil password))
(when (pdf-info-encrypted-p)
(password-cache-remove key))))
(while (and (> i 0)
(pdf-info-encrypted-p))
(setq i (1- i))
(setq password (password-read prompt key))
;; Cached password was not present or valid, try reading a new password
;; without cache.
(setq password (password-read prompt))
(setq prompt "Invalid password, try again: ")
(ignore-errors (pdf-info-open nil password)))
(pdf-info-open nil password)
(password-cache-add key password)))
(when key
(password-cache-add key password))))
nil)
(defun pdf-view-buffer-file-name ()
@@ -541,6 +553,7 @@ Optional parameters IGNORE-AUTO and NOCONFIRM are defined as in
after-revert-hook)))
(prog1
(revert-buffer ignore-auto noconfirm 'preserve-modes)
(pdf-view-decrypt-document)
(pdf-view-redisplay t))))
(defun pdf-view-close-document ()
@@ -812,7 +825,7 @@ at the bottom edge of the page moves to the next page."
(image-bob)
(image-bol 1))
(image-set-window-hscroll hscroll)))
(image-next-line 1)))
(image-next-line arg)))
(defun pdf-view-previous-line-or-previous-page (&optional arg)
"Scroll downward by ARG lines if possible, else go to the previous page.