mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Skip over possible blank lines returned by kpsewhich
* lisp/ffap.el (ffap-latex-mode): Starting with TeXlive 2025, the kpsewhich utility may return blank lines before the first valid path for `ffap'. The old behavior of `ffap-latex-mode' was to simply return the first line of output from kpsewhich (if the output was nonempty). The fix simply skips all \r and \n chars. (Bug#79397) Copyright-paperwork-exempt: yes
This commit is contained in:
parent
79b7c7b1d3
commit
23a8c06a23
1 changed files with 10 additions and 4 deletions
10
lisp/ffap.el
10
lisp/ffap.el
|
|
@ -1046,8 +1046,14 @@ out of NAME."
|
|||
(mapcar (lambda (rule)
|
||||
(concat (car rule) name (cdr rule)))
|
||||
guess-rules)))
|
||||
(when (< (point-min) (point-max))
|
||||
(buffer-substring (goto-char (point-min)) (line-end-position))))))))
|
||||
;; Starting with TeXlive 2025, kpsewhich returns blank
|
||||
;; lines when multiple filenames are given and a given file
|
||||
;; is not found, so we have to go to the first non-blank
|
||||
;; line in order to find a file-path (bug#79397):
|
||||
(goto-char (point-min))
|
||||
(skip-chars-forward "\r\n")
|
||||
(when (< (point) (line-end-position))
|
||||
(buffer-substring (point) (line-end-position))))))))
|
||||
|
||||
(defun ffap-tex (name)
|
||||
(ffap-tex-init)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue