Function: pp-insert-short-sexp
pp-insert-short-sexp is a byte-compiled function defined in pp.el.gz.
Signature
(pp-insert-short-sexp SEXP &optional WIDTH)
Documentation
Insert a short description of SEXP in the current buffer.
WIDTH is the maximum width to use for it and it defaults to the space available between point and the window margin.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/pp.el.gz
(defun pp-insert-short-sexp (sexp &optional width)
"Insert a short description of SEXP in the current buffer.
WIDTH is the maximum width to use for it and it defaults to the
space available between point and the window margin."
(let ((printed (format "%S" sexp)))
(if (and (not (string-search "\n" printed))
(<= (string-width printed)
(or width (- (window-width) (current-column)))))
(insert printed)
(insert-text-button
"[Show]"
'follow-link t
'action (lambda (&rest _ignore)
;; FIXME: Why "eval output"?
(pp-display-expression sexp "*Pp Eval Output*"))
'help-echo "mouse-2, RET: pretty print value in another buffer"))))