diff options
| author | Gerd Moellmann | 2001-07-26 13:34:32 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-07-26 13:34:32 +0000 |
| commit | be4a68f92a947ed48393f1ff99e305f250a0b4bb (patch) | |
| tree | e2ecf1f0aba4d23814c245d02a9a223a6d26f949 | |
| parent | 61a925c117ea9ccfaed6d83693a4e3fc638d18c4 (diff) | |
| download | emacs-be4a68f92a947ed48393f1ff99e305f250a0b4bb.tar.gz emacs-be4a68f92a947ed48393f1ff99e305f250a0b4bb.zip | |
(eval-last-sexp-1): Look for a `...'
before assigning text properties. Make properties rear-nonsticky.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 17 |
2 files changed, 15 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cd9de63f868..de29a5ae4e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2001-07-26 Gerd Moellmann <gerd@gnu.org> | 1 | 2001-07-26 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * emacs-lisp/lisp-mode.el (eval-last-sexp-1): Look for a `...' | ||
| 4 | before assigning text properties. Make properties rear-nonsticky. | ||
| 5 | |||
| 3 | * emacs-lisp/lisp-mode.el (last-sexp-print): New function. | 6 | * emacs-lisp/lisp-mode.el (last-sexp-print): New function. |
| 4 | (eval-last-sexp-1): Give printed text a `keymap' property and bind | 7 | (eval-last-sexp-1): Give printed text a `keymap' property and bind |
| 5 | <mouse-2> and <RET> in that map to a function printing the | 8 | <mouse-2> and <RET> in that map to a function printing the |
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 093357c5b43..35dfadbe66e 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -390,13 +390,17 @@ With argument, print output into current buffer." | |||
| 390 | (set-syntax-table stab)))))) | 390 | (set-syntax-table stab)))))) |
| 391 | (let ((print-length eval-expression-print-length) | 391 | (let ((print-length eval-expression-print-length) |
| 392 | (print-level eval-expression-print-level) | 392 | (print-level eval-expression-print-level) |
| 393 | (beg (point))) | 393 | (beg (point)) |
| 394 | end) | ||
| 394 | (prin1 value) | 395 | (prin1 value) |
| 396 | (setq end (point)) | ||
| 395 | (when (and (bufferp standard-output) | 397 | (when (and (bufferp standard-output) |
| 396 | (or (not (null print-length)) | 398 | (or (not (null print-length)) |
| 397 | (not (null print-level)))) | 399 | (not (null print-level))) |
| 398 | (let ((map (make-sparse-keymap)) | 400 | (save-excursion |
| 399 | (end (point))) | 401 | (goto-char beg) |
| 402 | (search-forward "..." end t))) | ||
| 403 | (let ((map (make-sparse-keymap))) | ||
| 400 | (define-key map "\C-m" 'last-sexp-print) | 404 | (define-key map "\C-m" 'last-sexp-print) |
| 401 | (define-key map [down-mouse-2] 'mouse-set-point) | 405 | (define-key map [down-mouse-2] 'mouse-set-point) |
| 402 | (define-key map [mouse-2] 'last-sexp-print) | 406 | (define-key map [mouse-2] 'last-sexp-print) |
| @@ -405,7 +409,10 @@ With argument, print output into current buffer." | |||
| 405 | `(printed-value ,value | 409 | `(printed-value ,value |
| 406 | mouse-face highlight | 410 | mouse-face highlight |
| 407 | keymap ,map | 411 | keymap ,map |
| 408 | help-echo "RET, mouse-2: print unabbreviated")))))))) | 412 | help-echo "RET, mouse-2: print unabbreviated" |
| 413 | read-nonsticky (mouse-face keymap help-echo | ||
| 414 | printed-value) | ||
| 415 | )))))))) | ||
| 409 | 416 | ||
| 410 | 417 | ||
| 411 | (defun eval-last-sexp (eval-last-sexp-arg-internal) | 418 | (defun eval-last-sexp (eval-last-sexp-arg-internal) |