diff options
Diffstat (limited to 'lisp/cedet')
31 files changed, 548 insertions, 905 deletions
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 580667f0ce6..1e5434fe836 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog @@ -1,4 +1,51 @@ -2010-10-29 Glenn Morris <rgm@gnu.org> +2011-01-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * srecode/srt-mode.el (srecode-template-mode): Use define-derived-mode. + * semantic/symref/list.el (semantic-symref-results-mode): + Use run-mode-hooks. + +2010-11-12 Glenn Morris <rgm@gnu.org> + + * semantic/wisent/comp.el: Remove unnecessary eval-when-compiles. + +2010-11-10 Glenn Morris <rgm@gnu.org> + + * semantic/bovine/c.el: Test system-type with memq. + +2010-11-09 Glenn Morris <rgm@gnu.org> + + * semantic/lex.el (semantic-lex-ignore-comments, semantic-flex): + * semantic/grammar.el (semantic-grammar-epilogue): + * ede/speedbar.el (ede-find-nearest-file-line): + * ede/pmake.el (ede-proj-makefile-insert-dist-rules): + * ede/autoconf-edit.el (autoconf-delete-parameter): + Use point-at-bol and point-at-eol. + +2010-11-07 Glenn Morris <rgm@gnu.org> + + * ede/proj-elisp.el (ede-proj-flush-autoconf): Use point-at-bol. + +2010-11-01 Glenn Morris <rgm@gnu.org> + + * semantic/bovine/c.el (semantic-analyze-split-name): Move before use. + + * semantic/symref/cscope.el (ede-toplevel): + * semantic/symref.el (ede-toplevel): + * semantic/tag-file.el (ede-toplevel): + * ede.el (ede-toplevel): Fix declarations. + +2010-10-31 Glenn Morris <rgm@gnu.org> + + * ede/proj-elisp.el (project-compile-target): Fix previous change. + * semantic/ede-grammar.el (project-compile-target): Fix previous change. + +2010-10-31 Julien Danjou <julien@danjou.info> + + * ede/proj-elisp.el (project-compile-target): + * semantic/ede-grammar.el (project-compile-target): + Use `byte-recompile-file'. + +2010-10-31 Glenn Morris <rgm@gnu.org> * mode-local.el (mode-local-augment-function-help): * semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons): @@ -6,12 +53,6 @@ (semantic-symref-rb-toggle-expand-tag): Replace inappropriate uses of toggle-read-only. -2010-10-12 Juanma Barranquero <lekktu@gmail.com> - - * semantic/symref/list.el (semantic-symref-list-rename-open-hits): - Fix typo in message. - (semantic-symref-list-map-open-hits): Fix typo in docstring. - 2010-09-30 Chong Yidong <cyd@stupidchicken.com> * semantic/bovine/el.el: @@ -49,6 +90,14 @@ * ede/simple.el (ede-project-class-files): * ede/cpp-root.el (ede-project-class-files): Fix require name. +2010-09-25 Juanma Barranquero <lekktu@gmail.com> + + * semantic/lex.el (semantic-ignore-comments): Doc fix. + + * semantic/symref/list.el (semantic-symref-list-rename-open-hits): + Fix typo in error message. + (semantic-symref-list-map-open-hits): Fix typo in docstring. + 2010-09-21 Eric Ludlam <zappo@gnu.org> Synch SRecode to CEDET 1.0. @@ -62,8 +111,8 @@ * srecode/texi.el (srecode-texi-insert-tag-as-doc): New function. (semantic-insert-foreign-tag): Use it. - * srecode/mode.el (srecode-bind-insert): Call - srecode-load-tables-for-mode. + * srecode/mode.el (srecode-bind-insert): + Call srecode-load-tables-for-mode. (srecode-minor-mode-templates-menu): Do not list templates that are not in the current project. (srecode-menu-bar): Add binding for srecode-macro-help. @@ -116,8 +165,8 @@ compare of built-in templates. Give built-ins lower piority. Support special variable "project". (srecode-compile-template-table): Set :project slot of new tables. - (srecode-compile-one-template-tag): Use - srecode-create-dictionaries-from-tags. + (srecode-compile-one-template-tag): + Use srecode-create-dictionaries-from-tags. 2010-09-21 Eric Ludlam <zappo@gnu.org> @@ -167,8 +216,8 @@ (autoconf-new-automake-string): Deleted. (autoconf-new-program): Use SRecode to fill an empty file. - * ede/cpp-root.el (ede-create-lots-of-projects-under-dir): New - function. + * ede/cpp-root.el (ede-create-lots-of-projects-under-dir): + New function. * ede/files.el (ede-flush-project-hash): New command. (ede-convert-path): Add optional PROJECT arg. @@ -189,8 +238,8 @@ list whether or not the vars are already in the Makefile. (ede-pmake-insert-variable-once): New macro. - * ede/project-am.el (project-am-with-makefile-current): Add - recentf-exclude. + * ede/project-am.el (project-am-with-makefile-current): + Add recentf-exclude. (project-am-load-makefile): Obey an optional suggested name. (project-am-expand-subdirlist): New function. (project-am-makefile::project-rescan): Use it. Combine SUBDIRS @@ -205,16 +254,16 @@ (project-am-extract-package-info): Fix separators. * ede/proj.el (project-run-target): New method. - (project-make-dist, project-compile-project): Use - ede-proj-automake-p to determine which kind of compile to use. + (project-make-dist, project-compile-project): + Use ede-proj-automake-p to determine which kind of compile to use. (project-rescan): Call ede-load-project-file. (ede-buffer-mine): Add more file names that belong to the project. (ede-proj-compilers): Improve error message. * ede/proj-obj.el (ede-ld-linker): Use the LDDEPS variable. (ede-source-c++): Add more C++ extensions. - (ede-proj-target-makefile-objectcode): Quote initforms. Support - lex and yacc. + (ede-proj-target-makefile-objectcode): Quote initforms. + Support lex and yacc. * ede/proj-prog.el (ede-proj-makefile-insert-rules): Removed. (ede-proj-makefile-insert-variables): New, add LDDEPS. @@ -224,8 +273,8 @@ they show up in the same order as in the command line. (ede-proj-target-makefile-program): Add ldlibs-local slot. - * ede/proj-shared.el (ede-g++-libtool-shared-compiler): Fix - inference rule to use cpp files. + * ede/proj-shared.el (ede-g++-libtool-shared-compiler): + Fix inference rule to use cpp files. (ede-proj-target-makefile-shared-object): Quote initforms. * ede/proj-misc.el (ede-proj-target-makefile-miscelaneous): @@ -284,8 +333,8 @@ (semantic-analyze-scoped-inherited-tag-map): Take the tag we are looking for as part of the scoped tags list. - * semantic/html.el (semantic-default-html-setup): Add - senator-step-at-tag-classes. + * semantic/html.el (semantic-default-html-setup): + Add senator-step-at-tag-classes. * semantic/decorate/include.el (semantic-decoration-on-unknown-includes): Change light bgcolor. @@ -312,8 +361,8 @@ * semantic/util.el (semantic-hack-search) (semantic-recursive-find-nonterminal-by-name) (semantic-current-tag-interactive): Deleted. - (semantic-describe-buffer): Fix expand-nonterminal. Add - lex-syntax-mods, type relation separator char, and command + (semantic-describe-buffer): Fix expand-nonterminal. + Add lex-syntax-mods, type relation separator char, and command separation char. (semantic-sanity-check): Only message if called interactively. @@ -329,8 +378,8 @@ * semantic/idle.el: Add breadcrumbs support. (semantic-idle-summary-current-symbol-info-default) (semantic-idle-tag-highlight) - (semantic-idle-completion-list-default): Use - semanticdb-without-unloaded-file-searches for speed, and to + (semantic-idle-completion-list-default): + Use semanticdb-without-unloaded-file-searches for speed, and to conform to the controls that specify if the idle timer is supposed to be parsing unparsed includes. (semantic-idle-symbol-highlight-face) @@ -405,8 +454,8 @@ (semantic-analyze-find-tag-sequence-default): Be robust to calculated scopes being nil. - * semantic/bovine/c.el (semantic-c-describe-environment): Add - project macro symbol array. + * semantic/bovine/c.el (semantic-c-describe-environment): + Add project macro symbol array. (semantic-c-parse-lexical-token): Add recursion limit. (semantic-ctxt-imported-packages, semanticdb-expand-nested-tag): New overrides. @@ -415,8 +464,8 @@ (semantic-expand-c-tag-namelist): Do not split out a typedef'd inline type if it is an anonymous type. (semantic-c-reconstitute-token): Use the optional initializers as - a clue that some function is probably a constructor. When - defining the type of these constructors, split the parent name, + a clue that some function is probably a constructor. + When defining the type of these constructors, split the parent name, and use only the class part, if applicable. * semantic/bovine/c-by.el: @@ -437,7 +486,85 @@ * ede/cpp-root.el (ede-set-project-variables): Fix feature name (bug#6231). -2010-04-18 Chong Yidong <cyd@stupidchicken.com> +2010-05-02 Stefan Monnier <monnier@iro.umontreal.ca> + + Use a mode-line spec rather than a static string in Semantic. + * semantic/util-modes.el: + (semantic-minor-modes-format): New var to replace... + (semantic-minor-modes-status): Remove. + (semantic-mode-line-update): Construct a mode-line spec rather than + a static string so that mouse buttons can be used on individual minor + modes and so that semantic-mode-line-update only needs to be called + when global settings are changed. + (semantic-add-minor-mode, semantic-toggle-minor-mode-globally): + Call semantic-mode-line-update. + (semantic-toggle-minor-mode-globally): Don't assume mode is on + minor-mode-alist, check semantic-minor-mode-alist as well. + (semantic-stickyfunc-mode, semantic-show-parser-state-auto-marker) + (semantic-show-parser-state-marker, semantic-show-parser-state-mode) + (semantic-show-unmatched-syntax-mode, semantic-highlight-edits-mode): + * semantic/mru-bookmark.el (semantic-mru-bookmark-mode): + * semantic/idle.el (semantic-idle-scheduler-mode) + (define-semantic-idle-service, semantic-idle-summary-mode): + * semantic/decorate/mode.el (semantic-decoration-mode): + Don't call semantic-mode-line-update any more. + +2010-05-02 Stefan Monnier <monnier@iro.umontreal.ca> + + Use define-minor-mode in CEDET where applicable. + + * srecode/mode.el (srecode-minor-mode,global-srecode-minor-mode): + Use define-minor-mode. + + * semantic/util-modes.el (semantic-add-minor-mode): + Remove unused arg `keymap' and code redundant with define-minor-mode. + (semantic-toggle-minor-mode-globally): Only handle arg -1 and 1. + (semantic-stickyfunc-mode, global-semantic-show-unmatched-syntax-mode) + (semantic-highlight-func-mode, global-semantic-show-parser-state-mode) + (global-semantic-highlight-edits-mode, semantic-highlight-edits-mode) + (semantic-show-unmatched-syntax-mode, semantic-show-parser-state-mode) + (global-semantic-stickyfunc-mode, global-semantic-highlight-func-mode): + Use define-minor-mode. + (semantic-stickyfunc-mode-setup, semantic-highlight-edits-mode-setup) + (semantic-show-unmatched-syntax-mode-setup) + (semantic-show-parser-state-mode-setup) + (semantic-highlight-func-mode-setup): Inline into sole caller. + + * semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode) + (semantic-mru-bookmark-mode): Use define-minor-mode. + (semantic-mru-bookmark-mode-setup): Inline into sole caller. + + * semantic/idle.el (define-semantic-idle-service): + Use define-minor-mode and inline setup function into its sole caller. + (semantic-idle-scheduler-mode-setup) + (semantic-idle-summary-mode-setup): Inline into sole caller. + (global-semantic-idle-scheduler-mode, semantic-idle-scheduler-mode): + Use define-minor-mode. + + * semantic/decorate/mode.el (global-semantic-decoration-mode) + (semantic-decoration-mode): Use define-minor-mode. + (semantic-decoration-mode-setup): Inline into sole caller. + + * ede/dired.el (ede-dired-minor-mode): Initialize in declaration. + (ede-dired-minor-mode): Use define-minor-mode and derived-mode-p. + (ede-dired-add-to-target): Use dolist. + +2010-04-29 Chong Yidong <cyd@stupidchicken.com> + + * semantic.el (semantic-completion-at-point-function): + New function. + (semantic-mode): Use semantic-completion-at-point-function for + completion-at-point-functions instead. + +2010-04-28 Chong Yidong <cyd@stupidchicken.com> + + * semantic.el (semantic-mode): When enabled, add + semantic-ia-complete-symbol to completion-at-point-functions. + + * semantic/ia.el (semantic-ia-complete-symbol): Return nil + if Semantic is not active. + +2010-04-19 Chong Yidong <cyd@stupidchicken.com> * ede/pmake.el (ede-proj-makefile-insert-variables): Don't destroy list before using it. @@ -452,6 +579,13 @@ * srecode/table.el (srecode-template-table): Fix docstring typo. +2010-03-24 Glenn Morris <rgm@gnu.org> + + * semantic/bovine/c.el (semantic-c-describe-environment): + Consistently check ede-object is bound throughout. + + * ede/project-am.el (ede-shell-run-something): Declare. + 2010-03-13 Eric M. Ludlam <zappo@gnu.org> * semantic/imenu.el: New file, from the CEDET repository @@ -466,8 +600,13 @@ * semantic/db-find.el (semanticdb-find-translate-path-brutish-default): - * ede/make.el (ede-make-check-version): Use - with-current-buffer instead of save-excursion. + * ede/make.el (ede-make-check-version): + Use with-current-buffer instead of save-excursion. + +2010-02-24 Eduard Wiebe <usenet@pusto.de> + + * semantic/wisent/javascript.el (wisent-javascript-jv-expand-tag): + Avoid c(ad)ddr and use c(ad)r of cddr (Bug#5640). 2010-02-16 Chong Yidong <cyd@stupidchicken.com> @@ -650,8 +789,8 @@ * ede.el (ede-apply-preprocessor-map): Accept lists of ede-objects as targets. - * ede/pmake.el (ede-proj-makefile-insert-variables): Output - a target's object list even if compiler vars are already in the + * ede/pmake.el (ede-proj-makefile-insert-variables): + Output a target's object list even if compiler vars are already in the Makefile. * ede/emacs.el (ede-preprocessor-map): Add config.h to the @@ -747,8 +886,8 @@ 2009-11-08 Chong Yidong <cyd@stupidchicken.com> - * semantic/ctxt.el (semantic-get-local-variables): Disable - the progress reporter entirely. + * semantic/ctxt.el (semantic-get-local-variables): + Disable the progress reporter entirely. 2009-11-03 Stefan Monnier <monnier@iro.umontreal.ca> @@ -843,8 +982,8 @@ * semantic/tag.el (semantic--tag-link-list-to-buffer): Use mapc rather than mapcar because the return value is never used. - * srecode/template.el, cedet/semantic/wisent/javascript.el: - * semantic/wisent/java-tags.el, cedet/semantic/texi.el: + * srecode/template.el, semantic/wisent/javascript.el: + * semantic/wisent/java-tags.el, semantic/texi.el: * semantic/html.el: Suppress harmless warnings about setting up semantic-imenu (not part of Emacs) variables. @@ -998,10 +1137,6 @@ * semantic/idle.el (semantic-idle-tag-highlight): Use semantic-idle-summary-highlight-face as the highlighting. - * emacs-lisp/eieio-base.el (eieio-persistent-save): If buffer - contains multibyte characters, choose first applicable coding - system automatically. - * ede/project-am.el (project-run-target): New method. (project-run-target): New method. @@ -1329,10 +1464,6 @@ * srecode/expandproto.el: Fix provide statement. -2009-09-30 Eric Ludlam <zappo@gnu.org> - - * emacs-lisp/eieio.el (boolean-p): Delete. - 2009-09-30 Sascha Wilde <wilde@sha-bang.de> * ede/srecode.el: Fix provide statement. @@ -1378,15 +1509,6 @@ 2009-09-28 Eric Ludlam <zappo@gnu.org> - * emacs-lisp/chart.el: - * emacs-lisp/eieio-base.el: - * emacs-lisp/eieio-comp.el: - * emacs-lisp/eieio-custom.el: - * emacs-lisp/eieio-datadebug.el: - * emacs-lisp/eieio-opt.el: - * emacs-lisp/eieio-speedbar.el: - * emacs-lisp/eieio.el: New files. - * cedet-cscope.el: * cedet-files.el: * cedet-global.el: diff --git a/lisp/cedet/cedet-cscope.el b/lisp/cedet/cedet-cscope.el index 90b2277012a..afb06044f22 100644 --- a/lisp/cedet/cedet-cscope.el +++ b/lisp/cedet/cedet-cscope.el @@ -3,6 +3,7 @@ ;;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam <zappo@gnu.org> +;; Package: cedet ;; This file is part of GNU Emacs. diff --git a/lisp/cedet/cedet-files.el b/lisp/cedet/cedet-files.el index 65112bdab92..b20cb3a172a 100644 --- a/lisp/cedet/cedet-files.el +++ b/lisp/cedet/cedet-files.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam <eric@siege-engine.com> +;; Package: cedet ;; This file is part of GNU Emacs. diff --git a/lisp/cedet/cedet-global.el b/lisp/cedet/cedet-global.el index 9b270415dc1..8ac4ba1d0ba 100644 --- a/lisp/cedet/cedet-global.el +++ b/lisp/cedet/cedet-global.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam <eric@siege-engine.com> +;; Package: cedet ;; This file is part of GNU Emacs. diff --git a/lisp/cedet/cedet-idutils.el b/lisp/cedet/cedet-idutils.el index 760a85deb3b..1f8470ac20f 100644 --- a/lisp/cedet/cedet-idutils.el +++ b/lisp/cedet/cedet-idutils.el @@ -5,6 +5,7 @@ ;; Author: Eric M. Ludlam <eric@siege-engine.com> ;; Version: 0.2 ;; Keywords: OO, lisp +;; Package: cedet ;; This file is part of GNU Emacs. diff --git a/lisp/cedet/cedet.el b/lisp/cedet/cedet.el index ab5d7cd2132..7abc5c543fc 100644 --- a/lisp/cedet/cedet.el +++ b/lisp/cedet/cedet.el @@ -5,7 +5,7 @@ ;; Author: David Ponce <david@dponce.com> ;; Maintainer: Eric M. Ludlam <zappo@gnu.org> -;; Version: 0.2 +;; Version: 1.0pre7 ;; Keywords: OO, lisp ;; This file is part of GNU Emacs. diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el index 084d1899f57..ad5f5ca01a0 100644 --- a/lisp/cedet/data-debug.el +++ b/lisp/cedet/data-debug.el @@ -5,6 +5,7 @@ ;; Author: Eric M. Ludlam <zappo@gnu.org> ;; Version: 0.2 ;; Keywords: OO, lisp +;; Package: cedet ;; This file is part of GNU Emacs. diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el index f0450d539a3..84d56bcdb56 100644 --- a/lisp/cedet/ede.el +++ b/lisp/cedet/ede.el @@ -5,6 +5,7 @@ ;; Author: Eric M. Ludlam <zappo@gnu.org> ;; Keywords: project, make +;; Version: 1.0pre7 ;; This file is part of GNU Emacs. @@ -55,7 +56,7 @@ (declare-function ede-directory-project-p "ede/files") (declare-function ede-find-subproject-for-directory "ede/files") (declare-function ede-project-directory-remove-hash "ede/files") -(declare-function ede-toplevel "ede/files") +(declare-function ede-toplevel "ede/base") (declare-function ede-toplevel-project "ede/files") (declare-function ede-up-directory "ede/files") (declare-function semantic-lex-make-spp-table "semantic/lex-spp") @@ -1277,5 +1278,4 @@ is the project to use, instead of `ede-current-project'." (ede-speedbar-file-setup) (add-hook 'speedbar-load-hook 'ede-speedbar-file-setup)) -;; arch-tag: 0e1e0eba-484f-4119-abdb-30951f725705 ;;; ede.el ends here diff --git a/lisp/cedet/ede/autoconf-edit.el b/lisp/cedet/ede/autoconf-edit.el index 5af44a56f9c..0f7ea3fea2c 100644 --- a/lisp/cedet/ede/autoconf-edit.el +++ b/lisp/cedet/ede/autoconf-edit.el @@ -381,9 +381,7 @@ INDEX starts at 1." (down-list 1) (re-search-forward ", ?" nil nil (1- index)) (let ((end (save-excursion - (re-search-forward ",\\|)" (save-excursion - (end-of-line) - (point))) + (re-search-forward ",\\|)" (point-at-eol)) (forward-char -1) (point)))) (setq autoconf-deleted-text (buffer-substring (point) end)) @@ -417,5 +415,4 @@ to Makefiles, or other files using Autoconf substitution." (provide 'ede/autoconf-edit) -;; arch-tag: 5932c433-4fd4-4d5e-ab35-8effd95a405f ;;; ede/autoconf-edit.el ends here diff --git a/lisp/cedet/ede/dired.el b/lisp/cedet/ede/dired.el index af9ff274351..68a2899f3a5 100644 --- a/lisp/cedet/ede/dired.el +++ b/lisp/cedet/ede/dired.el @@ -27,57 +27,46 @@ ;; This provides a dired interface to EDE, allowing users to modify ;; their project file by adding files (or whatever) directly from a ;; dired buffer. - +(eval-when-compile (require 'cl)) (require 'easymenu) (require 'dired) (require 'ede) ;;; Code: -(defvar ede-dired-minor-mode nil - "Non-nil when in ede dired minor mode.") -(make-variable-buffer-local 'ede-dired-minor-mode) - -(defvar ede-dired-keymap nil +(defvar ede-dired-keymap + (let ((map (make-sparse-keymap))) + (define-key map ".a" 'ede-dired-add-to-target) + (define-key map ".t" 'ede-new-target) + (define-key map ".s" 'ede-speedbar) + (define-key map ".C" 'ede-compile-project) + (define-key map ".d" 'ede-make-dist) + + (easy-menu-define + ede-dired-menu map "EDE Dired Minor Mode Menu" + '("Project" + [ "Add files to target" ede-dired-add-to-target (ede-current-project) ] + ( "Build" :filter ede-build-forms-menu) + "-" + [ "Create Project" ede-new (not (ede-current-project)) ] + [ "Create Target" ede-new-target (ede-current-project) ] + "-" + ( "Customize Project" :filter ede-customize-forms-menu ) + [ "View Project Tree" ede-speedbar (ede-current-project) ] + )) + map) "Keymap used for ede dired minor mode.") -(if ede-dired-keymap - nil - (setq ede-dired-keymap (make-sparse-keymap)) - (define-key ede-dired-keymap ".a" 'ede-dired-add-to-target) - (define-key ede-dired-keymap ".t" 'ede-new-target) - (define-key ede-dired-keymap ".s" 'ede-speedbar) - (define-key ede-dired-keymap ".C" 'ede-compile-project) - (define-key ede-dired-keymap ".d" 'ede-make-dist) - - (easy-menu-define - ede-dired-menu ede-dired-keymap "EDE Dired Minor Mode Menu" - '("Project" - [ "Add files to target" ede-dired-add-to-target (ede-current-project) ] - ( "Build" :filter ede-build-forms-menu) - "-" - [ "Create Project" ede-new (not (ede-current-project)) ] - [ "Create Target" ede-new-target (ede-current-project) ] - "-" - ( "Customize Project" :filter ede-customize-forms-menu ) - [ "View Project Tree" ede-speedbar (ede-current-project) ] - )) - ) - -(defun ede-dired-minor-mode (&optional arg) +(define-minor-mode ede-dired-minor-mode "A minor mode that should only be activated in DIRED buffers. -If ARG is nil, toggle, if it is a positive number, force on, if +If ARG is nil or a positive number, force on, if negative, force off." - (interactive "P") - (if (not (or (eq major-mode 'dired-mode) - (eq major-mode 'vc-dired-mode))) - (error "Not in DIRED mode")) - (setq ede-dired-minor-mode - (not (or (and (null arg) ede-dired-minor-mode) - (<= (prefix-numeric-value arg) 0)))) - (if (and (not (ede-directory-project-p default-directory)) - (not (interactive-p))) - (setq ede-dired-minor-mode nil)) - ) + :lighter " EDE" :keymap ede-dired-keymap + (unless (derived-mode-p 'dired-mode) + (setq ede-dired-minor-mode nil) + (error "Not in DIRED mode")) + (unless (or (ede-directory-project-p default-directory) + (interactive-p)) + (setq ede-dired-minor-mode nil))) (defun ede-dired-add-to-target (target) "Add a file, or all marked files into a TARGET." @@ -85,24 +74,13 @@ negative, force off." (let ((ede-object (ede-current-project))) (ede-invoke-method 'project-interactive-select-target "Add files to Target: ")))) - (let ((files (dired-get-marked-files t))) - (while files - (project-add-file target (car files)) - ;; Find the buffer for this files, and set its ede-object - (if (get-file-buffer (car files)) - (with-current-buffer (get-file-buffer (car files)) - (setq ede-object nil) - (setq ede-object (ede-buffer-object (current-buffer))))) - ;; Increment. - (setq files (cdr files))))) - -;; Minor mode management. -(add-to-list 'minor-mode-alist '(ede-dired-minor-mode " EDE")) -(let ((a (assoc 'ede-dired-minor-mode minor-mode-map-alist))) - (if a - (setcdr a ede-dired-keymap) - (add-to-list 'minor-mode-map-alist (cons 'ede-dired-minor-mode - ede-dired-keymap)))) + (dolist (file (dired-get-marked-files t)) + (project-add-file target file) + ;; Find the buffer for this files, and set its ede-object + (if (get-file-buffer file) + (with-current-buffer (get-file-buffer file) + (setq ede-object nil) + (setq ede-object (ede-buffer-object (current-buffer))))))) (provide 'ede/dired) diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el index 45660566234..a9575b69249 100644 --- a/lisp/cedet/ede/pmake.el +++ b/lisp/cedet/ede/pmake.el @@ -1,7 +1,7 @@ ;;; ede-pmake.el --- EDE Generic Project Makefile code generator. -;;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -;;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam <zappo@gnu.org> ;; Keywords: project, make @@ -565,10 +565,7 @@ Argument THIS is the target that should insert stuff." (cond ((eq (cdr sv) 'share) ;; This variable may be shared between multiple targets. (if (re-search-backward (concat "\\$(" (car sv) ")") - (save-excursion - (beginning-of-line) - (point)) - t) + (point-at-bol) t) ;; If its already in the dist target, then skip it. nil (setq sv (car sv)))) @@ -693,5 +690,4 @@ Argument TARGETS are the targets we should depend on for TAGS." (provide 'ede/pmake) -;; arch-tag: 7ad8e19f-cdee-484c-8caf-f15cb0fc4df2 ;;; ede/pmake.el ends here diff --git a/lisp/cedet/ede/proj-elisp.el b/lisp/cedet/ede/proj-elisp.el index cff68debef0..8e964d5379e 100644 --- a/lisp/cedet/ede/proj-elisp.el +++ b/lisp/cedet/ede/proj-elisp.el @@ -129,18 +129,13 @@ Bonus: Return a cons cell: (COMPILED . UPTODATE)." (utd 0)) (mapc (lambda (src) (let* ((fsrc (expand-file-name src dir)) - (elc (concat (file-name-sans-extension fsrc) ".elc")) - ) - (if (or (not (file-exists-p elc)) - (file-newer-than-file-p fsrc elc)) - (progn - (setq comp (1+ comp)) - (byte-compile-file fsrc)) + (elc (concat (file-name-sans-extension fsrc) ".elc"))) + (if (eq (byte-recompile-file fsrc nil 0) t) + (setq comp (1+ comp)) (setq utd (1+ utd))))) (oref obj source)) (message "All Emacs Lisp sources are up to date in %s" (object-name obj)) - (cons comp utd) - )) + (cons comp utd))) (defmethod ede-update-version-in-source ((this ede-proj-target-elisp) version) "In a Lisp file, updated a version string for THIS to VERSION. @@ -250,10 +245,7 @@ is found, such as a `-version' variable, or the standard header." (let ((path (match-string 1))) (if (string= path "nil") nil - (delete-region (save-excursion (beginning-of-line) (point)) - (save-excursion (end-of-line) - (forward-char 1) - (point)))))))))) + (delete-region (point-at-bol) (point-at-bol 2))))))))) ;;; ;; Autoload generators @@ -390,5 +382,4 @@ Argument THIS is the target which needs to insert an info file." (provide 'ede/proj-elisp) -;; arch-tag: 3802c94b-d04d-4ecf-9bab-b29ed6e77588 ;;; ede/proj-elisp.el ends here diff --git a/lisp/cedet/ede/project-am.el b/lisp/cedet/ede/project-am.el index c5042ca3a9a..ac3e8bfc6eb 100644 --- a/lisp/cedet/ede/project-am.el +++ b/lisp/cedet/ede/project-am.el @@ -401,6 +401,8 @@ Argument COMMAND is the command to use for compiling the target." (funcall project-am-debug-target-function cmd)) (kill-buffer tb)))) +(declare-function ede-shell-run-something "ede/shell") + (defmethod project-run-target ((obj project-am-objectcode)) "Run the current project target in comint buffer." (require 'ede/shell) diff --git a/lisp/cedet/ede/speedbar.el b/lisp/cedet/ede/speedbar.el index 11c3bd8b7e5..c7ea005e6cb 100644 --- a/lisp/cedet/ede/speedbar.el +++ b/lisp/cedet/ede/speedbar.el @@ -1,7 +1,7 @@ ;;; ede/speedbar.el --- Speedbar viewing of EDE projects -;;; Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005, 2007, 2008, 2009, 2010, 2011 -;;; Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005, 2007, 2008, 2009, 2010, 2011 +;; Free Software Foundation, Inc. ;; Author: Eric M. Ludlam <zappo@gnu.org> ;; Keywords: project, make, tags @@ -176,10 +176,7 @@ Argument DIR is the directory from which to derive the list of objects." (beginning-of-line) (looking-at "^\\([0-9]+\\):") (let ((depth (string-to-number (match-string 1)))) - (while (not (re-search-forward "[]] [^ ]" - (save-excursion (end-of-line) - (point)) - t)) + (while (not (re-search-forward "[]] [^ ]" (point-at-eol) t)) (re-search-backward (format "^%d:" (1- depth))) (setq depth (1- depth))) (speedbar-line-token)))) @@ -358,5 +355,4 @@ INDENT is the current indentation level." ;; generated-autoload-load-name: "ede/speedbar" ;; End: -;; arch-tag: 56721fc9-8eb5-4115-8511-18cf8397ec87 ;;; ede/speedbar.el ends here diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index 166543c73cb..128dd0dcd61 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el @@ -94,8 +94,8 @@ NOTE: In process of obsoleting this." ;; Compiler options need to show up after path setup, but before ;; the preprocessor section. -(when (member system-type '(gnu gnu/linux darwin cygwin)) - (semantic-gcc-setup)) +(if (memq system-type '(gnu gnu/linux darwin cygwin)) + (semantic-gcc-setup)) ;;; Pre-processor maps ;; @@ -1002,6 +1002,13 @@ if something is a constructor. Value should be: where typename is the name of the type, and typeoftype is \"class\" or \"struct\".") +(define-mode-local-override semantic-analyze-split-name c-mode (name) + "Split up tag names on colon (:) boundaries." + (let ((ans (split-string name ":"))) + (if (= (length ans) 1) + name + (delete "" ans)))) + (defun semantic-c-reconstitute-token (tokenpart declmods typedecl) "Reconstitute a token TOKENPART with DECLMODS and TYPEDECL. This is so we don't have to match the same starting text several times. @@ -1559,13 +1566,6 @@ These are constants which are of type TYPE." (string= (semantic-tag-type type) "enum")) (semantic-tag-type-members type))) -(define-mode-local-override semantic-analyze-split-name c-mode (name) - "Split up tag names on colon (:) boundaries." - (let ((ans (split-string name ":"))) - (if (= (length ans) 1) - name - (delete "" ans)))) - (define-mode-local-override semantic-analyze-unsplit-name c-mode (namelist) "Assemble the list of names NAMELIST into a namespace name." (mapconcat 'identity namelist "::")) @@ -1840,8 +1840,9 @@ For types with a :parent, create faux namespaces to put TAG into." ede-object (arrayp semantic-lex-spp-project-macro-symbol-obarray)) (princ "\n Project symbol map:\n") - (princ " Your project symbol map is derived from the EDE object:\n ") - (princ (object-print ede-object)) + (when (and (boundp 'ede-object) ede-object) + (princ " Your project symbol map is derived from the EDE object:\n ") + (princ (object-print ede-object))) (princ "\n\n") (let ((macros nil)) (mapatoms @@ -1870,5 +1871,4 @@ For types with a :parent, create faux namespaces to put TAG into." ;; generated-autoload-load-name: "semantic/bovine/c" ;; End: -;; arch-tag: 263951a8-0f18-445d-8e73-eb8f9ac8e2a3 ;;; semantic/bovine/c.el ends here diff --git a/lisp/cedet/semantic/decorate/mode.el b/lisp/cedet/semantic/decorate/mode.el index cfe5d407eee..a41b0438703 100644 --- a/lisp/cedet/semantic/decorate/mode.el +++ b/lisp/cedet/semantic/decorate/mode.el @@ -224,46 +224,34 @@ Flush functions from `semantic-decorate-pending-decoration-hook'." ;; Generic mode for handling basic highlighting and decorations. ;; -(defcustom global-semantic-decoration-mode nil - "*If non-nil, enable global use of command `semantic-decoration-mode'. -When this mode is activated, decorations specified by -`semantic-decoration-styles'." - :group 'semantic - :group 'semantic-modes - :type 'boolean - :require 'semantic/decorate/mode - :initialize 'custom-initialize-default - :set (lambda (sym val) - (global-semantic-decoration-mode (if val 1 -1)))) - ;;;###autoload -(defun global-semantic-decoration-mode (&optional arg) +(define-minor-mode global-semantic-decoration-mode "Toggle global use of option `semantic-decoration-mode'. Decoration mode turns on all active decorations as specified -by `semantic-decoration-styles'. -If ARG is positive, enable, if it is negative, disable. -If ARG is nil, then toggle." - (interactive "P") - (setq global-semantic-decoration-mode - (semantic-toggle-minor-mode-globally - 'semantic-decoration-mode arg))) +by `semantic-decoration-styles'." + :global t :group 'semantic :group 'semantic-modes + ;; Not needed because it's autoloaded instead. + ;; :require 'semantic/decorate/mode + (semantic-toggle-minor-mode-globally + 'semantic-decoration-mode (if global-semantic-decoration-mode 1 -1))) (defcustom semantic-decoration-mode-hook nil "Hook run at the end of function `semantic-decoration-mode'." :group 'semantic :type 'hook) -;;;;###autoload -(defvar semantic-decoration-mode nil - "Non-nil if command `semantic-decoration-mode' is enabled. -Use the command `semantic-decoration-mode' to change this variable.") -(make-variable-buffer-local 'semantic-decoration-mode) - -(defun semantic-decoration-mode-setup () - "Setup the `semantic-decoration-mode' minor mode. -The minor mode can be turned on only if the semantic feature is available -and the current buffer was set up for parsing. Return non-nil if the +(define-minor-mode semantic-decoration-mode + "Minor mode for decorating tags. +Decorations are specified in `semantic-decoration-styles'. +You can define new decoration styles with +`define-semantic-decoration-style'. +With prefix argument ARG, turn on if positive, otherwise off. The +minor mode can be turned on only if semantic feature is available and +the current buffer was set up for parsing. Return non-nil if the minor mode is enabled." +;; +;;\\{semantic-decoration-map}" + nil nil nil (if semantic-decoration-mode (if (not (and (featurep 'semantic) (semantic-active-p))) (progn @@ -280,8 +268,7 @@ minor mode is enabled." 'semantic-decorate-tags-after-full-reparse nil t) ;; Add decorations to available tags. The above hooks ensure ;; that new tags will be decorated when they become available. - (semantic-decorate-add-decorations (semantic-fetch-available-tags)) - ) + (semantic-decorate-add-decorations (semantic-fetch-available-tags))) ;; Remove decorations from available tags. (semantic-decorate-clear-decorations (semantic-fetch-available-tags)) ;; Cleanup any leftover crap too. @@ -290,41 +277,10 @@ minor mode is enabled." (remove-hook 'semantic-after-partial-cache-change-hook 'semantic-decorate-tags-after-partial-reparse t) (remove-hook 'semantic-after-toplevel-cache-change-hook - 'semantic-decorate-tags-after-full-reparse t) - ) - semantic-decoration-mode) - -(defun semantic-decoration-mode (&optional arg) - "Minor mode for decorating tags. -Decorations are specified in `semantic-decoration-styles'. -You can define new decoration styles with -`define-semantic-decoration-style'. -With prefix argument ARG, turn on if positive, otherwise off. The -minor mode can be turned on only if semantic feature is available and -the current buffer was set up for parsing. Return non-nil if the -minor mode is enabled." -;; -;;\\{semantic-decoration-map}" - (interactive - (list (or current-prefix-arg - (if semantic-decoration-mode 0 1)))) - (setq semantic-decoration-mode - (if arg - (> - (prefix-numeric-value arg) - 0) - (not semantic-decoration-mode))) - (semantic-decoration-mode-setup) - (run-hooks 'semantic-decoration-mode-hook) - (if (called-interactively-p 'interactive) - (message "decoration-mode minor mode %sabled" - (if semantic-decoration-mode "en" "dis"))) - (semantic-mode-line-update) - semantic-decoration-mode) + 'semantic-decorate-tags-after-full-reparse t))) (semantic-add-minor-mode 'semantic-decoration-mode - "" - nil) + "") (defun semantic-decorate-tags-after-full-reparse (tag-list) "Add decorations after a complete reparse of the current buffer. diff --git a/lisp/cedet/semantic/ede-grammar.el b/lisp/cedet/semantic/ede-grammar.el index 8623998cc30..a3d901a6146 100644 --- a/lisp/cedet/semantic/ede-grammar.el +++ b/lisp/cedet/semantic/ede-grammar.el @@ -1,6 +1,6 @@ ;;; semantic/ede-grammar.el --- EDE support for Semantic Grammar Files -;;; Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam <zappo@gnu.org> ;; Keywords: project, make @@ -133,11 +133,8 @@ Lays claim to all -by.el, and -wy.el files." (save-excursion (semantic-grammar-create-package)) (save-buffer) - (let ((cf (concat (semantic-grammar-package) ".el"))) - (if (or (not (file-exists-p cf)) - (file-newer-than-file-p src cf)) - (byte-compile-file cf))))) - (oref obj source))) + (byte-recompile-file (concat (semantic-grammar-package) ".el") nil 0))) + (oref obj source))) (message "All Semantic Grammar sources are up to date in %s" (object-name obj))) ;;; Makefile generation functions @@ -197,5 +194,4 @@ Argument THIS is the target that should insert stuff." (provide 'semantic/ede-grammar) -;; arch-tag: 37a06a8d-957a-4fa2-a931-38482d28c24a ;;; semantic/ede-grammar.el ends here diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index 182a2f7978f..638f5f1ebab 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -248,10 +248,7 @@ That is tag names plus names defined in tag attribute `:rest'." (skip-chars-backward "\r\n\t") ;; If a grammar footer is found, skip it. (re-search-backward "^;;;\\s-+\\S-+\\s-+ends here" - (save-excursion - (beginning-of-line) - (point)) - t) + (point-at-bol) t) (skip-chars-backward "\r\n\t") (point))) "\n")) @@ -1897,5 +1894,4 @@ Optional argument COLOR determines if color is added to the text." (provide 'semantic/grammar) -;; arch-tag: 12ffc9d5-557d-49af-a5fd-a66a006ddb3e ;;; semantic/grammar.el ends here diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el index 4d93a5c4a3c..a545eb469ec 100644 --- a/lisp/cedet/semantic/idle.el +++ b/lisp/cedet/semantic/idle.el @@ -129,16 +129,6 @@ unlikely the user would be ready to type again right away." ;; The minor mode portion of this code just sets up the minor mode ;; which does the initial scheduling of the idle timers. ;; -;;;###autoload -(defcustom global-semantic-idle-scheduler-mode nil - "*If non-nil, enable global use of idle-scheduler mode." - :group 'semantic - :group 'semantic-modes - :type 'boolean - :require 'semantic/idle - :initialize 'custom-initialize-default - :set (lambda (sym val) - (global-semantic-idle-scheduler-mode (if val 1 -1)))) (defcustom semantic-idle-scheduler-mode-hook nil "Hook run at the end of the function `semantic-idle-scheduler-mode'." @@ -168,24 +158,8 @@ exceeds the `semantic-idle-scheduler-max-buffer-size' threshold." (or (<= semantic-idle-scheduler-max-buffer-size 0) (< (buffer-size) semantic-idle-scheduler-max-buffer-size)))) -(defun semantic-idle-scheduler-mode-setup () - "Setup option `semantic-idle-scheduler-mode'. -The minor mode can be turned on only if semantic feature is available -and the current buffer was set up for parsing. When minor mode is -enabled parse the current buffer if needed. Return non-nil if the -minor mode is enabled." - (if semantic-idle-scheduler-mode - (if (not (and (featurep 'semantic) (semantic-active-p))) - (progn - ;; Disable minor mode if semantic stuff not available - (setq semantic-idle-scheduler-mode nil) - (error "Buffer %s was not set up idle time scheduling" - (buffer-name))) - (semantic-idle-scheduler-setup-timers))) - semantic-idle-scheduler-mode) - ;;;###autoload -(defun semantic-idle-scheduler-mode (&optional arg) +(define-minor-mode semantic-idle-scheduler-mode "Minor mode to auto parse buffer following a change. When this mode is off, a buffer is only rescanned for tokens when some command requests the list of available tokens. When idle-scheduler @@ -196,26 +170,18 @@ With prefix argument ARG, turn on if positive, otherwise off. The minor mode can be turned on only if semantic feature is available and the current buffer was set up for parsing. Return non-nil if the minor mode is enabled." - (interactive - (list (or current-prefix-arg - (if semantic-idle-scheduler-mode 0 1)))) - (setq semantic-idle-scheduler-mode - (if arg - (> - (prefix-numeric-value arg) - 0) - (not semantic-idle-scheduler-mode))) - (semantic-idle-scheduler-mode-setup) - (run-hooks 'semantic-idle-scheduler-mode-hook) - (if (called-interactively-p 'interactive) - (message "idle-scheduler minor mode %sabled" - (if semantic-idle-scheduler-mode "en" "dis"))) - (semantic-mode-line-update) - semantic-idle-scheduler-mode) + nil nil nil + (if semantic-idle-scheduler-mode + (if (not (and (featurep 'semantic) (semantic-active-p))) + (progn + ;; Disable minor mode if semantic stuff not available + (setq semantic-idle-scheduler-mode nil) + (error "Buffer %s was not set up idle time scheduling" + (buffer-name))) + (semantic-idle-scheduler-setup-timers)))) (semantic-add-minor-mode 'semantic-idle-scheduler-mode - "ARP" - nil) + "ARP") ;;; SERVICES services ;; @@ -592,31 +558,23 @@ This routine creates the following functions and variables:" (mode (intern (concat (symbol-name name) "-mode"))) (hook (intern (concat (symbol-name name) "-mode-hook"))) (map (intern (concat (symbol-name name) "-mode-map"))) - (setup (intern (concat (symbol-name name) "-mode-setup"))) (func (intern (concat (symbol-name name) "-idle-function")))) `(eval-and-compile - (defun ,global (&optional arg) + (define-minor-mode ,global ,(concat "Toggle " (symbol-name global) ". With ARG, turn the minor mode on if ARG is positive, off otherwise. When this minor mode is enabled, `" (symbol-name mode) "' is turned on in every Semantic-supported buffer.") - (interactive "P") - (setq ,global - (semantic-toggle-minor-mode-globally - ',mode arg))) - - (defcustom ,global nil - ,(concat "Non-nil if `" (symbol-name mode) "' is enabled.") + :global t :group 'semantic :group 'semantic-modes - :type 'boolean :require 'semantic/idle - :initialize 'custom-initialize-default - :set (lambda (sym val) - (,global (if val 1 -1)))) + (semantic-toggle-minor-mode-globally + ',mode (if ,global 1 -1))) + ;; FIXME: Get rid of this when define-minor-mode does it for us. (defcustom ,hook nil ,(concat "Hook run at the end of function `" (symbol-name mode) "'.") :group 'semantic @@ -627,14 +585,9 @@ turned on in every Semantic-supported buffer.") km) ,(concat "Keymap for `" (symbol-name mode) "'.")) - (defvar ,mode nil - ,(concat "Non-nil if the minor mode `" (symbol-name mode) "' is enabled. -Use the command `" (symbol-name mode) "' to change this variable.")) - (make-variable-buffer-local ',mode) - - (defun ,setup () - ,(concat "Set up `" (symbol-name mode) "'. -Return non-nil if the minor mode is enabled.") + (define-minor-mode ,mode + ,doc + :keymap ,map (if ,mode (if (not (and (featurep 'semantic) (semantic-active-p))) (progn @@ -643,36 +596,12 @@ Return non-nil if the minor mode is enabled.") (error "Buffer %s was not set up for parsing" (buffer-name))) ;; Enable the mode mode - (semantic-idle-scheduler-add #',func) - ) + (semantic-idle-scheduler-add #',func)) ;; Disable the mode mode - (semantic-idle-scheduler-remove #',func) - ) - ,mode) - - (defun ,mode (&optional arg) - ,doc - (interactive - (list (or current-prefix-arg - (if ,mode 0 1)))) - (setq ,mode - (if arg - (> - (prefix-numeric-value arg) - 0) - (not ,mode))) - (,setup) - (run-hooks ,hook) - (if (called-interactively-p 'interactive) - (message "%s %sabled" - (symbol-name ',mode) - (if ,mode "en" "dis"))) - (semantic-mode-line-update) - ,mode) + (semantic-idle-scheduler-remove #',func))) (semantic-add-minor-mode ',mode - "" ; idle schedulers are quiet? - ,map) + "") ; idle schedulers are quiet? (defun ,func () ,(concat "Perform idle activity for the minor mode `" @@ -832,21 +761,6 @@ When this minor mode is enabled, the echo area displays a summary of the lexical token at point whenever Emacs is idle." :group 'semantic :group 'semantic-modes - (semantic-idle-summary-mode-setup) - (semantic-mode-line-update)) - -(defun semantic-idle-summary-refresh-echo-area () - (and semantic-idle-summary-mode - eldoc-last-message - (if (and (not executing-kbd-macro) - (not (and (boundp 'edebug-active) edebug-active)) - (not cursor-in-echo-area) - (not (eq (selected-window) (minibuffer-window)))) - (eldoc-message eldoc-last-message) - (setq eldoc-last-message nil)))) - -(defun semantic-idle-summary-mode-setup () - "Set up `semantic-idle-summary-mode'." (if semantic-idle-summary-mode ;; Enable the mode (progn @@ -860,8 +774,17 @@ of the lexical token at point whenever Emacs is idle." (add-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t)) ;; Disable the mode (semantic-idle-scheduler-remove 'semantic-idle-summary-idle-function) - (remove-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t)) - semantic-idle-summary-mode) + (remove-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t))) + +(defun semantic-idle-summary-refresh-echo-area () + (and semantic-idle-summary-mode + eldoc-last-message + (if (and (not executing-kbd-macro) + (not (and (boundp 'edebug-active) edebug-active)) + (not cursor-in-echo-area) + (not (eq (selected-window) (minibuffer-window)))) + (eldoc-message eldoc-last-message) + (setq eldoc-last-message nil)))) (semantic-add-minor-mode 'semantic-idle-summary-mode "") @@ -977,22 +900,22 @@ Call `semantic-symref-hits-in-region' to identify local references." ;;;###autoload -(defun global-semantic-idle-scheduler-mode (&optional arg) +(define-minor-mode global-semantic-idle-scheduler-mode "Toggle global use of option `semantic-idle-scheduler-mode'. The idle scheduler will automatically reparse buffers in idle time, and then schedule other jobs setup with `semantic-idle-scheduler-add'. -If ARG is positive, enable, if it is negative, disable. -If ARG is nil, then toggle." - (interactive "P") +If ARG is positive or nil, enable, if it is negative, disable." + :global t + :group 'semantic + :group 'semantic-modes ;; When turning off, disable other idle modes. - (when (or (and (numberp arg) (< arg 0)) - (and (null arg) global-semantic-idle-scheduler-mode)) + (when (null global-semantic-idle-scheduler-mode) (global-semantic-idle-summary-mode -1) (global-semantic-idle-local-symbol-highlight-mode -1) (global-semantic-idle-completions-mode -1)) - (setq global-semantic-idle-scheduler-mode - (semantic-toggle-minor-mode-globally - 'semantic-idle-scheduler-mode arg))) + (semantic-toggle-minor-mode-globally + 'semantic-idle-scheduler-mode + (if global-semantic-idle-scheduler-mode 1 -1))) ;;; Completion Popup Mode diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el index cc7a9ca8885..fa1a7762f28 100644 --- a/lisp/cedet/semantic/lex.el +++ b/lisp/cedet/semantic/lex.el @@ -1427,10 +1427,7 @@ Return either a paren token or a semantic list token depending on ;; to work properly. Lets try and move over ;; whatever white space we matched to begin ;; with. - (skip-syntax-forward "-.'" - (save-excursion - (end-of-line) - (point))) + (skip-syntax-forward "-.'" (point-at-eol)) ;; We may need to back up so newlines or whitespace is generated. (if (bolp) (backward-char 1))) @@ -1810,8 +1807,8 @@ what syntax class CHAR has.") (defvar semantic-ignore-comments t "Default comment handling. -t means to strip comments when flexing. Nil means to keep comments -as part of the token stream.") +The value t means to strip comments when flexing; nil means +to keep comments as part of the token stream.") (make-variable-buffer-local 'semantic-ignore-comments) (defvar semantic-flex-enable-newlines nil @@ -1997,10 +1994,7 @@ return LENGTH tokens." ;; to work properly. Lets try and move over ;; whatever white space we matched to begin ;; with. - (skip-syntax-forward "-.'" - (save-excursion - (end-of-line) - (point))) + (skip-syntax-forward "-.'" (point-at-eol)) ;;(forward-comment 1) ;; Generate newline token if enabled (if (and semantic-flex-enable-newlines @@ -2049,5 +2043,4 @@ return LENGTH tokens." ;; generated-autoload-load-name: "semantic/lex" ;; End: -;; arch-tag: a47664fc-48d9-4b36-921f-cab0ea8cdf92 ;;; semantic/lex.el ends here diff --git a/lisp/cedet/semantic/mru-bookmark.el b/lisp/cedet/semantic/mru-bookmark.el index bdb21adf12b..0f2a3f87dd7 100644 --- a/lisp/cedet/semantic/mru-bookmark.el +++ b/lisp/cedet/semantic/mru-bookmark.el @@ -252,14 +252,14 @@ been edited, and you can re-visit them with \\[semantic-mrub-switch-tags]." (global-semantic-mru-bookmark-mode (if val 1 -1)))) ;;;###autoload -(defun global-semantic-mru-bookmark-mode (&optional arg) +(define-minor-mode global-semantic-mru-bookmark-mode "Toggle global use of option `semantic-mru-bookmark-mode'. -If ARG is positive, enable, if it is negative, disable. -If ARG is nil, then toggle." - (interactive "P") - (setq global-semantic-mru-bookmark-mode - (semantic-toggle-minor-mode-globally - 'semantic-mru-bookmark-mode arg))) +If ARG is positive or nil, enable, if it is negative, disable." + :global t :group 'semantic :group 'semantic-modes + ;; Not needed because it's autoloaded instead. + ;; :require 'semantic-util-modes + (semantic-toggle-minor-mode-globally + 'semantic-mru-bookmark-mode (if global-semantic-mru-bookmark-mode 1 -1))) (defcustom semantic-mru-bookmark-mode-hook nil "*Hook run at the end of function `semantic-mru-bookmark-mode'." @@ -272,17 +272,18 @@ If ARG is nil, then toggle." km) "Keymap for mru-bookmark minor mode.") -(defvar semantic-mru-bookmark-mode nil - "Non-nil if mru-bookmark minor mode is enabled. -Use the command `semantic-mru-bookmark-mode' to change this variable.") -(make-variable-buffer-local 'semantic-mru-bookmark-mode) +(define-minor-mode semantic-mru-bookmark-mode + "Minor mode for tracking tag-based bookmarks automatically. +When this mode is enabled, Emacs keeps track of which tags have +been edited, and you can re-visit them with \\[semantic-mrub-switch-tags]. -(defun semantic-mru-bookmark-mode-setup () - "Setup option `semantic-mru-bookmark-mode'. -The minor mode can be turned on only if semantic feature is available -and the current buffer was set up for parsing. When minor mode is -enabled parse the current buffer if needed. Return non-nil if the +\\{semantic-mru-bookmark-mode-map} + +With prefix argument ARG, turn on if positive, otherwise off. The +minor mode can be turned on only if semantic feature is available and +the current buffer was set up for parsing. Return non-nil if the minor mode is enabled." + :keymap semantic-mru-bookmark-mode-map (if semantic-mru-bookmark-mode (if (not (and (featurep 'semantic) (semantic-active-p))) (progn @@ -294,47 +295,15 @@ minor mode is enabled." (add-hook 'semantic-edits-new-change-hooks 'semantic-mru-bookmark-change-hook-fcn nil t) (add-hook 'semantic-edits-move-change-hooks - 'semantic-mru-bookmark-change-hook-fcn nil t) - ) + 'semantic-mru-bookmark-change-hook-fcn nil t)) ;; Remove hooks (remove-hook 'semantic-edits-new-change-hooks 'semantic-mru-bookmark-change-hook-fcn t) (remove-hook 'semantic-edits-move-change-hooks - 'semantic-mru-bookmark-change-hook-fcn t) - ) - semantic-mru-bookmark-mode) - -(defun semantic-mru-bookmark-mode (&optional arg) - "Minor mode for tracking tag-based bookmarks automatically. -When this mode is enabled, Emacs keeps track of which tags have -been edited, and you can re-visit them with \\[semantic-mrub-switch-tags]. - -\\{semantic-mru-bookmark-mode-map} - -With prefix argument ARG, turn on if positive, otherwise off. The -minor mode can be turned on only if semantic feature is available and -the current buffer was set up for parsing. Return non-nil if the -minor mode is enabled." - (interactive - (list (or current-prefix-arg - (if semantic-mru-bookmark-mode 0 1)))) - (setq semantic-mru-bookmark-mode - (if arg - (> - (prefix-numeric-value arg) - 0) - (not semantic-mru-bookmark-mode))) - (semantic-mru-bookmark-mode-setup) - (run-hooks 'semantic-mru-bookmark-mode-hook) - (if (called-interactively-p 'interactive) - (message "mru-bookmark minor mode %sabled" - (if semantic-mru-bookmark-mode "en" "dis"))) - (semantic-mode-line-update) - semantic-mru-bookmark-mode) + 'semantic-mru-bookmark-change-hook-fcn t))) (semantic-add-minor-mode 'semantic-mru-bookmark-mode - "k" - semantic-mru-bookmark-mode-map) + "k") ;;; COMPLETING READ ;; diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el index 60ad734f84f..196d6b2bc89 100644 --- a/lisp/cedet/semantic/symref.el +++ b/lisp/cedet/semantic/symref.el @@ -69,7 +69,7 @@ (defvar ede-minor-mode) (declare-function data-debug-new-buffer "data-debug") (declare-function data-debug-insert-object-slots "eieio-datadebug") -(declare-function ede-toplevel "ede/files") +(declare-function ede-toplevel "ede/base") (declare-function ede-project-root-directory "ede/files") (declare-function ede-up-directory "ede/files") @@ -508,5 +508,4 @@ over until it returns nil." ;; generated-autoload-load-name: "semantic/symref" ;; End: -;; arch-tag: 928394b7-19ef-4f76-8cb3-37e9a9891984 ;;; semantic/symref.el ends here diff --git a/lisp/cedet/semantic/symref/cscope.el b/lisp/cedet/semantic/symref/cscope.el index ed11b473d6c..9267e8bb9f4 100644 --- a/lisp/cedet/semantic/symref/cscope.el +++ b/lisp/cedet/semantic/symref/cscope.el @@ -27,7 +27,7 @@ (require 'semantic/symref) (defvar ede-minor-mode) -(declare-function ede-toplevel "ede/files") +(declare-function ede-toplevel "ede/base") (declare-function ede-project-root-directory "ede/files") ;;; Code: @@ -91,5 +91,4 @@ Moves cursor to end of the match." ;; generated-autoload-load-name: "semantic/symref/cscope" ;; End: -;; arch-tag: 7c0a4e02-ade4-407a-9df7-4f948bd61a19 ;;; semantic/symref/cscope.el ends here diff --git a/lisp/cedet/semantic/symref/list.el b/lisp/cedet/semantic/symref/list.el index 8f887c7b398..39d4fe10c37 100644 --- a/lisp/cedet/semantic/symref/list.el +++ b/lisp/cedet/semantic/symref/list.el @@ -189,6 +189,7 @@ Display the references in`semantic-symref-results-mode'." "The current results in a results mode buffer.") (defun semantic-symref-results-mode (results) + ;; FIXME: Use define-derived-mode. "Major-mode for displaying Semantic Symbol Reference RESULTS. RESULTS is an object of class `semantic-symref-results'." (interactive) @@ -204,7 +205,7 @@ RESULTS is an object of class `semantic-symref-results'." (buffer-disable-undo) (set (make-local-variable 'font-lock-global-modes) nil) (font-lock-mode -1) - (run-hooks 'semantic-symref-results-mode-hook) + (run-mode-hooks 'semantic-symref-results-mode-hook) ) (defun semantic-symref-hide-buffer () diff --git a/lisp/cedet/semantic/tag-file.el b/lisp/cedet/semantic/tag-file.el index 2fea7b66f7a..381cb423393 100644 --- a/lisp/cedet/semantic/tag-file.el +++ b/lisp/cedet/semantic/tag-file.el @@ -32,7 +32,7 @@ (declare-function semanticdb-table-child-p "semantic/db" t t) (declare-function semanticdb-get-buffer "semantic/db") (declare-function semantic-dependency-find-file-on-path "semantic/dep") -(declare-function ede-toplevel "ede/files") +(declare-function ede-toplevel "ede/base") ;;; Code: @@ -214,5 +214,4 @@ file prototypes belong in." ;; generated-autoload-load-name: "semantic/tag-file" ;; End: -;; arch-tag: 71d4cf18-c1ec-414c-bb0a-c2ed914c1361 ;;; semantic/tag-file.el ends here diff --git a/lisp/cedet/semantic/util-modes.el b/lisp/cedet/semantic/util-modes.el index 6027165faae..f2798f0d90c 100644 --- a/lisp/cedet/semantic/util-modes.el +++ b/lisp/cedet/semantic/util-modes.el @@ -28,6 +28,10 @@ ;; ;;; Code: + +;; FIXME: compiling util-modes.el seems to require loading util-modes.el, +;; so if the previous compilation generated a file that fails to load, +;; recompiling fails to fix the problem. (require 'semantic) ;;; Group for all semantic enhancing modes @@ -49,8 +53,7 @@ line." :set (lambda (sym val) (set-default sym val) ;; Update status of all Semantic enabled buffers - (semantic-map-buffers - #'semantic-mode-line-update))) + (semantic-mode-line-update))) (defcustom semantic-mode-line-prefix (propertize "S" 'face 'bold) @@ -60,59 +63,61 @@ line." :require 'semantic/util-modes :initialize 'custom-initialize-default) -(defvar semantic-minor-modes-status nil - "String showing Semantic minor modes which are locally enabled. +(defvar semantic-minor-modes-format nil + "Mode line format showing Semantic minor modes which are locally enabled. It is displayed in the mode line.") -(make-variable-buffer-local 'semantic-minor-modes-status) +(put 'semantic-minor-modes-format 'risky-local-variable t) (defvar semantic-minor-mode-alist nil "Alist saying how to show Semantic minor modes in the mode line. Like variable `minor-mode-alist'.") (defun semantic-mode-line-update () - "Update display of Semantic minor modes in the mode line. + "Update mode line format of Semantic minor modes. Only minor modes that are locally enabled are shown in the mode line." - (setq semantic-minor-modes-status nil) - (if semantic-update-mode-line - (let ((ml semantic-minor-mode-alist) - mm ms see) - (while ml - (setq mm (car ml) - ms (cadr mm) - mm (car mm) - ml (cdr ml)) - (when (and (symbol-value mm) - ;; Only show local minor mode status - (not (memq mm semantic-init-hook))) - (and ms - (symbolp ms) - (setq ms (symbol-value ms))) - (and (stringp ms) - (not (member ms see)) ;; Don't duplicate same status - (setq see (cons ms see) - ms (if (string-match "^[ ]*\\(.+\\)" ms) - (match-string 1 ms))) - (setq semantic-minor-modes-status - (if semantic-minor-modes-status - (concat semantic-minor-modes-status "/" ms) - ms))))) - (if semantic-minor-modes-status - (setq semantic-minor-modes-status - (concat - " " - (if (string-match "^[ ]*\\(.+\\)" - semantic-mode-line-prefix) - (match-string 1 semantic-mode-line-prefix) - "S") - "/" - semantic-minor-modes-status)))))) + (setq semantic-minor-modes-format nil) + (dolist (x semantic-minor-mode-alist) + (setq minor-mode-alist (delq (assq (car x) minor-mode-alist) + minor-mode-alist))) + (when semantic-update-mode-line + (let ((locals '())) + ;; Select the minor modes that aren't enabled globally and who + ;; have a non-empty "name". + (dolist (x semantic-minor-mode-alist) + (unless (or (memq (car x) semantic-init-hook) + (not (string-match "^[ ]*\\(.+\\)" (cadr x)))) + (push (list (car x) (concat "/" (match-string 1 (cadr x)))) locals))) + ;; Then build the format spec. + (when locals + (let ((prefix (if (string-match "^[ ]*\\(.+\\)" + semantic-mode-line-prefix) + (match-string 1 semantic-mode-line-prefix) + "S"))) + (setq semantic-minor-modes-format + `((:eval (if (or ,@(mapcar 'car locals)) + ,(concat " " prefix))))) + ;; It would be easier to just put `locals' inside + ;; semantic-minor-modes-format, but then things like + ;; mode-line-minor-mode-help can't find the right major mode + ;; any more. So instead, we carefully put the minor modes + ;; in minor-mode-alist. + (let* ((elem (or (assq 'semantic-minor-modes-format + minor-mode-alist) + ;; FIXME: This entry is meaningless for + ;; mode-line-minor-mode-help. + '(semantic-minor-modes-format + semantic-minor-modes-format))) + (tail (or (memq elem minor-mode-alist) + (setq minor-mode-alist + (cons elem minor-mode-alist))))) + (setcdr tail (nconc locals (cdr tail))))))))) (defun semantic-desktop-ignore-this-minor-mode (buffer) "Installed as a minor-mode initializer for Desktop mode. BUFFER is the buffer to not initialize a Semantic minor mode in." nil) -(defun semantic-add-minor-mode (toggle name &optional keymap) +(defun semantic-add-minor-mode (toggle name) "Register a new Semantic minor mode. TOGGLE is a symbol which is the name of a buffer-local variable that is toggled on or off to say whether the minor mode is active or not. @@ -120,98 +125,58 @@ It is also an interactive function to toggle the mode. NAME specifies what will appear in the mode line when the minor mode is active. NAME should be either a string starting with a space, or a -symbol whose value is such a string. - -Optional KEYMAP is the keymap for the minor mode that will be added to -`minor-mode-map-alist'." - ;; Add a dymmy semantic minor mode to display the status - (or (assq 'semantic-minor-modes-status minor-mode-alist) - (setq minor-mode-alist (cons (list 'semantic-minor-modes-status - 'semantic-minor-modes-status) - minor-mode-alist))) - (if (fboundp 'add-minor-mode) - ;; Emacs 21 & XEmacs - (add-minor-mode toggle "" keymap) - ;; Emacs 20 - (or (assq toggle minor-mode-alist) - (setq minor-mode-alist (cons (list toggle "") minor-mode-alist))) - (or (not keymap) - (assq toggle minor-mode-map-alist) - (setq minor-mode-map-alist (cons (cons toggle keymap) - minor-mode-map-alist)))) +symbol whose value is such a string." ;; Record how to display this minor mode in the mode line (let ((mm (assq toggle semantic-minor-mode-alist))) (if mm (setcdr mm (list name)) (setq semantic-minor-mode-alist (cons (list toggle name) semantic-minor-mode-alist)))) + (semantic-mode-line-update) ;; Semantic minor modes don't work w/ Desktop restore. ;; This line will disable this minor mode from being restored ;; by Desktop. (when (boundp 'desktop-minor-mode-handlers) (add-to-list 'desktop-minor-mode-handlers - (cons toggle 'semantic-desktop-ignore-this-minor-mode))) - ) + (cons toggle 'semantic-desktop-ignore-this-minor-mode)))) (defun semantic-toggle-minor-mode-globally (mode &optional arg) "Toggle minor mode MODE in every Semantic enabled buffer. Return non-nil if MODE is turned on in every Semantic enabled buffer. -If ARG is positive, enable, if it is negative, disable. If ARG is -nil, then toggle. Otherwise do nothing. MODE must be a valid minor -mode defined in `minor-mode-alist' and must be too an interactive -function used to toggle the mode." - (or (and (fboundp mode) (assq mode minor-mode-alist)) +If ARG is positive, enable, if it is negative, disable. +MODE must be a valid minor mode defined in `minor-mode-alist' and must be +too an interactive function used to toggle the mode." + ;; FIXME: All callers should pass a -1 or +1 argument. + (or (and (fboundp mode) (or (assq mode minor-mode-alist) ;Needed? + (assq mode semantic-minor-mode-alist))) (error "Semantic minor mode %s not found" mode)) - (if (not arg) - (if (memq mode semantic-init-hook) - (setq arg -1) - (setq arg 1))) - ;; Add or remove the MODE toggle function from - ;; `semantic-init-hook'. Then turn MODE on or off in every - ;; Semantic enabled buffer. + ;; Add or remove the MODE toggle function from `semantic-init-hook'. (cond ;; Turn off if ARG < 0 - ((< arg 0) - (remove-hook 'semantic-init-hook mode) - (semantic-map-buffers #'(lambda () (funcall mode -1))) - nil) + ((< arg 0) (remove-hook 'semantic-init-hook mode)) ;; Turn on if ARG > 0 - ((> arg 0) - (add-hook 'semantic-init-hook mode) - (semantic-map-buffers #'(lambda () (funcall mode 1))) - t) + ((> arg 0) (add-hook 'semantic-init-hook mode)) ;; Otherwise just check MODE state (t - (memq mode semantic-init-hook)) - )) + (error "semantic-toggle-minor-mode-globally: arg should be -1 or 1"))) + ;; Update the minor mode format. + (semantic-mode-line-update) + ;; Then turn MODE on or off in every Semantic enabled buffer. + (semantic-map-buffers #'(lambda () (funcall mode arg)))) ;;;; ;;;; Minor mode to highlight areas that a user edits. ;;;; ;;;###autoload -(defun global-semantic-highlight-edits-mode (&optional arg) +(define-minor-mode global-semantic-highlight-edits-mode "Toggle global use of option `semantic-highlight-edits-mode'. -If ARG is positive, enable, if it is negative, disable. -If ARG is nil, then toggle." - (interactive "P") - (setq global-semantic-highlight-edits-mode - (semantic-toggle-minor-mode-globally - 'semantic-highlight-edits-mode arg))) - -;;;###autoload -(defcustom global-semantic-highlight-edits-mode nil - "If non-nil enable global use of variable `semantic-highlight-edits-mode'. -When this mode is enabled, changes made to a buffer are highlighted -until the buffer is reparsed." - :group 'semantic - :group 'semantic-modes - :type 'boolean - :require 'semantic/util-modes - :initialize 'custom-initialize-default - :set (lambda (sym val) - (global-semantic-highlight-edits-mode (if val 1 -1)))) +If ARG is positive or nil, enable, if it is negative, disable." + :global t :group 'semantic :group 'semantic-modes + (semantic-toggle-minor-mode-globally + 'semantic-highlight-edits-mode + (if global-semantic-highlight-edits-mode 1 -1))) (defcustom semantic-highlight-edits-mode-hook nil "Hook run at the end of function `semantic-highlight-edits-mode'." @@ -238,17 +203,18 @@ This function will set the face property on this overlay." km) "Keymap for highlight-edits minor mode.") -(defvar semantic-highlight-edits-mode nil - "Non-nil if highlight-edits minor mode is enabled. -Use the command `semantic-highlight-edits-mode' to change this variable.") -(make-variable-buffer-local 'semantic-highlight-edits-mode) - -(defun semantic-highlight-edits-mode-setup () - "Setup option `semantic-highlight-edits-mode'. -The minor mode can be turned on only if semantic feature is available -and the current buffer was set up for parsing. When minor mode is -enabled parse the current buffer if needed. Return non-nil if the +;;;###autoload +(define-minor-mode semantic-highlight-edits-mode + "Minor mode for highlighting changes made in a buffer. +Changes are tracked by semantic so that the incremental parser can work +properly. +This mode will highlight those changes as they are made, and clear them +when the incremental parser accounts for those edits. +With prefix argument ARG, turn on if positive, otherwise off. The +minor mode can be turned on only if semantic feature is available and +the current buffer was set up for parsing. Return non-nil if the minor mode is enabled." + :keymap semantic-highlight-edits-mode-map (if semantic-highlight-edits-mode (if (not (and (featurep 'semantic) (semantic-active-p))) (progn @@ -258,73 +224,28 @@ minor mode is enabled." (buffer-name))) (semantic-make-local-hook 'semantic-edits-new-change-hooks) (add-hook 'semantic-edits-new-change-hooks - 'semantic-highlight-edits-new-change-hook-fcn nil t) - ) + 'semantic-highlight-edits-new-change-hook-fcn nil t)) ;; Remove hooks (remove-hook 'semantic-edits-new-change-hooks - 'semantic-highlight-edits-new-change-hook-fcn t) - ) - semantic-highlight-edits-mode) - -;;;###autoload -(defun semantic-highlight-edits-mode (&optional arg) - "Minor mode for highlighting changes made in a buffer. -Changes are tracked by semantic so that the incremental parser can work -properly. -This mode will highlight those changes as they are made, and clear them -when the incremental parser accounts for those edits. -With prefix argument ARG, turn on if positive, otherwise off. The -minor mode can be turned on only if semantic feature is available and -the current buffer was set up for parsing. Return non-nil if the -minor mode is enabled." - (interactive - (list (or current-prefix-arg - (if semantic-highlight-edits-mode 0 1)))) - (setq semantic-highlight-edits-mode - (if arg - (> - (prefix-numeric-value arg) - 0) - (not semantic-highlight-edits-mode))) - (semantic-highlight-edits-mode-setup) - (run-hooks 'semantic-highlight-edits-mode-hook) - (if (called-interactively-p 'interactive) - (message "highlight-edits minor mode %sabled" - (if semantic-highlight-edits-mode "en" "dis"))) - (semantic-mode-line-update) - semantic-highlight-edits-mode) + 'semantic-highlight-edits-new-change-hook-fcn t))) (semantic-add-minor-mode 'semantic-highlight-edits-mode - "e" - semantic-highlight-edits-mode-map) - + "e") ;;;; ;;;; Minor mode to show unmatched-syntax elements ;;;; ;;;###autoload -(defun global-semantic-show-unmatched-syntax-mode (&optional arg) +(define-minor-mode global-semantic-show-unmatched-syntax-mode "Toggle global use of option `semantic-show-unmatched-syntax-mode'. -If ARG is positive, enable, if it is negative, disable. -If ARG is nil, then toggle." - (interactive "P") - (setq global-semantic-show-unmatched-syntax-mode - (semantic-toggle-minor-mode-globally - 'semantic-show-unmatched-syntax-mode arg))) - -;;;###autoload -(defcustom global-semantic-show-unmatched-syntax-mode nil - "If non-nil, enable global use of `semantic-show-unmatched-syntax-mode'. -When this mode is enabled, syntax in the current buffer which the -semantic parser cannot match is highlighted with a red underline." - :group 'semantic - :group 'semantic-modes - :type 'boolean - :require 'semantic/util-modes - :initialize 'custom-initialize-default - :set (lambda (sym val) - (global-semantic-show-unmatched-syntax-mode (if val 1 -1)))) +If ARG is positive or nil, enable, if it is negative, disable." + :global t :group 'semantic :group 'semantic-modes + ;; Not needed because it's autoloaded instead. + ;; :require 'semantic/util-modes + (semantic-toggle-minor-mode-globally + 'semantic-show-unmatched-syntax-mode + (if global-semantic-show-unmatched-syntax-mode 1 -1))) (defcustom semantic-show-unmatched-syntax-mode-hook nil "Hook run at the end of function `semantic-show-unmatched-syntax-mode'." @@ -432,18 +353,21 @@ Do not search past BOUND if non-nil." km) "Keymap for command `semantic-show-unmatched-syntax-mode'.") -(defvar semantic-show-unmatched-syntax-mode nil - "Non-nil if show-unmatched-syntax minor mode is enabled. -Use the command `semantic-show-unmatched-syntax-mode' to change this -variable.") -(make-variable-buffer-local 'semantic-show-unmatched-syntax-mode) - -(defun semantic-show-unmatched-syntax-mode-setup () - "Setup the `semantic-show-unmatched-syntax' minor mode. -The minor mode can be turned on only if semantic feature is available -and the current buffer was set up for parsing. When minor mode is -enabled parse the current buffer if needed. Return non-nil if the -minor mode is enabled." +;;;###autoload +(define-minor-mode semantic-show-unmatched-syntax-mode + "Minor mode to highlight unmatched lexical syntax tokens. +When a parser executes, some elements in the buffer may not match any +parser rules. These text characters are considered unmatched syntax. +Often time, the display of unmatched syntax can expose coding +problems before the compiler is run. + +With prefix argument ARG, turn on if positive, otherwise off. The +minor mode can be turned on only if semantic feature is available and +the current buffer was set up for parsing. Return non-nil if the +minor mode is enabled. + +\\{semantic-show-unmatched-syntax-mode-map}" + :keymap semantic-show-unmatched-syntax-mode-map (if semantic-show-unmatched-syntax-mode (if (not (and (featurep 'semantic) (semantic-active-p))) (progn @@ -468,43 +392,10 @@ minor mode is enabled." (remove-hook 'semantic-pre-clean-token-hooks 'semantic-clean-token-of-unmatched-syntax t) ;; Cleanup unmatched-syntax highlighting - (semantic-clean-unmatched-syntax-in-buffer)) - semantic-show-unmatched-syntax-mode) - -;;;###autoload -(defun semantic-show-unmatched-syntax-mode (&optional arg) - "Minor mode to highlight unmatched lexical syntax tokens. -When a parser executes, some elements in the buffer may not match any -parser rules. These text characters are considered unmatched syntax. -Often time, the display of unmatched syntax can expose coding -problems before the compiler is run. - -With prefix argument ARG, turn on if positive, otherwise off. The -minor mode can be turned on only if semantic feature is available and -the current buffer was set up for parsing. Return non-nil if the -minor mode is enabled. - -\\{semantic-show-unmatched-syntax-mode-map}" - (interactive - (list (or current-prefix-arg - (if semantic-show-unmatched-syntax-mode 0 1)))) - (setq semantic-show-unmatched-syntax-mode - (if arg - (> - (prefix-numeric-value arg) - 0) - (not semantic-show-unmatched-syntax-mode))) - (semantic-show-unmatched-syntax-mode-setup) - (run-hooks 'semantic-show-unmatched-syntax-mode-hook) - (if (called-interactively-p 'interactive) - (message "show-unmatched-syntax minor mode %sabled" - (if semantic-show-unmatched-syntax-mode "en" "dis"))) - (semantic-mode-line-update) - semantic-show-unmatched-syntax-mode) + (semantic-clean-unmatched-syntax-in-buffer))) (semantic-add-minor-mode 'semantic-show-unmatched-syntax-mode - "u" - semantic-show-unmatched-syntax-mode-map) + "u") (defun semantic-show-unmatched-syntax-next () "Move forward to the next occurrence of unmatched syntax." @@ -519,27 +410,15 @@ minor mode is enabled. ;;;; ;;;###autoload -(defcustom global-semantic-show-parser-state-mode nil - "If non-nil enable global use of `semantic-show-parser-state-mode'. -When enabled, the current parse state of the current buffer is displayed -in the mode line. See `semantic-show-parser-state-marker' for details -on what is displayed." - :group 'semantic - :type 'boolean - :require 'semantic/util-modes - :initialize 'custom-initialize-default - :set (lambda (sym val) - (global-semantic-show-parser-state-mode (if val 1 -1)))) - -;;;###autoload -(defun global-semantic-show-parser-state-mode (&optional arg) +(define-minor-mode global-semantic-show-parser-state-mode "Toggle global use of option `semantic-show-parser-state-mode'. -If ARG is positive, enable, if it is negative, disable. -If ARG is nil, then toggle." - (interactive "P") - (setq global-semantic-show-parser-state-mode - (semantic-toggle-minor-mode-globally - 'semantic-show-parser-state-mode arg))) +If ARG is positive or nil, enable, if it is negative, disable." + :global t :group 'semantic + ;; Not needed because it's autoloaded instead. + ;; :require 'semantic/util-modes + (semantic-toggle-minor-mode-globally + 'semantic-show-parser-state-mode + (if global-semantic-show-parser-state-mode 1 -1))) (defcustom semantic-show-parser-state-mode-hook nil "Hook run at the end of function `semantic-show-parser-state-mode'." @@ -551,17 +430,22 @@ If ARG is nil, then toggle." km) "Keymap for show-parser-state minor mode.") -(defvar semantic-show-parser-state-mode nil - "Non-nil if show-parser-state minor mode is enabled. -Use the command `semantic-show-parser-state-mode' to change this variable.") -(make-variable-buffer-local 'semantic-show-parser-state-mode) - -(defun semantic-show-parser-state-mode-setup () - "Setup option `semantic-show-parser-state-mode'. -The minor mode can be turned on only if semantic feature is available -and the current buffer was set up for parsing. When minor mode is -enabled parse the current buffer if needed. Return non-nil if the +;;;###autoload +(define-minor-mode semantic-show-parser-state-mode + "Minor mode for displaying parser cache state in the modeline. +The cache can be in one of three states. They are +Up to date, Partial reparse needed, and Full reparse needed. +The state is indicated in the modeline with the following characters: + `-' -> The cache is up to date. + `!' -> The cache requires a full update. + `~' -> The cache needs to be incrementally parsed. + `%' -> The cache is not currently parseable. + `@' -> Auto-parse in progress (not set here.) +With prefix argument ARG, turn on if positive, otherwise off. The +minor mode can be turned on only if semantic feature is available and +the current buffer was set up for parsing. Return non-nil if the minor mode is enabled." + :keymap semantic-show-parser-state-mode-map (if semantic-show-parser-state-mode (if (not (and (featurep 'semantic) (semantic-active-p))) (progn @@ -603,8 +487,7 @@ minor mode is enabled." 'semantic-show-parser-state-auto-marker nil t) (semantic-make-local-hook 'semantic-after-idle-scheduler-reparse-hook) (add-hook 'semantic-after-idle-scheduler-reparse-hook - 'semantic-show-parser-state-marker nil t) - ) + 'semantic-show-parser-state-marker nil t)) ;; Remove parts of mode line (setq mode-line-modified (delq 'semantic-show-parser-state-string mode-line-modified)) @@ -626,45 +509,10 @@ minor mode is enabled." (remove-hook 'semantic-before-idle-scheduler-reparse-hook 'semantic-show-parser-state-auto-marker t) (remove-hook 'semantic-after-idle-scheduler-reparse-hook - 'semantic-show-parser-state-marker t) - ) - semantic-show-parser-state-mode) - -;;;###autoload -(defun semantic-show-parser-state-mode (&optional arg) - "Minor mode for displaying parser cache state in the modeline. -The cache can be in one of three states. They are -Up to date, Partial reparse needed, and Full reparse needed. -The state is indicated in the modeline with the following characters: - `-' -> The cache is up to date. - `!' -> The cache requires a full update. - `~' -> The cache needs to be incrementally parsed. - `%' -> The cache is not currently parseable. - `@' -> Auto-parse in progress (not set here.) -With prefix argument ARG, turn on if positive, otherwise off. The -minor mode can be turned on only if semantic feature is available and -the current buffer was set up for parsing. Return non-nil if the -minor mode is enabled." - (interactive - (list (or current-prefix-arg - (if semantic-show-parser-state-mode 0 1)))) - (setq semantic-show-parser-state-mode - (if arg - (> - (prefix-numeric-value arg) - 0) - (not semantic-show-parser-state-mode))) - (semantic-show-parser-state-mode-setup) - (run-hooks 'semantic-show-parser-state-mode-hook) - (if (called-interactively-p 'interactive) - (message "show-parser-state minor mode %sabled" - (if semantic-show-parser-state-mode "en" "dis"))) - (semantic-mode-line-update) - semantic-show-parser-state-mode) + 'semantic-show-parser-state-marker t))) (semantic-add-minor-mode 'semantic-show-parser-state-mode - "" - semantic-show-parser-state-mode-map) + "") (defvar semantic-show-parser-state-string nil "String showing the parser state for this buffer. @@ -691,7 +539,7 @@ in many situations." (t "-"))) ;;(message "Setup mode line indicator to [%s]" semantic-show-parser-state-string) - (semantic-mode-line-update)) + ) (defun semantic-show-parser-state-auto-marker () "Hook function run before an autoparse. @@ -699,7 +547,6 @@ Set up `semantic-show-parser-state-marker' to show `@' to indicate a parse in progress." (unless (semantic-parse-tree-up-to-date-p) (setq semantic-show-parser-state-string "@") - (semantic-mode-line-update) ;; For testing. ;;(sit-for 1) )) @@ -710,30 +557,14 @@ to indicate a parse in progress." ;;;; ;;;###autoload -(defun global-semantic-stickyfunc-mode (&optional arg) +(define-minor-mode global-semantic-stickyfunc-mode "Toggle global use of option `semantic-stickyfunc-mode'. -If ARG is positive, enable, if it is negative, disable. -If ARG is nil, then toggle." - (interactive "P") - (setq global-semantic-stickyfunc-mode - (semantic-toggle-minor-mode-globally - 'semantic-stickyfunc-mode arg))) - -;;;###autoload -(defcustom global-semantic-stickyfunc-mode nil - "If non-nil, enable global use of `semantic-stickyfunc-mode'. -This minor mode only works for Emacs 21 or later. -When enabled, the header line is enabled, and the first line -of the current function or method is displayed in it. -This makes it appear that the first line of that tag is -`sticky' to the top of the window." - :group 'semantic - :group 'semantic-modes - :type 'boolean - :require 'semantic/util-modes - :initialize 'custom-initialize-default - :set (lambda (sym val) - (global-semantic-stickyfunc-mode (if val 1 -1)))) +If ARG is positive or nil, enable, if it is negative, disable." + :global t :group 'semantic :group 'semantic-modes + ;; Not needed because it's autoloaded instead. + ;; :require 'semantic/util-modes + (semantic-toggle-minor-mode-globally + 'semantic-stickyfunc-mode (if global-semantic-stickyfunc-mode 1 -1))) (defcustom semantic-stickyfunc-mode-hook nil "Hook run at the end of function `semantic-stickyfunc-mode'." @@ -781,11 +612,6 @@ This makes it appear that the first line of that tag is (describe-function 'semantic-stickyfunc-mode)) t]) ) -(defvar semantic-stickyfunc-mode nil - "Non-nil if stickyfunc minor mode is enabled. -Use the command `semantic-stickyfunc-mode' to change this variable.") -(make-variable-buffer-local 'semantic-stickyfunc-mode) - (defcustom semantic-stickyfunc-indent-string (if (and window-system (not (featurep 'xemacs))) (concat @@ -870,11 +696,21 @@ when it lands in the sticky line." (t nil)) "The header line format used by stickyfunc mode.") -(defun semantic-stickyfunc-mode-setup () - "Setup option `semantic-stickyfunc-mode'. -For semantic enabled buffers, make the function declaration for the top most -function \"sticky\". This is accomplished by putting the first line of -text for that function in the header line." +;;;###autoload +(define-minor-mode semantic-stickyfunc-mode + "Minor mode to show the title of a tag in the header line. +Enables/disables making the header line of functions sticky. +A function (or other tag class specified by +`semantic-stickyfunc-sticky-classes') has a header line, meaning the +first line which describes the rest of the construct. This first +line is what is displayed in the header line. + +With prefix argument ARG, turn on if positive, otherwise off. The +minor mode can be turned on only if semantic feature is available and +the current buffer was set up for parsing. Return non-nil if the +minor mode is enabled." + ;; Don't need indicator. It's quite visible + :keymap semantic-stickyfunc-mode-map (if semantic-stickyfunc-mode (progn (unless (and (featurep 'semantic) (semantic-active-p)) @@ -892,8 +728,7 @@ text for that function in the header line." semantic-stickyfunc-header-line-format))) (set (make-local-variable 'semantic-stickyfunc-old-hlf) header-line-format)) - (setq header-line-format semantic-stickyfunc-header-line-format) - ) + (setq header-line-format semantic-stickyfunc-header-line-format)) ;; Disable sticky func mode ;; Restore previous buffer local value of header line format if ;; the current one is the sticky func one. @@ -901,38 +736,7 @@ text for that function in the header line." (kill-local-variable 'header-line-format) (when (local-variable-p 'semantic-stickyfunc-old-hlf (current-buffer)) (setq header-line-format semantic-stickyfunc-old-hlf) - (kill-local-variable 'semantic-stickyfunc-old-hlf)))) - semantic-stickyfunc-mode) - -;;;###autoload -(defun semantic-stickyfunc-mode (&optional arg) - "Minor mode to show the title of a tag in the header line. -Enables/disables making the header line of functions sticky. -A function (or other tag class specified by -`semantic-stickyfunc-sticky-classes') has a header line, meaning the -first line which describes the rest of the construct. This first -line is what is displayed in the header line. - -With prefix argument ARG, turn on if positive, otherwise off. The -minor mode can be turned on only if semantic feature is available and -the current buffer was set up for parsing. Return non-nil if the -minor mode is enabled." - (interactive - (list (or current-prefix-arg - (if semantic-stickyfunc-mode 0 1)))) - (setq semantic-stickyfunc-mode - (if arg - (> - (prefix-numeric-value arg) - 0) - (not semantic-stickyfunc-mode))) - (semantic-stickyfunc-mode-setup) - (run-hooks 'semantic-stickyfunc-mode-hook) - (if (called-interactively-p 'interactive) - (message "Stickyfunc minor mode %sabled" - (if semantic-stickyfunc-mode "en" "dis"))) - (semantic-mode-line-update) - semantic-stickyfunc-mode) + (kill-local-variable 'semantic-stickyfunc-old-hlf))))) (defvar semantic-stickyfunc-sticky-classes '(function type) @@ -1025,8 +829,7 @@ Argument EVENT describes the event that caused this function to be called." (semantic-add-minor-mode 'semantic-stickyfunc-mode - "" ;; Don't need indicator. It's quite visible - semantic-stickyfunc-mode-map) + "") ;; Don't need indicator. It's quite visible @@ -1038,26 +841,15 @@ Argument EVENT describes the event that caused this function to be called." ;; from the tag going off the top of the screen. ;;;###autoload -(defun global-semantic-highlight-func-mode (&optional arg) +(define-minor-mode global-semantic-highlight-func-mode "Toggle global use of option `semantic-highlight-func-mode'. -If ARG is positive, enable, if it is negative, disable. -If ARG is nil, then toggle." - (interactive "P") - (setq global-semantic-highlight-func-mode - (semantic-toggle-minor-mode-globally - 'semantic-highlight-func-mode arg))) - -;;;###autoload -(defcustom global-semantic-highlight-func-mode nil - "If non-nil, enable global use of `semantic-highlight-func-mode'. -When enabled, the first line of the current tag is highlighted." - :group 'semantic - :group 'semantic-modes - :type 'boolean - :require 'semantic/util-modes - :initialize 'custom-initialize-default - :set (lambda (sym val) - (global-semantic-highlight-func-mode (if val 1 -1)))) +If ARG is positive or nil, enable, if it is negative, disable." + :global t :group 'semantic :group 'semantic-modes + ;; Not needed because it's autoloaded instead. + ;; :require 'semantic/util-modes + (semantic-toggle-minor-mode-globally + 'semantic-highlight-func-mode + (if global-semantic-highlight-func-mode 1 -1))) (defcustom semantic-highlight-func-mode-hook nil "Hook run at the end of function `semantic-highlight-func-mode'." @@ -1121,11 +913,6 @@ Argument EVENT describes the event that caused this function to be called." ) (select-window startwin))) -(defvar semantic-highlight-func-mode nil - "Non-nil if highlight-func minor mode is enabled. -Use the command `semantic-highlight-func-mode' to change this variable.") -(make-variable-buffer-local 'semantic-highlight-func-mode) - (defvar semantic-highlight-func-ct-overlay nil "Overlay used to highlight the tag the cursor is in.") (make-variable-buffer-local 'semantic-highlight-func-ct-overlay) @@ -1139,28 +926,8 @@ Use the command `semantic-highlight-func-mode' to change this variable.") "Face used to show the top of current function." :group 'semantic-faces) - -(defun semantic-highlight-func-mode-setup () - "Setup option `semantic-highlight-func-mode'. -For Semantic enabled buffers, highlight the first line of the -current tag declaration." - (if semantic-highlight-func-mode - (progn - (unless (and (featurep 'semantic) (semantic-active-p)) - ;; Disable minor mode if semantic stuff not available - (setq semantic-highlight-func-mode nil) - (error "Buffer %s was not set up for parsing" (buffer-name))) - ;; Setup our hook - (add-hook 'post-command-hook 'semantic-highlight-func-highlight-current-tag nil t) - ) - ;; Disable highlight func mode - (remove-hook 'post-command-hook 'semantic-highlight-func-highlight-current-tag t) - (semantic-highlight-func-highlight-current-tag t) - ) - semantic-highlight-func-mode) - ;;;###autoload -(defun semantic-highlight-func-mode (&optional arg) +(define-minor-mode semantic-highlight-func-mode "Minor mode to highlight the first line of the current tag. Enables/disables making the current function's first line light up. A function (or other tag class specified by @@ -1175,21 +942,20 @@ With prefix argument ARG, turn on if positive, otherwise off. The minor mode can be turned on only if semantic feature is available and the current buffer was set up for parsing. Return non-nil if the minor mode is enabled." - (interactive - (list (or current-prefix-arg - (if semantic-highlight-func-mode 0 1)))) - (setq semantic-highlight-func-mode - (if arg - (> - (prefix-numeric-value arg) - 0) - (not semantic-highlight-func-mode))) - (semantic-highlight-func-mode-setup) - (run-hooks 'semantic-highlight-func-mode-hook) - (if (called-interactively-p 'interactive) - (message "Highlight-Func minor mode %sabled" - (if semantic-highlight-func-mode "en" "dis"))) - semantic-highlight-func-mode) + :lighter nil ;; Don't need indicator. It's quite visible. + (if semantic-highlight-func-mode + (progn + (unless (and (featurep 'semantic) (semantic-active-p)) + ;; Disable minor mode if semantic stuff not available + (setq semantic-highlight-func-mode nil) + (error "Buffer %s was not set up for parsing" (buffer-name))) + ;; Setup our hook + (add-hook 'post-command-hook + 'semantic-highlight-func-highlight-current-tag nil t)) + ;; Disable highlight func mode + (remove-hook 'post-command-hook + 'semantic-highlight-func-highlight-current-tag t) + (semantic-highlight-func-highlight-current-tag t))) (defun semantic-highlight-func-highlight-current-tag (&optional disable) "Highlight the current tag under point. @@ -1236,8 +1002,7 @@ function was called, move the overlay." nil) (semantic-add-minor-mode 'semantic-highlight-func-mode - "" ;; Don't need indicator. It's quite visible - nil) + "") ;; Don't need indicator. It's quite visible (provide 'semantic/util-modes) diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index 8fd1a1df5eb..62b42c9a274 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el @@ -160,12 +160,6 @@ If optional LEFT is non-nil insert spaces on left." (not (zerop (logand (aref x (/ i wisent-BITS-PER-WORD)) (lsh 1 (% i wisent-BITS-PER-WORD)))))) -(eval-when-compile - (or (fboundp 'noninteractive) - ;; Silence the Emacs byte compiler - (defun noninteractive nil)) - ) - (defsubst wisent-noninteractive () "Return non-nil if running without interactive terminal." (if (featurep 'xemacs) @@ -205,7 +199,7 @@ Its name is defined in constant `wisent-log-buffer-name'." `(with-current-buffer (wisent-log-buffer) (erase-buffer))) -(eval-when-compile (defvar byte-compile-current-file)) +(defvar byte-compile-current-file) (defun wisent-source () "Return the current source file name or nil." @@ -3536,5 +3530,4 @@ See also `wisent-compile-grammar' for more details on AUTOMATON." (provide 'semantic/wisent/comp) -;; arch-tag: 758ea04c-ea97-466b-9b35-aea0861033c9 ;;; semantic/wisent/comp.el ends here diff --git a/lisp/cedet/srecode.el b/lisp/cedet/srecode.el index 373c14c6244..3bc17f0dbf8 100644 --- a/lisp/cedet/srecode.el +++ b/lisp/cedet/srecode.el @@ -4,6 +4,7 @@ ;; Author: Eric M. Ludlam <zappo@gnu.org> ;; Keywords: codegeneration +;; Version: 1.0pre7 ;; This file is part of GNU Emacs. diff --git a/lisp/cedet/srecode/fields.el b/lisp/cedet/srecode/fields.el index 9092467a583..817bb93d2fd 100644 --- a/lisp/cedet/srecode/fields.el +++ b/lisp/cedet/srecode/fields.el @@ -198,7 +198,7 @@ If SET-TO is a string, then replace the text of OLAID wit SET-TO." (oset ir fields srecode-field-archive) (setq srecode-field-archive nil) - ;; Initailize myself first. + ;; Initialize myself first. (call-next-method) ) diff --git a/lisp/cedet/srecode/mode.el b/lisp/cedet/srecode/mode.el index 08da334767d..bdb8172eb5e 100644 --- a/lisp/cedet/srecode/mode.el +++ b/lisp/cedet/srecode/mode.el @@ -37,19 +37,6 @@ ;;; Code: -(defcustom global-srecode-minor-mode nil - "Non-nil in buffers with Semantic Recoder macro keybindings." - :group 'srecode - :type 'boolean - :require 'srecode/mode - :initialize 'custom-initialize-default - :set (lambda (sym val) - (global-srecode-minor-mode (if val 1 -1)))) - -(defvar srecode-minor-mode nil - "Non-nil in buffers with Semantic Recoder macro keybindings.") -(make-variable-buffer-local 'srecode-minor-mode) - (defcustom srecode-minor-mode-hook nil "Hook run at the end of the function `srecode-minor-mode'." :group 'srecode @@ -156,7 +143,7 @@ "Keymap for srecode minor mode.") ;;;###autoload -(defun srecode-minor-mode (&optional arg) +(define-minor-mode srecode-minor-mode "Toggle srecode minor mode. With prefix argument ARG, turn on if positive, otherwise off. The minor mode can be turned on only if semantic feature is available and @@ -164,16 +151,7 @@ the current buffer was set up for parsing. Return non-nil if the minor mode is enabled. \\{srecode-mode-map}" - (interactive - (list (or current-prefix-arg - (if srecode-minor-mode 0 1)))) - ;; Flip the bits. - (setq srecode-minor-mode - (if arg - (> - (prefix-numeric-value arg) - 0) - (not srecode-minor-mode))) + :keymap srecode-mode-map ;; If we are turning things on, make sure we have templates for ;; this mode first. (when srecode-minor-mode @@ -182,25 +160,20 @@ minor mode is enabled. (mapcar (lambda (map) (srecode-map-entries-for-mode map major-mode)) (srecode-get-maps)))) - (setq srecode-minor-mode nil)) - ) - ;; Run hooks if we are turning this on. - (when srecode-minor-mode - (run-hooks 'srecode-minor-mode-hook)) - srecode-minor-mode) + (setq srecode-minor-mode nil)))) ;;;###autoload -(defun global-srecode-minor-mode (&optional arg) +(define-minor-mode global-srecode-minor-mode "Toggle global use of srecode minor mode. -If ARG is positive, enable, if it is negative, disable. -If ARG is nil, then toggle." - (interactive "P") - (setq global-srecode-minor-mode - (semantic-toggle-minor-mode-globally - 'srecode-minor-mode arg))) +If ARG is positive or nil, enable, if it is negative, disable." + :global t :group 'srecode + ;; Not needed because it's autoloaded instead. + ;; :require 'srecode/mode + (semantic-toggle-minor-mode-globally + 'srecode-minor-mode (if global-srecode-minor-mode 1 -1))) ;; Use the semantic minor mode magic stuff. -(semantic-add-minor-mode 'srecode-minor-mode "" srecode-mode-map) +(semantic-add-minor-mode 'srecode-minor-mode "") ;;; Menu Filters ;; diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el index dd2c062ca69..7df06a608f5 100644 --- a/lisp/cedet/srecode/srt-mode.el +++ b/lisp/cedet/srecode/srt-mode.el @@ -183,27 +183,20 @@ we can tell font lock about them.") "Keymap used in srecode mode.") ;;;###autoload -(defun srecode-template-mode () +(define-derived-mode srecode-template-mode fundamental-mode "SRecorder" "Major-mode for writing SRecode macros." - (interactive) - (kill-all-local-variables) - (setq major-mode 'srecode-template-mode - mode-name "SRecoder" - comment-start ";;" + (setq comment-start ";;" comment-end "") (set (make-local-variable 'parse-sexp-ignore-comments) t) (set (make-local-variable 'comment-start-skip) "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") - (set-syntax-table srecode-template-mode-syntax-table) - (use-local-map srecode-template-mode-map) (set (make-local-variable 'font-lock-defaults) '(srecode-font-lock-keywords nil ;; perform string/comment fontification nil ;; keywords are case sensitive. ;; This puts _ & - as a word constituant, ;; simplifying our keywords significantly - ((?_ . "w") (?- . "w")))) - (run-hooks 'srecode-template-mode-hook)) + ((?_ . "w") (?- . "w"))))) ;;;###autoload (defalias 'srt-mode 'srecode-template-mode) |