From 3da360a745b3835504e7ac426dfec5f0908dcb3a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 4 Jan 2008 06:18:31 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 7 +++++++ lisp/bookmark.el | 6 +++--- lisp/calendar/todo-mode.el | 8 ++++---- lisp/ido.el | 23 +++++++++++------------ lisp/iswitchb.el | 17 ++++++++--------- lisp/progmodes/ada-mode.el | 7 +++---- lisp/progmodes/ada-xref.el | 8 ++++---- 7 files changed, 40 insertions(+), 36 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 560fa9e4b77..a3a7aaa425b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2008-01-04 Stefan Monnier + + * 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 * emacs-lisp/bytecomp.el (byte-compile-from-buffer): diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 49749f4e465..0968ff01411 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1,7 +1,7 @@ ;;; 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 ;; Maintainer: Karl Fogel @@ -978,7 +978,7 @@ The directory part of the file name is not used." 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? @@ -2227,5 +2227,5 @@ This also runs `bookmark-exit-hook'." (provide 'bookmark) -;;; arch-tag: 139f519a-dd0c-4b8d-8b5d-f9fcf53ca8f6 +;; arch-tag: 139f519a-dd0c-4b8d-8b5d-f9fcf53ca8f6 ;;; bookmark.el ends here diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index e3db7e46407..1727ed09d82 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -1,6 +1,6 @@ ;;; 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 @@ -592,7 +592,7 @@ With a prefix argument solicit the category, otherwise use the current 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: " @@ -615,7 +615,7 @@ category." "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: " @@ -959,5 +959,5 @@ Number of entries for each category is given by `todo-print-priorities'." (provide 'todo-mode) -;;; arch-tag: 6fd91be5-776e-4464-a109-da4ea0e4e497 +;; arch-tag: 6fd91be5-776e-4464-a109-da4ea0e4e497 ;;; todo-mode.el ends here diff --git a/lisp/ido.el b/lisp/ido.el index 4658a887716..750eb6e6dfc 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1,7 +1,7 @@ ;;; 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 ;; Based on: iswitchb by Stephen Eglen @@ -436,17 +436,16 @@ in merged file and directory lists." :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'. @@ -4655,5 +4654,5 @@ DEF, if non-nil, is the default value." (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 diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index 792e610fa4a..c259edcc954 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el @@ -1,7 +1,7 @@ ;;; 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 ;; Maintainer: Stephen Eglen @@ -311,15 +311,14 @@ window with completion alternatives, or `iswitchb-next-match' or :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'. diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index 5910ebf3f28..2c3acdda176 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el @@ -1,7 +1,7 @@ ;;; 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 ;; Markus Heritsch @@ -4811,10 +4811,9 @@ Moves to 'begin' if in a declarative part." ;; ------------------------------------------------------- (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) diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el index 00be89553a7..f9b5c026a4e 100644 --- a/lisp/progmodes/ada-xref.el +++ b/lisp/progmodes/ada-xref.el @@ -1,7 +1,7 @@ ;; 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 ;; Rolf Ebert @@ -648,8 +648,8 @@ is non-nil, prompt the user to select one. If none are found, return (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) @@ -2310,5 +2310,5 @@ For instance, it creates the gnat-specific menus, sets some hooks for (provide 'ada-xref) -;;; arch-tag: 415a39fe-577b-4676-b3b1-6ff6db7ca24e +;; arch-tag: 415a39fe-577b-4676-b3b1-6ff6db7ca24e ;;; ada-xref.el ends here -- 2.39.2