From da68c4c88c9e505f622afe741e7533fda808f418 Mon Sep 17 00:00:00 2001 From: Deniz Dogan Date: Tue, 28 Jun 2011 14:09:43 +0200 Subject: * emacs-lisp/lisp-mode.el (emacs-lisp-mode-syntax-table): Unnest `let'. --- lisp/emacs-lisp/lisp-mode.el | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 04299aec099..114e9755039 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -38,46 +38,46 @@ (define-abbrev-table 'lisp-mode-abbrev-table ()) (defvar emacs-lisp-mode-syntax-table - (let ((table (make-syntax-table))) - (let ((i 0)) - (while (< i ?0) - (modify-syntax-entry i "_ " table) - (setq i (1+ i))) - (setq i (1+ ?9)) - (while (< i ?A) - (modify-syntax-entry i "_ " table) - (setq i (1+ i))) - (setq i (1+ ?Z)) - (while (< i ?a) - (modify-syntax-entry i "_ " table) - (setq i (1+ i))) - (setq i (1+ ?z)) - (while (< i 128) - (modify-syntax-entry i "_ " table) - (setq i (1+ i))) - (modify-syntax-entry ?\s " " table) - ;; Non-break space acts as whitespace. - (modify-syntax-entry ?\x8a0 " " table) - (modify-syntax-entry ?\t " " table) - (modify-syntax-entry ?\f " " table) - (modify-syntax-entry ?\n "> " table) - ;; This is probably obsolete since nowadays such features use overlays. - ;; ;; Give CR the same syntax as newline, for selective-display. - ;; (modify-syntax-entry ?\^m "> " table) - (modify-syntax-entry ?\; "< " table) - (modify-syntax-entry ?` "' " table) - (modify-syntax-entry ?' "' " table) - (modify-syntax-entry ?, "' " table) - (modify-syntax-entry ?@ "' " table) - ;; Used to be singlequote; changed for flonums. - (modify-syntax-entry ?. "_ " table) - (modify-syntax-entry ?# "' " table) - (modify-syntax-entry ?\" "\" " table) - (modify-syntax-entry ?\\ "\\ " table) - (modify-syntax-entry ?\( "() " table) - (modify-syntax-entry ?\) ")( " table) - (modify-syntax-entry ?\[ "(] " table) - (modify-syntax-entry ?\] ")[ " table)) + (let ((table (make-syntax-table)) + (i 0)) + (while (< i ?0) + (modify-syntax-entry i "_ " table) + (setq i (1+ i))) + (setq i (1+ ?9)) + (while (< i ?A) + (modify-syntax-entry i "_ " table) + (setq i (1+ i))) + (setq i (1+ ?Z)) + (while (< i ?a) + (modify-syntax-entry i "_ " table) + (setq i (1+ i))) + (setq i (1+ ?z)) + (while (< i 128) + (modify-syntax-entry i "_ " table) + (setq i (1+ i))) + (modify-syntax-entry ?\s " " table) + ;; Non-break space acts as whitespace. + (modify-syntax-entry ?\x8a0 " " table) + (modify-syntax-entry ?\t " " table) + (modify-syntax-entry ?\f " " table) + (modify-syntax-entry ?\n "> " table) + ;; This is probably obsolete since nowadays such features use overlays. + ;; ;; Give CR the same syntax as newline, for selective-display. + ;; (modify-syntax-entry ?\^m "> " table) + (modify-syntax-entry ?\; "< " table) + (modify-syntax-entry ?` "' " table) + (modify-syntax-entry ?' "' " table) + (modify-syntax-entry ?, "' " table) + (modify-syntax-entry ?@ "' " table) + ;; Used to be singlequote; changed for flonums. + (modify-syntax-entry ?. "_ " table) + (modify-syntax-entry ?# "' " table) + (modify-syntax-entry ?\" "\" " table) + (modify-syntax-entry ?\\ "\\ " table) + (modify-syntax-entry ?\( "() " table) + (modify-syntax-entry ?\) ")( " table) + (modify-syntax-entry ?\[ "(] " table) + (modify-syntax-entry ?\] ")[ " table) table) "Syntax table used in `emacs-lisp-mode'.") -- cgit v1.2.3 From 450a0f09279df347a10d6c1e4b809a5082daf9c8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 5 Jul 2011 14:26:33 -0400 Subject: * lisp/emacs-lisp/lisp-mode.el (lisp-interaction-mode-abbrev-table): Let define-derived-mode define it. * lisp/emacs-lisp/derived.el (define-derived-mode): Try to avoid creating cycles of abbrev-table inheritance. Fixes: debbugs:8998 --- lisp/ChangeLog | 15 +++++++++++---- lisp/emacs-lisp/derived.el | 5 ++++- lisp/emacs-lisp/lisp-mode.el | 1 - 3 files changed, 15 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 05fbbfa89fc..66215266bdb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2011-07-05 Stefan Monnier + + * emacs-lisp/lisp-mode.el (lisp-interaction-mode-abbrev-table): + Let define-derived-mode define it. + * emacs-lisp/derived.el (define-derived-mode): Try to avoid creating + cycles of abbrev-table inheritance (bug#8998). + 2011-07-05 Roland Winkler * textmodes/bibtex.el: Add support for biblatex. @@ -10,15 +17,15 @@ (bibtex-entry-alist, bibtex-field-alist): New widgets. (bibtex-set-dialect): New command. (bibtex-entry-type, bibtex-entry-head) - (bibtex-entry-maybe-empty-head, bibtex-any-valid-entry-type): Bind - via bibtex-set-dialect. + (bibtex-entry-maybe-empty-head, bibtex-any-valid-entry-type): + Bind via bibtex-set-dialect. (bibtex-Article, bibtex-Book, bibtex-Booklet, bibtex-InBook) (bibtex-InCollection, bibtex-InProceedings, bibtex-Manual) (bibtex-MastersThesis, bibtex-Misc, bibtex-PhdThesis) (bibtex-Proceedings, bibtex-TechReport, bibtex-Unpublished): Define via bibtex-set-dialect. - (bibtex-name-in-field, bibtex-remove-OPT-or-ALT): Obey - bibtex-no-opt-remove-re. + (bibtex-name-in-field, bibtex-remove-OPT-or-ALT): + Obey bibtex-no-opt-remove-re. (bibtex-vec-push, bibtex-vec-incr): New functions. (bibtex-format-entry, bibtex-field-list) (bibtex-print-help-message, bibtex-validate) diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index e8f799b9afc..4fda2bf1d52 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -255,7 +255,10 @@ No problems result if this variable is not bound. (not (eq parent (standard-syntax-table)))) (set-char-table-parent ,syntax (syntax-table))))) ,(when declare-abbrev - `(unless (abbrev-table-get ,abbrev :parents) + `(unless (or (abbrev-table-get ,abbrev :parents) + ;; This can happen if the major mode defines + ;; the abbrev-table to be its parent's. + (eq ,abbrev local-abbrev-table)) (abbrev-table-put ,abbrev :parents (list local-abbrev-table)))))) (use-local-map ,map) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 114e9755039..32f67a173f9 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -525,7 +525,6 @@ if that value is non-nil." "Keymap for Lisp Interaction mode. All commands in `lisp-mode-shared-map' are inherited by this map.") -(defvar lisp-interaction-mode-abbrev-table lisp-mode-abbrev-table) (define-derived-mode lisp-interaction-mode emacs-lisp-mode "Lisp Interaction" "Major mode for typing and evaluating Lisp forms. Like Lisp mode except that \\[eval-print-last-sexp] evals the Lisp expression -- cgit v1.2.3 From f4f7319875f9502424804f56e2a12cd620b51c12 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Wed, 6 Jul 2011 18:46:27 +0200 Subject: * emacs-lisp/lisp-mode.el (eval-defun-1): Update the documentation of faces when `M-C-x'-ing their definitions. Also clean up the code slightly. Fixes: debbugs:8378 --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/lisp-mode.el | 38 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 19 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 080f9494996..a2b389f4fe4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -10,6 +10,10 @@ 2011-07-06 Lars Magne Ingebrigtsen + * emacs-lisp/lisp-mode.el (eval-defun-1): Update the documentation + of faces when `M-C-x'-ing their definitions (bug#8378). Also + clean up the code slightly. + * progmodes/grep.el (rgrep): Don't bind `process-connection-type', because that makes the colours go away. diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 32f67a173f9..c8620aaa439 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -789,25 +789,25 @@ Reinitialize the face according to the `defface' specification." ;; `defface' is macroexpanded to `custom-declare-face'. ((eq (car form) 'custom-declare-face) ;; Reset the face. - (setq face-new-frame-defaults - (assq-delete-all (eval (nth 1 form) lexical-binding) - face-new-frame-defaults)) - (put (eval (nth 1 form) lexical-binding) 'face-defface-spec nil) - ;; Setting `customized-face' to the new spec after calling - ;; the form, but preserving the old saved spec in `saved-face', - ;; imitates the situation when the new face spec is set - ;; temporarily for the current session in the customize - ;; buffer, thus allowing `face-user-default-spec' to use the - ;; new customized spec instead of the saved spec. - ;; Resetting `saved-face' temporarily to nil is needed to let - ;; `defface' change the spec, regardless of a saved spec. - (prog1 `(prog1 ,form - (put ,(nth 1 form) 'saved-face - ',(get (eval (nth 1 form) lexical-binding) - 'saved-face)) - (put ,(nth 1 form) 'customized-face - ,(nth 2 form))) - (put (eval (nth 1 form) lexical-binding) 'saved-face nil))) + (let ((face-symbol (eval (nth 1 form) lexical-binding))) + (setq face-new-frame-defaults + (assq-delete-all face-symbol face-new-frame-defaults)) + (put face-symbol 'face-defface-spec nil) + (put face-symbol 'face-documentation (nth 3 form)) + ;; Setting `customized-face' to the new spec after calling + ;; the form, but preserving the old saved spec in `saved-face', + ;; imitates the situation when the new face spec is set + ;; temporarily for the current session in the customize + ;; buffer, thus allowing `face-user-default-spec' to use the + ;; new customized spec instead of the saved spec. + ;; Resetting `saved-face' temporarily to nil is needed to let + ;; `defface' change the spec, regardless of a saved spec. + (prog1 `(prog1 ,form + (put ,(nth 1 form) 'saved-face + ',(get face-symbol 'saved-face)) + (put ,(nth 1 form) 'customized-face + ,(nth 2 form))) + (put face-symbol 'saved-face nil)))) ((eq (car form) 'progn) (cons 'progn (mapcar 'eval-defun-1 (cdr form)))) (t form))) -- cgit v1.2.3