Mercurial > emacs
comparison lisp/emacs-lisp/lisp-mode.el @ 50463:b4b69a752c69
(last-sexp-toggle-display): Correct the starting point for
previous-single-property-change.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 06 Apr 2003 20:17:01 +0000 |
parents | 745c2428aae8 |
children | 7c83c5770cb6 |
comparison
equal
deleted
inserted
replaced
50462:c56acfe75212 | 50463:b4b69a752c69 |
---|---|
422 (defun last-sexp-toggle-display () | 422 (defun last-sexp-toggle-display () |
423 "Toggle between abbreviated and unabbreviated printed representations." | 423 "Toggle between abbreviated and unabbreviated printed representations." |
424 (interactive) | 424 (interactive) |
425 (let ((value (get-text-property (point) 'printed-value))) | 425 (let ((value (get-text-property (point) 'printed-value))) |
426 (when value | 426 (when value |
427 (let ((beg (or (previous-single-property-change (point) 'printed-value) (point))) | 427 (let ((beg (or (previous-single-property-change (min (point-max) (1+ (point))) |
428 'printed-value) | |
429 (point))) | |
428 (end (or (next-single-char-property-change (point) 'printed-value) (point))) | 430 (end (or (next-single-char-property-change (point) 'printed-value) (point))) |
429 (standard-output (current-buffer)) | 431 (standard-output (current-buffer)) |
430 (point (point))) | 432 (point (point))) |
431 (delete-region beg end) | 433 (delete-region beg end) |
432 (insert (nth 1 value)) | 434 (insert (nth 1 value)) |
433 (last-sexp-setup-props beg (point) | 435 (last-sexp-setup-props beg (point) |
434 (nth 0 value) | 436 (nth 0 value) |
435 (nth 2 value) | 437 (nth 2 value) |
436 (nth 1 value)) | 438 (nth 1 value)) |
437 (goto-char (min (point-max) point)))))) | 439 (goto-char (min (point-max) point)))))) |
438 | |
439 | 440 |
440 (defun eval-last-sexp-1 (eval-last-sexp-arg-internal) | 441 (defun eval-last-sexp-1 (eval-last-sexp-arg-internal) |
441 "Evaluate sexp before point; print value in minibuffer. | 442 "Evaluate sexp before point; print value in minibuffer. |
442 With argument, print output into current buffer." | 443 With argument, print output into current buffer." |
443 (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t))) | 444 (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t))) |