403 |
(defun last-sexp-setup-props (beg end value alt1 alt2) |
(defun last-sexp-setup-props (beg end value alt1 alt2) |
404 |
"Set up text properties for the output of `eval-last-sexp-1'. |
"Set up text properties for the output of `eval-last-sexp-1'. |
405 |
BEG and END are the start and end of the output in current-buffer. |
BEG and END are the start and end of the output in current-buffer. |
406 |
VALUE is the Lisp value printed, ALT1 and ALT2 are strings for the |
VALUE is the Lisp value printed, ALT1 and ALT2 are strings for the |
407 |
alternative printed representations that can be displayed." |
alternative printed representations that can be displayed." |
408 |
(let ((map (make-sparse-keymap))) |
(let ((map (make-sparse-keymap))) |
409 |
(define-key map "\C-m" 'last-sexp-toggle-display) |
(define-key map "\C-m" 'last-sexp-toggle-display) |
410 |
(define-key map [down-mouse-2] 'mouse-set-point) |
(define-key map [down-mouse-2] 'mouse-set-point) |
411 |
(define-key map [mouse-2] 'last-sexp-toggle-display) |
(define-key map [mouse-2] 'last-sexp-toggle-display) |
412 |
(add-text-properties |
(add-text-properties |
413 |
beg end |
beg end |
414 |
`(printed-value (,value ,alt1 ,alt2) |
`(printed-value (,value ,alt1 ,alt2) |
415 |
mouse-face highlight |
mouse-face highlight |
416 |
keymap ,map |
keymap ,map |
417 |
help-echo "RET, mouse-2: toggle abbreviated display" |
help-echo "RET, mouse-2: toggle abbreviated display" |
418 |
rear-nonsticky (mouse-face keymap help-echo |
rear-nonsticky (mouse-face keymap help-echo |
430 |
(point (point))) |
(point (point))) |
431 |
(delete-region beg end) |
(delete-region beg end) |
432 |
(insert (nth 1 value)) |
(insert (nth 1 value)) |
433 |
(last-sexp-setup-props beg (point) |
(last-sexp-setup-props beg (point) |
434 |
(nth 0 value) |
(nth 0 value) |
435 |
(nth 2 value) |
(nth 2 value) |
436 |
(nth 1 value)) |
(nth 1 value)) |
508 |
(not (null print-level))) |
(not (null print-level))) |
509 |
(not (string= unabbreviated |
(not (string= unabbreviated |
510 |
(buffer-substring-no-properties beg end)))) |
(buffer-substring-no-properties beg end)))) |
511 |
(last-sexp-setup-props beg end value |
(last-sexp-setup-props beg end value |
512 |
unabbreviated |
unabbreviated |
513 |
(buffer-substring-no-properties beg end)) |
(buffer-substring-no-properties beg end)) |
514 |
)))))) |
)))))) |