Try harder to keep lines short in pp-emacs-lisp-code
* lisp/emacs-lisp/pp.el (pp--insert): Try harder to keep lines short.
This commit is contained in:
parent
4cf7af5a2a
commit
a78ac0c5df
1 changed files with 11 additions and 1 deletions
|
@ -333,7 +333,17 @@ Ignores leading comment characters."
|
|||
(save-excursion
|
||||
(goto-char start)
|
||||
(unless (looking-at "[ \t]+$")
|
||||
(insert "\n"))))))
|
||||
(insert "\n"))
|
||||
(pp--indent-buffer)
|
||||
(goto-char (point-max))
|
||||
;; If we're still too wide, then go up one step and try to
|
||||
;; insert a newline there.
|
||||
(when (> (current-column) (window-width))
|
||||
(condition-case ()
|
||||
(backward-up-list 1)
|
||||
(:success (when (looking-back " " 2)
|
||||
(insert "\n")))
|
||||
(error nil)))))))
|
||||
|
||||
(defun pp--indent-buffer ()
|
||||
(goto-char (point-min))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue