Commit 1b3b87df authored by Stefan Monnier's avatar Stefan Monnier

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.
parent 765da53c
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.
2013-09-10 Glenn Morris <rgm@gnu.org>
......
......@@ -683,9 +683,9 @@ archive.
;; At present we cannot create archives from scratch
(funcall (or (default-value 'major-mode) 'fundamental-mode))
(if (and (not force) archive-files) nil
(kill-all-local-variables)
(let* ((type (archive-find-type))
(typename (capitalize (symbol-name type))))
(kill-all-local-variables)
(make-local-variable 'archive-subtype)
(setq archive-subtype type)
......@@ -761,7 +761,7 @@ archive.
((looking-at "..-l[hz][0-9ds]-") 'lzh)
((looking-at "....................[\334]\247\304\375") 'zoo)
((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))))
'arc)
;; This pattern modeled on the BSD/GNU+Linux `file' command.
......
......@@ -800,7 +800,7 @@ Return COLUMN."
(put 'array-mode 'mode-class 'special)
;;;###autoload
(defun array-mode ()
(define-derived-mode array-mode fundamental-mode "Array"
"Major mode for editing arrays.
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.
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-column)
(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)
(if array-rows-numbered 2 1)))
(message "")
(setq major-mode 'array-mode)
(setq mode-name "Array")
(force-mode-line-update)
(set (make-local-variable 'truncate-lines) t)
(setq overwrite-mode 'overwrite-mode-textual)
(use-local-map array-mode-map)
(run-mode-hooks 'array-mode-hook))
(setq overwrite-mode 'overwrite-mode-textual))
......
......@@ -862,31 +862,25 @@ It takes one argument, the name of the bookmark, as a string.")
map)
"Keymap for editing an annotation of a bookmark.")
(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")
(defun bookmark-insert-annotation (bookmark-name-or-record)
(insert (funcall bookmark-edit-annotation-text-func bookmark-name-or-record))
(let ((annotation (bookmark-get-annotation bookmark-name-or-record)))
(if (and annotation (not (string-equal annotation "")))
(insert annotation)))
(run-mode-hooks 'text-mode-hook))
(insert annotation))))
(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 ()
"Use buffer contents as annotation for a bookmark.
Lines beginning with `#' are ignored."
(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"))
(goto-char (point-min))
(while (< (point) (point-max))
......@@ -906,7 +900,10 @@ Lines beginning with `#' are ignored."
(defun bookmark-edit-annotation (bookmark-name-or-record)
"Pop up a buffer for editing bookmark BOOKMARK-NAME-OR-RECORD's annotation."
(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 ()
......
......@@ -1387,7 +1387,12 @@ Notations: 3.14e6 3.14 * 10^6
(calc-check-defines))
(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.
This mode is used by the *Calc Trail* buffer, which records all results
obtained by the GNU Emacs Calculator.
......@@ -1397,26 +1402,18 @@ the Trail.
This buffer uses the same key map as the *Calculator* buffer; calculator
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 buffer-read-only t)
(make-local-variable 'overlay-arrow-position)
(make-local-variable 'overlay-arrow-string)
(when buf
(set (make-local-variable 'calc-main-buffer) buf))
(when (= (buffer-size) 0)
(let ((buffer-read-only nil))
(insert (propertize "Emacs Calculator Trail\n" 'face 'italic))))
(run-mode-hooks 'calc-trail-mode-hook))
(insert (propertize "Emacs Calculator Trail\n" 'face 'italic)))))
(defun calc-create-buffer ()
"Create and initialize a buffer for the Calculator."
(set-buffer (get-buffer-create "*Calculator*"))
(or (eq major-mode 'calc-mode)
(or (derived-mode-p 'calc-mode)
(calc-mode))
(setq max-lisp-eval-depth (max max-lisp-eval-depth 1000))
(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*")
(calc-keypad)
(set-buffer (window-buffer)))
(if (eq major-mode 'calc-mode)
(if (derived-mode-p 'calc-mode)
(calc-quit)
(let ((oldbuf (current-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*")
(> (recursion-depth) 0))
(exit-recursive-edit)
(if (eq major-mode 'calc-edit-mode)
(if (derived-mode-p 'calc-edit-mode)
(calc-edit-finish arg)
(if calc-was-keypad-mode
(calc-keypad)
......@@ -1504,13 +1501,13 @@ commands given here will actually operate on the *Calculator* stack."
(if (and (equal (buffer-name) "*Gnuplot Trail*")
(> (recursion-depth) 0))
(exit-recursive-edit))
(if (eq major-mode 'calc-edit-mode)
(if (derived-mode-p 'calc-edit-mode)
(calc-edit-cancel)
(if (and interactive
calc-embedded-info
(eq (current-buffer) (aref calc-embedded-info 0)))
(calc-embedded nil)
(unless (eq major-mode 'calc-mode)
(unless (derived-mode-p 'calc-mode)
(calc-create-buffer))
(run-hooks 'calc-end-hook)
(if (integerp calc-undo-length)
......@@ -1631,10 +1628,10 @@ See calc-keypad for details."
(if (math-lessp 1 time)
(calc-record time "(t)"))))
(or (memq 'no-align calc-command-flags)
(eq major-mode 'calc-trail-mode)
(derived-mode-p 'calc-trail-mode)
(calc-align-stack-window))
(and (memq 'position-point calc-command-flags)
(if (eq major-mode 'calc-mode)
(if (derived-mode-p 'calc-mode)
(progn
(goto-char (point-min))
(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))))
(defun calc-select-buffer ()
(or (eq major-mode 'calc-mode)
(or (derived-mode-p 'calc-mode)
(if calc-main-buffer
(set-buffer calc-main-buffer)
(let ((buf (get-buffer "*Calculator*")))
......@@ -1801,7 +1798,7 @@ See calc-keypad for details."
(and calc-embedded-info (calc-embedded-mode-line-change))))))
(defun calc-align-stack-window ()
(if (eq major-mode 'calc-mode)
(if (derived-mode-p 'calc-mode)
(progn
(let ((win (get-buffer-window (current-buffer))))
(if win
......@@ -1988,7 +1985,7 @@ See calc-keypad for details."
(defvar calc-any-evaltos nil)
(defun calc-refresh (&optional align)
(interactive)
(and (eq major-mode 'calc-mode)
(and (derived-mode-p 'calc-mode)
(not calc-executing-macro)
(let* ((buffer-read-only nil)
(save-point (point))
......@@ -2016,7 +2013,7 @@ See calc-keypad for details."
(calc-align-stack-window)
(goto-char save-point))
(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)
(calc-refresh align)))
(setq calc-refresh-count (1+ calc-refresh-count)))
......@@ -2078,12 +2075,13 @@ the United States."
(null (buffer-name calc-trail-buffer)))
(save-excursion
(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*"))
(current-buffer))))
(set-buffer calc-trail-buffer)
(or (eq major-mode 'calc-trail-mode)
(calc-trail-mode buf)))))
(unless (derived-mode-p 'calc-trail-mode)
(calc-trail-mode)
(set (make-local-variable 'calc-main-buffer) buf)))))
(or (and calc-trail-pointer
(eq (marker-buffer calc-trail-pointer) calc-trail-buffer))
(with-current-buffer calc-trail-buffer
......@@ -2152,7 +2150,7 @@ the United States."
(defun calc-trail-here ()
(interactive)
(if (eq major-mode 'calc-trail-mode)
(if (derived-mode-p 'calc-trail-mode)
(progn
(beginning-of-line)
(if (bobp)
......
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>
* semantic/fw.el (semantic-make-local-hook):
......@@ -15,15 +24,15 @@
* semantic/decorate/mode.el
(semantic-decoration-on-includes-p-default)
(semantic-decoration-on-includes-highlight-default): Declare for
(semantic-decoration-on-includes-highlight-default): Declare for
byte compiler.
* semantic/wisent/python.el (semantic/format): New require.
2013-07-27 Eric Ludlam <zappo@gnu.org>
* lisp/cedet/semantic/edit.el (semantic-edits-splice-remove): Wrap
debug message removing middle tag in semantic-edits-verbose-flag
* lisp/cedet/semantic/edit.el (semantic-edits-splice-remove):
Wrap debug message removing middle tag in semantic-edits-verbose-flag
check.
2013-07-27 David Engster <deng@randomsample.de>
......@@ -69,8 +78,8 @@
`semantic/decorate/include' anymore.
(semantic-toggle-decoration-style): Error if an unknown decoration
style is toggled.
(define-semantic-decoration-style): Add new :load option. When
:load is specified, add autoload tokens for the definition
(define-semantic-decoration-style): Add new :load option.
When :load is specified, add autoload tokens for the definition
functions so that code is loaded when the mode is used.
(semantic-decoration-on-includes): New autoload definition for
highlighting includes.
......@@ -94,8 +103,8 @@
* semantic/ctxt.el (semantic-ctxt-end-of-symbol): New.
(semantic-ctxt-current-symbol-default): New.
* semantic/bovine/el.el (semantic-default-elisp-setup): Add
autoload cookie. Explain existence.
* semantic/bovine/el.el (semantic-default-elisp-setup):
Add autoload cookie. Explain existence.
(footer): Add local variable for loaddefs.
* semantic/db.el (semanticdb-file-table-object): Add new filter,
......@@ -120,7 +129,7 @@
* ede/cpp-root.el (ede-preprocessor-map): Protect against init
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
restricting things to only the predefined compilers and linkers.
......@@ -198,15 +207,15 @@
2013-04-27 David Engster <deng@randomsample.de>
* semantic/complete.el
(semantic-collector-calculate-completions-raw): If
`completionslist' is not set, refresh the cache if necessary and
(semantic-collector-calculate-completions-raw):
If `completionslist' is not set, refresh the cache if necessary and
use it for completions. This fixes the
`semantic-collector-buffer-deep' collector (bug#14265).
2013-03-26 Leo Liu <sdl.web@gmail.com>
* semantic/senator.el (senator-copy-tag-to-register): Move
register handling logic from register.el. (Bug#14052)
* semantic/senator.el (senator-copy-tag-to-register):
Move register handling logic from register.el. (Bug#14052)
2013-03-21 Eric Ludlam <zappo@gnu.org>
......@@ -223,17 +232,17 @@
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/tag-ls.el (semantic-tag-similar-p-default):
Add short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
(semantic-analyze-dereference-metatype-stack):
Use `semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the
same node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix
require to semantic/db-typecache to be correct.
* semantic/db-find.el (semanticdb-partial-synchronize):
Fix require to semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a
brutish search by default.
......@@ -243,19 +252,19 @@
input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/db-file.el (semanticdb-default-save-directory):
Doc fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor
* semantic/complete.el (semantic-complete-post-command-hook):
When detecting if cursor is outside completion area, do so if cursor
moves before start of overlay, or the original starting location
of the overlay (i.e., if user deletes past beginning of the
overlay region).
(semantic-complete-inline-tag-engine): Initialize original start
of `semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update
some section titles. Test semanticdb table before printing it.
* semantic/bovine/c.el (semantic-c-describe-environment):
Update some section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all
the files contributing to its value.
......@@ -271,8 +280,8 @@
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all
characters in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force
semantic to load if it is not active in the template being added
* srecode/map.el (srecode-map-validate-file-for-mode):
Force semantic to load if it is not active in the template being added
to the map.
* 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
`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
to do with :spp-table.
(ede-preprocessor-map): Update file tests to provide better
......@@ -302,8 +311,8 @@
2013-03-21 David Engster <deng@randomsample.de>
* semantic/bovine/c.el (semantic-get-local-variables): Also add a
new variable 'this' if we are in an inline member function. For
detecting this, we check overlays at point if there is a class
new variable 'this' if we are in an inline member function.
For detecting this, we check overlays at point if there is a class
spanning the current function. Also, the variable 'this' has to
be a pointer.
......@@ -350,14 +359,14 @@
2013-03-21 Tomasz Gajewski <tomga@wp.pl> (tiny change)
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix
EDE file symbol to match rename. Fix ede-cpp-root symbol to
* ede/cpp-root.el (ede-project-autoload, initialize-instance):
Fix EDE file symbol to match rename. Fix ede-cpp-root symbol to
include -project in name.
2013-03-21 Alex Ott <alexott@gmail.com>
* cedet-files.el (cedet-files-list-recursively): New. Recursively
find files whose names are matching to given regex.
* cedet-files.el (cedet-files-list-recursively): New.
Recursively find files whose names are matching to given regex.
* ede.el (ede-current-project): Rewrite to avoid imperative style.
......
......@@ -869,7 +869,8 @@ If PARENT is non-nil, it is somehow related as a parent to thing."
table)
"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)))
(suppress-keymap km)
(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
:type 'hook)
(defun data-debug-mode ()
(define-derived-mode data-debug-mode fundamental-mode "DATA-DEBUG"
"Major-mode for the Analyzer debugger.
\\{data-debug-map}"
(interactive)
(kill-all-local-variables)
(setq major-mode 'data-debug-mode
mode-name "DATA-DEBUG"
comment-start ";;"
\\{data-debug-mode-map}"
(setq comment-start ";;"
comment-end ""
buffer-read-only t)
(set (make-local-variable 'comment-start-skip)
(setq-local comment-start-skip
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
(set-syntax-table data-debug-mode-syntax-table)
(use-local-map data-debug-map)
(run-hooks 'data-debug-hook)
(buffer-disable-undo)
(set (make-local-variable 'font-lock-global-modes) nil)
(font-lock-mode -1)
......
......@@ -860,7 +860,7 @@ Lisp code."
;; Use Unix EOLs, so that the file is portable to all platforms.
(setq buffer-file-coding-system 'raw-text-unix)
(erase-buffer)
(unless (eq major-mode 'emacs-lisp-mode)
(unless (derived-mode-p 'emacs-lisp-mode)
(emacs-lisp-mode))
;;;; Header + Prologue
......@@ -1102,7 +1102,9 @@ END is the limit of the search."
;;;; 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))))
(modify-syntax-entry ?\: "." table) ;; COLON
(modify-syntax-entry ?\> "." table) ;; GT
......@@ -1170,7 +1172,9 @@ END is the limit of the search."
semantic-grammar-mode-keywords-1
"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)))
(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-end outer)))))
(defun semantic-grammar-mode ()
(define-derived-mode semantic-grammar-mode
fundamental-mode "Semantic Grammar Framework"
"Initialize a buffer for editing Semantic grammars.
\\{semantic-grammar-map}"
(interactive)
(kill-all-local-variables)
(setq major-mode 'semantic-grammar-mode
mode-name "Semantic Grammar Framework")
\\{semantic-grammar-mode-map}"
(set (make-local-variable 'parse-sexp-ignore-comments) t)
(set (make-local-variable 'comment-start) ";;")
;; Look within the line for a ; following an even number of backslashes
;; after either a non-backslash or the line beginning.
(set (make-local-variable 'comment-start-skip)
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
(set-syntax-table semantic-grammar-syntax-table)
(use-local-map semantic-grammar-map)
(set (make-local-variable 'indent-line-function)
'semantic-grammar-indent)
(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)
(add-hook 'semantic-edits-new-change-functions
'semantic-grammar-edits-new-change-hook-fcn
nil t)
(semantic-run-mode-hooks 'semantic-grammar-mode-hook))
nil t))
;;;;
;;;; Useful commands
;;;;
(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)
st)
"Syntax table to skip a whole quoted expression in grammar code.
......
......@@ -121,7 +121,9 @@ The buffer is left in Command History mode."
(error "No command history")
(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)))
(set-keymap-parent map lisp-mode-shared-map)
(suppress-keymap map)
......@@ -132,21 +134,11 @@ The buffer is left in Command History mode."
map)
"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.