/[emacs]/emacs/lisp/emacs-lisp/lisp-mode.el
ViewVC logotype

Diff of /emacs/lisp/emacs-lisp/lisp-mode.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.160 by jurta, Thu Jun 10 04:16:05 2004 UTC revision 1.160.2.1 by miles, Sat Sep 4 12:01:09 2004 UTC
# Line 363  if that value is non-nil." Line 363  if that value is non-nil."
363      (when (stringp default)      (when (stringp default)
364        (if (string-match ":+" default)        (if (string-match ":+" default)
365            (substring default (match-end 0))            (substring default (match-end 0))
366            default))))          default))))
367    
368  ;; Used in old LispM code.  ;; Used in old LispM code.
369  (defalias 'common-lisp-mode 'lisp-mode)  (defalias 'common-lisp-mode 'lisp-mode)
# Line 459  alternative printed representations that Line 459  alternative printed representations that
459  If CHAR is not a character, return nil."  If CHAR is not a character, return nil."
460    (and (integerp char)    (and (integerp char)
461         (eventp char)         (eventp char)
462         (let ((c (event-basic-type char)))         (let ((c (event-basic-type char))
463           (concat               (mods (event-modifiers char))
464            "?"               string)
465            (mapconcat           ;; Prevent ?A from turning into ?\S-a.
466             (lambda (modif)           (if (and (memq 'shift mods)
467               (cond ((eq modif 'super) "\\s-")                    (zerop (logand char ?\S-\^@))
468                     (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-))))                    (not (let ((case-fold-search nil))
469             (event-modifiers char) "")                           (char-equal c (upcase c)))))
470            (cond               (setq c (upcase c) mods nil))
471             ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))           ;; What string are we considering using?
472             ((eq c 127) "\\C-?")           (condition-case nil
473             (t               (setq string
474              (condition-case nil                     (concat
475                  (string c)                      "?"
476                (error nil))))))))                      (mapconcat
477                         (lambda (modif)
478                           (cond ((eq modif 'super) "\\s-")
479                                 (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-))))
480                         mods "")
481                        (cond
482                         ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))
483                         ((eq c 127) "\\C-?")
484                         (t
485                          (string c)))))
486               (error nil))
487             ;; Verify the string reads a CHAR, not to some other character.
488             ;; If it doesn't, return nil instead.
489             (and string
490                  (= (car (read-from-string string)) char)
491                  string))))
492            
493    
494  (defun eval-last-sexp-1 (eval-last-sexp-arg-internal)  (defun eval-last-sexp-1 (eval-last-sexp-arg-internal)
495    "Evaluate sexp before point; print value in minibuffer.    "Evaluate sexp before point; print value in minibuffer.
# Line 555  With argument, print output into current Line 571  With argument, print output into current
571          ))))          ))))
572    
573    
574    (defvar eval-last-sexp-fake-value (make-symbol "t"))
575    
576  (defun eval-last-sexp (eval-last-sexp-arg-internal)  (defun eval-last-sexp (eval-last-sexp-arg-internal)
577    "Evaluate sexp before point; print value in minibuffer.    "Evaluate sexp before point; print value in minibuffer.
578  Interactively, with prefix argument, print output into current buffer."  Interactively, with prefix argument, print output into current buffer."
579    (interactive "P")    (interactive "P")
580    (if (null eval-expression-debug-on-error)    (if (null eval-expression-debug-on-error)
581        (eval-last-sexp-1 eval-last-sexp-arg-internal)        (eval-last-sexp-1 eval-last-sexp-arg-internal)
582      (let ((old-value (make-symbol "t")) new-value value)      (let ((old-value eval-last-sexp-fake-value) new-value value)
583        (let ((debug-on-error old-value))        (let ((debug-on-error old-value))
584          (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal))          (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal))
585          (setq new-value debug-on-error))          (setq new-value debug-on-error))

Legend:
Removed from v.1.160  
changed lines
  Added in v.1.160.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26