2009-08-28 Stefan Monnier <monnier@iro.umontreal.ca>
+ * textmodes/reftex.el (reftex-get-file-buffer-force):
+ * progmodes/verilog-mode.el (verilog-batch-execute-func):
+ * emulation/viper.el (viper-go-away, viper-set-hooks):
+ * emacs-lisp/re-builder.el (re-builder-unload-function):
+ * emacs-lisp/bytecomp.el (byte-compile-file):
+ * ses.el (ses-unload-function):
+ * hexl.el (hexl-find-file):
+ * files.el (normal-mode):
+ * ehelp.el (with-electric-help):
+ * autoinsert.el (auto-insert-alist):
+ * arc-mode.el (archive-mode):
+ Use (default-value 'major-mode) instead of default-major-mode.
+
* textmodes/ispell.el (ispell-check-version, ispell-send-string):
* international/mule.el (load-with-code-conversion):
* emacs-lisp/debug.el (debug):
;; mode on and off. You can corrupt things that way.
(if (zerop (buffer-size))
;; At present we cannot create archives from scratch
- (funcall default-major-mode)
+ (funcall (default-value 'major-mode))
(if (and (not force) archive-files) nil
(let* ((type (archive-find-type))
(typename (capitalize (symbol-name type))))
(("/bin/.*[^/]\\'" . "Shell-Script mode magic number")
lambda ()
- (if (eq major-mode default-major-mode)
+ (if (eq major-mode (default-value 'major-mode))
(sh-mode)))
(ada-mode . ada-header)
(defun electric-help-mode ()
"`with-electric-help' temporarily places its buffer in this mode.
-\(On exit from `with-electric-help', the buffer is put in `default-major-mode'.)"
+\(On exit from `with-electric-help', the buffer is put in default `major-mode'.)"
(setq buffer-read-only t)
(setq mode-name "Help")
(setq major-mode 'help)
When the user exits (with `electric-help-exit', or otherwise), the help
buffer's window disappears (i.e., we use `save-window-excursion'), and
-BUFFER is put into `default-major-mode' (or `fundamental-mode')."
+BUFFER is put into default `major-mode' (or `fundamental-mode')."
(setq buffer (get-buffer-create (or buffer "*Help*")))
(let ((one (one-window-p t))
(config (current-window-configuration))
(goto-char (window-start (selected-window))))
(let ((pop-up-windows t))
(pop-to-buffer buffer))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(when (and minheight (< (window-height) minheight))
(enlarge-window (- minheight (window-height))))
(electric-help-mode)
;; afterwards. It's also not clear that `help-mode' is always
;; the right thing, maybe we should add an optional parameter.
(condition-case ()
- (funcall (or default-major-mode 'fundamental-mode))
+ (funcall (or (default-value 'major-mode) 'fundamental-mode))
(error nil))
(set-window-configuration config)
;; Some versions of `file' can be customized to recognize that.
(require 'backquote)
+(eval-when-compile (require 'cl))
(or (fboundp 'defsubst)
;; This really ought to be loaded already!
(set-buffer-multibyte nil))
;; Run hooks including the uncompression hook.
;; If they change the file name, then change it for the output also.
- (let ((buffer-file-name bytecomp-filename)
- (default-major-mode 'emacs-lisp-mode)
- ;; Ignore unsafe local variables.
- ;; We only care about a few of them for our purposes.
- (enable-local-variables :safe)
- (enable-local-eval nil))
+ (letf ((buffer-file-name bytecomp-filename)
+ ((default-value 'major-mode) 'emacs-lisp-mode)
+ ;; Ignore unsafe local variables.
+ ;; We only care about a few of them for our purposes.
+ (enable-local-variables :safe)
+ (enable-local-eval nil))
;; Arg of t means don't alter enable-local-variables.
(normal-mode t)
(setq bytecomp-filename buffer-file-name))
(remove-hook 'kill-buffer-hook 'reb-kill-buffer t)
(when (reb-mode-buffer-p)
(reb-delete-overlays)
- (funcall default-major-mode))))
+ (funcall (default-value 'major-mode)))))
;; continue standard unloading
nil)
global-mode-string
(delq 'viper-mode-string global-mode-string))
- (setq default-major-mode
- (viper-standard-value 'default-major-mode viper-saved-non-viper-variables))
+ (setq-default major-mode
+ (viper-standard-value 'default-major-mode
+ viper-saved-non-viper-variables))
(if (featurep 'emacs)
(setq-default
;; in Fundamental Mode and Vi state.
;; When viper-mode is executed in such a case, it will set the major mode
;; back to fundamental-mode.
- (if (eq default-major-mode 'fundamental-mode)
- (setq default-major-mode 'viper-mode))
+ (if (eq (default-value 'major-mode) 'fundamental-mode)
+ (setq-default major-mode 'viper-mode))
(add-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel)
(add-hook 'find-file-hooks 'set-viper-state-in-major-mode)
(if (null viper-saved-non-viper-variables)
(setq viper-saved-non-viper-variables
(list
- (cons 'default-major-mode (list default-major-mode))
+ (cons 'default-major-mode (list (default-value 'major-mode)))
(cons 'next-line-add-newlines (list next-line-add-newlines))
(cons 'require-final-newline (list require-final-newline))
(cons 'scroll-step (list scroll-step))
or from Lisp without specifying the optional argument FIND-FILE;
in that case, this function acts as if `enable-local-variables' were t."
(interactive)
- (funcall (or default-major-mode 'fundamental-mode))
+ (funcall (or (default-value 'major-mode) 'fundamental-mode))
(let ((enable-local-variables (or (not find-file) enable-local-variables)))
(report-errors "File mode specification error: %s"
(set-auto-mode))
+2009-08-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * nnheader.el (nnheader-find-file-noselect):
+ * mm-util.el (mm-insert-file-contents):
+ Use (default-value 'major-mode) instead of default-major-mode.
+
2009-08-27 Stefan Monnier <monnier@iro.umontreal.ca>
* nnrss.el (nnrss-request-article): Avoid default-fill-column.
`find-file-hooks', etc.
If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'.
This function ensures that none of these modifications will take place."
- (let* ((format-alist nil)
- (auto-mode-alist (if inhibit nil (mm-auto-mode-alist)))
- (default-major-mode 'fundamental-mode)
- (enable-local-variables nil)
- (after-insert-file-functions nil)
- (enable-local-eval nil)
- (inhibit-file-name-operation (if inhibit
- 'insert-file-contents
- inhibit-file-name-operation))
- (inhibit-file-name-handlers
- (if inhibit
- (append mm-inhibit-file-name-handlers
- inhibit-file-name-handlers)
- inhibit-file-name-handlers))
- (ffh (if (boundp 'find-file-hook)
- 'find-file-hook
- 'find-file-hooks))
- (val (symbol-value ffh)))
+ (letf* ((format-alist nil)
+ (auto-mode-alist (if inhibit nil (mm-auto-mode-alist)))
+ ((default-value 'major-mode) 'fundamental-mode)
+ (enable-local-variables nil)
+ (after-insert-file-functions nil)
+ (enable-local-eval nil)
+ (inhibit-file-name-operation (if inhibit
+ 'insert-file-contents
+ inhibit-file-name-operation))
+ (inhibit-file-name-handlers
+ (if inhibit
+ (append mm-inhibit-file-name-handlers
+ inhibit-file-name-handlers)
+ inhibit-file-name-handlers))
+ (ffh (if (boundp 'find-file-hook)
+ 'find-file-hook
+ 'find-file-hooks))
+ (val (symbol-value ffh)))
(set ffh nil)
(unwind-protect
(insert-file-contents filename visit beg end replace)
(defun nnheader-find-file-noselect (&rest args)
"Open a file with some variables bound.
See `find-file-noselect' for the arguments."
- (let* ((format-alist nil)
- (auto-mode-alist (mm-auto-mode-alist))
- (default-major-mode 'fundamental-mode)
- (enable-local-variables nil)
- (after-insert-file-functions nil)
- (enable-local-eval nil)
- (coding-system-for-read nnheader-file-coding-system)
- (version-control 'never)
- (ffh (if (boundp 'find-file-hook)
- 'find-file-hook
- 'find-file-hooks))
- (val (symbol-value ffh)))
+ (letf* ((format-alist nil)
+ (auto-mode-alist (mm-auto-mode-alist))
+ ((default-value 'major-mode) 'fundamental-mode)
+ (enable-local-variables nil)
+ (after-insert-file-functions nil)
+ (enable-local-eval nil)
+ (coding-system-for-read nnheader-file-coding-system)
+ (version-control 'never)
+ (ffh (if (boundp 'find-file-hook)
+ 'find-file-hook
+ 'find-file-hooks))
+ (val (symbol-value ffh)))
(set ffh nil)
(unwind-protect
(apply 'find-file-noselect args)
;;; Code:
(require 'eldoc)
+(eval-when-compile (require 'cl))
;;
;; vars here
(list
(let ((completion-ignored-extensions nil))
(read-file-name "Filename: " nil nil 'ret-must-match))))
- ;; Ignore the user's setting of default-major-mode.
- (let ((default-major-mode 'fundamental-mode))
+ ;; Ignore the user's setting of default major-mode.
+ (letf (((default-value 'major-mode) 'fundamental-mode))
(find-file-literally filename))
(if (not (eq major-mode 'hexl-mode))
(hexl-mode)))
(defvar font-lock-auto-fontify)
(defvar font-lock-defaults) ; XEmacs
-;; Ensure new buffers won't get this mode if default-major-mode is nil.
+;; Ensure new buffers won't get this mode if default major-mode is nil.
(put 'mh-folder-mode 'mode-class 'special)
;; Autoload cookie needed by desktop.el
;; Shush compiler.
(defvar font-lock-defaults) ; XEmacs
-;; Ensure new buffers won't get this mode if default-major-mode is nil.
+;; Ensure new buffers won't get this mode if default major-mode is nil.
(put 'mh-letter-mode 'mode-class 'special)
;;;###mh-autoload
;;; MH-Show Mode
-;; Ensure new buffers won't get this mode if default-major-mode is nil.
+;; Ensure new buffers won't get this mode if default major-mode is nil.
(put 'mh-show-mode 'mode-class 'special)
;; Shush compiler.
+2009-08-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * org-html.el (org-export-as-html):
+ * org-docbook.el (org-export-as-docbook):
+ Use (default-value 'major-mode) instead of default-major-mode.
+
2009-08-08 Carsten Dominik <carsten.dominik@gmail.com>
* org-docbook.el: Add arch-tag.
;; Maintainer: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
;; Keywords: org, wp, docbook
;; Description: Converts an org-mode buffer into DocBook
-;; $Id: org-docbook.el,v 1.2 2009/08/08 02:33:22 gm Exp $
+;; $Id: org-docbook.el,v 1.3 2009/08/08 12:18:56 cdominik Exp $
;; URL:
;; This file is part of GNU Emacs.
(unless (plist-get opt-plist :buffer-will-be-killed)
(normal-mode)
- (if (eq major-mode default-major-mode)
+ (if (eq major-mode (default-value 'major-mode))
(nxml-mode)))
;; Remove empty paragraphs and lists. Replace them with a
(unless (plist-get opt-plist :buffer-will-be-killed)
(normal-mode)
- (if (eq major-mode default-major-mode) (html-mode)))
+ (if (eq major-mode (default-value 'major-mode)) (html-mode)))
;; insert the table of contents
(goto-char (point-min))
(defun verilog-batch-execute-func (funref)
"Internal processing of a batch command, running FUNREF on all command arguments."
(verilog-batch-error-wrapper
+ ;; !!! FIXME: Setting global variables like that is *VERY NASTY* !!! --Stef
;; General globals needed
(setq make-backup-files nil)
(setq-default make-backup-files nil)
(setq enable-local-variables t)
(setq enable-local-eval t)
;; Make sure any sub-files we read get proper mode
- (setq default-major-mode `verilog-mode)
+ (setq-default major-mode 'verilog-mode)
;; Ditto files already read in
(mapc (lambda (buf)
(when (buffer-file-name buf)
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(verilog-mode))))
(buffer-list))
;; Process the files
(dolist (buf (buffer-list))
(set-buffer buf)
(when (eq major-mode 'ses-mode)
- (funcall (or default-major-mode 'fundamental-mode)))))
+ (funcall (or (default-value 'major-mode) 'fundamental-mode)))))
;; continue standard unloading
nil)
;; with limited Magic
;; The magic goes away
- (let ((format-alist nil)
- (auto-mode-alist (reftex-auto-mode-alist))
- (default-major-mode 'fundamental-mode)
- (enable-local-variables nil)
- (after-insert-file-functions nil))
+ (letf ((format-alist nil)
+ (auto-mode-alist (reftex-auto-mode-alist))
+ ((default-value 'major-mode) 'fundamental-mode)
+ (enable-local-variables nil)
+ (after-insert-file-functions nil))
(setq buf (find-file-noselect file)))
;; Is there a hook to run?