diff options
| author | Richard M. Stallman | 2003-04-09 01:32:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-04-09 01:32:45 +0000 |
| commit | 98996d899ebeb1d4a26702a950a2e8877a214959 (patch) | |
| tree | f2cae986b4ca5f9df64436f99a6dc4b07b450f41 | |
| parent | 71f46c95f65b5bbc9d66a3be0815f3d9669e3273 (diff) | |
| download | emacs-98996d899ebeb1d4a26702a950a2e8877a214959.tar.gz emacs-98996d899ebeb1d4a26702a950a2e8877a214959.zip | |
(last-sexp-toggle-display): At end of buffer, just call `newline'.
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index e0030ea766a..6c084c409df 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -419,24 +419,29 @@ alternative printed representations that can be displayed." | |||
| 419 | printed-value))))) | 419 | printed-value))))) |
| 420 | 420 | ||
| 421 | 421 | ||
| 422 | (defun last-sexp-toggle-display () | 422 | (defun last-sexp-toggle-display (&optional arg) |
| 423 | "Toggle between abbreviated and unabbreviated printed representations." | 423 | "Toggle between abbreviated and unabbreviated printed representations." |
| 424 | (interactive) | 424 | (interactive "P") |
| 425 | (let ((value (get-text-property (point) 'printed-value))) | 425 | ;; Normally this command won't be called at end of line. |
| 426 | (when value | 426 | ;; But when the end of the line is also the end of the buffer, |
| 427 | (let ((beg (or (previous-single-property-change (min (point-max) (1+ (point))) | 427 | ;; it does get called. For consistency, pretend it was not called. |
| 428 | 'printed-value) | 428 | (if (eobp) |
| 429 | (point))) | 429 | (newline arg) |
| 430 | (end (or (next-single-char-property-change (point) 'printed-value) (point))) | 430 | (let ((value (get-text-property (point) 'printed-value))) |
| 431 | (standard-output (current-buffer)) | 431 | (when value |
| 432 | (point (point))) | 432 | (let ((beg (or (previous-single-property-change (min (point-max) (1+ (point))) |
| 433 | (delete-region beg end) | 433 | 'printed-value) |
| 434 | (insert (nth 1 value)) | 434 | (point))) |
| 435 | (last-sexp-setup-props beg (point) | 435 | (end (or (next-single-char-property-change (point) 'printed-value) (point))) |
| 436 | (nth 0 value) | 436 | (standard-output (current-buffer)) |
| 437 | (nth 2 value) | 437 | (point (point))) |
| 438 | (nth 1 value)) | 438 | (delete-region beg end) |
| 439 | (goto-char (min (point-max) point)))))) | 439 | (insert (nth 1 value)) |
| 440 | (last-sexp-setup-props beg (point) | ||
| 441 | (nth 0 value) | ||
| 442 | (nth 2 value) | ||
| 443 | (nth 1 value)) | ||
| 444 | (goto-char (min (point-max) point))))))) | ||
| 440 | 445 | ||
| 441 | (defun eval-last-sexp-1 (eval-last-sexp-arg-internal) | 446 | (defun eval-last-sexp-1 (eval-last-sexp-arg-internal) |
| 442 | "Evaluate sexp before point; print value in minibuffer. | 447 | "Evaluate sexp before point; print value in minibuffer. |
| @@ -626,7 +631,7 @@ which see." | |||
| 626 | (unless (eq old-value new-value) | 631 | (unless (eq old-value new-value) |
| 627 | (setq debug-on-error new-value)) | 632 | (setq debug-on-error new-value)) |
| 628 | value))))) | 633 | value))))) |
| 629 | 634 | ||
| 630 | 635 | ||
| 631 | (defun lisp-comment-indent () | 636 | (defun lisp-comment-indent () |
| 632 | (if (looking-at "\\s<\\s<\\s<") | 637 | (if (looking-at "\\s<\\s<\\s<") |