mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Improve pp-emacs-lisp-code for #'
* lisp/emacs-lisp/pp.el (pp--insert-lisp): Format (function ...) as #'.
This commit is contained in:
parent
38b4bbb7e1
commit
0d315102fe
2 changed files with 10 additions and 2 deletions
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(require 'cl-lib)
|
||||
(defvar font-lock-verbose)
|
||||
|
||||
(defgroup pp nil
|
||||
|
|
@ -233,13 +234,14 @@ Use the `pp-max-width' variable to control the desired line length."
|
|||
(cons (cond
|
||||
((consp (cdr sexp))
|
||||
(if (and (length= sexp 2)
|
||||
(eq (car sexp) 'quote))
|
||||
(memq (car sexp) '(quote function)))
|
||||
(cond
|
||||
((symbolp (cadr sexp))
|
||||
(let ((print-quoted t))
|
||||
(prin1 sexp (current-buffer))))
|
||||
((consp (cadr sexp))
|
||||
(insert "'")
|
||||
(insert (if (eq (car sexp) 'quote)
|
||||
"'" "#'"))
|
||||
(pp--format-list (cadr sexp)
|
||||
(set-marker (make-marker) (1- (point))))))
|
||||
(pp--format-list sexp)))
|
||||
|
|
|
|||
|
|
@ -122,3 +122,9 @@ Name: code-formats11
|
|||
(lambda ()
|
||||
[(foo bar) (foo bar)])
|
||||
=-=-=
|
||||
|
||||
Name: code-formats12
|
||||
|
||||
=-=
|
||||
(global-set-key (kbd "s-x") #'kill-region)
|
||||
=-=-=
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue