1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Use define-derived-mode (and derived-mode-p).

* lisp/play/snake.el (snake-mode):
* lisp/play/mpuz.el (mpuz-mode):
* lisp/play/landmark.el (lm-mode):
* lisp/play/blackbox.el (blackbox-mode):
* lisp/play/5x5.el (5x5-mode):
* lisp/obsolete/options.el (Edit-options-mode):
* lisp/net/quickurl.el (quickurl-list-mode):
* lisp/net/newst-treeview.el (newsticker-treeview-mode):
* lisp/mail/rmailsum.el (rmail-summary-mode):
* lisp/mail/mspools.el (mspools-mode):
* lisp/locate.el (locate-mode):
* lisp/ibuffer.el (ibuffer-mode):
* lisp/emulation/ws-mode.el (wordstar-mode):
* lisp/emacs-lisp/debug.el (debugger-mode):
* lisp/array.el (array-mode):
* lisp/net/eudc.el (eudc-mode): Use define-derived-mode.
* lisp/net/mairix.el (mairix-searches-mode-font-lock-keywords):
Move initialization into declaration.
(mairix-searches-mode): Use define-derived-mode.
* lisp/net/eudc-hotlist.el (eudc-hotlist-mode): Use define-derived-mode.
(eudc-edit-hotlist): Use dolist.
* lisp/man.el (Man-mode-syntax-table): Rename from man-mode-syntax-table.
(Man-mode): Use define-derived-mode.
* lisp/info.el (Info-edit-mode-map): Rename from Info-edit-map.
(Info-edit-mode): Use define-derived-mode.
(Info-cease-edit): Use Info-mode.
* lisp/eshell/esh-mode.el (eshell-mode-syntax-table): Move initialization
into declaration.
(eshell-mode): Use define-derived-mode.
* lisp/chistory.el (command-history-mode-map): Rename from
command-history-map.
(command-history-mode): Use define-derived-mode.
* lisp/calc/calc.el (calc-trail-mode-map): New var.
(calc-trail-mode): Use define-derived-mode.
(calc-trail-buffer): Set calc-main-buffer manually.
* lisp/bookmark.el (bookmark-insert-annotation): New function.
(bookmark-edit-annotation): Use it.
(bookmark-edit-annotation-mode): Make it a proper major mode.
(bookmark-send-edited-annotation): Use derived-mode-p.
* lisp/arc-mode.el (archive-mode): Move kill-all-local-variables a tiny bit
closer to its ideal place.  Use \' to match EOS.

* lisp/cedet/semantic/grammar.el (semantic-grammar-mode): Use define-derived-mode.
(semantic-grammar-mode-syntax-table): Rename from
semantic-grammar-syntax-table.
(semantic-grammar-mode-map): Rename from semantic-grammar-map.
* lisp/cedet/data-debug.el (data-debug-mode-map): Rename from data-debug-map.
(data-debug-mode): Use define-derived-mode.

* lisp/gnus/score-mode.el (gnus-score-mode-map): Move initialization
into declaration.
(gnus-score-mode): Use define-derived-mode.
* lisp/gnus/gnus-srvr.el (gnus-browse-mode): Use define-derived-mode.
* lisp/gnus/gnus-kill.el (gnus-kill-file-mode-map): Move initialization
into declaration.
(gnus-kill-file-mode): Use define-derived-mode.
(gnus-kill-file-edit-file, gnus-kill-file-enter-kill, gnus-kill):
Use derived-mode-p.
* lisp/gnus/gnus-group.el (gnus-group-mode): Use define-derived-mode.
(gnus-group-setup-buffer, gnus-group-name-at-point)
(gnus-group-make-web-group, gnus-group-enter-directory)
(gnus-group-suspend): Use derived-mode-p.
* lisp/gnus/gnus-cus.el (gnus-custom-mode): Use define-derived-mode.
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-mode): Use define-derived-mode.
* lisp/gnus/gnus-art.el (gnus-article-mode): Use define-derived-mode.
(gnus-article-setup-buffer, gnus-article-prepare)
(gnus-article-prepare-display, gnus-sticky-article)
(gnus-kill-sticky-article-buffer, gnus-kill-sticky-article-buffers)
(gnus-bind-safe-url-regexp, gnus-article-check-buffer)
(gnus-article-read-summary-keys): Use derived-mode-p.
This commit is contained in:
Stefan Monnier 2013-09-10 23:31:56 -04:00
parent 765da53c20
commit 1b3b87dfe0
38 changed files with 441 additions and 686 deletions

View file

@ -1,5 +1,47 @@
2013-09-11 Stefan Monnier <monnier@iro.umontreal.ca> 2013-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
* play/snake.el (snake-mode):
* play/mpuz.el (mpuz-mode):
* play/landmark.el (lm-mode):
* play/blackbox.el (blackbox-mode):
* play/5x5.el (5x5-mode):
* obsolete/options.el (Edit-options-mode):
* net/quickurl.el (quickurl-list-mode):
* net/newst-treeview.el (newsticker-treeview-mode):
* mail/rmailsum.el (rmail-summary-mode):
* mail/mspools.el (mspools-mode):
* locate.el (locate-mode):
* ibuffer.el (ibuffer-mode):
* emulation/ws-mode.el (wordstar-mode):
* emacs-lisp/debug.el (debugger-mode):
* array.el (array-mode):
* net/eudc.el (eudc-mode): Use define-derived-mode.
* net/mairix.el (mairix-searches-mode-font-lock-keywords):
Move initialization into declaration.
(mairix-searches-mode): Use define-derived-mode.
* net/eudc-hotlist.el (eudc-hotlist-mode): Use define-derived-mode.
(eudc-edit-hotlist): Use dolist.
* man.el (Man-mode-syntax-table): Rename from man-mode-syntax-table.
(Man-mode): Use define-derived-mode.
* info.el (Info-edit-mode-map): Rename from Info-edit-map.
(Info-edit-mode): Use define-derived-mode.
(Info-cease-edit): Use Info-mode.
* eshell/esh-mode.el (eshell-mode-syntax-table): Move initialization
into declaration.
(eshell-mode): Use define-derived-mode.
* chistory.el (command-history-mode-map): Rename from
command-history-map.
(command-history-mode): Use define-derived-mode.
* calc/calc.el (calc-trail-mode-map): New var.
(calc-trail-mode): Use define-derived-mode.
(calc-trail-buffer): Set calc-main-buffer manually.
* bookmark.el (bookmark-insert-annotation): New function.
(bookmark-edit-annotation): Use it.
(bookmark-edit-annotation-mode): Make it a proper major mode.
(bookmark-send-edited-annotation): Use derived-mode-p.
* arc-mode.el (archive-mode): Move kill-all-local-variables a tiny bit
closer to its ideal place. Use \' to match EOS.
* profiler.el (profiler-calltree-find): Use function-equal. * profiler.el (profiler-calltree-find): Use function-equal.
2013-09-10 Glenn Morris <rgm@gnu.org> 2013-09-10 Glenn Morris <rgm@gnu.org>

View file

@ -683,9 +683,9 @@ archive.
;; At present we cannot create archives from scratch ;; At present we cannot create archives from scratch
(funcall (or (default-value 'major-mode) 'fundamental-mode)) (funcall (or (default-value 'major-mode) 'fundamental-mode))
(if (and (not force) archive-files) nil (if (and (not force) archive-files) nil
(kill-all-local-variables)
(let* ((type (archive-find-type)) (let* ((type (archive-find-type))
(typename (capitalize (symbol-name type)))) (typename (capitalize (symbol-name type))))
(kill-all-local-variables)
(make-local-variable 'archive-subtype) (make-local-variable 'archive-subtype)
(setq archive-subtype type) (setq archive-subtype type)
@ -761,7 +761,7 @@ archive.
((looking-at "..-l[hz][0-9ds]-") 'lzh) ((looking-at "..-l[hz][0-9ds]-") 'lzh)
((looking-at "....................[\334]\247\304\375") 'zoo) ((looking-at "....................[\334]\247\304\375") 'zoo)
((and (looking-at "\C-z") ; signature too simple, IMHO ((and (looking-at "\C-z") ; signature too simple, IMHO
(string-match "\\.[aA][rR][cC]$" (string-match "\\.[aA][rR][cC]\\'"
(or buffer-file-name (buffer-name)))) (or buffer-file-name (buffer-name))))
'arc) 'arc)
;; This pattern modeled on the BSD/GNU+Linux `file' command. ;; This pattern modeled on the BSD/GNU+Linux `file' command.

View file

@ -800,7 +800,7 @@ Return COLUMN."
(put 'array-mode 'mode-class 'special) (put 'array-mode 'mode-class 'special)
;;;###autoload ;;;###autoload
(defun array-mode () (define-derived-mode array-mode fundamental-mode "Array"
"Major mode for editing arrays. "Major mode for editing arrays.
Array mode is a specialized mode for editing arrays. An array is Array mode is a specialized mode for editing arrays. An array is
@ -863,9 +863,6 @@ take a numeric prefix argument):
\\[array-display-local-variables] Display the current values of local variables. \\[array-display-local-variables] Display the current values of local variables.
Entering array mode calls the function `array-mode-hook'." Entering array mode calls the function `array-mode-hook'."
(interactive)
(kill-all-local-variables)
(make-local-variable 'array-buffer-line) (make-local-variable 'array-buffer-line)
(make-local-variable 'array-buffer-column) (make-local-variable 'array-buffer-column)
(make-local-variable 'array-row) (make-local-variable 'array-row)
@ -888,13 +885,9 @@ Entering array mode calls the function `array-mode-hook'."
(+ (floor (1- array-max-column) array-columns-per-line) (+ (floor (1- array-max-column) array-columns-per-line)
(if array-rows-numbered 2 1))) (if array-rows-numbered 2 1)))
(message "") (message "")
(setq major-mode 'array-mode)
(setq mode-name "Array")
(force-mode-line-update) (force-mode-line-update)
(set (make-local-variable 'truncate-lines) t) (set (make-local-variable 'truncate-lines) t)
(setq overwrite-mode 'overwrite-mode-textual) (setq overwrite-mode 'overwrite-mode-textual))
(use-local-map array-mode-map)
(run-mode-hooks 'array-mode-hook))

View file

@ -862,31 +862,25 @@ It takes one argument, the name of the bookmark, as a string.")
map) map)
"Keymap for editing an annotation of a bookmark.") "Keymap for editing an annotation of a bookmark.")
(defun bookmark-insert-annotation (bookmark-name-or-record)
(defun bookmark-edit-annotation-mode (bookmark-name-or-record)
"Mode for editing the annotation of bookmark BOOKMARK-NAME-OR-RECORD.
When you have finished composing, type \\[bookmark-send-annotation].
\\{bookmark-edit-annotation-mode-map}"
(interactive)
(kill-all-local-variables)
(make-local-variable 'bookmark-annotation-name)
(setq bookmark-annotation-name bookmark-name-or-record)
(use-local-map bookmark-edit-annotation-mode-map)
(setq major-mode 'bookmark-edit-annotation-mode
mode-name "Edit Bookmark Annotation")
(insert (funcall bookmark-edit-annotation-text-func bookmark-name-or-record)) (insert (funcall bookmark-edit-annotation-text-func bookmark-name-or-record))
(let ((annotation (bookmark-get-annotation bookmark-name-or-record))) (let ((annotation (bookmark-get-annotation bookmark-name-or-record)))
(if (and annotation (not (string-equal annotation ""))) (if (and annotation (not (string-equal annotation "")))
(insert annotation))) (insert annotation))))
(run-mode-hooks 'text-mode-hook))
(define-derived-mode bookmark-edit-annotation-mode
text-mode "Edit Bookmark Annotation"
"Mode for editing the annotation of bookmarks.
When you have finished composing, type \\[bookmark-send-annotation].
\\{bookmark-edit-annotation-mode-map}")
(defun bookmark-send-edited-annotation () (defun bookmark-send-edited-annotation ()
"Use buffer contents as annotation for a bookmark. "Use buffer contents as annotation for a bookmark.
Lines beginning with `#' are ignored." Lines beginning with `#' are ignored."
(interactive) (interactive)
(if (not (eq major-mode 'bookmark-edit-annotation-mode)) (if (not (derived-mode-p 'bookmark-edit-annotation-mode))
(error "Not in bookmark-edit-annotation-mode")) (error "Not in bookmark-edit-annotation-mode"))
(goto-char (point-min)) (goto-char (point-min))
(while (< (point) (point-max)) (while (< (point) (point-max))
@ -906,7 +900,10 @@ Lines beginning with `#' are ignored."
(defun bookmark-edit-annotation (bookmark-name-or-record) (defun bookmark-edit-annotation (bookmark-name-or-record)
"Pop up a buffer for editing bookmark BOOKMARK-NAME-OR-RECORD's annotation." "Pop up a buffer for editing bookmark BOOKMARK-NAME-OR-RECORD's annotation."
(pop-to-buffer (generate-new-buffer-name "*Bookmark Annotation Compose*")) (pop-to-buffer (generate-new-buffer-name "*Bookmark Annotation Compose*"))
(bookmark-edit-annotation-mode bookmark-name-or-record)) (bookmark-insert-annotation bookmark-name-or-record)
(bookmark-edit-annotation-mode)
(set (make-local-variable 'bookmark-annotation-name)
bookmark-name-or-record))
(defun bookmark-buffer-name () (defun bookmark-buffer-name ()

View file

@ -1387,7 +1387,12 @@ Notations: 3.14e6 3.14 * 10^6
(calc-check-defines)) (calc-check-defines))
(setplist 'calc-define nil))))) (setplist 'calc-define nil)))))
(defun calc-trail-mode (&optional buf) (defvar calc-trail-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map calc-mode-map)
map))
(define-derived-mode calc-trail-mode fundamental-mode "Calc Trail"
"Calc Trail mode. "Calc Trail mode.
This mode is used by the *Calc Trail* buffer, which records all results This mode is used by the *Calc Trail* buffer, which records all results
obtained by the GNU Emacs Calculator. obtained by the GNU Emacs Calculator.
@ -1397,26 +1402,18 @@ the Trail.
This buffer uses the same key map as the *Calculator* buffer; calculator This buffer uses the same key map as the *Calculator* buffer; calculator
commands given here will actually operate on the *Calculator* stack." commands given here will actually operate on the *Calculator* stack."
(interactive)
(fundamental-mode)
(use-local-map calc-mode-map)
(setq major-mode 'calc-trail-mode)
(setq mode-name "Calc Trail")
(setq truncate-lines t) (setq truncate-lines t)
(setq buffer-read-only t) (setq buffer-read-only t)
(make-local-variable 'overlay-arrow-position) (make-local-variable 'overlay-arrow-position)
(make-local-variable 'overlay-arrow-string) (make-local-variable 'overlay-arrow-string)
(when buf
(set (make-local-variable 'calc-main-buffer) buf))
(when (= (buffer-size) 0) (when (= (buffer-size) 0)
(let ((buffer-read-only nil)) (let ((buffer-read-only nil))
(insert (propertize "Emacs Calculator Trail\n" 'face 'italic)))) (insert (propertize "Emacs Calculator Trail\n" 'face 'italic)))))
(run-mode-hooks 'calc-trail-mode-hook))
(defun calc-create-buffer () (defun calc-create-buffer ()
"Create and initialize a buffer for the Calculator." "Create and initialize a buffer for the Calculator."
(set-buffer (get-buffer-create "*Calculator*")) (set-buffer (get-buffer-create "*Calculator*"))
(or (eq major-mode 'calc-mode) (or (derived-mode-p 'calc-mode)
(calc-mode)) (calc-mode))
(setq max-lisp-eval-depth (max max-lisp-eval-depth 1000)) (setq max-lisp-eval-depth (max max-lisp-eval-depth 1000))
(when calc-always-load-extensions (when calc-always-load-extensions
@ -1439,7 +1436,7 @@ commands given here will actually operate on the *Calculator* stack."
(when (get-buffer-window "*Calc Keypad*") (when (get-buffer-window "*Calc Keypad*")
(calc-keypad) (calc-keypad)
(set-buffer (window-buffer))) (set-buffer (window-buffer)))
(if (eq major-mode 'calc-mode) (if (derived-mode-p 'calc-mode)
(calc-quit) (calc-quit)
(let ((oldbuf (current-buffer))) (let ((oldbuf (current-buffer)))
(calc-create-buffer) (calc-create-buffer)
@ -1490,7 +1487,7 @@ commands given here will actually operate on the *Calculator* stack."
(if (and (equal (buffer-name) "*Gnuplot Trail*") (if (and (equal (buffer-name) "*Gnuplot Trail*")
(> (recursion-depth) 0)) (> (recursion-depth) 0))
(exit-recursive-edit) (exit-recursive-edit)
(if (eq major-mode 'calc-edit-mode) (if (derived-mode-p 'calc-edit-mode)
(calc-edit-finish arg) (calc-edit-finish arg)
(if calc-was-keypad-mode (if calc-was-keypad-mode
(calc-keypad) (calc-keypad)
@ -1504,13 +1501,13 @@ commands given here will actually operate on the *Calculator* stack."
(if (and (equal (buffer-name) "*Gnuplot Trail*") (if (and (equal (buffer-name) "*Gnuplot Trail*")
(> (recursion-depth) 0)) (> (recursion-depth) 0))
(exit-recursive-edit)) (exit-recursive-edit))
(if (eq major-mode 'calc-edit-mode) (if (derived-mode-p 'calc-edit-mode)
(calc-edit-cancel) (calc-edit-cancel)
(if (and interactive (if (and interactive
calc-embedded-info calc-embedded-info
(eq (current-buffer) (aref calc-embedded-info 0))) (eq (current-buffer) (aref calc-embedded-info 0)))
(calc-embedded nil) (calc-embedded nil)
(unless (eq major-mode 'calc-mode) (unless (derived-mode-p 'calc-mode)
(calc-create-buffer)) (calc-create-buffer))
(run-hooks 'calc-end-hook) (run-hooks 'calc-end-hook)
(if (integerp calc-undo-length) (if (integerp calc-undo-length)
@ -1631,10 +1628,10 @@ See calc-keypad for details."
(if (math-lessp 1 time) (if (math-lessp 1 time)
(calc-record time "(t)")))) (calc-record time "(t)"))))
(or (memq 'no-align calc-command-flags) (or (memq 'no-align calc-command-flags)
(eq major-mode 'calc-trail-mode) (derived-mode-p 'calc-trail-mode)
(calc-align-stack-window)) (calc-align-stack-window))
(and (memq 'position-point calc-command-flags) (and (memq 'position-point calc-command-flags)
(if (eq major-mode 'calc-mode) (if (derived-mode-p 'calc-mode)
(progn (progn
(goto-char (point-min)) (goto-char (point-min))
(forward-line (1- calc-final-point-line)) (forward-line (1- calc-final-point-line))
@ -1664,7 +1661,7 @@ See calc-keypad for details."
(setq calc-command-flags (cons f calc-command-flags)))) (setq calc-command-flags (cons f calc-command-flags))))
(defun calc-select-buffer () (defun calc-select-buffer ()
(or (eq major-mode 'calc-mode) (or (derived-mode-p 'calc-mode)
(if calc-main-buffer (if calc-main-buffer
(set-buffer calc-main-buffer) (set-buffer calc-main-buffer)
(let ((buf (get-buffer "*Calculator*"))) (let ((buf (get-buffer "*Calculator*")))
@ -1801,7 +1798,7 @@ See calc-keypad for details."
(and calc-embedded-info (calc-embedded-mode-line-change)))))) (and calc-embedded-info (calc-embedded-mode-line-change))))))
(defun calc-align-stack-window () (defun calc-align-stack-window ()
(if (eq major-mode 'calc-mode) (if (derived-mode-p 'calc-mode)
(progn (progn
(let ((win (get-buffer-window (current-buffer)))) (let ((win (get-buffer-window (current-buffer))))
(if win (if win
@ -1988,7 +1985,7 @@ See calc-keypad for details."
(defvar calc-any-evaltos nil) (defvar calc-any-evaltos nil)
(defun calc-refresh (&optional align) (defun calc-refresh (&optional align)
(interactive) (interactive)
(and (eq major-mode 'calc-mode) (and (derived-mode-p 'calc-mode)
(not calc-executing-macro) (not calc-executing-macro)
(let* ((buffer-read-only nil) (let* ((buffer-read-only nil)
(save-point (point)) (save-point (point))
@ -2016,7 +2013,7 @@ See calc-keypad for details."
(calc-align-stack-window) (calc-align-stack-window)
(goto-char save-point)) (goto-char save-point))
(if save-mark (set-mark save-mark)))) (if save-mark (set-mark save-mark))))
(and calc-embedded-info (not (eq major-mode 'calc-mode)) (and calc-embedded-info (not (derived-mode-p 'calc-mode))
(with-current-buffer (aref calc-embedded-info 1) (with-current-buffer (aref calc-embedded-info 1)
(calc-refresh align))) (calc-refresh align)))
(setq calc-refresh-count (1+ calc-refresh-count))) (setq calc-refresh-count (1+ calc-refresh-count)))
@ -2078,12 +2075,13 @@ the United States."
(null (buffer-name calc-trail-buffer))) (null (buffer-name calc-trail-buffer)))
(save-excursion (save-excursion
(setq calc-trail-buffer (get-buffer-create "*Calc Trail*")) (setq calc-trail-buffer (get-buffer-create "*Calc Trail*"))
(let ((buf (or (and (not (eq major-mode 'calc-mode)) (let ((buf (or (and (not (derived-mode-p 'calc-mode))
(get-buffer "*Calculator*")) (get-buffer "*Calculator*"))
(current-buffer)))) (current-buffer))))
(set-buffer calc-trail-buffer) (set-buffer calc-trail-buffer)
(or (eq major-mode 'calc-trail-mode) (unless (derived-mode-p 'calc-trail-mode)
(calc-trail-mode buf))))) (calc-trail-mode)
(set (make-local-variable 'calc-main-buffer) buf)))))
(or (and calc-trail-pointer (or (and calc-trail-pointer
(eq (marker-buffer calc-trail-pointer) calc-trail-buffer)) (eq (marker-buffer calc-trail-pointer) calc-trail-buffer))
(with-current-buffer calc-trail-buffer (with-current-buffer calc-trail-buffer
@ -2152,7 +2150,7 @@ the United States."
(defun calc-trail-here () (defun calc-trail-here ()
(interactive) (interactive)
(if (eq major-mode 'calc-trail-mode) (if (derived-mode-p 'calc-trail-mode)
(progn (progn
(beginning-of-line) (beginning-of-line)
(if (bobp) (if (bobp)

View file

@ -1,3 +1,12 @@
2013-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
* semantic/grammar.el (semantic-grammar-mode): Use define-derived-mode.
(semantic-grammar-mode-syntax-table): Rename from
semantic-grammar-syntax-table.
(semantic-grammar-mode-map): Rename from semantic-grammar-map.
* data-debug.el (data-debug-mode-map): Rename from data-debug-map.
(data-debug-mode): Use define-derived-mode.
2013-09-05 Glenn Morris <rgm@gnu.org> 2013-09-05 Glenn Morris <rgm@gnu.org>
* semantic/fw.el (semantic-make-local-hook): * semantic/fw.el (semantic-make-local-hook):
@ -15,15 +24,15 @@
* semantic/decorate/mode.el * semantic/decorate/mode.el
(semantic-decoration-on-includes-p-default) (semantic-decoration-on-includes-p-default)
(semantic-decoration-on-includes-highlight-default): Declare for (semantic-decoration-on-includes-highlight-default): Declare for
byte compiler. byte compiler.
* semantic/wisent/python.el (semantic/format): New require. * semantic/wisent/python.el (semantic/format): New require.
2013-07-27 Eric Ludlam <zappo@gnu.org> 2013-07-27 Eric Ludlam <zappo@gnu.org>
* lisp/cedet/semantic/edit.el (semantic-edits-splice-remove): Wrap * lisp/cedet/semantic/edit.el (semantic-edits-splice-remove):
debug message removing middle tag in semantic-edits-verbose-flag Wrap debug message removing middle tag in semantic-edits-verbose-flag
check. check.
2013-07-27 David Engster <deng@randomsample.de> 2013-07-27 David Engster <deng@randomsample.de>
@ -69,8 +78,8 @@
`semantic/decorate/include' anymore. `semantic/decorate/include' anymore.
(semantic-toggle-decoration-style): Error if an unknown decoration (semantic-toggle-decoration-style): Error if an unknown decoration
style is toggled. style is toggled.
(define-semantic-decoration-style): Add new :load option. When (define-semantic-decoration-style): Add new :load option.
:load is specified, add autoload tokens for the definition When :load is specified, add autoload tokens for the definition
functions so that code is loaded when the mode is used. functions so that code is loaded when the mode is used.
(semantic-decoration-on-includes): New autoload definition for (semantic-decoration-on-includes): New autoload definition for
highlighting includes. highlighting includes.
@ -94,8 +103,8 @@
* semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New.
(semantic-ctxt-current-symbol-default): New. (semantic-ctxt-current-symbol-default): New.
* semantic/bovine/el.el (semantic-default-elisp-setup): Add * semantic/bovine/el.el (semantic-default-elisp-setup):
autoload cookie. Explain existence. Add autoload cookie. Explain existence.
(footer): Add local variable for loaddefs. (footer): Add local variable for loaddefs.
* semantic/db.el (semanticdb-file-table-object): Add new filter, * semantic/db.el (semanticdb-file-table-object): Add new filter,
@ -120,7 +129,7 @@
* ede/cpp-root.el (ede-preprocessor-map): Protect against init * ede/cpp-root.el (ede-preprocessor-map): Protect against init
problems. problems.
* ede/proj.el (ede-proj-target): Added a new "custom" option for * ede/proj.el (ede-proj-target): Add a new "custom" option for
custom symbols representing a compiler or linker instead of custom symbols representing a compiler or linker instead of
restricting things to only the predefined compilers and linkers. restricting things to only the predefined compilers and linkers.
@ -198,15 +207,15 @@
2013-04-27 David Engster <deng@randomsample.de> 2013-04-27 David Engster <deng@randomsample.de>
* semantic/complete.el * semantic/complete.el
(semantic-collector-calculate-completions-raw): If (semantic-collector-calculate-completions-raw):
`completionslist' is not set, refresh the cache if necessary and If `completionslist' is not set, refresh the cache if necessary and
use it for completions. This fixes the use it for completions. This fixes the
`semantic-collector-buffer-deep' collector (bug#14265). `semantic-collector-buffer-deep' collector (bug#14265).
2013-03-26 Leo Liu <sdl.web@gmail.com> 2013-03-26 Leo Liu <sdl.web@gmail.com>
* semantic/senator.el (senator-copy-tag-to-register): Move * semantic/senator.el (senator-copy-tag-to-register):
register handling logic from register.el. (Bug#14052) Move register handling logic from register.el. (Bug#14052)
2013-03-21 Eric Ludlam <zappo@gnu.org> 2013-03-21 Eric Ludlam <zappo@gnu.org>
@ -223,17 +232,17 @@
* semantic/find.el (semantic-filter-tags-by-class): New function. * semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add * semantic/tag-ls.el (semantic-tag-similar-p-default):
short-circuit in case tag1 and 2 are identical. Add short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el * semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use (semantic-analyze-dereference-metatype-stack):
`semantic-tag-similar-p' instead of 'eq' when comparing two tags Use `semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the during metatype evaluation in case they are the same, but not the
same node. (Tweaked patch from Tomasz Gajewski) (Tiny change) same node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix * semantic/db-find.el (semanticdb-partial-synchronize):
require to semantic/db-typecache to be correct. Fix require to semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a (semanticdb-find-tags-external-children-of-type): Make this a
brutish search by default. brutish search by default.
@ -243,19 +252,19 @@
input tag as the place to start searching for externally defined input tag as the place to start searching for externally defined
methods. methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc * semantic/db-file.el (semanticdb-default-save-directory):
fix: Add ref to default value. Doc fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When * semantic/complete.el (semantic-complete-post-command-hook):
detecting if cursor is outside completion area, do so if cursor When detecting if cursor is outside completion area, do so if cursor
moves before start of overlay, or the original starting location moves before start of overlay, or the original starting location
of the overlay (i.e., if user deletes past beginning of the of the overlay (i.e., if user deletes past beginning of the
overlay region). overlay region).
(semantic-complete-inline-tag-engine): Initialize original start (semantic-complete-inline-tag-engine): Initialize original start
of `semantic-complete-inline-overlay'. of `semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update * semantic/bovine/c.el (semantic-c-describe-environment):
some section titles. Test semanticdb table before printing it. Update some section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update (semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all `semantic-lex-spp-macro-symbol-obarray' outside the loop over all
the files contributing to its value. the files contributing to its value.
@ -271,8 +280,8 @@
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all * srecode/cpp.el (srecode-semantic-handle-:c): Replace all
characters in FILENAME_SYMBOL that aren't valid CPP symbol chars. characters in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force * srecode/map.el (srecode-map-validate-file-for-mode):
semantic to load if it is not active in the template being added Force semantic to load if it is not active in the template being added
to the map. to the map.
* srecode/srt.el: Add local variables for setting the autoload * srecode/srt.el: Add local variables for setting the autoload
@ -287,7 +296,7 @@
has both a version variable and a Version: comment, always use has both a version variable and a Version: comment, always use
`call-next-method'. `call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted. * ede/cpp-root.el (ede-set-project-variables): Delete.
`ede-preprocessor-map' does the job this function was attempting `ede-preprocessor-map' does the job this function was attempting
to do with :spp-table. to do with :spp-table.
(ede-preprocessor-map): Update file tests to provide better (ede-preprocessor-map): Update file tests to provide better
@ -302,8 +311,8 @@
2013-03-21 David Engster <deng@randomsample.de> 2013-03-21 David Engster <deng@randomsample.de>
* semantic/bovine/c.el (semantic-get-local-variables): Also add a * semantic/bovine/c.el (semantic-get-local-variables): Also add a
new variable 'this' if we are in an inline member function. For new variable 'this' if we are in an inline member function.
detecting this, we check overlays at point if there is a class For detecting this, we check overlays at point if there is a class
spanning the current function. Also, the variable 'this' has to spanning the current function. Also, the variable 'this' has to
be a pointer. be a pointer.
@ -350,14 +359,14 @@
2013-03-21 Tomasz Gajewski <tomga@wp.pl> (tiny change) 2013-03-21 Tomasz Gajewski <tomga@wp.pl> (tiny change)
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix * ede/cpp-root.el (ede-project-autoload, initialize-instance):
EDE file symbol to match rename. Fix ede-cpp-root symbol to Fix EDE file symbol to match rename. Fix ede-cpp-root symbol to
include -project in name. include -project in name.
2013-03-21 Alex Ott <alexott@gmail.com> 2013-03-21 Alex Ott <alexott@gmail.com>
* cedet-files.el (cedet-files-list-recursively): New. Recursively * cedet-files.el (cedet-files-list-recursively): New.
find files whose names are matching to given regex. Recursively find files whose names are matching to given regex.
* ede.el (ede-current-project): Rewrite to avoid imperative style. * ede.el (ede-current-project): Rewrite to avoid imperative style.

View file

@ -869,7 +869,8 @@ If PARENT is non-nil, it is somehow related as a parent to thing."
table) table)
"Syntax table used in data-debug macro buffers.") "Syntax table used in data-debug macro buffers.")
(defvar data-debug-map (define-obsolete-variable-alias 'data-debug-map 'data-debug-mode-map "24.1")
(defvar data-debug-mode-map
(let ((km (make-sparse-keymap))) (let ((km (make-sparse-keymap)))
(suppress-keymap km) (suppress-keymap km)
(define-key km [mouse-2] 'data-debug-expand-or-contract-mouse) (define-key km [mouse-2] 'data-debug-expand-or-contract-mouse)
@ -887,22 +888,15 @@ If PARENT is non-nil, it is somehow related as a parent to thing."
:group 'data-debug :group 'data-debug
:type 'hook) :type 'hook)
(defun data-debug-mode () (define-derived-mode data-debug-mode fundamental-mode "DATA-DEBUG"
"Major-mode for the Analyzer debugger. "Major-mode for the Analyzer debugger.
\\{data-debug-map}" \\{data-debug-mode-map}"
(interactive) (setq comment-start ";;"
(kill-all-local-variables)
(setq major-mode 'data-debug-mode
mode-name "DATA-DEBUG"
comment-start ";;"
comment-end "" comment-end ""
buffer-read-only t) buffer-read-only t)
(set (make-local-variable 'comment-start-skip) (setq-local comment-start-skip
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
(set-syntax-table data-debug-mode-syntax-table)
(use-local-map data-debug-map)
(run-hooks 'data-debug-hook)
(buffer-disable-undo) (buffer-disable-undo)
(set (make-local-variable 'font-lock-global-modes) nil) (set (make-local-variable 'font-lock-global-modes) nil)
(font-lock-mode -1) (font-lock-mode -1)

View file

@ -860,7 +860,7 @@ Lisp code."
;; Use Unix EOLs, so that the file is portable to all platforms. ;; Use Unix EOLs, so that the file is portable to all platforms.
(setq buffer-file-coding-system 'raw-text-unix) (setq buffer-file-coding-system 'raw-text-unix)
(erase-buffer) (erase-buffer)
(unless (eq major-mode 'emacs-lisp-mode) (unless (derived-mode-p 'emacs-lisp-mode)
(emacs-lisp-mode)) (emacs-lisp-mode))
;;;; Header + Prologue ;;;; Header + Prologue
@ -1102,7 +1102,9 @@ END is the limit of the search."
;;;; Define major mode ;;;; Define major mode
;;;; ;;;;
(defvar semantic-grammar-syntax-table (define-obsolete-variable-alias 'semantic-grammar-syntax-table
'semantic-grammar-mode-syntax-table "24.1")
(defvar semantic-grammar-mode-syntax-table
(let ((table (make-syntax-table (standard-syntax-table)))) (let ((table (make-syntax-table (standard-syntax-table))))
(modify-syntax-entry ?\: "." table) ;; COLON (modify-syntax-entry ?\: "." table) ;; COLON
(modify-syntax-entry ?\> "." table) ;; GT (modify-syntax-entry ?\> "." table) ;; GT
@ -1170,7 +1172,9 @@ END is the limit of the search."
semantic-grammar-mode-keywords-1 semantic-grammar-mode-keywords-1
"Font Lock keywords used to highlight Semantic grammar buffers.") "Font Lock keywords used to highlight Semantic grammar buffers.")
(defvar semantic-grammar-map (define-obsolete-variable-alias 'semantic-grammar-map
'semantic-grammar-mode-map "24.1")
(defvar semantic-grammar-mode-map
(let ((km (make-sparse-keymap))) (let ((km (make-sparse-keymap)))
(define-key km "|" 'semantic-grammar-electric-punctuation) (define-key km "|" 'semantic-grammar-electric-punctuation)
@ -1271,22 +1275,17 @@ the change bounds to encompass the whole nonterminal tag."
(semantic-tag-start outer) (semantic-tag-start outer)
(semantic-tag-end outer))))) (semantic-tag-end outer)))))
(defun semantic-grammar-mode () (define-derived-mode semantic-grammar-mode
fundamental-mode "Semantic Grammar Framework"
"Initialize a buffer for editing Semantic grammars. "Initialize a buffer for editing Semantic grammars.
\\{semantic-grammar-map}" \\{semantic-grammar-mode-map}"
(interactive)
(kill-all-local-variables)
(setq major-mode 'semantic-grammar-mode
mode-name "Semantic Grammar Framework")
(set (make-local-variable 'parse-sexp-ignore-comments) t) (set (make-local-variable 'parse-sexp-ignore-comments) t)
(set (make-local-variable 'comment-start) ";;") (set (make-local-variable 'comment-start) ";;")
;; Look within the line for a ; following an even number of backslashes ;; Look within the line for a ; following an even number of backslashes
;; after either a non-backslash or the line beginning. ;; after either a non-backslash or the line beginning.
(set (make-local-variable 'comment-start-skip) (set (make-local-variable 'comment-start-skip)
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
(set-syntax-table semantic-grammar-syntax-table)
(use-local-map semantic-grammar-map)
(set (make-local-variable 'indent-line-function) (set (make-local-variable 'indent-line-function)
'semantic-grammar-indent) 'semantic-grammar-indent)
(set (make-local-variable 'fill-paragraph-function) (set (make-local-variable 'fill-paragraph-function)
@ -1335,15 +1334,14 @@ the change bounds to encompass the whole nonterminal tag."
(semantic-make-local-hook 'semantic-edits-new-change-functions) (semantic-make-local-hook 'semantic-edits-new-change-functions)
(add-hook 'semantic-edits-new-change-functions (add-hook 'semantic-edits-new-change-functions
'semantic-grammar-edits-new-change-hook-fcn 'semantic-grammar-edits-new-change-hook-fcn
nil t) nil t))
(semantic-run-mode-hooks 'semantic-grammar-mode-hook))
;;;; ;;;;
;;;; Useful commands ;;;; Useful commands
;;;; ;;;;
(defvar semantic-grammar-skip-quoted-syntax-table (defvar semantic-grammar-skip-quoted-syntax-table
(let ((st (copy-syntax-table semantic-grammar-syntax-table))) (let ((st (copy-syntax-table semantic-grammar-mode-syntax-table)))
(modify-syntax-entry ?\' "$" st) (modify-syntax-entry ?\' "$" st)
st) st)
"Syntax table to skip a whole quoted expression in grammar code. "Syntax table to skip a whole quoted expression in grammar code.

View file

@ -121,7 +121,9 @@ The buffer is left in Command History mode."
(error "No command history") (error "No command history")
(command-history-mode))))) (command-history-mode)))))
(defvar command-history-map (define-obsolete-variable-alias 'command-history-map
'command-history-mode-map "24.1")
(defvar command-history-mode-map
(let ((map (make-sparse-keymap))) (let ((map (make-sparse-keymap)))
(set-keymap-parent map lisp-mode-shared-map) (set-keymap-parent map lisp-mode-shared-map)
(suppress-keymap map) (suppress-keymap map)
@ -132,21 +134,11 @@ The buffer is left in Command History mode."
map) map)
"Keymap for `command-history-mode'.") "Keymap for `command-history-mode'.")
(defun command-history-mode () (define-derived-mode command-history-mode fundamental-mode "Command History"
"Major mode for listing and repeating recent commands. "Major mode for listing and repeating recent commands.
Keybindings: Keybindings:
\\{command-history-map}" \\{command-history-mode-map}"
(interactive)
(Command-history-setup)
(setq major-mode 'command-history-mode)
(setq mode-name "Command History")
(use-local-map command-history-map)
(run-mode-hooks 'command-history-mode-hook))
(defun Command-history-setup ()
(kill-all-local-variables)
(use-local-map command-history-map)
(lisp-mode-variables nil) (lisp-mode-variables nil)
(set-syntax-table emacs-lisp-mode-syntax-table) (set-syntax-table emacs-lisp-mode-syntax-table)
(setq buffer-read-only t)) (setq buffer-read-only t))

View file

@ -3793,25 +3793,21 @@ REGEXP-GROUP is the regular expression group in REGEXP to use."
;; comint-mode will take care of it. The following example, from shell.el, ;; comint-mode will take care of it. The following example, from shell.el,
;; is typical: ;; is typical:
;; ;;
;; (defvar shell-mode-map '()) ;; (defvar shell-mode-map
;; (cond ((not shell-mode-map) ;; (let ((map (make-sparse-keymap)))
;; (setq shell-mode-map (copy-keymap comint-mode-map)) ;; (set-keymap-parent map comint-mode-map)
;; (define-key shell-mode-map "\C-c\C-f" 'shell-forward-command) ;; (define-key map "\C-c\C-f" 'shell-forward-command)
;; (define-key shell-mode-map "\C-c\C-b" 'shell-backward-command) ;; (define-key map "\C-c\C-b" 'shell-backward-command)
;; (define-key shell-mode-map "\t" 'completion-at-point) ;; (define-key map "\t" 'completion-at-point)
;; (define-key shell-mode-map "\M-?" ;; (define-key map "\M-?"
;; 'comint-dynamic-list-filename-completions))) ;; 'comint-dynamic-list-filename-completions)
;; map))
;; ;;
;; (defun shell-mode () ;; (define-derived-mode shell-mode comint-mode "Shell"
;; (interactive) ;; "Doc."
;; (comint-mode)
;; (setq comint-prompt-regexp shell-prompt-pattern) ;; (setq comint-prompt-regexp shell-prompt-pattern)
;; (setq major-mode 'shell-mode)
;; (setq mode-name "Shell")
;; (use-local-map shell-mode-map)
;; (setq-local shell-directory-stack nil) ;; (setq-local shell-directory-stack nil)
;; (add-hook 'comint-input-filter-functions 'shell-directory-tracker) ;; (add-hook 'comint-input-filter-functions 'shell-directory-tracker))
;; (run-mode-hooks 'shell-mode-hook))
;; ;;
;; ;;
;; Completion for comint-mode users ;; Completion for comint-mode users

View file

@ -626,7 +626,7 @@ The environment used is the one when entering the activation frame at point."
(put 'debugger-mode 'mode-class 'special) (put 'debugger-mode 'mode-class 'special)
(defun debugger-mode () (define-derived-mode debugger-mode fundamental-mode "Debugger"
"Mode for backtrace buffers, selected in debugger. "Mode for backtrace buffers, selected in debugger.
\\<debugger-mode-map> \\<debugger-mode-map>
A line starts with `*' if exiting that frame will call the debugger. A line starts with `*' if exiting that frame will call the debugger.
@ -641,13 +641,9 @@ which functions will enter the debugger when called.
Complete list of commands: Complete list of commands:
\\{debugger-mode-map}" \\{debugger-mode-map}"
(kill-all-local-variables)
(setq major-mode 'debugger-mode)
(setq mode-name "Debugger")
(setq truncate-lines t) (setq truncate-lines t)
(set-syntax-table emacs-lisp-mode-syntax-table) (set-syntax-table emacs-lisp-mode-syntax-table)
(use-local-map debugger-mode-map) (use-local-map debugger-mode-map))
(run-mode-hooks 'debugger-mode-hook))
(defcustom debugger-record-buffer "*Debugger-record*" (defcustom debugger-record-buffer "*Debugger-record*"
"Buffer name for expression values, for \\[debugger-record-expression]." "Buffer name for expression values, for \\[debugger-record-expression]."

View file

@ -73,8 +73,7 @@
(define-key map "\C-x" 'save-buffers-kill-emacs) (define-key map "\C-x" 'save-buffers-kill-emacs)
(define-key map "y" 'ws-delete-block) (define-key map "y" 'ws-delete-block)
(define-key map "\C-y" 'ws-delete-block) (define-key map "\C-y" 'ws-delete-block)
map) map))
"")
(defvar wordstar-C-o-map (defvar wordstar-C-o-map
(let ((map (make-keymap))) (let ((map (make-keymap)))
@ -140,8 +139,7 @@
(define-key map "y" 'ws-kill-eol) (define-key map "y" 'ws-kill-eol)
(define-key map "\C-y" 'ws-kill-eol) (define-key map "\C-y" 'ws-kill-eol)
(define-key map "\177" 'ws-kill-bol) (define-key map "\177" 'ws-kill-bol)
map) map))
"")
(defvar wordstar-mode-map (defvar wordstar-mode-map
(let ((map (make-keymap))) (let ((map (make-keymap)))
@ -170,17 +168,16 @@
(define-key map "\C-x" 'next-line) (define-key map "\C-x" 'next-line)
(define-key map "\C-y" 'kill-complete-line) (define-key map "\C-y" 'kill-complete-line)
(define-key map "\C-z" 'scroll-up-line) (define-key map "\C-z" 'scroll-up-line)
map) map))
"")
;; wordstar-C-j-map not yet implemented ;; wordstar-C-j-map not yet implemented
(defvar wordstar-C-j-map nil "") (defvar wordstar-C-j-map nil)
(put 'wordstar-mode 'mode-class 'special) (put 'wordstar-mode 'mode-class 'special)
;;;###autoload ;;;###autoload
(defun wordstar-mode () (define-derived-mode wordstar-mode fundamental-mode "WordStar"
"Major mode with WordStar-like key bindings. "Major mode with WordStar-like key bindings.
BUGS: BUGS:
@ -191,106 +188,7 @@ BUGS:
- Search and replace (C-q a) is only available in forward direction - Search and replace (C-q a) is only available in forward direction
No key bindings beginning with ESC are installed, they will work No key bindings beginning with ESC are installed, they will work
Emacs-like. Emacs-like.")
The key bindings are:
C-a backward-word
C-b fill-paragraph
C-c scroll-up-line
C-d forward-char
C-e previous-line
C-f forward-word
C-g delete-char
C-h backward-char
C-i indent-for-tab-command
C-j help-for-help
C-k ordstar-C-k-map
C-l ws-repeat-search
C-n open-line
C-p quoted-insert
C-r scroll-down-line
C-s backward-char
C-t kill-word
C-u keyboard-quit
C-v overwrite-mode
C-w scroll-down
C-x next-line
C-y kill-complete-line
C-z scroll-up
C-k 0 ws-set-marker-0
C-k 1 ws-set-marker-1
C-k 2 ws-set-marker-2
C-k 3 ws-set-marker-3
C-k 4 ws-set-marker-4
C-k 5 ws-set-marker-5
C-k 6 ws-set-marker-6
C-k 7 ws-set-marker-7
C-k 8 ws-set-marker-8
C-k 9 ws-set-marker-9
C-k b ws-begin-block
C-k c ws-copy-block
C-k d save-buffers-kill-emacs
C-k f find-file
C-k h ws-show-markers
C-k i ws-indent-block
C-k k ws-end-block
C-k p ws-print-block
C-k q kill-emacs
C-k r insert-file
C-k s save-some-buffers
C-k t ws-mark-word
C-k u ws-exdent-block
C-k C-u keyboard-quit
C-k v ws-move-block
C-k w ws-write-block
C-k x kill-emacs
C-k y ws-delete-block
C-o c wordstar-center-line
C-o b switch-to-buffer
C-o j justify-current-line
C-o k kill-buffer
C-o l list-buffers
C-o m auto-fill-mode
C-o r set-fill-column
C-o C-u keyboard-quit
C-o wd delete-other-windows
C-o wh split-window-right
C-o wo other-window
C-o wv split-window-below
C-q 0 ws-find-marker-0
C-q 1 ws-find-marker-1
C-q 2 ws-find-marker-2
C-q 3 ws-find-marker-3
C-q 4 ws-find-marker-4
C-q 5 ws-find-marker-5
C-q 6 ws-find-marker-6
C-q 7 ws-find-marker-7
C-q 8 ws-find-marker-8
C-q 9 ws-find-marker-9
C-q a ws-query-replace
C-q b ws-to-block-begin
C-q c end-of-buffer
C-q d end-of-line
C-q f ws-search
C-q k ws-to-block-end
C-q l ws-undo
C-q p ws-last-cursorp
C-q r beginning-of-buffer
C-q C-u keyboard-quit
C-q w ws-last-error
C-q y ws-kill-eol
C-q DEL ws-kill-bol
"
(interactive)
(kill-all-local-variables)
(use-local-map wordstar-mode-map)
(setq mode-name "WordStar")
(setq major-mode 'wordstar-mode)
(run-mode-hooks 'wordstar-mode-hook))
(defun wordstar-center-paragraph () (defun wordstar-center-paragraph ()

View file

@ -220,74 +220,66 @@ This is used by `eshell-watch-for-password-prompt'."
(defvar eshell-last-output-end nil) (defvar eshell-last-output-end nil)
(defvar eshell-currently-handling-window nil) (defvar eshell-currently-handling-window nil)
(defvar eshell-mode-syntax-table nil)
(defvar eshell-mode-abbrev-table nil)
(define-abbrev-table 'eshell-mode-abbrev-table ()) (define-abbrev-table 'eshell-mode-abbrev-table ())
(if (not eshell-mode-syntax-table) (defvar eshell-mode-syntax-table
(let ((i 0)) (let ((st (make-syntax-table))
(setq eshell-mode-syntax-table (make-syntax-table)) (i 0))
(while (< i ?0) (while (< i ?0)
(modify-syntax-entry i "_ " eshell-mode-syntax-table) (modify-syntax-entry i "_ " st)
(setq i (1+ i))) (setq i (1+ i)))
(setq i (1+ ?9)) (setq i (1+ ?9))
(while (< i ?A) (while (< i ?A)
(modify-syntax-entry i "_ " eshell-mode-syntax-table) (modify-syntax-entry i "_ " st)
(setq i (1+ i))) (setq i (1+ i)))
(setq i (1+ ?Z)) (setq i (1+ ?Z))
(while (< i ?a) (while (< i ?a)
(modify-syntax-entry i "_ " eshell-mode-syntax-table) (modify-syntax-entry i "_ " st)
(setq i (1+ i))) (setq i (1+ i)))
(setq i (1+ ?z)) (setq i (1+ ?z))
(while (< i 128) (while (< i 128)
(modify-syntax-entry i "_ " eshell-mode-syntax-table) (modify-syntax-entry i "_ " st)
(setq i (1+ i))) (setq i (1+ i)))
(modify-syntax-entry ? " " eshell-mode-syntax-table) (modify-syntax-entry ? " " st)
(modify-syntax-entry ?\t " " eshell-mode-syntax-table) (modify-syntax-entry ?\t " " st)
(modify-syntax-entry ?\f " " eshell-mode-syntax-table) (modify-syntax-entry ?\f " " st)
(modify-syntax-entry ?\n "> " eshell-mode-syntax-table) (modify-syntax-entry ?\n "> " st)
;; Give CR the same syntax as newline, for selective-display. ;; Give CR the same syntax as newline, for selective-display.
(modify-syntax-entry ?\^m "> " eshell-mode-syntax-table) (modify-syntax-entry ?\^m "> " st)
;;; (modify-syntax-entry ?\; "< " eshell-mode-syntax-table) ;; (modify-syntax-entry ?\; "< " st)
(modify-syntax-entry ?` "' " eshell-mode-syntax-table) (modify-syntax-entry ?` "' " st)
(modify-syntax-entry ?' "' " eshell-mode-syntax-table) (modify-syntax-entry ?' "' " st)
(modify-syntax-entry ?, "' " eshell-mode-syntax-table) (modify-syntax-entry ?, "' " st)
;; Used to be singlequote; changed for flonums. ;; Used to be singlequote; changed for flonums.
(modify-syntax-entry ?. "_ " eshell-mode-syntax-table) (modify-syntax-entry ?. "_ " st)
(modify-syntax-entry ?- "_ " eshell-mode-syntax-table) (modify-syntax-entry ?- "_ " st)
(modify-syntax-entry ?| ". " eshell-mode-syntax-table) (modify-syntax-entry ?| ". " st)
(modify-syntax-entry ?# "' " eshell-mode-syntax-table) (modify-syntax-entry ?# "' " st)
(modify-syntax-entry ?\" "\" " eshell-mode-syntax-table) (modify-syntax-entry ?\" "\" " st)
(modify-syntax-entry ?\\ "/ " eshell-mode-syntax-table) (modify-syntax-entry ?\\ "/ " st)
(modify-syntax-entry ?\( "() " eshell-mode-syntax-table) (modify-syntax-entry ?\( "() " st)
(modify-syntax-entry ?\) ")( " eshell-mode-syntax-table) (modify-syntax-entry ?\) ")( " st)
(modify-syntax-entry ?\{ "(} " eshell-mode-syntax-table) (modify-syntax-entry ?\{ "(} " st)
(modify-syntax-entry ?\} "){ " eshell-mode-syntax-table) (modify-syntax-entry ?\} "){ " st)
(modify-syntax-entry ?\[ "(] " eshell-mode-syntax-table) (modify-syntax-entry ?\[ "(] " st)
(modify-syntax-entry ?\] ")[ " eshell-mode-syntax-table) (modify-syntax-entry ?\] ")[ " st)
;; All non-word multibyte characters should be `symbol'. ;; All non-word multibyte characters should be `symbol'.
(if (featurep 'xemacs) (map-char-table
(map-char-table (if (featurep 'xemacs)
(function (lambda (key val)
(lambda (key val) (and (characterp key)
(and (characterp key) (>= (char-int key) 256)
(>= (char-int key) 256) (/= (char-syntax key) ?w)
(/= (char-syntax key) ?w) (modify-syntax-entry key "_ " st)))
(modify-syntax-entry key "_ " (lambda (key val)
eshell-mode-syntax-table)))) (and (if (consp key)
(standard-syntax-table)) (and (>= (car key) 128)
(map-char-table (/= (char-syntax (car key)) ?w))
(function (and (>= key 256)
(lambda (key val) (/= (char-syntax key) ?w)))
(and (if (consp key) (modify-syntax-entry key "_ " st))))
(and (>= (car key) 128) (standard-syntax-table))))
(/= (char-syntax (car key)) ?w))
(and (>= key 256)
(/= (char-syntax key) ?w)))
(modify-syntax-entry key "_ "
eshell-mode-syntax-table))))
(standard-syntax-table)))))
;;; User Functions: ;;; User Functions:
@ -303,25 +295,18 @@ and the hook `eshell-exit-hook'."
(run-hooks 'eshell-exit-hook)) (run-hooks 'eshell-exit-hook))
;;;###autoload ;;;###autoload
(defun eshell-mode () (define-derived-mode eshell-mode fundamental-mode "EShell"
"Emacs shell interactive mode. "Emacs shell interactive mode."
(setq-local eshell-mode t)
\\{eshell-mode-map}" ;; FIXME: What the hell!?
(kill-all-local-variables) (setq-local eshell-mode-map (make-sparse-keymap))
(setq major-mode 'eshell-mode)
(setq mode-name "EShell")
(set (make-local-variable 'eshell-mode) t)
(make-local-variable 'eshell-mode-map)
(setq eshell-mode-map (make-sparse-keymap))
(use-local-map eshell-mode-map) (use-local-map eshell-mode-map)
(when eshell-status-in-mode-line (when eshell-status-in-mode-line
(make-local-variable 'eshell-command-running-string) (make-local-variable 'eshell-command-running-string)
(let ((fmt (copy-sequence mode-line-format))) (let ((fmt (copy-sequence mode-line-format)))
(make-local-variable 'mode-line-format) (setq-local mode-line-format fmt))
(setq mode-line-format fmt))
(let ((mode-line-elt (memq 'mode-line-modified mode-line-format))) (let ((mode-line-elt (memq 'mode-line-modified mode-line-format)))
(if mode-line-elt (if mode-line-elt
(setcar mode-line-elt 'eshell-command-running-string)))) (setcar mode-line-elt 'eshell-command-running-string))))
@ -331,11 +316,9 @@ and the hook `eshell-exit-hook'."
(define-key eshell-mode-map [(meta control ?l)] 'eshell-show-output) (define-key eshell-mode-map [(meta control ?l)] 'eshell-show-output)
(define-key eshell-mode-map [(control ?a)] 'eshell-bol) (define-key eshell-mode-map [(control ?a)] 'eshell-bol)
(set (make-local-variable 'eshell-command-prefix) (setq-local eshell-command-prefix (make-symbol "eshell-command-prefix"))
(make-symbol "eshell-command-prefix"))
(fset eshell-command-prefix (make-sparse-keymap)) (fset eshell-command-prefix (make-sparse-keymap))
(set (make-local-variable 'eshell-command-map) (setq-local eshell-command-map (symbol-function eshell-command-prefix))
(symbol-function eshell-command-prefix))
(define-key eshell-mode-map [(control ?c)] eshell-command-prefix) (define-key eshell-mode-map [(control ?c)] eshell-command-prefix)
;; without this, find-tag complains about read-only text being ;; without this, find-tag complains about read-only text being
@ -359,7 +342,6 @@ and the hook `eshell-exit-hook'."
(define-key eshell-command-map [(control ?y)] 'eshell-repeat-argument) (define-key eshell-command-map [(control ?y)] 'eshell-repeat-argument)
(setq local-abbrev-table eshell-mode-abbrev-table) (setq local-abbrev-table eshell-mode-abbrev-table)
(set-syntax-table eshell-mode-syntax-table)
(set (make-local-variable 'dired-directory) default-directory) (set (make-local-variable 'dired-directory) default-directory)
(set (make-local-variable 'list-buffers-directory) (set (make-local-variable 'list-buffers-directory)
@ -442,7 +424,6 @@ and the hook `eshell-exit-hook'."
(if eshell-first-time-p (if eshell-first-time-p
(run-hooks 'eshell-first-time-mode-hook)) (run-hooks 'eshell-first-time-mode-hook))
(run-mode-hooks 'eshell-mode-hook)
(run-hooks 'eshell-post-command-hook)) (run-hooks 'eshell-post-command-hook))
(put 'eshell-mode 'mode-class 'special) (put 'eshell-mode 'mode-class 'special)

View file

@ -1,3 +1,27 @@
2013-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
* score-mode.el (gnus-score-mode-map): Move initialization
into declaration.
(gnus-score-mode): Use define-derived-mode.
* gnus-srvr.el (gnus-browse-mode): Use define-derived-mode.
* gnus-kill.el (gnus-kill-file-mode-map): Move initialization
into declaration.
(gnus-kill-file-mode): Use define-derived-mode.
(gnus-kill-file-edit-file, gnus-kill-file-enter-kill, gnus-kill):
Use derived-mode-p.
* gnus-group.el (gnus-group-mode): Use define-derived-mode.
(gnus-group-setup-buffer, gnus-group-name-at-point)
(gnus-group-make-web-group, gnus-group-enter-directory)
(gnus-group-suspend): Use derived-mode-p.
* gnus-cus.el (gnus-custom-mode): Use define-derived-mode.
* gnus-bookmark.el (gnus-bookmark-bmenu-mode): Use define-derived-mode.
* gnus-art.el (gnus-article-mode): Use define-derived-mode.
(gnus-article-setup-buffer, gnus-article-prepare)
(gnus-article-prepare-display, gnus-sticky-article)
(gnus-kill-sticky-article-buffer, gnus-kill-sticky-article-buffers)
(gnus-bind-safe-url-regexp, gnus-article-check-buffer)
(gnus-article-read-summary-keys): Use derived-mode-p.
2013-08-28 Katsumi Yamaoka <yamaoka@jpl.org> 2013-08-28 Katsumi Yamaoka <yamaoka@jpl.org>
* mm-decode.el (mm-temp-files-delete): Fix file deletion logic. * mm-decode.el (mm-temp-files-delete): Fix file deletion logic.
@ -177,15 +201,15 @@
2013-07-10 David Engster <deng@randomsample.de> 2013-07-10 David Engster <deng@randomsample.de>
* gnus-start.el (gnus-clean-old-newsrc): Always remove 'unexist' marks * gnus-start.el (gnus-clean-old-newsrc): Always remove 'unexist' marks
if `gnus-newsrc-file-version' does not match `gnus-version'. This if `gnus-newsrc-file-version' does not match `gnus-version'.
fixes a bug in Emacs trunk where the 'unexist' marks were always This fixes a bug in Emacs trunk where the 'unexist' marks were always
removed at startup because "Gnus v5.13" was considered smaller than "Ma removed at startup because "Gnus v5.13" was considered smaller than "Ma
Gnus v0.03". Gnus v0.03".
2013-07-10 Tassilo Horn <tsdh@gnu.org> 2013-07-10 Tassilo Horn <tsdh@gnu.org>
* gnus.el (gnus-summary-line-format): Reference * gnus.el (gnus-summary-line-format):
`gnus-user-date-format-alist' for the &user-date; format, not Reference `gnus-user-date-format-alist' for the &user-date; format, not
`gnus-summary-user-date-format-alist'. `gnus-summary-user-date-format-alist'.
2013-07-08 Lars Magne Ingebrigtsen <larsi@gnus.org> 2013-07-08 Lars Magne Ingebrigtsen <larsi@gnus.org>
@ -467,7 +491,7 @@
* shr.el (shr-render-td): Support horizontal alignment. * shr.el (shr-render-td): Support horizontal alignment.
* eww.el (eww-put-color): Removed. * eww.el (eww-put-color): Remove.
(eww-colorize-region): Use `add-face-text-property'. (eww-colorize-region): Use `add-face-text-property'.
* shr.el (shr-add-font): Append face data, so that we get the correct * shr.el (shr-add-font): Append face data, so that we get the correct
@ -522,7 +546,7 @@
2013-06-16 Rüdiger Sonderfeld <ruediger@c-plusplus.de> 2013-06-16 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
* shr.el (shr-dom-to-xml): Fixed function call. * shr.el (shr-dom-to-xml): Fix function call.
* eww.el (eww): New group. * eww.el (eww): New group.
(eww-header-line-format): New custom variable. (eww-header-line-format): New custom variable.
@ -558,8 +582,8 @@
(auth-source-netrc-parse): Refactor and improve netrc parser to support (auth-source-netrc-parse): Refactor and improve netrc parser to support
single-quoted strings and multiline entries. single-quoted strings and multiline entries.
(auth-source-netrc-parse-next-interesting) (auth-source-netrc-parse-next-interesting)
(auth-source-netrc-parse-one, auth-source-netrc-parse-entries): New (auth-source-netrc-parse-one, auth-source-netrc-parse-entries):
functions to support parser. New functions to support parser.
2013-06-14 Lars Magne Ingebrigtsen <larsi@gnus.org> 2013-06-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
@ -707,8 +731,8 @@
* registry.el (initialize-instance, registry-lookup) * registry.el (initialize-instance, registry-lookup)
(registry-lookup-breaks-before-lexbind, registry-lookup-secondary) (registry-lookup-breaks-before-lexbind, registry-lookup-secondary)
(registry-lookup-secondary-value, registry-search, registry-delete) (registry-lookup-secondary-value, registry-search, registry-delete)
(registry-insert, registry-reindex, registry-size, registry-prune): Do (registry-insert, registry-reindex, registry-size, registry-prune):
not wrap methods in `eval-and-compile'. This breaks due to latest Do not wrap methods in `eval-and-compile'. This breaks due to latest
changes in EIEIO (introduction of eieio-core.el). changes in EIEIO (introduction of eieio-core.el).
2013-05-30 Glenn Morris <rgm@gnu.org> 2013-05-30 Glenn Morris <rgm@gnu.org>
@ -988,8 +1012,8 @@
2013-03-26 Andrew Cohen <cohen@bu.edu> 2013-03-26 Andrew Cohen <cohen@bu.edu>
* nnir.el: Major rewrite. Cleaner separation between searches and group * nnir.el: Major rewrite. Cleaner separation between searches and group
management. Marks are now shown in nnir summary buffers. Rudimentary management. Marks are now shown in nnir summary buffers.
support for real (i.e. not ephemeral) nnir groups. Rudimentary support for real (i.e. not ephemeral) nnir groups.
(gnus-summary-make-nnir-group): New function for initiating searches (gnus-summary-make-nnir-group): New function for initiating searches
from a summary buffer. from a summary buffer.
@ -1018,8 +1042,8 @@
2013-02-22 David Engster <deng@randomsample.de> 2013-02-22 David Engster <deng@randomsample.de>
* gnus-registry.el (gnus-registry-save): Provide class name when * gnus-registry.el (gnus-registry-save): Provide class name when
calling `eieio-persistent-read' to avoid "unsafe call" warning. Use calling `eieio-persistent-read' to avoid "unsafe call" warning.
`condition-case' to stay compatible with older EIEIO versions which Use `condition-case' to stay compatible with older EIEIO versions which
only accept one argument. only accept one argument.
2013-02-17 Daiki Ueno <ueno@gnu.org> 2013-02-17 Daiki Ueno <ueno@gnu.org>
@ -5295,7 +5319,7 @@
a creation default, pass the whole port list down. It will be a creation default, pass the whole port list down. It will be
completed. completed.
* auth-source.el (auth-source-search): Updated docs to talk about * auth-source.el (auth-source-search): Update docs to talk about
multiple creation choices. multiple creation choices.
(auth-source-netrc-create): Accept a list as a value (from the search (auth-source-netrc-create): Accept a list as a value (from the search
parameters) and do completion on that list. Keep a separate netrc line parameters) and do completion on that list. Keep a separate netrc line
@ -5362,7 +5386,7 @@
(gnus-summary-exit): Kill the correct article buffer on exit from a (gnus-summary-exit): Kill the correct article buffer on exit from a
`C-d' group. `C-d' group.
* gnus-start.el (gnus-use-backend-marks): Removed, since it duplicates * gnus-start.el (gnus-use-backend-marks): Remove, since it duplicates
gnus-propagate-marks. gnus-propagate-marks.
* gnus-sum.el (gnus-summary-exit-no-update): Restore the group conf * gnus-sum.el (gnus-summary-exit-no-update): Restore the group conf
@ -18399,7 +18423,7 @@
2005-11-19 Kevin Greiner <kevin.greiner@compsol.cc> 2005-11-19 Kevin Greiner <kevin.greiner@compsol.cc>
* gnus-sum.el (gnus-fetch-old-headers): Updated docs to warn that * gnus-sum.el (gnus-fetch-old-headers): Update docs to warn that
it can seriously impact performance as it bypasses the agent's it can seriously impact performance as it bypasses the agent's
local caches. local caches.

View file

@ -3683,7 +3683,7 @@ function and want to see what the date was before converting."
(walk-windows (walk-windows
(lambda (w) (lambda (w)
(set-buffer (window-buffer w)) (set-buffer (window-buffer w))
(when (eq major-mode 'gnus-article-mode) (when (derived-mode-p 'gnus-article-mode)
(let ((old-line (count-lines (point-min) (point))) (let ((old-line (count-lines (point-min) (point)))
(old-column (- (point) (line-beginning-position))) (old-column (- (point) (line-beginning-position)))
(window-start (window-start w)) (window-start (window-start w))
@ -4455,7 +4455,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
(defvar bookmark-make-record-function) (defvar bookmark-make-record-function)
(defvar shr-put-image-function) (defvar shr-put-image-function)
(defun gnus-article-mode () (define-derived-mode gnus-article-mode fundamental-mode "Article"
"Major mode for displaying an article. "Major mode for displaying an article.
All normal editing commands are switched off. All normal editing commands are switched off.
@ -4470,13 +4470,8 @@ commands:
\\[gnus-article-mail]\t Send a reply to the address near point \\[gnus-article-mail]\t Send a reply to the address near point
\\[gnus-article-describe-briefly]\t Describe the current mode briefly \\[gnus-article-describe-briefly]\t Describe the current mode briefly
\\[gnus-info-find-node]\t Go to the Gnus info node" \\[gnus-info-find-node]\t Go to the Gnus info node"
(interactive)
(kill-all-local-variables)
(gnus-simplify-mode-line) (gnus-simplify-mode-line)
(setq mode-name "Article")
(setq major-mode 'gnus-article-mode)
(make-local-variable 'minor-mode-alist) (make-local-variable 'minor-mode-alist)
(use-local-map gnus-article-mode-map)
(when (gnus-visual-p 'article-menu 'menu) (when (gnus-visual-p 'article-menu 'menu)
(gnus-article-make-menu-bar) (gnus-article-make-menu-bar)
(when gnus-summary-tool-bar-map (when gnus-summary-tool-bar-map
@ -4504,9 +4499,7 @@ commands:
(buffer-disable-undo) (buffer-disable-undo)
(setq buffer-read-only t (setq buffer-read-only t
show-trailing-whitespace nil) show-trailing-whitespace nil)
(set-syntax-table gnus-article-mode-syntax-table) (mm-enable-multibyte))
(mm-enable-multibyte)
(gnus-run-mode-hooks 'gnus-article-mode-hook))
(defun gnus-article-setup-buffer () (defun gnus-article-setup-buffer ()
"Initialize the article buffer." "Initialize the article buffer."
@ -4554,7 +4547,7 @@ commands:
(setq gnus-article-mime-handle-alist nil) (setq gnus-article-mime-handle-alist nil)
(buffer-disable-undo) (buffer-disable-undo)
(setq buffer-read-only t) (setq buffer-read-only t)
(unless (eq major-mode 'gnus-article-mode) (unless (derived-mode-p 'gnus-article-mode)
(gnus-article-mode)) (gnus-article-mode))
(setq truncate-lines gnus-article-truncate-lines) (setq truncate-lines gnus-article-truncate-lines)
(current-buffer)) (current-buffer))
@ -4603,7 +4596,7 @@ If ARTICLE is an id, HEADER should be the article headers.
If ALL-HEADERS is non-nil, no headers are hidden." If ALL-HEADERS is non-nil, no headers are hidden."
(save-excursion (save-excursion
;; Make sure we start in a summary buffer. ;; Make sure we start in a summary buffer.
(unless (eq major-mode 'gnus-summary-mode) (unless (derived-mode-p 'gnus-summary-mode)
(set-buffer gnus-summary-buffer)) (set-buffer gnus-summary-buffer))
(setq gnus-summary-buffer (current-buffer)) (setq gnus-summary-buffer (current-buffer))
(let* ((gnus-article (if header (mail-header-number header) article)) (let* ((gnus-article (if header (mail-header-number header) article))
@ -4714,7 +4707,7 @@ If ALL-HEADERS is non-nil, no headers are hidden."
(let ((gnus-article-buffer (current-buffer)) (let ((gnus-article-buffer (current-buffer))
buffer-read-only buffer-read-only
(inhibit-read-only t)) (inhibit-read-only t))
(unless (eq major-mode 'gnus-article-mode) (unless (derived-mode-p 'gnus-article-mode)
(gnus-article-mode)) (gnus-article-mode))
(setq buffer-read-only nil (setq buffer-read-only nil
gnus-article-wash-types nil gnus-article-wash-types nil
@ -4776,7 +4769,7 @@ If a prefix ARG is given, ask for a name for this sticky article buffer."
"*")) "*"))
(if (and (gnus-buffer-live-p new-art-buf-name) (if (and (gnus-buffer-live-p new-art-buf-name)
(with-current-buffer new-art-buf-name (with-current-buffer new-art-buf-name
(eq major-mode 'gnus-sticky-article-mode))) (derived-mode-p 'gnus-sticky-article-mode)))
(switch-to-buffer new-art-buf-name) (switch-to-buffer new-art-buf-name)
(setq new-art-buf-name (rename-buffer new-art-buf-name t))) (setq new-art-buf-name (rename-buffer new-art-buf-name t)))
(gnus-sticky-article-mode)) (gnus-sticky-article-mode))
@ -4792,7 +4785,7 @@ If none is given, assume the current buffer and kill it if it has
(unless buffer (unless buffer
(setq buffer (current-buffer))) (setq buffer (current-buffer)))
(with-current-buffer buffer (with-current-buffer buffer
(when (eq major-mode 'gnus-sticky-article-mode) (when (derived-mode-p 'gnus-sticky-article-mode)
(gnus-kill-buffer buffer)))) (gnus-kill-buffer buffer))))
(defun gnus-kill-sticky-article-buffers (arg) (defun gnus-kill-sticky-article-buffers (arg)
@ -4801,11 +4794,11 @@ If a prefix ARG is given, ask for confirmation."
(interactive "P") (interactive "P")
(dolist (buf (gnus-buffers)) (dolist (buf (gnus-buffers))
(with-current-buffer buf (with-current-buffer buf
(when (eq major-mode 'gnus-sticky-article-mode) (when (derived-mode-p 'gnus-sticky-article-mode)
(if (not arg) (if (not arg)
(gnus-kill-buffer buf) (gnus-kill-buffer buf)
(when (yes-or-no-p (concat "Kill buffer " (buffer-name buf) "? ")) (when (yes-or-no-p (concat "Kill buffer " (buffer-name buf) "? "))
(gnus-kill-buffer buf))))))) (gnus-kill-buffer buf)))))))
;;; ;;;
;;; Gnus MIME viewing functions ;;; Gnus MIME viewing functions
@ -4893,7 +4886,7 @@ General format specifiers can also be used. See Info node
(defmacro gnus-bind-safe-url-regexp (&rest body) (defmacro gnus-bind-safe-url-regexp (&rest body)
"Bind `mm-w3m-safe-url-regexp' according to `gnus-safe-html-newsgroups'." "Bind `mm-w3m-safe-url-regexp' according to `gnus-safe-html-newsgroups'."
`(let ((mm-w3m-safe-url-regexp `(let ((mm-w3m-safe-url-regexp
(let ((group (if (and (eq major-mode 'gnus-article-mode) (let ((group (if (and (derived-mode-p 'gnus-article-mode)
(gnus-buffer-live-p (gnus-buffer-live-p
gnus-article-current-summary)) gnus-article-current-summary))
(with-current-buffer gnus-article-current-summary (with-current-buffer gnus-article-current-summary
@ -6477,7 +6470,7 @@ not have a face in `gnus-article-boring-faces'."
(defun gnus-article-check-buffer () (defun gnus-article-check-buffer ()
"Beep if not in an article buffer." "Beep if not in an article buffer."
(unless (equal major-mode 'gnus-article-mode) (unless (derived-mode-p 'gnus-article-mode)
(error "Command invoked outside of a Gnus article buffer"))) (error "Command invoked outside of a Gnus article buffer")))
(defun gnus-article-read-summary-keys (&optional arg key not-restore-window) (defun gnus-article-read-summary-keys (&optional arg key not-restore-window)
@ -6592,7 +6585,7 @@ not have a face in `gnus-article-boring-faces'."
new-sum-point new-sum-point
(window-live-p win) (window-live-p win)
(with-current-buffer (window-buffer win) (with-current-buffer (window-buffer win)
(eq major-mode 'gnus-summary-mode))) (derived-mode-p 'gnus-summary-mode)))
(set-window-point win new-sum-point) (set-window-point win new-sum-point)
(set-window-start win new-sum-start) (set-window-start win new-sum-start)
(set-window-hscroll win new-sum-hscroll)))) (set-window-hscroll win new-sum-hscroll))))

View file

@ -190,7 +190,7 @@ So the cdr of each bookmark is an alist too.")
"Set a bookmark for this article." "Set a bookmark for this article."
(interactive) (interactive)
(gnus-bookmark-maybe-load-default-file) (gnus-bookmark-maybe-load-default-file)
(if (or (not (eq major-mode 'gnus-summary-mode)) (if (or (not (derived-mode-p 'gnus-summary-mode))
(not gnus-article-current)) (not gnus-article-current))
(error "Please select an article in the Gnus summary buffer") (error "Please select an article in the Gnus summary buffer")
(let* ((group (car gnus-article-current)) (let* ((group (car gnus-article-current))
@ -473,7 +473,7 @@ That is, all information but the name."
;; Been to lazy to use gnus-bookmark-save... ;; Been to lazy to use gnus-bookmark-save...
(defalias 'gnus-bookmark-bmenu-save 'gnus-bookmark-write-file) (defalias 'gnus-bookmark-bmenu-save 'gnus-bookmark-write-file)
(defun gnus-bookmark-bmenu-mode () (define-derived-mode gnus-bookmark-bmenu-mode fundamental-mode "Bookmark Menu"
"Major mode for editing a list of Gnus bookmarks. "Major mode for editing a list of Gnus bookmarks.
Each line describes one of the bookmarks in Gnus. Each line describes one of the bookmarks in Gnus.
Letters do not insert themselves; instead, they are commands. Letters do not insert themselves; instead, they are commands.
@ -497,13 +497,8 @@ Gnus bookmarks names preceded by a \"*\" have annotations.
in another buffer. in another buffer.
\\[gnus-bookmark-bmenu-show-all-annotations] -- show the annotations of all bookmarks in another buffer. \\[gnus-bookmark-bmenu-show-all-annotations] -- show the annotations of all bookmarks in another buffer.
\\[gnus-bookmark-bmenu-edit-annotation] -- edit the annotation for the current bookmark." \\[gnus-bookmark-bmenu-edit-annotation] -- edit the annotation for the current bookmark."
(kill-all-local-variables)
(use-local-map gnus-bookmark-bmenu-mode-map)
(setq truncate-lines t) (setq truncate-lines t)
(setq buffer-read-only t) (setq buffer-read-only t))
(setq major-mode 'gnus-bookmark-bmenu-mode)
(setq mode-name "Bookmark Menu")
(gnus-run-mode-hooks 'gnus-bookmark-bmenu-mode-hook))
;; avoid compilation warnings ;; avoid compilation warnings
(defvar gnus-bookmark-bmenu-toggle-infos nil) (defvar gnus-bookmark-bmenu-toggle-infos nil)

View file

@ -33,7 +33,7 @@
;;; Widgets: ;;; Widgets:
(defun gnus-custom-mode () (define-derived-mode gnus-custom-mode fundamental-mode "Gnus Customize"
"Major mode for editing Gnus customization buffers. "Major mode for editing Gnus customization buffers.
The following commands are available: The following commands are available:
@ -45,9 +45,6 @@ The following commands are available:
Entry to this mode calls the value of `gnus-custom-mode-hook' Entry to this mode calls the value of `gnus-custom-mode-hook'
if that value is non-nil." if that value is non-nil."
(kill-all-local-variables)
(setq major-mode 'gnus-custom-mode
mode-name "Gnus Customize")
(use-local-map widget-keymap) (use-local-map widget-keymap)
;; Emacs stuff: ;; Emacs stuff:
(when (and (facep 'custom-button-face) (when (and (facep 'custom-button-face)
@ -63,8 +60,7 @@ if that value is non-nil."
(set (make-local-variable 'widget-push-button-prefix) "") (set (make-local-variable 'widget-push-button-prefix) "")
(set (make-local-variable 'widget-push-button-suffix) "") (set (make-local-variable 'widget-push-button-suffix) "")
(set (make-local-variable 'widget-link-prefix) "") (set (make-local-variable 'widget-link-prefix) "")
(set (make-local-variable 'widget-link-suffix) "")) (set (make-local-variable 'widget-link-suffix) "")))
(gnus-run-mode-hooks 'gnus-custom-mode-hook))
;;; Group Customization: ;;; Group Customization:

View file

@ -1105,7 +1105,7 @@ When FORCE, rebuild the tool bar."
(set (make-local-variable 'tool-bar-map) map)))) (set (make-local-variable 'tool-bar-map) map))))
gnus-group-tool-bar-map) gnus-group-tool-bar-map)
(defun gnus-group-mode () (define-derived-mode gnus-group-mode fundamental-mode "Group"
"Major mode for reading news. "Major mode for reading news.
All normal editing commands are switched off. All normal editing commands are switched off.
@ -1122,17 +1122,12 @@ For more in-depth information on this mode, read the manual (`\\[gnus-info-find-
The following commands are available: The following commands are available:
\\{gnus-group-mode-map}" \\{gnus-group-mode-map}"
(interactive)
(kill-all-local-variables)
(when (gnus-visual-p 'group-menu 'menu) (when (gnus-visual-p 'group-menu 'menu)
(gnus-group-make-menu-bar) (gnus-group-make-menu-bar)
(gnus-group-make-tool-bar)) (gnus-group-make-tool-bar))
(gnus-simplify-mode-line) (gnus-simplify-mode-line)
(setq major-mode 'gnus-group-mode)
(setq mode-name "Group")
(gnus-group-set-mode-line) (gnus-group-set-mode-line)
(setq mode-line-process nil) (setq mode-line-process nil)
(use-local-map gnus-group-mode-map)
(buffer-disable-undo) (buffer-disable-undo)
(setq truncate-lines t) (setq truncate-lines t)
(setq buffer-read-only t (setq buffer-read-only t
@ -1143,8 +1138,7 @@ The following commands are available:
(when gnus-use-undo (when gnus-use-undo
(gnus-undo-mode 1)) (gnus-undo-mode 1))
(when gnus-slave (when gnus-slave
(gnus-slave-mode)) (gnus-slave-mode)))
(gnus-run-mode-hooks 'gnus-group-mode-hook))
(defun gnus-update-group-mark-positions () (defun gnus-update-group-mark-positions ()
(save-excursion (save-excursion
@ -1193,7 +1187,7 @@ The following commands are available:
(defun gnus-group-setup-buffer () (defun gnus-group-setup-buffer ()
(set-buffer (gnus-get-buffer-create gnus-group-buffer)) (set-buffer (gnus-get-buffer-create gnus-group-buffer))
(unless (eq major-mode 'gnus-group-mode) (unless (derived-mode-p 'gnus-group-mode)
(gnus-group-mode))) (gnus-group-mode)))
(defun gnus-group-name-charset (method group) (defun gnus-group-name-charset (method group)
@ -2147,7 +2141,7 @@ be permanent."
(defun gnus-group-name-at-point () (defun gnus-group-name-at-point ()
"Return a group name from around point if it exists, or nil." "Return a group name from around point if it exists, or nil."
(if (eq major-mode 'gnus-group-mode) (if (derived-mode-p 'gnus-group-mode)
(let ((group (gnus-group-group-name))) (let ((group (gnus-group-group-name)))
(when group (when group
(gnus-group-decoded-name group))) (gnus-group-decoded-name group)))
@ -3114,7 +3108,7 @@ If SOLID (the prefix), create a solid group."
(gnus-group-read-ephemeral-group (gnus-group-read-ephemeral-group
group method t group method t
(cons (current-buffer) (cons (current-buffer)
(if (eq major-mode 'gnus-summary-mode) 'summary 'group)))))) (if (derived-mode-p 'gnus-summary-mode) 'summary 'group))))))
(defvar nnrss-group-alist) (defvar nnrss-group-alist)
(eval-when-compile (eval-when-compile
@ -3229,7 +3223,7 @@ mail messages or news articles in files that have numeric names."
(unless (gnus-group-read-ephemeral-group (unless (gnus-group-read-ephemeral-group
name method t name method t
(cons (current-buffer) (cons (current-buffer)
(if (eq major-mode 'gnus-summary-mode) (if (derived-mode-p 'gnus-summary-mode)
'summary 'group))) 'summary 'group)))
(error "Couldn't enter %s" dir)))) (error "Couldn't enter %s" dir))))
@ -4319,7 +4313,7 @@ The hook `gnus-suspend-gnus-hook' is called before actually suspending."
(unless (or (eq buf group-buf) (unless (or (eq buf group-buf)
(eq buf gnus-dribble-buffer) (eq buf gnus-dribble-buffer)
(with-current-buffer buf (with-current-buffer buf
(eq major-mode 'message-mode))) (derived-mode-p 'message-mode)))
(gnus-kill-buffer buf))) (gnus-kill-buffer buf)))
(setq gnus-backlog-articles nil) (setq gnus-backlog-articles nil)
(gnus-kill-gnus-frames) (gnus-kill-gnus-frames)

View file

@ -75,20 +75,20 @@ of time."
;;; Gnus Kill File Mode ;;; Gnus Kill File Mode
;;; ;;;
(defvar gnus-kill-file-mode-map nil) (defvar gnus-kill-file-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map emacs-lisp-mode-map)
(gnus-define-keymap map
"\C-c\C-k\C-s" gnus-kill-file-kill-by-subject
"\C-c\C-k\C-a" gnus-kill-file-kill-by-author
"\C-c\C-k\C-t" gnus-kill-file-kill-by-thread
"\C-c\C-k\C-x" gnus-kill-file-kill-by-xref
"\C-c\C-a" gnus-kill-file-apply-buffer
"\C-c\C-e" gnus-kill-file-apply-last-sexp
"\C-c\C-c" gnus-kill-file-exit)
map))
(unless gnus-kill-file-mode-map (define-derived-mode gnus-kill-file-mode emacs-lisp-mode "Kill"
(gnus-define-keymap (setq gnus-kill-file-mode-map
(copy-keymap emacs-lisp-mode-map))
"\C-c\C-k\C-s" gnus-kill-file-kill-by-subject
"\C-c\C-k\C-a" gnus-kill-file-kill-by-author
"\C-c\C-k\C-t" gnus-kill-file-kill-by-thread
"\C-c\C-k\C-x" gnus-kill-file-kill-by-xref
"\C-c\C-a" gnus-kill-file-apply-buffer
"\C-c\C-e" gnus-kill-file-apply-last-sexp
"\C-c\C-c" gnus-kill-file-exit))
(defun gnus-kill-file-mode ()
"Major mode for editing kill files. "Major mode for editing kill files.
If you are using this mode - you probably shouldn't. Kill files If you are using this mode - you probably shouldn't. Kill files
@ -151,15 +151,7 @@ which are marked as read in the previous Gnus sessions. Marks other
than `D' should be used for articles which should really be deleted. than `D' should be used for articles which should really be deleted.
Entry to this mode calls emacs-lisp-mode-hook and Entry to this mode calls emacs-lisp-mode-hook and
gnus-kill-file-mode-hook with no arguments, if that value is non-nil." gnus-kill-file-mode-hook with no arguments, if that value is non-nil.")
(interactive)
(kill-all-local-variables)
(use-local-map gnus-kill-file-mode-map)
(set-syntax-table emacs-lisp-mode-syntax-table)
(setq major-mode 'gnus-kill-file-mode)
(setq mode-name "Kill")
(lisp-mode-variables nil)
(gnus-run-mode-hooks 'emacs-lisp-mode-hook 'gnus-kill-file-mode-hook))
(defun gnus-kill-file-edit-file (newsgroup) (defun gnus-kill-file-edit-file (newsgroup)
"Begin editing a kill file for NEWSGROUP. "Begin editing a kill file for NEWSGROUP.
@ -175,10 +167,10 @@ If NEWSGROUP is nil, the global kill file is selected."
(let ((buffer (find-file-noselect file))) (let ((buffer (find-file-noselect file)))
(cond ((get-buffer-window buffer) (cond ((get-buffer-window buffer)
(pop-to-buffer buffer)) (pop-to-buffer buffer))
((eq major-mode 'gnus-group-mode) ((derived-mode-p 'gnus-group-mode)
(gnus-configure-windows 'group) ;Take all windows. (gnus-configure-windows 'group) ;Take all windows.
(pop-to-buffer buffer)) (pop-to-buffer buffer))
((eq major-mode 'gnus-summary-mode) ((derived-mode-p 'gnus-summary-mode)
(gnus-configure-windows 'article) (gnus-configure-windows 'article)
(pop-to-buffer gnus-article-buffer) (pop-to-buffer gnus-article-buffer)
(bury-buffer gnus-article-buffer) (bury-buffer gnus-article-buffer)
@ -201,7 +193,7 @@ If NEWSGROUP is nil, the global kill file is selected."
;; REGEXP: The string to kill. ;; REGEXP: The string to kill.
(save-excursion (save-excursion
(let (string) (let (string)
(unless (eq major-mode 'gnus-kill-file-mode) (unless (derived-mode-p 'gnus-kill-file-mode)
(gnus-kill-set-kill-buffer)) (gnus-kill-set-kill-buffer))
(unless dont-move (unless dont-move
(goto-char (point-max))) (goto-char (point-max)))
@ -520,7 +512,7 @@ COMMAND must be a Lisp expression or a string representing a key sequence."
(setq kill-list (cdr kill-list)))) (setq kill-list (cdr kill-list))))
(gnus-execute field kill-list command nil (not all)))))) (gnus-execute field kill-list command nil (not all))))))
(switch-to-buffer old-buffer) (switch-to-buffer old-buffer)
(when (and (eq major-mode 'gnus-kill-file-mode) regexp (not silent)) (when (and (derived-mode-p 'gnus-kill-file-mode) regexp (not silent))
(gnus-pp-gnus-kill (gnus-pp-gnus-kill
(nconc (list 'gnus-kill field (nconc (list 'gnus-kill field
(if (consp regexp) (list 'quote regexp) regexp)) (if (consp regexp) (list 'quote regexp) regexp))

View file

@ -244,6 +244,7 @@ For more in-depth information on this mode, read the manual
The following commands are available: The following commands are available:
\\{gnus-server-mode-map}" \\{gnus-server-mode-map}"
;; FIXME: Use define-derived-mode.
(interactive) (interactive)
(when (gnus-visual-p 'server-menu 'menu) (when (gnus-visual-p 'server-menu 'menu)
(gnus-server-make-menu-bar)) (gnus-server-make-menu-bar))
@ -869,7 +870,7 @@ claim them."
(gnus-message 5 "Connecting to %s...done" (nth 1 method)) (gnus-message 5 "Connecting to %s...done" (nth 1 method))
t)))) t))))
(defun gnus-browse-mode () (define-derived-mode gnus-browse-mode fundamental-mode "Browse Server"
"Major mode for browsing a foreign server. "Major mode for browsing a foreign server.
All normal editing commands are switched off. All normal editing commands are switched off.
@ -884,20 +885,14 @@ buffer.
2) `\\[gnus-browse-read-group]' to read a group ephemerally. 2) `\\[gnus-browse-read-group]' to read a group ephemerally.
3) `\\[gnus-browse-exit]' to return to the group buffer." 3) `\\[gnus-browse-exit]' to return to the group buffer."
(interactive)
(kill-all-local-variables)
(when (gnus-visual-p 'browse-menu 'menu) (when (gnus-visual-p 'browse-menu 'menu)
(gnus-browse-make-menu-bar)) (gnus-browse-make-menu-bar))
(gnus-simplify-mode-line) (gnus-simplify-mode-line)
(setq major-mode 'gnus-browse-mode)
(setq mode-name "Browse Server")
(setq mode-line-process nil) (setq mode-line-process nil)
(use-local-map gnus-browse-mode-map)
(buffer-disable-undo) (buffer-disable-undo)
(setq truncate-lines t) (setq truncate-lines t)
(gnus-set-default-directory) (gnus-set-default-directory)
(setq buffer-read-only t) (setq buffer-read-only t))
(gnus-run-mode-hooks 'gnus-browse-mode-hook))
(defun gnus-browse-read-group (&optional no-article number) (defun gnus-browse-read-group (&optional no-article number)
"Enter the group at the current line. "Enter the group at the current line.
@ -1022,7 +1017,7 @@ doing the deletion."
(defun gnus-browse-exit () (defun gnus-browse-exit ()
"Quit browsing and return to the group buffer." "Quit browsing and return to the group buffer."
(interactive) (interactive)
(when (eq major-mode 'gnus-browse-mode) (when (derived-mode-p 'gnus-browse-mode)
(gnus-kill-buffer (current-buffer))) (gnus-kill-buffer (current-buffer)))
;; Insert the newly subscribed groups in the group buffer. ;; Insert the newly subscribed groups in the group buffer.
(with-current-buffer gnus-group-buffer (with-current-buffer gnus-group-buffer

View file

@ -40,13 +40,13 @@
(defvar gnus-score-edit-exit-function nil (defvar gnus-score-edit-exit-function nil
"Function run on exit from the score buffer.") "Function run on exit from the score buffer.")
(defvar gnus-score-mode-map nil) (defvar gnus-score-mode-map
(unless gnus-score-mode-map (let ((map (make-sparse-keymap)))
(setq gnus-score-mode-map (make-sparse-keymap)) (set-keymap-parent map emacs-lisp-mode-map)
(set-keymap-parent gnus-score-mode-map emacs-lisp-mode-map) (define-key map "\C-c\C-c" 'gnus-score-edit-exit)
(define-key gnus-score-mode-map "\C-c\C-c" 'gnus-score-edit-exit) (define-key map "\C-c\C-d" 'gnus-score-edit-insert-date)
(define-key gnus-score-mode-map "\C-c\C-d" 'gnus-score-edit-insert-date) (define-key map "\C-c\C-p" 'gnus-score-pretty-print)
(define-key gnus-score-mode-map "\C-c\C-p" 'gnus-score-pretty-print)) map))
(defvar score-mode-syntax-table (defvar score-mode-syntax-table
(let ((table (copy-syntax-table lisp-mode-syntax-table))) (let ((table (copy-syntax-table lisp-mode-syntax-table)))
@ -58,21 +58,13 @@
(defvar score-mode-coding-system mm-universal-coding-system) (defvar score-mode-coding-system mm-universal-coding-system)
;;;###autoload ;;;###autoload
(defun gnus-score-mode () (define-derived-mode gnus-score-mode emacs-lisp-mode "Score"
"Mode for editing Gnus score files. "Mode for editing Gnus score files.
This mode is an extended emacs-lisp mode. This mode is an extended emacs-lisp mode.
\\{gnus-score-mode-map}" \\{gnus-score-mode-map}"
(interactive)
(kill-all-local-variables)
(use-local-map gnus-score-mode-map)
(gnus-score-make-menu-bar) (gnus-score-make-menu-bar)
(set-syntax-table score-mode-syntax-table) (make-local-variable 'gnus-score-edit-exit-function))
(setq major-mode 'gnus-score-mode)
(setq mode-name "Score")
(lisp-mode-variables nil)
(make-local-variable 'gnus-score-edit-exit-function)
(gnus-run-mode-hooks 'emacs-lisp-mode-hook 'gnus-score-mode-hook))
(defun gnus-score-make-menu-bar () (defun gnus-score-make-menu-bar ()
(unless (boundp 'gnus-score-menu) (unless (boundp 'gnus-score-menu)

View file

@ -156,7 +156,7 @@ elisp byte-compiler."
(null buffer-file-name)) (null buffer-file-name))
italic) italic)
(30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face) (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face)
(35 (eq major-mode 'dired-mode) font-lock-function-name-face)) (35 (derived-mode-p 'dired-mode) font-lock-function-name-face))
"An alist describing how to fontify buffers. "An alist describing how to fontify buffers.
Each element should be of the form (PRIORITY FORM FACE), where Each element should be of the form (PRIORITY FORM FACE), where
PRIORITY is an integer, FORM is an arbitrary form to evaluate in the PRIORITY is an integer, FORM is an arbitrary form to evaluate in the
@ -2358,7 +2358,7 @@ FORMATS is the value to use for `ibuffer-formats'.
;; We switch to the buffer's window in order to be able ;; We switch to the buffer's window in order to be able
;; to modify the value of point ;; to modify the value of point
(select-window (get-buffer-window buf 0)) (select-window (get-buffer-window buf 0))
(or (eq major-mode 'ibuffer-mode) (or (derived-mode-p 'ibuffer-mode)
(ibuffer-mode)) (ibuffer-mode))
(setq ibuffer-restore-window-config-on-quit other-window-p) (setq ibuffer-restore-window-config-on-quit other-window-p)
(when shrink (when shrink
@ -2383,7 +2383,7 @@ FORMATS is the value to use for `ibuffer-formats'.
(message "Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help")))))) (message "Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help"))))))
(put 'ibuffer-mode 'mode-class 'special) (put 'ibuffer-mode 'mode-class 'special)
(defun ibuffer-mode () (define-derived-mode ibuffer-mode special-mode "IBuffer"
"A major mode for viewing a list of buffers. "A major mode for viewing a list of buffers.
In Ibuffer, you can conveniently perform many operations on the In Ibuffer, you can conveniently perform many operations on the
currently open buffers, in addition to filtering your view to a currently open buffers, in addition to filtering your view to a
@ -2564,10 +2564,6 @@ filter groups are displayed in this order of precedence.
You may rearrange filter groups by using the regular You may rearrange filter groups by using the regular
'\\[ibuffer-kill-line]' and '\\[ibuffer-yank]' pair. Yanked groups '\\[ibuffer-kill-line]' and '\\[ibuffer-yank]' pair. Yanked groups
will be inserted before the group at point." will be inserted before the group at point."
(kill-all-local-variables)
(use-local-map ibuffer-mode-map)
(setq major-mode 'ibuffer-mode)
(setq mode-name "Ibuffer")
;; Include state info next to the mode name. ;; Include state info next to the mode name.
(set (make-local-variable 'mode-line-process) (set (make-local-variable 'mode-line-process)
'(" by " '(" by "
@ -2627,13 +2623,12 @@ will be inserted before the group at point."
(ibuffer-update-format) (ibuffer-update-format)
(when ibuffer-default-directory (when ibuffer-default-directory
(setq default-directory ibuffer-default-directory)) (setq default-directory ibuffer-default-directory))
(add-hook 'change-major-mode-hook 'font-lock-defontify nil t) (add-hook 'change-major-mode-hook 'font-lock-defontify nil t))
(run-mode-hooks 'ibuffer-mode-hook))
;;; Start of automatically extracted autoloads. ;;; Start of automatically extracted autoloads.
;;;### (autoloads nil "ibuf-ext" "ibuf-ext.el" "d06b2735a74954e0c6922a811de7608c") ;;;### (autoloads nil "ibuf-ext" "ibuf-ext.el" "85795a4045d20654599b73b88e8e1bc9")
;;; Generated autoloads from ibuf-ext.el ;;; Generated autoloads from ibuf-ext.el
(autoload 'ibuffer-auto-mode "ibuf-ext" "\ (autoload 'ibuffer-auto-mode "ibuf-ext" "\

View file

@ -790,7 +790,7 @@ See a list of available Info commands in `Info-mode'."
(defun info-setup (file-or-node buffer) (defun info-setup (file-or-node buffer)
"Display Info node FILE-OR-NODE in BUFFER." "Display Info node FILE-OR-NODE in BUFFER."
(if (and buffer (not (eq major-mode 'Info-mode))) (if (and buffer (not (derived-mode-p 'Info-mode)))
(Info-mode)) (Info-mode))
(if file-or-node (if file-or-node
;; If argument already contains parentheses, don't add another set ;; If argument already contains parentheses, don't add another set
@ -931,7 +931,7 @@ STRICT-CASE is non-nil)."
(info-initialize) (info-initialize)
(setq filename (Info-find-file filename)) (setq filename (Info-find-file filename))
;; Go into Info buffer. ;; Go into Info buffer.
(or (eq major-mode 'Info-mode) (switch-to-buffer "*info*")) (or (derived-mode-p 'Info-mode) (switch-to-buffer "*info*"))
;; Record the node we are leaving, if we were in one. ;; Record the node we are leaving, if we were in one.
(and (not no-going-back) (and (not no-going-back)
Info-current-file Info-current-file
@ -961,7 +961,7 @@ otherwise, that defaults to `Top'."
"Go to an Info node FILENAME and NODENAME, re-reading disk contents. "Go to an Info node FILENAME and NODENAME, re-reading disk contents.
When *info* is already displaying FILENAME and NODENAME, the window position When *info* is already displaying FILENAME and NODENAME, the window position
is preserved, if possible." is preserved, if possible."
(or (eq major-mode 'Info-mode) (switch-to-buffer "*info*")) (or (derived-mode-p 'Info-mode) (switch-to-buffer "*info*"))
(let ((old-filename Info-current-file) (let ((old-filename Info-current-file)
(old-nodename Info-current-node) (old-nodename Info-current-node)
(window-selected (eq (selected-window) (get-buffer-window))) (window-selected (eq (selected-window) (get-buffer-window)))
@ -1065,7 +1065,7 @@ is non-nil)."
(defun Info-find-node-2 (filename nodename &optional no-going-back strict-case) (defun Info-find-node-2 (filename nodename &optional no-going-back strict-case)
(buffer-disable-undo (current-buffer)) (buffer-disable-undo (current-buffer))
(or (eq major-mode 'Info-mode) (or (derived-mode-p 'Info-mode)
(Info-mode)) (Info-mode))
(widen) (widen)
(setq Info-current-node nil) (setq Info-current-node nil)
@ -2212,7 +2212,7 @@ End of submatch 0, 1, and 3 are the same, so you can safely concat."
(interactive) (interactive)
;; In case another window is currently selected ;; In case another window is currently selected
(save-window-excursion (save-window-excursion
(or (eq major-mode 'Info-mode) (switch-to-buffer "*info*")) (or (derived-mode-p 'Info-mode) (switch-to-buffer "*info*"))
(Info-goto-node (Info-extract-pointer "next")))) (Info-goto-node (Info-extract-pointer "next"))))
(defun Info-prev () (defun Info-prev ()
@ -2220,7 +2220,7 @@ End of submatch 0, 1, and 3 are the same, so you can safely concat."
(interactive) (interactive)
;; In case another window is currently selected ;; In case another window is currently selected
(save-window-excursion (save-window-excursion
(or (eq major-mode 'Info-mode) (switch-to-buffer "*info*")) (or (derived-mode-p 'Info-mode) (switch-to-buffer "*info*"))
(Info-goto-node (Info-extract-pointer "prev[ious]*" "previous")))) (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous"))))
(defun Info-up (&optional same-file) (defun Info-up (&optional same-file)
@ -2229,7 +2229,7 @@ If SAME-FILE is non-nil, do not move to a different Info file."
(interactive) (interactive)
;; In case another window is currently selected ;; In case another window is currently selected
(save-window-excursion (save-window-excursion
(or (eq major-mode 'Info-mode) (switch-to-buffer "*info*")) (or (derived-mode-p 'Info-mode) (switch-to-buffer "*info*"))
(let ((old-node Info-current-node) (let ((old-node Info-current-node)
(old-file Info-current-file) (old-file Info-current-file)
(node (Info-extract-pointer "up")) p) (node (Info-extract-pointer "up")) p)
@ -4082,7 +4082,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
(defun Info-menu-update () (defun Info-menu-update ()
"Update the Info menu for the current node." "Update the Info menu for the current node."
(condition-case nil (condition-case nil
(if (or (not (eq major-mode 'Info-mode)) (if (or (not (derived-mode-p 'Info-mode))
(equal (list Info-current-file Info-current-node) (equal (list Info-current-file Info-current-node)
Info-menu-last-node)) Info-menu-last-node))
() ()
@ -4285,7 +4285,7 @@ Advanced commands:
;; When an Info buffer is killed, make sure the associated tags buffer ;; When an Info buffer is killed, make sure the associated tags buffer
;; is killed too. ;; is killed too.
(defun Info-kill-buffer () (defun Info-kill-buffer ()
(and (eq major-mode 'Info-mode) (and (derived-mode-p 'Info-mode)
Info-tag-table-buffer Info-tag-table-buffer
(kill-buffer Info-tag-table-buffer))) (kill-buffer Info-tag-table-buffer)))
@ -4302,10 +4302,11 @@ Advanced commands:
(copy-marker (marker-position m))) (copy-marker (marker-position m)))
(make-marker)))))) (make-marker))))))
(defvar Info-edit-map (let ((map (make-sparse-keymap))) (define-obsolete-variable-alias 'Info-edit-map 'Info-edit-mode-map "24.1")
(set-keymap-parent map text-mode-map) (defvar Info-edit-mode-map (let ((map (make-sparse-keymap)))
(define-key map "\C-c\C-c" 'Info-cease-edit) (set-keymap-parent map text-mode-map)
map) (define-key map "\C-c\C-c" 'Info-cease-edit)
map)
"Local keymap used within `e' command of Info.") "Local keymap used within `e' command of Info.")
(make-obsolete-variable 'Info-edit-map (make-obsolete-variable 'Info-edit-map
@ -4315,19 +4316,14 @@ Advanced commands:
;; Info-edit mode is suitable only for specially formatted data. ;; Info-edit mode is suitable only for specially formatted data.
(put 'Info-edit-mode 'mode-class 'special) (put 'Info-edit-mode 'mode-class 'special)
(defun Info-edit-mode () (define-derived-mode Info-edit-mode text-mode "Info Edit"
"Major mode for editing the contents of an Info node. "Major mode for editing the contents of an Info node.
Like text mode with the addition of `Info-cease-edit' Like text mode with the addition of `Info-cease-edit'
which returns to Info mode for browsing. which returns to Info mode for browsing.
\\{Info-edit-map}" \\{Info-edit-map}"
(use-local-map Info-edit-map)
(setq major-mode 'Info-edit-mode)
(setq mode-name "Info Edit")
(kill-local-variable 'mode-line-buffer-identification)
(setq buffer-read-only nil) (setq buffer-read-only nil)
(force-mode-line-update) (force-mode-line-update)
(buffer-enable-undo (current-buffer)) (buffer-enable-undo (current-buffer)))
(run-mode-hooks 'Info-edit-mode-hook))
(make-obsolete 'Info-edit-mode (make-obsolete 'Info-edit-mode
"editing Info nodes by hand is not recommended." "24.4") "editing Info nodes by hand is not recommended." "24.4")
@ -4352,11 +4348,7 @@ This feature will be removed in future.")
(and (buffer-modified-p) (and (buffer-modified-p)
(y-or-n-p "Save the file? ") (y-or-n-p "Save the file? ")
(save-buffer)) (save-buffer))
(use-local-map Info-mode-map) (Info-mode)
(setq major-mode 'Info-mode)
(setq mode-name "Info")
(Info-set-mode-line)
(setq buffer-read-only t)
(force-mode-line-update) (force-mode-line-update)
(and (marker-position Info-tag-table-marker) (and (marker-position Info-tag-table-marker)
(buffer-modified-p) (buffer-modified-p)
@ -4469,7 +4461,7 @@ COMMAND must be a symbol or string."
;; Get Info running, and pop to it in another window. ;; Get Info running, and pop to it in another window.
(save-window-excursion (save-window-excursion
(info)) (info))
(or (eq major-mode 'Info-mode) (pop-to-buffer "*info*")) (or (derived-mode-p 'Info-mode) (pop-to-buffer "*info*"))
;; Bind Info-history to nil, to prevent the last Index node ;; Bind Info-history to nil, to prevent the last Index node
;; visited by Info-find-emacs-command-nodes from being ;; visited by Info-find-emacs-command-nodes from being
;; pushed onto the history. ;; pushed onto the history.
@ -5133,7 +5125,7 @@ INDENT is the current indentation depth."
NODESPEC is a string of the form: (file)node." NODESPEC is a string of the form: (file)node."
;; Set up a buffer we can use to fake-out Info. ;; Set up a buffer we can use to fake-out Info.
(with-current-buffer (get-buffer-create " *info-browse-tmp*") (with-current-buffer (get-buffer-create " *info-browse-tmp*")
(if (not (equal major-mode 'Info-mode)) (if (not (derived-mode-p 'Info-mode))
(Info-mode)) (Info-mode))
;; Get the node into this buffer ;; Get the node into this buffer
(if (not (string-match "^(\\([^)]+\\))\\([^.]+\\)$" nodespec)) (if (not (string-match "^(\\([^)]+\\))\\([^.]+\\)$" nodespec))

View file

@ -95,7 +95,7 @@
;; ;;
;; (defadvice dired-make-relative (before set-no-error activate) ;; (defadvice dired-make-relative (before set-no-error activate)
;; "For locate mode and Windows, don't return errors" ;; "For locate mode and Windows, don't return errors"
;; (if (and (eq major-mode 'locate-mode) ;; (if (and (derived-mode-p 'locate-mode)
;; (memq system-type '(windows-nt ms-dos))) ;; (memq system-type '(windows-nt ms-dos)))
;; (ad-set-arg 2 t) ;; (ad-set-arg 2 t)
;; )) ;; ))
@ -448,7 +448,7 @@ file name or is inside a subdirectory."
;; Define a mode for locate ;; Define a mode for locate
;; Default directory is set to "/" so that dired commands, which ;; Default directory is set to "/" so that dired commands, which
;; expect to be in a tree, will work properly ;; expect to be in a tree, will work properly
(defun locate-mode () (define-derived-mode locate-mode special-mode "Locate"
"Major mode for the `*Locate*' buffer made by \\[locate]. "Major mode for the `*Locate*' buffer made by \\[locate].
\\<locate-mode-map>\ \\<locate-mode-map>\
In that buffer, you can use almost all the usual dired bindings. In that buffer, you can use almost all the usual dired bindings.
@ -463,39 +463,31 @@ Specific `locate-mode' commands, such as \\[locate-find-directory],
do not work in subdirectories. do not work in subdirectories.
\\{locate-mode-map}" \\{locate-mode-map}"
;; Not to be called interactively.
(kill-all-local-variables)
;; Avoid clobbering this variable ;; Avoid clobbering this variable
(make-local-variable 'dired-subdir-alist) (make-local-variable 'dired-subdir-alist)
(use-local-map locate-mode-map) (setq default-directory "/"
(setq major-mode 'locate-mode
mode-name "Locate"
default-directory "/"
buffer-read-only t buffer-read-only t
selective-display t) selective-display t)
(dired-alist-add-1 default-directory (point-min-marker)) (dired-alist-add-1 default-directory (point-min-marker))
(set (make-local-variable 'dired-directory) "/") (set (make-local-variable 'dired-directory) "/")
(set (make-local-variable 'dired-subdir-switches) locate-ls-subdir-switches) (set (make-local-variable 'dired-subdir-switches) locate-ls-subdir-switches)
(setq dired-switches-alist nil) (setq dired-switches-alist nil)
(make-local-variable 'directory-listing-before-filename-regexp)
;; This should support both Unix and Windoze style names ;; This should support both Unix and Windoze style names
(setq directory-listing-before-filename-regexp (setq-local directory-listing-before-filename-regexp
(concat "^.\\(" (concat "^.\\("
(make-string (1- locate-filename-indentation) ?\s) (make-string (1- locate-filename-indentation) ?\s)
"\\)\\|" "\\)\\|"
(default-value 'directory-listing-before-filename-regexp))) (default-value
(make-local-variable 'dired-actual-switches) 'directory-listing-before-filename-regexp)))
(setq dired-actual-switches "") (setq-local dired-actual-switches "")
(make-local-variable 'dired-permission-flags-regexp) (setq-local dired-permission-flags-regexp
(setq dired-permission-flags-regexp (concat "^.\\("
(concat "^.\\(" (make-string (1- locate-filename-indentation) ?\s)
(make-string (1- locate-filename-indentation) ?\s) "\\)\\|"
"\\)\\|" (default-value 'dired-permission-flags-regexp)))
(default-value 'dired-permission-flags-regexp)))
(make-local-variable 'revert-buffer-function) (setq-local revert-buffer-function #'locate-update)
(setq revert-buffer-function 'locate-update) (setq-local page-delimiter "\n\n"))
(set (make-local-variable 'page-delimiter) "\n\n")
(run-mode-hooks 'locate-mode-hook))
(put 'locate-mode 'derived-mode-parent 'dired-mode) (put 'locate-mode 'derived-mode-parent 'dired-mode)
(defun locate-do-setup (search-string) (defun locate-do-setup (search-string)

View file

@ -344,19 +344,13 @@ nil."
(interactive) (interactive)
(kill-buffer mspools-buffer)) (kill-buffer mspools-buffer))
(defun mspools-mode () (define-derived-mode mspools-mode special-mode "MSpools"
"Major mode for output from mspools-show. "Major mode for output from mspools-show.
\\<mspools-mode-map>Move point to one of the items in this buffer, then use \\<mspools-mode-map>Move point to one of the items in this buffer, then use
\\[mspools-visit-spool] to go to the spool that the current line refers to. \\[mspools-visit-spool] to go to the spool that the current line refers to.
\\[revert-buffer] to regenerate the list of spools. \\[revert-buffer] to regenerate the list of spools.
\\{mspools-mode-map}" \\{mspools-mode-map}"
(kill-all-local-variables) (setq-local revert-buffer-function 'mspools-revert-buffer))
(make-local-variable 'revert-buffer-function)
(setq revert-buffer-function 'mspools-revert-buffer)
(use-local-map mspools-mode-map)
(setq major-mode 'mspools-mode)
(setq mode-name "MSpools")
(run-mode-hooks 'mspools-mode-hook))
(defun mspools-get-spool-files () (defun mspools-get-spool-files ()
"Find the list of spool files and display them in *spools* buffer." "Find the list of spool files and display them in *spools* buffer."

View file

@ -408,7 +408,7 @@ If FUNCTION is nil, includes all messages."
(unless rmail-buffer (unless rmail-buffer
(error "No RMAIL buffer found")) (error "No RMAIL buffer found"))
(let (mesg was-in-summary sumbuf) (let (mesg was-in-summary sumbuf)
(if (eq major-mode 'rmail-summary-mode) (if (derived-mode-p 'rmail-summary-mode)
(setq was-in-summary t)) (setq was-in-summary t))
(with-current-buffer rmail-buffer (with-current-buffer rmail-buffer
(setq rmail-summary-buffer (rmail-new-summary-1 desc redo function args) (setq rmail-summary-buffer (rmail-new-summary-1 desc redo function args)
@ -1035,7 +1035,7 @@ Optional prefix ARG means undelete ARG previous messages."
;; Rmail Summary mode is suitable only for specially formatted data. ;; Rmail Summary mode is suitable only for specially formatted data.
(put 'rmail-summary-mode 'mode-class 'special) (put 'rmail-summary-mode 'mode-class 'special)
(defun rmail-summary-mode () (define-derived-mode rmail-summary-mode special-mode "RMAIL Summary"
"Rmail Summary Mode is invoked from Rmail Mode by using \\<rmail-mode-map>\\[rmail-summary]. "Rmail Summary Mode is invoked from Rmail Mode by using \\<rmail-mode-map>\\[rmail-summary].
As commands are issued in the summary buffer, they are applied to the As commands are issued in the summary buffer, they are applied to the
corresponding mail messages in the rmail buffer. corresponding mail messages in the rmail buffer.
@ -1058,10 +1058,6 @@ Commands for sorting the summary:
\\[rmail-summary-sort-by-correspondent] Sort by correspondent. \\[rmail-summary-sort-by-correspondent] Sort by correspondent.
\\[rmail-summary-sort-by-lines] Sort by lines. \\[rmail-summary-sort-by-lines] Sort by lines.
\\[rmail-summary-sort-by-labels] Sort by labels." \\[rmail-summary-sort-by-labels] Sort by labels."
(interactive)
(kill-all-local-variables)
(setq major-mode 'rmail-summary-mode)
(setq mode-name "RMAIL Summary")
(setq truncate-lines t) (setq truncate-lines t)
(setq buffer-read-only t) (setq buffer-read-only t)
(set-syntax-table text-mode-syntax-table) (set-syntax-table text-mode-syntax-table)
@ -1074,8 +1070,7 @@ Commands for sorting the summary:
(make-local-variable 'revert-buffer-function) (make-local-variable 'revert-buffer-function)
(make-local-variable 'font-lock-defaults) (make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(rmail-summary-font-lock-keywords t)) (setq font-lock-defaults '(rmail-summary-font-lock-keywords t))
(rmail-summary-enable) (rmail-summary-enable))
(run-mode-hooks 'rmail-summary-mode-hook))
;; Summary features need to be disabled during edit mode. ;; Summary features need to be disabled during edit mode.
(defun rmail-summary-disable () (defun rmail-summary-disable ()

View file

@ -413,7 +413,7 @@ Otherwise, the value is whatever the function
(defvar Man-topic-history nil "Topic read history.") (defvar Man-topic-history nil "Topic read history.")
(defvar man-mode-syntax-table (defvar Man-mode-syntax-table
(let ((table (copy-syntax-table (standard-syntax-table)))) (let ((table (copy-syntax-table (standard-syntax-table))))
(modify-syntax-entry ?. "w" table) (modify-syntax-entry ?. "w" table)
(modify-syntax-entry ?_ "w" table) (modify-syntax-entry ?_ "w" table)
@ -1350,7 +1350,7 @@ manpage command."
(put 'Man-mode 'mode-class 'special) (put 'Man-mode 'mode-class 'special)
(defun Man-mode () (define-derived-mode Man-mode fundamental-mode "Man"
"A mode for browsing Un*x manual pages. "A mode for browsing Un*x manual pages.
The following man commands are available in the buffer. Try The following man commands are available in the buffer. Try
@ -1387,11 +1387,7 @@ The following variables may be of some use. Try
The following key bindings are currently in effect in the buffer: The following key bindings are currently in effect in the buffer:
\\{Man-mode-map}" \\{Man-mode-map}"
(interactive) (setq buffer-auto-save-file-name nil
(kill-all-local-variables)
(setq major-mode 'Man-mode
mode-name "Man"
buffer-auto-save-file-name nil
mode-line-buffer-identification mode-line-buffer-identification
(list (default-value 'mode-line-buffer-identification) (list (default-value 'mode-line-buffer-identification)
" {" 'Man-page-mode-string "}") " {" 'Man-page-mode-string "}")
@ -1399,8 +1395,6 @@ The following key bindings are currently in effect in the buffer:
buffer-read-only t) buffer-read-only t)
(buffer-disable-undo) (buffer-disable-undo)
(auto-fill-mode -1) (auto-fill-mode -1)
(use-local-map Man-mode-map)
(set-syntax-table man-mode-syntax-table)
(setq imenu-generic-expression (list (list nil Man-heading-regexp 0))) (setq imenu-generic-expression (list (list nil Man-heading-regexp 0)))
(set (make-local-variable 'outline-regexp) Man-heading-regexp) (set (make-local-variable 'outline-regexp) Man-heading-regexp)
(set (make-local-variable 'outline-level) (lambda () 1)) (set (make-local-variable 'outline-level) (lambda () 1))
@ -1409,8 +1403,7 @@ The following key bindings are currently in effect in the buffer:
(Man-build-page-list) (Man-build-page-list)
(Man-strip-page-headers) (Man-strip-page-headers)
(Man-unindent) (Man-unindent)
(Man-goto-page 1 t) (Man-goto-page 1 t))
(run-mode-hooks 'Man-mode-hook))
(defsubst Man-build-section-alist () (defsubst Man-build-section-alist ()
"Build the list of manpage sections." "Build the list of manpage sections."

View file

@ -44,7 +44,7 @@
(define-key map "x" 'kill-this-buffer) (define-key map "x" 'kill-this-buffer)
map)) map))
(defun eudc-hotlist-mode () (define-derived-mode eudc-hotlist-mode fundamental-mode "EUDC-Servers"
"Major mode used to edit the hotlist of servers. "Major mode used to edit the hotlist of servers.
These are the special commands of this mode: These are the special commands of this mode:
@ -54,18 +54,12 @@ These are the special commands of this mode:
t -- Transpose the server at point and the previous one t -- Transpose the server at point and the previous one
q -- Commit the changes and quit. q -- Commit the changes and quit.
x -- Quit without committing the changes." x -- Quit without committing the changes."
(interactive)
(kill-all-local-variables)
(setq major-mode 'eudc-hotlist-mode)
(setq mode-name "EUDC-Servers")
(use-local-map eudc-hotlist-mode-map)
(when (featurep 'xemacs) (when (featurep 'xemacs)
(setq mode-popup-menu eudc-hotlist-menu) (setq mode-popup-menu eudc-hotlist-menu)
(when (featurep 'menubar) (when (featurep 'menubar)
(set-buffer-menubar current-menubar) (set-buffer-menubar current-menubar)
(add-submenu nil (cons "EUDC-Hotlist" (cdr (cdr eudc-hotlist-menu)))))) (add-submenu nil (cons "EUDC-Hotlist" (cdr (cdr eudc-hotlist-menu))))))
(setq buffer-read-only t) (setq buffer-read-only t))
(run-mode-hooks 'eudc-hotlist-mode-hook))
;;;###autoload ;;;###autoload
(defun eudc-edit-hotlist () (defun eudc-edit-hotlist ()
@ -76,10 +70,8 @@ These are the special commands of this mode:
(switch-to-buffer (get-buffer-create "*EUDC Servers*")) (switch-to-buffer (get-buffer-create "*EUDC Servers*"))
(setq buffer-read-only nil) (setq buffer-read-only nil)
(erase-buffer) (erase-buffer)
(mapc (function (dolist (entry eudc-server-hotlist)
(lambda (entry) (setq proto-col (max (length (car entry)) proto-col)))
(setq proto-col (max (length (car entry)) proto-col))))
eudc-server-hotlist)
(setq proto-col (+ 3 proto-col)) (setq proto-col (+ 3 proto-col))
(setq gap (make-string (- proto-col 6) ?\ )) (setq gap (make-string (- proto-col 6) ?\ ))
(insert " EUDC Servers\n" (insert " EUDC Servers\n"
@ -89,17 +81,16 @@ These are the special commands of this mode:
"------" gap "--------\n" "------" gap "--------\n"
"\n") "\n")
(setq eudc-hotlist-list-beginning (point)) (setq eudc-hotlist-list-beginning (point))
(mapc (lambda (entry) (dolist (entry eudc-server-hotlist)
(insert (car entry)) (insert (car entry))
(indent-to proto-col) (indent-to proto-col)
(insert (symbol-name (cdr entry)) "\n")) (insert (symbol-name (cdr entry)) "\n"))
eudc-server-hotlist) (eudc-hotlist-mode)))
(eudc-hotlist-mode)))
(defun eudc-hotlist-add-server () (defun eudc-hotlist-add-server ()
"Add a new server to the list after current one." "Add a new server to the list after current one."
(interactive) (interactive)
(if (not (eq major-mode 'eudc-hotlist-mode)) (if (not (derived-mode-p 'eudc-hotlist-mode))
(error "Not in a EUDC hotlist edit buffer")) (error "Not in a EUDC hotlist edit buffer"))
(let ((server (read-from-minibuffer "Server: ")) (let ((server (read-from-minibuffer "Server: "))
(protocol (completing-read "Protocol: " (protocol (completing-read "Protocol: "
@ -117,7 +108,7 @@ These are the special commands of this mode:
(defun eudc-hotlist-delete-server () (defun eudc-hotlist-delete-server ()
"Delete the server at point from the list." "Delete the server at point from the list."
(interactive) (interactive)
(if (not (eq major-mode 'eudc-hotlist-mode)) (if (not (derived-mode-p 'eudc-hotlist-mode))
(error "Not in a EUDC hotlist edit buffer")) (error "Not in a EUDC hotlist edit buffer"))
(let ((buffer-read-only nil)) (let ((buffer-read-only nil))
(save-excursion (save-excursion
@ -130,7 +121,7 @@ These are the special commands of this mode:
(defun eudc-hotlist-quit-edit () (defun eudc-hotlist-quit-edit ()
"Quit the hotlist editing mode and save changes to the hotlist." "Quit the hotlist editing mode and save changes to the hotlist."
(interactive) (interactive)
(if (not (eq major-mode 'eudc-hotlist-mode)) (if (not (derived-mode-p 'eudc-hotlist-mode))
(error "Not in a EUDC hotlist edit buffer")) (error "Not in a EUDC hotlist edit buffer"))
(let (hotlist) (let (hotlist)
(goto-char eudc-hotlist-list-beginning) (goto-char eudc-hotlist-list-beginning)
@ -149,7 +140,7 @@ These are the special commands of this mode:
(defun eudc-hotlist-select-server () (defun eudc-hotlist-select-server ()
"Select the server at point as the current server." "Select the server at point as the current server."
(interactive) (interactive)
(if (not (eq major-mode 'eudc-hotlist-mode)) (if (not (derived-mode-p 'eudc-hotlist-mode))
(error "Not in a EUDC hotlist edit buffer")) (error "Not in a EUDC hotlist edit buffer"))
(save-excursion (save-excursion
(beginning-of-line) (beginning-of-line)
@ -163,7 +154,7 @@ These are the special commands of this mode:
(defun eudc-hotlist-transpose-servers () (defun eudc-hotlist-transpose-servers ()
"Swap the order of the server with the previous one in the list." "Swap the order of the server with the previous one in the list."
(interactive) (interactive)
(if (not (eq major-mode 'eudc-hotlist-mode)) (if (not (derived-mode-p 'eudc-hotlist-mode))
(error "Not in a EUDC hotlist edit buffer")) (error "Not in a EUDC hotlist edit buffer"))
(let ((buffer-read-only nil)) (let ((buffer-read-only nil))
(save-excursion (save-excursion

View file

@ -652,7 +652,7 @@ Each copy is added a new field containing one of the values of FIELD."
result)) result))
(defun eudc-mode () (define-derived-mode eudc-mode special-mode "EUDC"
"Major mode used in buffers displaying the results of directory queries. "Major mode used in buffers displaying the results of directory queries.
There is no sense in calling this command from a buffer other than There is no sense in calling this command from a buffer other than
one containing the results of a directory query. one containing the results of a directory query.
@ -663,15 +663,9 @@ These are the special commands of EUDC mode:
n -- Move to next record. n -- Move to next record.
p -- Move to previous record. p -- Move to previous record.
b -- Insert record at point into the BBDB database." b -- Insert record at point into the BBDB database."
(interactive)
(kill-all-local-variables)
(setq major-mode 'eudc-mode)
(setq mode-name "EUDC")
(use-local-map eudc-mode-map)
(if (not (featurep 'xemacs)) (if (not (featurep 'xemacs))
(easy-menu-define eudc-emacs-menu eudc-mode-map "" (eudc-menu)) (easy-menu-define eudc-emacs-menu eudc-mode-map "" (eudc-menu))
(setq mode-popup-menu (eudc-menu))) (setq mode-popup-menu (eudc-menu))))
(run-mode-hooks 'eudc-mode-hook))
;;}}} ;;}}}
@ -1084,7 +1078,7 @@ queries the server for the existing fields and displays a corresponding form."
(defun eudc-move-to-next-record () (defun eudc-move-to-next-record ()
"Move to next record, in a buffer displaying directory query results." "Move to next record, in a buffer displaying directory query results."
(interactive) (interactive)
(if (not (eq major-mode 'eudc-mode)) (if (not (derived-mode-p 'eudc-mode))
(error "Not in a EUDC buffer") (error "Not in a EUDC buffer")
(let ((pt (next-overlay-change (point)))) (let ((pt (next-overlay-change (point))))
(if (< pt (point-max)) (if (< pt (point-max))
@ -1094,7 +1088,7 @@ queries the server for the existing fields and displays a corresponding form."
(defun eudc-move-to-previous-record () (defun eudc-move-to-previous-record ()
"Move to previous record, in a buffer displaying directory query results." "Move to previous record, in a buffer displaying directory query results."
(interactive) (interactive)
(if (not (eq major-mode 'eudc-mode)) (if (not (derived-mode-p 'eudc-mode))
(error "Not in a EUDC buffer") (error "Not in a EUDC buffer")
(let ((pt (previous-overlay-change (point)))) (let ((pt (previous-overlay-change (point))))
(if (> pt (point-min)) (if (> pt (point-min))
@ -1122,7 +1116,7 @@ queries the server for the existing fields and displays a corresponding form."
(overlay-get (car (overlays-at (point))) 'eudc-record)) (overlay-get (car (overlays-at (point))) 'eudc-record))
:help "Insert record at point into the BBDB database"] :help "Insert record at point into the BBDB database"]
["Insert All Records into BBDB" eudc-batch-export-records-to-bbdb ["Insert All Records into BBDB" eudc-batch-export-records-to-bbdb
(and (eq major-mode 'eudc-mode) (and (derived-mode-p 'eudc-mode)
(or (featurep 'bbdb) (or (featurep 'bbdb)
(prog1 (locate-library "bbdb") (message "")))) (prog1 (locate-library "bbdb") (message ""))))
:help "Insert all the records returned by a directory query into BBDB"] :help "Insert all the records returned by a directory query into BBDB"]

View file

@ -757,31 +757,24 @@ VALUES may contain values for editable fields from current article."
map) map)
"'mairix-searches-mode' keymap.") "'mairix-searches-mode' keymap.")
(defvar mairix-searches-mode-font-lock-keywords) (defvar mairix-searches-mode-font-lock-keywords
'(("^\\([0-9]+\\)"
(1 font-lock-constant-face))
("^[0-9 ]+\\(Name:\\) \\(.*\\)"
(1 font-lock-keyword-face) (2 font-lock-string-face))
("^[ ]+\\(Query:\\) \\(.*\\) , "
(1 font-lock-keyword-face) (2 font-lock-string-face))
(", \\(Threads:\\) \\(.*\\)"
(1 font-lock-keyword-face) (2 font-lock-constant-face))
("^\\([A-Z].*\\)$"
(1 font-lock-comment-face))
("^[ ]+\\(Folder:\\) \\(.*\\)"
(1 font-lock-keyword-face) (2 font-lock-string-face))))
(defun mairix-searches-mode () (define-derived-mode mairix-searches-mode fundamental-mode "mairix-searches"
"Major mode for editing mairix searches." "Major mode for editing mairix searches."
(interactive) :syntax-table text-mode-syntax-table
(kill-all-local-variables) (setq-local font-lock-defaults '(mairix-searches-mode-font-lock-keywords)))
(setq major-mode 'mairix-searches-mode)
(setq mode-name "mairix-searches")
(set-syntax-table text-mode-syntax-table)
(use-local-map mairix-searches-mode-map)
(make-local-variable 'font-lock-defaults)
(setq mairix-searches-mode-font-lock-keywords
(list (list "^\\([0-9]+\\)"
'(1 font-lock-constant-face))
(list "^[0-9 ]+\\(Name:\\) \\(.*\\)"
'(1 font-lock-keyword-face) '(2 font-lock-string-face))
(list "^[ ]+\\(Query:\\) \\(.*\\) , "
'(1 font-lock-keyword-face) '(2 font-lock-string-face))
(list ", \\(Threads:\\) \\(.*\\)"
'(1 font-lock-keyword-face) '(2 font-lock-constant-face))
(list "^\\([A-Z].*\\)$"
'(1 font-lock-comment-face))
(list "^[ ]+\\(Folder:\\) \\(.*\\)"
'(1 font-lock-keyword-face) '(2 font-lock-string-face))))
(setq font-lock-defaults '(mairix-searches-mode-font-lock-keywords)))
(defun mairix-build-search-list () (defun mairix-build-search-list ()
"Display saved searches in current buffer." "Display saved searches in current buffer."

View file

@ -1909,13 +1909,9 @@ Return t if groups have changed, nil otherwise."
map) map)
"Mode map for newsticker treeview.") "Mode map for newsticker treeview.")
(defun newsticker-treeview-mode () (define-derived-mode newsticker-treeview-mode fundamental-mode "Newsticker TV"
"Major mode for Newsticker Treeview. "Major mode for Newsticker Treeview.
\\{newsticker-treeview-mode-map}" \\{newsticker-treeview-mode-map}"
(kill-all-local-variables)
(use-local-map newsticker-treeview-mode-map)
(setq major-mode 'newsticker-treeview-mode)
(setq mode-name "Newsticker TV")
(if (boundp 'tool-bar-map) (if (boundp 'tool-bar-map)
(set (make-local-variable 'tool-bar-map) (set (make-local-variable 'tool-bar-map)
newsticker-treeview-tool-bar-map)) newsticker-treeview-tool-bar-map))

View file

@ -429,18 +429,12 @@ current buffer, this default action can be modified via
(put 'quickurl-list-mode 'mode-class 'special) (put 'quickurl-list-mode 'mode-class 'special)
;;;###autoload ;;;###autoload
(defun quickurl-list-mode () (define-derived-mode quickurl-list-mode fundamental-mode "quickurl list"
"A mode for browsing the quickurl URL list. "A mode for browsing the quickurl URL list.
The key bindings for `quickurl-list-mode' are: The key bindings for `quickurl-list-mode' are:
\\{quickurl-list-mode-map}" \\{quickurl-list-mode-map}"
(interactive)
(kill-all-local-variables)
(use-local-map quickurl-list-mode-map)
(setq major-mode 'quickurl-list-mode
mode-name "quickurl list")
(run-mode-hooks 'quickurl-list-mode-hook)
(setq buffer-read-only t (setq buffer-read-only t
truncate-lines t)) truncate-lines t))

View file

@ -88,7 +88,7 @@ The Custom feature is intended to make this obsolete."
;; Edit Options mode is suitable only for specially formatted data. ;; Edit Options mode is suitable only for specially formatted data.
(put 'Edit-options-mode 'mode-class 'special) (put 'Edit-options-mode 'mode-class 'special)
(defun Edit-options-mode () (define-derived-mode Edit-options-mode emacs-lisp-mode "Options"
"\\<Edit-options-mode-map>\ "\\<Edit-options-mode-map>\
Major mode for editing Emacs user option settings. Major mode for editing Emacs user option settings.
Special commands are: Special commands are:
@ -100,17 +100,9 @@ Changed values made by these commands take effect immediately.
Each variable description is a paragraph. Each variable description is a paragraph.
For convenience, the characters \\[backward-paragraph] and \\[forward-paragraph] move back and forward by paragraphs." For convenience, the characters \\[backward-paragraph] and \\[forward-paragraph] move back and forward by paragraphs."
(kill-all-local-variables) (setq-local paragraph-separate "[^\^@-\^?]")
(set-syntax-table emacs-lisp-mode-syntax-table) (setq-local paragraph-start "\t")
(use-local-map Edit-options-mode-map) (setq-local truncate-lines t))
(make-local-variable 'paragraph-separate)
(setq paragraph-separate "[^\^@-\^?]")
(make-local-variable 'paragraph-start)
(setq paragraph-start "\t")
(setq truncate-lines t)
(setq major-mode 'Edit-options-mode)
(setq mode-name "Options")
(run-mode-hooks 'Edit-options-mode-hook))
(defun Edit-options-set () (interactive) (defun Edit-options-set () (interactive)
(Edit-options-modify (Edit-options-modify

View file

@ -185,19 +185,8 @@ GRID is the grid of positions to click.")
;; Gameplay functions. ;; Gameplay functions.
(put '5x5-mode 'mode-class 'special) (define-derived-mode 5x5-mode special-mode "5x5"
"A mode for playing `5x5'."
(defun 5x5-mode ()
"A mode for playing `5x5'.
The key bindings for `5x5-mode' are:
\\{5x5-mode-map}"
(kill-all-local-variables)
(use-local-map 5x5-mode-map)
(setq major-mode '5x5-mode
mode-name "5x5")
(run-mode-hooks '5x5-mode-hook)
(setq buffer-read-only t (setq buffer-read-only t
truncate-lines t) truncate-lines t)
(buffer-disable-undo)) (buffer-disable-undo))

View file

@ -113,9 +113,8 @@
map)) map))
;; Blackbox mode is suitable only for specially formatted data. ;; Blackbox mode is suitable only for specially formatted data.
(put 'blackbox-mode 'mode-class 'special)
(defun blackbox-mode () (define-derived-mode blackbox-mode special-mode "Blackbox"
"Major mode for playing blackbox. "Major mode for playing blackbox.
To learn how to play blackbox, see the documentation for function `blackbox'. To learn how to play blackbox, see the documentation for function `blackbox'.
@ -124,13 +123,7 @@ The usual mnemonic keys move the cursor around the box.
\\[bb-romp] -- send in a ray from point, or toggle a ball at point \\[bb-romp] -- send in a ray from point, or toggle a ball at point
\\[bb-done] -- end game and get score" \\[bb-done] -- end game and get score"
(interactive) (setq truncate-lines t))
(kill-all-local-variables)
(use-local-map blackbox-mode-map)
(setq truncate-lines t)
(setq major-mode 'blackbox-mode)
(setq mode-name "Blackbox")
(run-mode-hooks 'blackbox-mode-hook))
;;;###autoload ;;;###autoload
(defun blackbox (num) (defun blackbox (num)

View file

@ -233,10 +233,8 @@
(put 'landmark-mode 'intangible 1) (put 'landmark-mode 'intangible 1)
;; This one is for when they set view-read-only to t: Landmark cannot ;; This one is for when they set view-read-only to t: Landmark cannot
;; allow View Mode to be activated in its buffer. ;; allow View Mode to be activated in its buffer.
(put 'landmark-mode 'mode-class 'special) (define-derived-mode lm-mode special-mode "Lm"
"Major mode for playing Lm against Emacs.
(defun landmark-mode ()
"Major mode for playing Landmark against Emacs.
You and Emacs play in turn by marking a free square. You mark it with X You and Emacs play in turn by marking a free square. You mark it with X
and Emacs marks it with O. The winner is the first to get five contiguous and Emacs marks it with O. The winner is the first to get five contiguous
marks horizontally, vertically or in diagonal. marks horizontally, vertically or in diagonal.
@ -247,16 +245,9 @@ Other useful commands:
\\{landmark-mode-map} \\{landmark-mode-map}
Entry to this mode calls the value of `landmark-mode-hook' if that value Entry to this mode calls the value of `landmark-mode-hook' if that value
is non-nil. One interesting value is `turn-on-font-lock'." is non-nil. One interesting value is `turn-on-font-lock'."
(interactive) (lm-display-statistics)
(kill-all-local-variables) (setq-local font-lock-defaults '(lm-font-lock-keywords t))
(setq major-mode 'landmark-mode (setq buffer-read-only t))
mode-name "Landmark")
(landmark-display-statistics)
(use-local-map landmark-mode-map)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(landmark-font-lock-keywords t)
buffer-read-only t)
(run-mode-hooks 'landmark-mode-hook))
;;;_ + THE SCORE TABLE. ;;;_ + THE SCORE TABLE.

View file

@ -94,7 +94,9 @@ The value t means never ding, and `error' means only ding on wrong input."
map) map)
"Local keymap to use in Mult Puzzle.") "Local keymap to use in Mult Puzzle.")
(defun mpuz-mode ()
(define-derived-mode mpuz-mode fundamental-mode "Mult Puzzle"
"Multiplication puzzle mode. "Multiplication puzzle mode.
You have to guess which letters stand for which digits in the You have to guess which letters stand for which digits in the
@ -106,13 +108,7 @@ then the digit. Thus, to guess that A=3, type `A 3'.
To leave the game to do other editing work, just switch buffers. To leave the game to do other editing work, just switch buffers.
Then you may resume the game with M-x mpuz. Then you may resume the game with M-x mpuz.
You may abort a game by typing \\<mpuz-mode-map>\\[mpuz-offer-abort]." You may abort a game by typing \\<mpuz-mode-map>\\[mpuz-offer-abort]."
(interactive) (setq tab-width 30))
(kill-all-local-variables)
(setq major-mode 'mpuz-mode
mode-name "Mult Puzzle"
tab-width 30)
(use-local-map mpuz-mode-map)
(run-mode-hooks 'mpuz-mode-hook))
;; Some variables for statistics ;; Some variables for statistics

View file

@ -353,21 +353,13 @@ Argument SNAKE-BUFFER is the name of the buffer."
(put 'snake-mode 'mode-class 'special) (put 'snake-mode 'mode-class 'special)
(defun snake-mode () (define-derived-mode snake-mode special-mode "Snake"
"A mode for playing Snake. "A mode for playing Snake."
Snake mode keybindings:
\\{snake-mode-map}
"
(kill-all-local-variables)
(add-hook 'kill-buffer-hook 'gamegrid-kill-timer nil t) (add-hook 'kill-buffer-hook 'gamegrid-kill-timer nil t)
(use-local-map snake-null-map) (use-local-map snake-null-map)
(setq major-mode 'snake-mode)
(setq mode-name "Snake")
(unless (featurep 'emacs) (unless (featurep 'emacs)
(setq mode-popup-menu (setq mode-popup-menu
'("Snake Commands" '("Snake Commands"
@ -382,9 +374,7 @@ Snake mode keybindings:
(setq gamegrid-use-glyphs snake-use-glyphs-flag) (setq gamegrid-use-glyphs snake-use-glyphs-flag)
(setq gamegrid-use-color snake-use-color-flag) (setq gamegrid-use-color snake-use-color-flag)
(gamegrid-init (snake-display-options)) (gamegrid-init (snake-display-options)))
(run-mode-hooks 'snake-mode-hook))
;;;###autoload ;;;###autoload
(defun snake () (defun snake ()