comparison lisp/emacs-lisp/lisp-mode.el @ 49598:0d8b17d428b5

Trailing whitepace deleted.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 04 Feb 2003 13:24:35 +0000
parents 4dd5da1ea3dc
children 745c2428aae8 d7ddb3e565de
comparison
equal deleted inserted replaced
49597:e88404e8f2cf 49598:0d8b17d428b5
401 401
402 402
403 (defun last-sexp-setup-props (beg end value alt1 alt2) 403 (defun last-sexp-setup-props (beg end value alt1 alt2)
404 "Set up text properties for the output of `eval-last-sexp-1'. 404 "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. 405 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 406 VALUE is the Lisp value printed, ALT1 and ALT2 are strings for the
407 alternative printed representations that can be displayed." 407 alternative printed representations that can be displayed."
408 (let ((map (make-sparse-keymap))) 408 (let ((map (make-sparse-keymap)))
409 (define-key map "\C-m" 'last-sexp-toggle-display) 409 (define-key map "\C-m" 'last-sexp-toggle-display)
410 (define-key map [down-mouse-2] 'mouse-set-point) 410 (define-key map [down-mouse-2] 'mouse-set-point)
411 (define-key map [mouse-2] 'last-sexp-toggle-display) 411 (define-key map [mouse-2] 'last-sexp-toggle-display)
412 (add-text-properties 412 (add-text-properties
413 beg end 413 beg end
414 `(printed-value (,value ,alt1 ,alt2) 414 `(printed-value (,value ,alt1 ,alt2)
415 mouse-face highlight 415 mouse-face highlight
416 keymap ,map 416 keymap ,map
417 help-echo "RET, mouse-2: toggle abbreviated display" 417 help-echo "RET, mouse-2: toggle abbreviated display"
418 rear-nonsticky (mouse-face keymap help-echo 418 rear-nonsticky (mouse-face keymap help-echo
419 printed-value))))) 419 printed-value)))))
420 420
428 (end (or (next-single-char-property-change (point) 'printed-value) (point))) 428 (end (or (next-single-char-property-change (point) 'printed-value) (point)))
429 (standard-output (current-buffer)) 429 (standard-output (current-buffer))
430 (point (point))) 430 (point (point)))
431 (delete-region beg end) 431 (delete-region beg end)
432 (insert (nth 1 value)) 432 (insert (nth 1 value))
433 (last-sexp-setup-props beg (point) 433 (last-sexp-setup-props beg (point)
434 (nth 0 value) 434 (nth 0 value)
435 (nth 2 value) 435 (nth 2 value)
436 (nth 1 value)) 436 (nth 1 value))
437 (goto-char (min (point-max) point)))))) 437 (goto-char (min (point-max) point))))))
438 438
506 (when (and (bufferp standard-output) 506 (when (and (bufferp standard-output)
507 (or (not (null print-length)) 507 (or (not (null print-length))
508 (not (null print-level))) 508 (not (null print-level)))
509 (not (string= unabbreviated 509 (not (string= unabbreviated
510 (buffer-substring-no-properties beg end)))) 510 (buffer-substring-no-properties beg end))))
511 (last-sexp-setup-props beg end value 511 (last-sexp-setup-props beg end value
512 unabbreviated 512 unabbreviated
513 (buffer-substring-no-properties beg end)) 513 (buffer-substring-no-properties beg end))
514 )))))) 514 ))))))
515 515
516 516