[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp-mode.el [emacs-unico
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp-mode.el [emacs-unicode-2] |
Date: |
Mon, 28 Jun 2004 04:52:17 -0400 |
Index: emacs/lisp/emacs-lisp/lisp-mode.el
diff -c emacs/lisp/emacs-lisp/lisp-mode.el:1.149.2.2
emacs/lisp/emacs-lisp/lisp-mode.el:1.149.2.3
*** emacs/lisp/emacs-lisp/lisp-mode.el:1.149.2.2 Fri Apr 16 12:50:13 2004
--- emacs/lisp/emacs-lisp/lisp-mode.el Mon Jun 28 07:29:46 2004
***************
*** 239,244 ****
--- 239,245 ----
(set-keymap-parent emacs-lisp-mode-map lisp-mode-shared-map)
(define-key emacs-lisp-mode-map "\e\t" 'lisp-complete-symbol)
(define-key emacs-lisp-mode-map "\e\C-x" 'eval-defun)
+ (define-key emacs-lisp-mode-map "\e\C-q" 'indent-pp-sexp)
(define-key emacs-lisp-mode-map [menu-bar] (make-sparse-keymap))
(define-key emacs-lisp-mode-map [menu-bar emacs-lisp]
(cons "Emacs-Lisp" map))
***************
*** 355,360 ****
--- 356,369 ----
(setq imenu-case-fold-search t)
(set-syntax-table lisp-mode-syntax-table)
(run-mode-hooks 'lisp-mode-hook))
+ (put 'lisp-mode 'find-tag-default-function 'lisp-find-tag-default)
+
+ (defun lisp-find-tag-default ()
+ (let ((default (find-tag-default)))
+ (when (stringp default)
+ (if (string-match ":+" default)
+ (substring default (match-end 0))
+ default))))
;; Used in old LispM code.
(defalias 'common-lisp-mode 'lisp-mode)
***************
*** 369,374 ****
--- 378,384 ----
(let ((map (make-sparse-keymap)))
(set-keymap-parent map lisp-mode-shared-map)
(define-key map "\e\C-x" 'eval-defun)
+ (define-key map "\e\C-q" 'indent-pp-sexp)
(define-key map "\e\t" 'lisp-complete-symbol)
(define-key map "\n" 'eval-print-last-sexp)
map)
***************
*** 448,454 ****
"Return a string representing CHAR as a character rather than as an integer.
If CHAR is not a character, return nil."
(and (integerp char)
! (characterp (event-basic-type char))
(let ((c (event-basic-type char)))
(concat
"?"
--- 458,464 ----
"Return a string representing CHAR as a character rather than as an integer.
If CHAR is not a character, return nil."
(and (integerp char)
! (eventp char)
(let ((c (event-basic-type char)))
(concat
"?"
***************
*** 460,466 ****
(cond
((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))
((eq c 127) "\\C-?")
! (t (string c)))))))
(defun eval-last-sexp-1 (eval-last-sexp-arg-internal)
"Evaluate sexp before point; print value in minibuffer.
--- 470,479 ----
(cond
((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))
((eq c 127) "\\C-?")
! (t
! (condition-case nil
! (string c)
! (error nil))))))))
(defun eval-last-sexp-1 (eval-last-sexp-arg-internal)
"Evaluate sexp before point; print value in minibuffer.
***************
*** 524,536 ****
(prin1-to-string value)))
(print-length eval-expression-print-length)
(print-level eval-expression-print-level)
- (char-string (prin1-char value))
(beg (point))
end)
(prog1
(prin1 value)
! (if (and (eq standard-output t) char-string)
! (princ (concat " = " char-string)))
(setq end (point))
(when (and (bufferp standard-output)
(or (not (null print-length))
--- 537,548 ----
(prin1-to-string value)))
(print-length eval-expression-print-length)
(print-level eval-expression-print-level)
(beg (point))
end)
(prog1
(prin1 value)
! (let ((str (eval-expression-print-format value)))
! (if str (princ str)))
(setq end (point))
(when (and (bufferp standard-output)
(or (not (null print-length))
***************
*** 558,565 ****
value)))
(defun eval-defun-1 (form)
! "Change defvar into defconst within FORM.
! Likewise for other constructs as necessary."
;; The code in edebug-defun should be consistent with this, but not
;; the same, since this gets a macroexpended form.
(cond ((not (listp form))
--- 570,578 ----
value)))
(defun eval-defun-1 (form)
! "Treat some expressions specially.
! Reset the `defvar' and `defcustom' variables to the initial value.
! Reinitialize the face according to the `defface' specification."
;; The code in edebug-defun should be consistent with this, but not
;; the same, since this gets a macroexpended form.
(cond ((not (listp form))
***************
*** 577,582 ****
--- 590,602 ----
;; Force variable to be bound.
(set-default (eval (nth 1 form)) (eval (nth 1 (nth 2 form))))
form)
+ ;; `defface' is macroexpanded to `custom-declare-face'.
+ ((eq (car form) 'custom-declare-face)
+ ;; Reset the face.
+ (put (eval (nth 1 form)) 'face-defface-spec nil)
+ (setq face-new-frame-defaults
+ (assq-delete-all (eval (nth 1 form)) face-new-frame-defaults))
+ form)
((eq (car form) 'progn)
(cons 'progn (mapcar 'eval-defun-1 (cdr form))))
(t form)))
***************
*** 612,618 ****
(setq beg (point))
(setq form (read (current-buffer)))
(setq end (point)))
! ;; Alter the form if necessary, changing defvar into defconst, etc.
(setq form (eval-defun-1 (macroexpand form)))
(list beg end standard-output
`(lambda (ignore)
--- 632,638 ----
(setq beg (point))
(setq form (read (current-buffer)))
(setq end (point)))
! ;; Alter the form if necessary.
(setq form (eval-defun-1 (macroexpand form)))
(list beg end standard-output
`(lambda (ignore)
***************
*** 1084,1089 ****
--- 1104,1122 ----
(indent-sexp endmark)
(set-marker endmark nil))))
+ (defun indent-pp-sexp (&optional arg)
+ "Indent each line of the list or, with prefix ARG, pretty-printify the
list."
+ (interactive "P")
+ (if arg
+ (save-excursion
+ (save-restriction
+ (narrow-to-region (point) (progn (forward-sexp 1) (point)))
+ (pp-buffer)
+ (goto-char (point-max))
+ (if (eq (char-before) ?\n)
+ (delete-char -1)))))
+ (indent-sexp))
+
;;;; Lisp paragraph filling commands.
(defcustom emacs-lisp-docstring-fill-column 65
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp-mode.el [emacs-unicode-2],
Miles Bader <=