changeset 104681:91afee51b252

* textmodes/ispell.el (ispell-check-version, ispell-send-string): * international/mule.el (load-with-code-conversion): * emacs-lisp/debug.el (debug): * ediff-vers.el (ediff-rcs-get-output-buffer): * dired.el (dired-internal-noselect): Don't let-bind default-major-mode around code that doesn't use it. E.g. buffer creation via get-buffer-create doesn't use it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 28 Aug 2009 16:29:25 +0000
parents acf8f28a1a4a
children 73bff1db57b6
files lisp/ChangeLog lisp/dired.el lisp/ediff-vers.el lisp/emacs-lisp/debug.el lisp/international/mule.el lisp/textmodes/ispell.el
diffstat 6 files changed, 44 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Aug 28 14:36:53 2009 +0000
+++ b/lisp/ChangeLog	Fri Aug 28 16:29:25 2009 +0000
@@ -1,3 +1,13 @@
+2009-08-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textmodes/ispell.el (ispell-check-version, ispell-send-string):
+	* international/mule.el (load-with-code-conversion):
+	* emacs-lisp/debug.el (debug):
+	* ediff-vers.el (ediff-rcs-get-output-buffer):
+	* dired.el (dired-internal-noselect): Don't let-bind
+	default-major-mode around code that doesn't use it.
+	E.g. buffer creation via get-buffer-create doesn't use it.
+
 2009-08-28  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp.el (all): Replace "'(lambda" by "(lambda".
@@ -13,19 +23,19 @@
 	(tramp-root-regexp, tramp-completion-file-name-regexp-unified)
 	(tramp-completion-file-name-regexp-separate)
 	(tramp-completion-file-name-regexp-url): Use \\` and \\'.
-	(tramp-handle-file-attributes, tramp-set-file-uid-gid): Don't
-	modify last-coding-system-used by accident.
+	(tramp-handle-file-attributes, tramp-set-file-uid-gid):
+	Don't modify last-coding-system-used by accident.
 	(tramp-completion-file-name-handler): Apply the checks here,
 	instead during registration.
 	(tramp-register-file-name-handlers) Renamed from
 	`tramp-register-file-name-handler'.  Register both
 	`tramp-file-name-handler' and `tramp-completion-file-name-handler'.
-	(tramp-register-completion-file-name-handler): Removed.  (Bug#4260)
+	(tramp-register-completion-file-name-handler): Remove.  (Bug#4260)
 
 2009-08-28  Nick Roberts  <nickrob@snap.net.nz>
 
-	* progmodes/gdb-mi.el (gdb-use-separate-io-buffer): Remove
-	variable ...
+	* progmodes/gdb-mi.el (gdb-use-separate-io-buffer):
+	Remove variable ...
 	(gdb-init-1, gdb-display-separate-io-buffer)
 	(gdb-frame-separate-io-buffer, gdb-setup-windows): ... and
 	references to it.
@@ -183,11 +193,12 @@
 	(vc-rcs-checkout, vc-rcs-rollback): Adjust for the vc-rcs-trunk-p
 	renaming.
 	(vc-rcs-trunk-p, vc-rcs-minor-part, vc-rcs-previous-revision)
-	(vc-rcs-next-revision, vc-rcs-update-changelog): Moved here from
+	(vc-rcs-next-revision, vc-rcs-update-changelog): Move here from
 	vc.el, renamed to be RCS specific.
 
-	* vc-cvs.el (vc-cvs-previous-revision, vc-cvs-next-revision): New functions.
-	(vc-cvs-update-changelog): Moved here from vc.el.
+	* vc-cvs.el (vc-cvs-previous-revision, vc-cvs-next-revision):
+	New functions.
+	(vc-cvs-update-changelog): Move here from vc.el.
 
 	* vc-sccs.el (vc-sccs-previous-revision, vc-sccs-next-revision):
 	New functions.
@@ -231,8 +242,8 @@
 	(parse-time-rules, rmail-output-file-alist)
 	(special-display-buffer-names, vc-mode):
 	Move risky declarations to the relevant files.
-	* bindings.el (mode-line-client, mode-line-mule-info, mode-line-process)
-	(mode-line-modified, mode-line-remote, mode-line-position)
+	* bindings.el (mode-line-client, mode-line-mule-info, mode-line-remote)
+	(mode-line-modified, mode-line-process, mode-line-position)
 	(mode-line-modes, mode-line-buffer-identification, minor-mode-alist)
 	* font-core.el (font-lock-defaults):
 	* format.el (format-alist):
@@ -393,8 +404,8 @@
 	(decomposition-char-recursively, alist-list-to-vector, quick-check-list)
 	(quick-check-list-to-regexp): Declare.
 
-	* progmodes/make-mode.el (makefile-browser-insert-selection): Use
-	goto-char rather than goto-line.
+	* progmodes/make-mode.el (makefile-browser-insert-selection):
+	Use goto-char rather than goto-line.
 
 	* progmodes/prolog.el (compilation-error-regexp-alist)
 	(compilation-forget-errors): Declare.
--- a/lisp/dired.el	Fri Aug 28 14:36:53 2009 +0000
+++ b/lisp/dired.el	Fri Aug 28 16:29:25 2009 +0000
@@ -765,23 +765,14 @@
   ;; like find-file does.
   ;; Optional argument MODE is passed to dired-find-buffer-nocreate,
   ;; see there.
-  (let* (dirname
-	 buffer
-	 ;; note that buffer already is in dired-mode, if found
-	 new-buffer-p
-	 (old-buf (current-buffer)))
-    (if (consp dir-or-list)
-	(setq dirname (car dir-or-list))
-      (setq dirname dir-or-list))
-    ;; Look for an existing buffer.
-    (setq buffer (dired-find-buffer-nocreate dirname mode)
-	  new-buffer-p (null buffer))
+  (let* ((old-buf (current-buffer))
+	 (dirname (if (consp dir-or-list) (car dir-or-list) dir-or-list))
+         ;; Look for an existing buffer.
+         (buffer (dired-find-buffer-nocreate dirname mode))
+	 ;; Note that buffer already is in dired-mode, if found.
+	 (new-buffer-p (null buffer)))
     (or buffer
-	(let ((default-major-mode 'fundamental-mode))
-	  ;; We don't want default-major-mode to run hooks and set auto-fill
-	  ;; or whatever, now that dired-mode does not
-	  ;; kill-all-local-variables any longer.
-	  (setq buffer (create-file-buffer (directory-file-name dirname)))))
+        (setq buffer (create-file-buffer (directory-file-name dirname))))
     (set-buffer buffer)
     (if (not new-buffer-p)		; existing buffer ...
 	(cond (switches			; ... but new switches
--- a/lisp/ediff-vers.el	Fri Aug 28 14:36:53 2009 +0000
+++ b/lisp/ediff-vers.el	Fri Aug 28 16:29:25 2009 +0000
@@ -137,10 +137,8 @@
   ;; Optional NAME is name to use instead of `*RCS-output*'.
   ;; This is a modified version from rcs.el v1.1.  I use it here to make
   ;; Ediff immune to changes in rcs.el
-  (let* ((default-major-mode 'fundamental-mode) ; no frills!
-	 (buf (get-buffer-create name)))
-    (save-excursion
-      (set-buffer buf)
+  (let ((buf (get-buffer-create name)))
+    (with-current-buffer buf
       (setq buffer-read-only nil
 	    default-directory (file-name-directory (expand-file-name file)))
       (erase-buffer))
--- a/lisp/emacs-lisp/debug.el	Fri Aug 28 14:36:53 2009 +0000
+++ b/lisp/emacs-lisp/debug.el	Fri Aug 28 16:29:25 2009 +0000
@@ -119,8 +119,7 @@
     (let (debugger-value
 	  (debug-on-error nil)
 	  (debug-on-quit nil)
-	  (debugger-buffer (let ((default-major-mode 'fundamental-mode))
-			     (get-buffer-create "*Backtrace*")))
+	  (debugger-buffer (get-buffer-create "*Backtrace*"))
 	  (debugger-old-buffer (current-buffer))
 	  (debugger-step-after-exit nil)
           (debugger-will-be-back nil)
--- a/lisp/international/mule.el	Fri Aug 28 14:36:53 2009 +0000
+++ b/lisp/international/mule.el	Fri Aug 28 16:29:25 2009 +0000
@@ -307,12 +307,9 @@
 	   (signal 'file-error (list "Cannot open load file" file)))
     ;; Read file with code conversion, and then eval.
     (let* ((buffer
-	    ;; To avoid any autoloading, set default-major-mode to
-	    ;; fundamental-mode.
-	    (let ((default-major-mode 'fundamental-mode))
-	      ;; We can't use `generate-new-buffer' because files.el
-	      ;; is not yet loaded.
-	      (get-buffer-create (generate-new-buffer-name " *load*"))))
+            ;; We can't use `generate-new-buffer' because files.el
+            ;; is not yet loaded.
+            (get-buffer-create (generate-new-buffer-name " *load*")))
 	   (load-in-progress t)
 	   (source (save-match-data (string-match "\\.el\\'" fullname))))
       (unless nomessage
--- a/lisp/textmodes/ispell.el	Fri Aug 28 14:36:53 2009 +0000
+++ b/lisp/textmodes/ispell.el	Fri Aug 28 16:29:25 2009 +0000
@@ -785,9 +785,7 @@
   ;; all versions, since versions earlier than 3.0.09 didn't identify
   ;; themselves on startup.
   (interactive "p")
-  (let (;; avoid bugs when syntax of `.' changes in various default modes
-	(default-major-mode 'fundamental-mode)
-	(default-directory (or (and (boundp 'temporary-file-directory)
+  (let ((default-directory (or (and (boundp 'temporary-file-directory)
 				    temporary-file-directory)
 			       default-directory))
 	result status ispell-program-version)
@@ -814,7 +812,7 @@
 	    (message "%s" result))
 	;; return library directory.
 	(if (re-search-forward "LIBDIR = \\\"\\([^ \t\n]*\\)\\\"" nil t)
-	    (setq result (buffer-substring (match-beginning 1) (match-end 1)))))
+	    (setq result (match-string 1))))
       (goto-char (point-min))
       (if (not (memq status '(0 nil)))
 	  (error "%s exited with %s %s" ispell-program-name
@@ -839,7 +837,8 @@
 		       (match-string 1)))
 	    (setq ispell-really-hunspell
 		  (and (search-forward-regexp
-			"(but really Hunspell \\([0-9]+\\.[0-9\\.-]+\\)?)" nil t)
+			"(but really Hunspell \\([0-9]+\\.[0-9\\.-]+\\)?)"
+                        nil t)
 		       (match-string 1)))))
 
       (let ((aspell-minver    "0.50")
@@ -887,10 +886,9 @@
 
 
 
-;;; The preparation of the menu bar menu must be autoloaded
-;;; because otherwise this file gets autoloaded every time Emacs starts
-;;; so that it can set up the menus and determine keyboard equivalents.
-
+;; The preparation of the menu bar menu must be autoloaded
+;; because otherwise this file gets autoloaded every time Emacs starts
+;; so that it can set up the menus and determine keyboard equivalents.
 
 ;;;###autoload
 (defvar ispell-menu-map nil "Key map for ispell menu.")
@@ -1553,14 +1551,12 @@
 	  ;; The following commands are not passed to Ispell until
 	  ;; we have a *real* reason to invoke it.
 	  (cmds-to-defer '(?* ?@ ?~ ?+ ?- ?! ?%))
-	  (default-major-mode 'fundamental-mode)
 	  (session-buf ispell-session-buffer)
 	  (output-buf ispell-output-buffer)
 	  (ispell-args ispell-cmd-args)
 	  (defdir ispell-process-directory)
 	  prev-pos)
-      (save-excursion
-	(set-buffer session-buf)
+      (with-current-buffer session-buf
 	(setq prev-pos (point))
 	(setq default-directory defdir)
 	(insert string)