Commit 4d789d84 authored by Stefan Monnier's avatar Stefan Monnier

Use run-mode-hooks for major mode hooks.

* lisp/textmodes/reftex-toc.el (reftex-toc-mode-map):
Rename from reftex-toc-map.
(reftex-toc-mode): Use define-derived-mode.
* lisp/textmodes/reftex-sel.el (reftex-select-shared-map): New map.
(reftex-select-label-mode-map, reftex-select-bib-mode-map):
Rename from reftex-select-(label|bib)-map.  Move init into declaration.
(reftex-select-label-mode, reftex-select-bib-mode):
Use define-derived-mode.
* lisp/textmodes/reftex-index.el (reftex-index-phrases-mode-map)
(reftex-index-mode-map): Rename from reftex-index(-phrases)-map.
Move init into delcaration.
(reftex-index-mode, reftex-index-phrases-mode):
Use define-derived-mode.
* lisp/speedbar.el (speedbar-mode-syntax-table): Renaqme from
speedbar-syntax-table.  Move init into declaration.
(speedbar-mode-map): Rename from speedbar-key-map.
Move init into declaration.
(speedbar-file-key-map): Move init into declaration.
(speedbar-mode): Use define-derived-mode.
* lisp/recentf.el (recentf-mode): Don't run hook (or message) redundantly.
* lisp/net/rcirc.el (rcirc-mode): Use run-mode-hooks.
* lisp/emacs-lisp/chart.el (chart-mode-map): Rename from chart-map.
(chart-face-list): Move initialization into declaration.
(chart-mode): Use define-derived-mode.
* lisp/calculator.el (calculator-mode-map): Move init into declaration.
(calculator-mode): Use define-derived-mode.
* lisp/cedet/srecode/srt-mode.el (srecode-template-mode):
Use define-derived-mode.
* lisp/cedet/semantic/symref/list.el (semantic-symref-results-mode):
Use run-mode-hooks.
* lisp/erc/erc.el (erc-mode):
* lisp/erc/erc-dcc.el (erc-dcc-chat-mode): Use define-derived-mode.
* lisp/org/org-remember.el (org-remember-mode):
* lisp/org/org-capture.el (org-capture-mode): Don't run hook redundantly.

Fixes: debbugs:513
parent b49a2dbf
2011-01-13 Stefan Monnier <monnier@iro.umontreal.ca>
Use run-mode-hooks for major mode hooks (bug#513).
* textmodes/reftex-toc.el (reftex-toc-mode-map):
Rename from reftex-toc-map.
(reftex-toc-mode): Use define-derived-mode.
* textmodes/reftex-sel.el (reftex-select-shared-map): New map.
(reftex-select-label-mode-map, reftex-select-bib-mode-map):
Rename from reftex-select-(label|bib)-map. Move init into declaration.
(reftex-select-label-mode, reftex-select-bib-mode):
Use define-derived-mode.
* textmodes/reftex-index.el (reftex-index-phrases-mode-map)
(reftex-index-mode-map): Rename from reftex-index(-phrases)-map.
Move init into delcaration.
(reftex-index-mode, reftex-index-phrases-mode):
Use define-derived-mode.
* speedbar.el (speedbar-mode-syntax-table): Renaqme from
speedbar-syntax-table. Move init into declaration.
(speedbar-mode-map): Rename from speedbar-key-map.
Move init into declaration.
(speedbar-file-key-map): Move init into declaration.
(speedbar-mode): Use define-derived-mode.
* recentf.el (recentf-mode): Don't run hook (or message) redundantly.
* net/rcirc.el (rcirc-mode): Use run-mode-hooks.
* emacs-lisp/chart.el (chart-mode-map): Rename from chart-map.
(chart-face-list): Move initialization into declaration.
(chart-mode): Use define-derived-mode.
* calculator.el (calculator-mode-map): Move init into declaration.
(calculator-mode): Use define-derived-mode.
* mail/mail-utils.el (mail-strip-quoted-names): Make the regexp code
work for nested comments.
......
This diff is collapsed.
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.
......@@ -60,8 +66,8 @@
* semantic/db-typecache.el (semanticdb-typecache-find-default):
* semantic/imenu.el (semantic-create-imenu-index):
* semantic/grammar.el (semantic--grammar-macro-function-tag):
* semantic/fw.el (semanticdb-without-unloaded-file-searches): Fix
require. Suggested by David Engster.
* semantic/fw.el (semanticdb-without-unloaded-file-searches):
Fix require. Suggested by David Engster.
* semantic/bovine/c-by.el: Regenerate.
......@@ -105,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.
......@@ -159,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>
......@@ -210,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.
......@@ -232,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
......@@ -248,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.
......@@ -267,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):
......@@ -327,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.
......@@ -355,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.
......@@ -372,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)
......@@ -448,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.
......@@ -458,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:
......@@ -594,8 +600,8 @@
* 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>
......@@ -783,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
......@@ -880,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>
......
;;; semantic/symref/list.el --- Symref Output List UI.
;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
;; Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
......@@ -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 ()
......
;;; srecode/srt-mode.el --- Major mode for writing screcode macros
;; Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
......@@ -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)
......
......@@ -4021,7 +4021,7 @@ true then the type of the file linked to by FILE is printed instead.
;;;***
;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el"
;;;;;; "27c312d6d5d40d8cb4ef8d62e30d5f4a")
;;;;;; "6181a5bcc2b61255676a7a41549b9f40")
;;; Generated autoloads from dired-x.el
(autoload 'dired-jump "dired-x" "\
......
;;; chart.el --- Draw charts (bar charts, etc)
;; Copyright (C) 1996, 1998, 1999, 2001, 2004, 2005, 2007, 2008, 2009,
;; 2010 Free Software Foundation, Inc.
;; 2010, 2011 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Version: 0.2
......@@ -62,17 +62,13 @@
(require 'eieio)
;;; Code:
(defvar chart-map (make-sparse-keymap) "Keymap used in chart mode.")
(defvar chart-mode-map (make-sparse-keymap) "Keymap used in chart mode.")
(define-obsolete-variable-alias 'chart-map 'chart-mode-map "24.1")
(defvar chart-local-object nil
"Local variable containing the locally displayed chart object.")
(make-variable-buffer-local 'chart-local-object)
(defvar chart-face-list nil
"Faces used to colorize charts.
List is limited currently, which is ok since you really can't display
too much in text characters anyways.")
(defvar chart-face-color-list '("red" "green" "blue"
"cyan" "yellow" "purple")
"Colors to use when generating `chart-face-list'.
......@@ -90,41 +86,42 @@ Useful if new Emacs is used on B&W display.")
:group 'eieio
:type 'boolean)
(if (and (if (fboundp 'display-color-p)
(display-color-p)
window-system)
(not chart-face-list))
(let ((cl chart-face-color-list)
(pl chart-face-pixmap-list)
nf)
(while cl
(setq nf (make-face (intern (concat "chart-" (car cl) "-" (car pl)))))
(if (condition-case nil
(> (x-display-color-cells) 4)
(error t))
(set-face-background nf (car cl))
(set-face-background nf "white"))
(set-face-foreground nf "black")
(if (and chart-face-use-pixmaps
pl
(fboundp 'set-face-background-pixmap))
(condition-case nil
(set-face-background-pixmap nf (car pl))
(error (message "Cannot set background pixmap %s" (car pl)))))
(setq chart-face-list (cons nf chart-face-list))
(setq cl (cdr cl)
pl (cdr pl)))))
(defun chart-mode ()
(defvar chart-face-list
(if (if (fboundp 'display-color-p)
(display-color-p)
window-system)
(let ((cl chart-face-color-list)
(pl chart-face-pixmap-list)
(faces ())
nf)
(while cl
(setq nf (make-face
(intern (concat "chart-" (car cl) "-" (car pl)))))
(set-face-background nf (if (condition-case nil
(> (x-display-color-cells) 4)
(error t))
(car cl)
"white"))
(set-face-foreground nf "black")
(if (and chart-face-use-pixmaps
pl
(fboundp 'set-face-background-pixmap))
(condition-case nil
(set-face-background-pixmap nf (car pl))
(error (message "Cannot set background pixmap %s" (car pl)))))
(push nf faces)
(setq cl (cdr cl)
pl (cdr pl)))
faces))
"Faces used to colorize charts.
List is limited currently, which is ok since you really can't display
too much in text characters anyways.")
(define-derived-mode chart-mode fundamental-mode "CHART"
"Define a mode in Emacs for displaying a chart."
(kill-all-local-variables)
(use-local-map chart-map)
(setq major-mode 'chart-mode
mode-name "CHART")
(buffer-disable-undo)
(set (make-local-variable 'font-lock-global-modes) nil)
(font-lock-mode -1)
(run-hooks 'chart-mode-hook)
(font-lock-mode -1) ;Isn't it off already? --Stef
)
(defun chart-new-buffer (obj)
......
2011-01-13 Stefan Monnier <monnier@iro.umontreal.ca>
* erc.el (erc-mode):
* erc-dcc.el (erc-dcc-chat-mode): Use define-derived-mode.
2010-11-11 Glenn Morris <rgm@gnu.org>
* erc-lang.el (erc-cmd-LANG): Fix what may have been a typo.
......@@ -25,17 +30,17 @@
2010-08-14 Vivek Dasmohapatra <vivek@etla.org>
* erc-join.el (erc-autojoin-timing, erc-autojoin-delay): New vars.
(erc-autojoin-channels-delayed, erc-autojoin-after-ident): New
functions.
(erc-autojoin-channels-delayed, erc-autojoin-after-ident):
New functions.
(erc-autojoin-channels): Allow autojoining after ident (Bug#5521).
2010-08-08 Fran Litterio <flitterio@gmail.com>
* erc-backend.el (erc-server-filter-function): Call
erc-log-irc-protocol.
* erc-backend.el (erc-server-filter-function):
Call erc-log-irc-protocol.
* erc.el (erc-toggle-debug-irc-protocol): Bind
erc-toggle-debug-irc-protocol to t.
* erc.el (erc-toggle-debug-irc-protocol):
Bind erc-toggle-debug-irc-protocol to t.
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
......@@ -126,7 +131,7 @@
See ChangeLog.08 for earlier changes.
Copyright (C) 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
......
;;; erc-dcc.el --- CTCP DCC module for ERC
;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004, 2006, 2007,
;; 2008, 2009, 2010 Free Software Foundation, Inc.
;; 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu>
;; Noah Friedman <friedman@prep.ai.mit.edu>
......@@ -1098,17 +1098,11 @@ Possible values are: ask, auto, ignore."
map)
"Keymap for `erc-dcc-mode'.")
(defun erc-dcc-chat-mode ()
(define-derived-mode erc-dcc-chat-mode fundamental-mode "DCC-Chat"
"Major mode for wasting time via DCC chat."
(interactive)
(kill-all-local-variables)
(setq mode-line-process '(":%s")
mode-name "DCC-Chat"
major-mode 'erc-dcc-chat-mode
erc-send-input-line-function 'erc-dcc-chat-send-input-line
erc-default-recipients '(dcc))
(use-local-map erc-dcc-chat-mode-map)
(run-hooks 'erc-dcc-chat-mode-hook))
erc-default-recipients '(dcc)))
(defun erc-dcc-chat-send-input-line (recipient line &optional force)
"Send LINE to the remote end.
......
;; erc.el --- An Emacs Internet Relay Chat client
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Alexander L. Belikoff (alexander@belikoff.net)
;; Contributors: Sergey Berezin (sergey.berezin@cs.cmu.edu),
......@@ -1439,28 +1439,16 @@ Defaults to the server buffer."
;; Mode activation routines
(defun erc-mode ()
"Major mode for Emacs IRC.
Special commands:
\\{erc-mode-map}
Turning on `erc-mode' runs the hook `erc-mode-hook'."
(kill-all-local-variables)
(use-local-map erc-mode-map)
(setq mode-name "ERC"
major-mode 'erc-mode
local-abbrev-table erc-mode-abbrev-table)
(set-syntax-table erc-mode-syntax-table)
(define-derived-mode erc-mode fundamental-mode "ERC"
"Major mode for Emacs IRC."
(setq local-abbrev-table erc-mode-abbrev-table)
(when (boundp 'next-line-add-newlines)
(set (make-local-variable 'next-line-add-newlines) nil))
(setq line-move-ignore-invisible t)
(set (make-local-variable 'paragraph-separate)
(concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)"))
(set (make-local-variable 'paragraph-start)
(concat "\\(" (regexp-quote (erc-prompt)) "\\)"))
;; Run the mode hooks
(run-hooks 'erc-mode-hook))
(concat "\\(" (regexp-quote (erc-prompt)) "\\)")))
;; activation
......
;;; rcirc.el --- default, simple IRC client.
;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Author: Ryan Yeske
......@@ -895,6 +895,7 @@ Each element looks like (FILENAME . TEXT).")
This number is independent of the number of lines in the buffer.")
(defun rcirc-mode (process target)
;; FIXME: Use define-derived-mode.
"Major mode for IRC channel buffers.
\\{rcirc-mode-map}"
......@@ -973,7 +974,7 @@ This number is independent of the number of lines in the buffer.")
(add-hook 'completion-at-point-functions
'rcirc-completion-at-point nil 'local)
(run-hooks 'rcirc-mode-hook))
(run-mode-hooks 'rcirc-mode-hook))
(defun rcirc-update-prompt (&optional all)
"Reset the prompt string in the current buffer.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
;;; org-capture.el --- Fast note taking in Org-mode
;; Copyright (C) 2010 Free Software Foundation, Inc.
;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
......@@ -359,8 +359,7 @@ for a Remember buffer.")
nil " Rem" org-capture-mode-map
(org-set-local
'header-line-format
"Capture buffer. Finish `C-c C-c', refile `C-c C-w', abort `C-c C-k'.")
(run-hooks 'org-capture-mode-hook))
"Capture buffer. Finish `C-c C-c', refile `C-c C-w', abort `C-c C-k'."))
(define-key org-capture-mode-map "\C-c\C-c" 'org-capture-finalize)
(define-key org-capture-mode-map "\C-c\C-k" 'org-capture-kill)
(define-key org-capture-mode-map "\C-c\C-w" 'org-capture-refile)
......
;;; org-remember.el --- Fast note taking in Org-mode
;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
......@@ -224,8 +224,7 @@ for a Remember buffer.")
(define-minor-mode org-remember-mode
"Minor mode for special key bindings in a remember buffer."
nil " Rem" org-remember-mode-map
(run-hooks 'org-remember-mode-hook))
nil " Rem" org-remember-mode-map)
(define-key org-remember-mode-map "\C-c\C-c" 'org-remember-finalize)
(define-key org-remember-mode-map "\C-c\C-k" 'org-remember-kill)
......
;;; recentf.el --- setup a menu of recently opened files
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: David Ponce <david@dponce.com>
;; Created: July 19 1999
......@@ -1355,11 +1355,7 @@ that were operated on recently."
(recentf-auto-cleanup)
(let ((hook-setup (if recentf-mode 'add-hook 'remove-hook)))
(dolist (hook recentf-used-hooks)
(apply hook-setup hook)))
(run-hooks 'recentf-mode-hook)
(when (called-interactively-p 'interactive)
(message "Recentf mode %sabled" (if recentf-mode "en" "dis"))))
recentf-mode)
(apply hook-setup hook)))))
(defun recentf-unload-function ()
"Unload the recentf library."
......
;;; speedbar --- quick access to files and tags in a frame
;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007, 2008, 2009, 2010
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
......@@ -515,7 +515,7 @@ hierarchy would be replaced with the new directory."
:type 'hook)
(defcustom speedbar-mode-hook nil
"Hooks called after creating a speedbar buffer."
"Hook run after creating a speedbar buffer."
:group 'speedbar
:type 'hook)
......@@ -769,99 +769,95 @@ to toggle this value.")
(defvar speedbar-update-flag-disable nil
"Permanently disable changing of the update flag.")
(defvar speedbar-syntax-table nil
(defvar speedbar-mode-syntax-table
(let ((st (make-syntax-table)))
;; Turn off paren matching around here.
(modify-syntax-entry ?\' " " st)
(modify-syntax-entry ?\" " " st)
(modify-syntax-entry ?\( " " st)
(modify-syntax-entry ?\) " " st)
(modify-syntax-entry ?\{ " " st)
(modify-syntax-entry ?\} " " st)
(modify-syntax-entry ?\[ " " st)
(modify-syntax-entry ?\] " " st)
st)
"Syntax-table used on the speedbar.")
(if speedbar-syntax-table
nil
(setq speedbar-syntax-table (make-syntax-table))
;; turn off paren matching around here.
(modify-syntax-entry ?\' " " speedbar-syntax-table)
(modify-syntax-entry ?\" " " speedbar-syntax-table)
(modify-syntax-entry ?( " " speedbar-syntax-table)
(modify-syntax-entry ?) " " speedbar-syntax-table)
(modify-syntax-entry ?{ " " speedbar-syntax-table)
(modify-syntax-entry ?} " " speedbar-syntax-table)
(modify-syntax-entry ?[ " " speedbar-syntax-table)
(modify-syntax-entry ?] " " speedbar-syntax-table))
(defvar speedbar-key-map nil
(define-obsolete-variable-alias
'speedbar-syntax-table 'speedbar-mode-syntax-table "24.1")
(defvar speedbar-mode-map
(let ((map (make-keymap)))
(suppress-keymap map t)
;; Control.
(define-key map "t" 'speedbar-toggle-updates)
(define-key map "g" 'speedbar-refresh)
;; Navigation.
(define-key map "n" 'speedbar-next)
(define-key map "p" 'speedbar-prev)
(define-key map "\M-n" 'speedbar-restricted-next)
(define-key map "\M-p" 'speedbar-restricted-prev)
(define-key map "\C-\M-n" 'speedbar-forward-list)
(define-key map "\C-\M-p" 'speedbar-backward-list)
;; These commands never seemed useful.
;; (define-key map " " 'speedbar-scroll-up)
;; (define-key map [delete] 'speedbar-scroll-down)
;; Short cuts I happen to find useful.
(define-key map "r"
(lambda () (interactive)
(speedbar-change-initial-expansion-list
speedbar-previously-used-expansion-list-name)))
(define-key map "b"
(lambda () (interactive)
(speedbar-change-initial-expansion-list "quick buffers")))
(define-key map "f"
(lambda () (interactive)
(speedbar-change-initial-expansion-list "files")))
(dframe-update-keymap map)
map)
"Keymap used in speedbar buffer.")
(if speedbar-key-map
nil
(setq speedbar-key-map (make-keymap))
(suppress-keymap speedbar-key-map t)
;; control
(define-key speedbar-key-map "t" 'speedbar-toggle-updates)
(define-key speedbar-key-map "g" 'speedbar-refresh)
;; navigation
(define-key speedbar-key-map "n" 'speedbar-next)
(define-key speedbar-key-map "p" 'speedbar-prev)
(define-key speedbar-key-map "\M-n" 'speedbar-restricted-next)
(define-key speedbar-key-map "\M-p" 'speedbar-restricted-prev)
(define-key speedbar-key-map "\C-\M-n" 'speedbar-forward-list)
(define-key speedbar-key-map "\C-\M-p" 'speedbar-backward-list)
;; These commands never seemed useful.
;; (define-key speedbar-key-map " " 'speedbar-scroll-up)
;; (define-key speedbar-key-map [delete] 'speedbar-scroll-down)
;; Short cuts I happen to find useful
(define-key speedbar-key-map "r"
(lambda () (interactive)
(speedbar-change-initial-expansion-list
speedbar-previously-used-expansion-list-name)))
(define-key speedbar-key-map "b"
(lambda () (interactive)
(speedbar-change-initial-expansion-list "quick buffers")))
(define-key speedbar-key-map "f"
(lambda () (interactive)
(speedbar-change-initial-expansion-list "files")))
(dframe-update-keymap speedbar-key-map)
)
(define-obsolete-variable-alias 'speedbar-key-map 'speedbar-mode-map "24.1")
(defun speedbar-make-specialized-keymap ()
"Create a keymap for use with a speedbar major or minor display mode.
This basically creates a sparse keymap, and makes its parent be
`speedbar-key-map'."
`speedbar-mode-map'."
(let ((k (make-sparse-keymap)))
(set-keymap-parent k speedbar-key-map)
(set-keymap-parent k speedbar-mode-map)
k))
(defvar speedbar-file-key-map nil
(defvar speedbar-file-key-map
(let ((map (speedbar-make-specialized-keymap)))
;; Basic tree features.
(define-key map "e" 'speedbar-edit-line)
(define-key map "\C-m" 'speedbar-edit-line)
(define-key map "+" 'speedbar-expand-line)
(define-key map "=" 'speedbar-expand-line)
(define-key map "-" 'speedbar-contract-line)
(define-key map "[" 'speedbar-expand-line-descendants)
(define-key map "]" 'speedbar-contract-line-descendants)
(define-key map " " 'speedbar-toggle-line-expansion)
;; File based commands.
(define-key map "U" 'speedbar-up-directory)
(define-key map "I" 'speedbar-item-info)
(define-key map "B" 'speedbar-item-byte-compile)
(define-key map "L" 'speedbar-item-load)
(define-key map "C" 'speedbar-item-copy)
(define-key map "D" 'speedbar-item-delete)
(define-key map "O" 'speedbar-item-object-delete)
(define-key map "R" 'speedbar-item-rename)
(define-key map "M" 'speedbar-create-directory)
map)
"Keymap used in speedbar buffer while files are displayed.")
(if speedbar-file-key-map
nil
(setq speedbar-file-key-map (speedbar-make-specialized-keymap))
;; Basic tree features
(define-key speedbar-file-key-map "e" 'speedbar-edit-line)
(define-key speedbar-file-key-map "\C-m" 'speedbar-edit-line)
(define-key speedbar-file-key-map "+" 'speedbar-expand-line)
(define-key speedbar-file-key-map "=" 'speedbar-expand-line)
(define-key speedbar-file-key-map "-" 'speedbar-contract-line)