comparison lisp/emacs-lisp/lisp-mode.el @ 89969:3219f94257bc

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-34 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-514 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-522 Update from CVS
author Miles Bader <miles@gnu.org>
date Sat, 04 Sep 2004 09:14:28 +0000
parents d8411455de48 14c8ead25d14
children cce1c0ee76ee
comparison
equal deleted inserted replaced
89968:1e9fa4848335 89969:3219f94257bc
361 (defun lisp-find-tag-default () 361 (defun lisp-find-tag-default ()
362 (let ((default (find-tag-default))) 362 (let ((default (find-tag-default)))
363 (when (stringp default) 363 (when (stringp default)
364 (if (string-match ":+" default) 364 (if (string-match ":+" default)
365 (substring default (match-end 0)) 365 (substring default (match-end 0))
366 default)))) 366 default))))
367 367
368 ;; Used in old LispM code. 368 ;; Used in old LispM code.
369 (defalias 'common-lisp-mode 'lisp-mode) 369 (defalias 'common-lisp-mode 'lisp-mode)
370 370
371 ;; This will do unless inf-lisp.el is loaded. 371 ;; This will do unless inf-lisp.el is loaded.
457 (defun prin1-char (char) 457 (defun prin1-char (char)
458 "Return a string representing CHAR as a character rather than as an integer. 458 "Return a string representing CHAR as a character rather than as an integer.
459 If CHAR is not a character, return nil." 459 If CHAR is not a character, return nil."
460 (and (integerp char) 460 (and (integerp char)
461 (eventp char) 461 (eventp char)
462 (let ((c (event-basic-type char))) 462 (let ((c (event-basic-type char))
463 (concat 463 (mods (event-modifiers char))
464 "?" 464 string)
465 (mapconcat 465 ;; Prevent ?A from turning into ?\S-a.
466 (lambda (modif) 466 (if (and (memq 'shift mods)
467 (cond ((eq modif 'super) "\\s-") 467 (zerop (logand char ?\S-\^@))
468 (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-)))) 468 (not (let ((case-fold-search nil))
469 (event-modifiers char) "") 469 (char-equal c (upcase c)))))
470 (cond 470 (setq c (upcase c) mods nil))
471 ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) 471 ;; What string are we considering using?
472 ((eq c 127) "\\C-?") 472 (condition-case nil
473 (t 473 (setq string
474 (condition-case nil 474 (concat
475 (string c) 475 "?"
476 (error nil)))))))) 476 (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
477 493
478 (defun eval-last-sexp-1 (eval-last-sexp-arg-internal) 494 (defun eval-last-sexp-1 (eval-last-sexp-arg-internal)
479 "Evaluate sexp before point; print value in minibuffer. 495 "Evaluate sexp before point; print value in minibuffer.
480 With argument, print output into current buffer." 496 With argument, print output into current buffer."
481 (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t))) 497 (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t)))