mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-08 13:19:36 +00:00
Avoid signaling errors from 'pixel-fill-region'
* lisp/textmodes/pixel-fill.el (pixel-fill-region): Make sure the selected window displays the current buffer. This is important when this function is called inside 'with-current-buffer' or similar forms which temporarily change the buffer displayed in the selected window. (Bug#67791)
This commit is contained in:
parent
a398712761
commit
d49124fc14
1 changed files with 35 additions and 33 deletions
|
@ -73,6 +73,8 @@ lines that are visually wider than PIXEL-WIDTH.
|
|||
If START isn't at the start of a line, the horizontal position of
|
||||
START, converted to pixel units, will be used as the indentation
|
||||
prefix on subsequent lines."
|
||||
(save-window-excursion
|
||||
(set-window-buffer nil (current-buffer))
|
||||
(save-excursion
|
||||
(goto-char start)
|
||||
(let ((indentation
|
||||
|
@ -105,7 +107,7 @@ prefix on subsequent lines."
|
|||
(pixel-fill--fill-line pixel-width indentation)
|
||||
(goto-char (point-max))
|
||||
(when newline-end
|
||||
(insert "\n"))))))
|
||||
(insert "\n")))))))
|
||||
|
||||
(defun pixel-fill--goto-pixel (width)
|
||||
(vertical-motion (cons (/ width (frame-char-width)) 0)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue