+2008-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/ada-xref.el (ada-prj-find-prj-file):
+ * progmodes/ada-mode.el (comment-region):
+ * calendar/todo-mode.el (todo-insert-item):
+ * bookmark.el (bookmark-buffer-name): Test major-mode rather than mode-name.
+
2008-01-04 Richard Stallman <rms@gnu.org>
* emacs-lisp/bytecomp.el (byte-compile-from-buffer):
;;; bookmark.el --- set bookmarks, maybe annotate them, jump to them later
;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Karl Fogel <kfogel@red-bean.com>
;; Maintainer: Karl Fogel <kfogel@red-bean.com>
In Info, return the current node."
(cond
;; Are we in Info?
- ((string-equal mode-name "Info") Info-current-node)
+ ((derived-mode-p 'Info-mode) Info-current-node)
;; Or are we a file?
(buffer-file-name (file-name-nondirectory buffer-file-name))
;; Or are we a directory?
(provide 'bookmark)
-;;; arch-tag: 139f519a-dd0c-4b8d-8b5d-f9fcf53ca8f6
+;; arch-tag: 139f519a-dd0c-4b8d-8b5d-f9fcf53ca8f6
;;; bookmark.el ends here
;;; todo-mode.el --- major mode for editing TODO list files
-;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
;; Free Software Foundation, Inc.
;; Author: Oliver Seidel <os10000@seidel-space.de>
category."
(interactive "P")
(save-excursion
- (if (not (string-equal mode-name "TODO")) (todo-show))
+ (if (not (derived-mode-p 'todo-mode)) (todo-show))
(let* ((new-item (concat todo-prefix " "
(read-from-minibuffer
"New TODO entry: "
"Insert new TODO list entry under the cursor."
(interactive "")
(save-excursion
- (if (not (string-equal mode-name "TODO")) (todo-show))
+ (if (not (derived-mode-p 'todo-mode)) (todo-show))
(let* ((new-item (concat todo-prefix " "
(read-from-minibuffer
"New TODO entry: "
(provide 'todo-mode)
-;;; arch-tag: 6fd91be5-776e-4464-a109-da4ea0e4e497
+;; arch-tag: 6fd91be5-776e-4464-a109-da4ea0e4e497
;;; todo-mode.el ends here
;;; ido.el --- interactively do things with buffers and files.
;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Kim F. Storm <storm@cua.dk>
;; Based on: iswitchb by Stephen Eglen <stephen@cns.ed.ac.uk>
:type '(repeat (choice regexp function))
:group 'ido)
-;;; Examples for setting the value of ido-ignore-buffers
-;(defun ido-ignore-c-mode (name)
-; "Ignore all c mode buffers -- example function for ido."
-; (save-excursion
-; (set-buffer name)
-; (string-match "^C$" mode-name)))
-;
-;(setq ido-ignore-buffers '("^ " ido-ignore-c-mode))
+;; Examples for setting the value of ido-ignore-buffers
+;;(defun ido-ignore-c-mode (name)
+;; "Ignore all c mode buffers -- example function for ido."
+;; (with-current-buffer name
+;; (derived-mode-p 'c-mode)))
+;;
+;;(setq ido-ignore-buffers '("^ " ido-ignore-c-mode))
-;;; Examples for setting the value of ido-ignore-files
-;(setq ido-ignore-files '("^ " "\\.c$" "\\.h$"))
+;; Examples for setting the value of ido-ignore-files
+;;(setq ido-ignore-files '("^ " "\\.c\\'" "\\.h\\'"))
(defcustom ido-default-file-method 'raise-frame
"*How to visit a new file when using `ido-find-file'.
(ido-read-internal 'list prompt hist def require-match initial-input)))
-;;; arch-tag: b63a3500-1735-41bd-8a01-05373f0864da
+;; arch-tag: b63a3500-1735-41bd-8a01-05373f0864da
;;; ido.el ends here
;;; iswitchb.el --- switch between buffers using substrings
;; Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Stephen Eglen <stephen@gnu.org>
;; Maintainer: Stephen Eglen <stephen@gnu.org>
:type 'hook
:group 'iswitchb)
-;;; Examples for setting the value of iswitchb-buffer-ignore
-;(defun iswitchb-ignore-c-mode (name)
-; "Ignore all c mode buffers -- example function for iswitchb."
-; (save-excursion
-; (set-buffer name)
-; (string-match "^C$" mode-name)))
+;; Examples for setting the value of iswitchb-buffer-ignore
+;;(defun iswitchb-ignore-c-mode (name)
+;; "Ignore all c mode buffers -- example function for iswitchb."
+;; (with-current-buffer name
+;; (derived-mode-p 'c-mode)))
-;(setq iswitchb-buffer-ignore '("^ " iswitchb-ignore-c-mode))
-;(setq iswitchb-buffer-ignore '("^ " "\\.c$" "\\.h$"))
+;;(setq iswitchb-buffer-ignore '("^ " iswitchb-ignore-c-mode))
+;;(setq iswitchb-buffer-ignore '("^ " "\\.c\\'" "\\.h\\'"))
(defcustom iswitchb-default-method 'always-frame
"*How to switch to new buffer when using `iswitchb-buffer'.
;;; ada-mode.el --- major-mode for editing Ada sources
;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Rolf Ebert <ebert@inf.enst.fr>
;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
;; -------------------------------------------------------
(defadvice comment-region (before ada-uncomment-anywhere disable)
- (if (and arg
- (listp arg) ;; a prefix with \C-u is of the form '(4), whereas
+ (if (and (consp arg) ;; a prefix with \C-u is of the form '(4), whereas
;; \C-u 2 sets arg to '2' (fixed by S.Leake)
- (string= mode-name "Ada"))
+ (derived-mode-p 'ada-mode))
(save-excursion
(let ((cs (concat "^[ \t]*" (regexp-quote comment-start))))
(goto-char beg)
;; ada-xref.el --- for lookup and completion in Ada mode
;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
;; Rolf Ebert <ebert@inf.enst.fr>
(let (selected)
- (if (or (not (string= mode-name "Ada"))
- (not (buffer-file-name)))
+ (if (not (and (derived-mode-p 'ada-mode)
+ buffer-file-name))
;; Not in an Ada buffer, or current buffer not associated
;; with a file (for instance an emerge buffer)
(provide 'ada-xref)
-;;; arch-tag: 415a39fe-577b-4676-b3b1-6ff6db7ca24e
+;; arch-tag: 415a39fe-577b-4676-b3b1-6ff6db7ca24e
;;; ada-xref.el ends here