comparison lisp/emacs-lisp/lisp-mode.el @ 40730:b1a039465517

(last-sexp-toggle-display): Cope if previous-single-property-change or next-single-char-property-change returns nil.
author Richard M. Stallman <rms@gnu.org>
date Mon, 05 Nov 2001 02:35:32 +0000
parents 216728b10960
children 7441fb1a40ac
comparison
equal deleted inserted replaced
40729:650fb912b343 40730:b1a039465517
404 (defun last-sexp-toggle-display () 404 (defun last-sexp-toggle-display ()
405 "Toggle between abbreviated and unabbreviated printed representations." 405 "Toggle between abbreviated and unabbreviated printed representations."
406 (interactive) 406 (interactive)
407 (let ((value (get-text-property (point) 'printed-value))) 407 (let ((value (get-text-property (point) 'printed-value)))
408 (when value 408 (when value
409 (let ((beg (previous-single-property-change (point) 'printed-value)) 409 (let ((beg (or (previous-single-property-change (point) 'printed-value) (point)))
410 (end (next-single-char-property-change (point) 'printed-value)) 410 (end (or (next-single-char-property-change (point) 'printed-value) (point)))
411 (standard-output (current-buffer)) 411 (standard-output (current-buffer))
412 (point (point))) 412 (point (point)))
413 (delete-region beg end) 413 (delete-region beg end)
414 (insert (nth 1 value)) 414 (insert (nth 1 value))
415 (last-sexp-setup-props beg (point) 415 (last-sexp-setup-props beg (point)