# HG changeset patch # User Stefan Monnier # Date 1199427511 0 # Node ID 0c4a74c24677efb778e0b93bb4e7476ebbbe3e9f # Parent c27df69a8670543b431e13ce053f38e99d83ffa0 * 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. diff -r c27df69a8670 -r 0c4a74c24677 lisp/ChangeLog --- a/lisp/ChangeLog Fri Jan 04 05:35:12 2008 +0000 +++ b/lisp/ChangeLog Fri Jan 04 06:18:31 2008 +0000 @@ -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 -r c27df69a8670 -r 0c4a74c24677 lisp/bookmark.el --- a/lisp/bookmark.el Fri Jan 04 05:35:12 2008 +0000 +++ b/lisp/bookmark.el Fri Jan 04 06:18:31 2008 +0000 @@ -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 @@ 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 @@ (provide 'bookmark) -;;; arch-tag: 139f519a-dd0c-4b8d-8b5d-f9fcf53ca8f6 +;; arch-tag: 139f519a-dd0c-4b8d-8b5d-f9fcf53ca8f6 ;;; bookmark.el ends here diff -r c27df69a8670 -r 0c4a74c24677 lisp/calendar/todo-mode.el --- a/lisp/calendar/todo-mode.el Fri Jan 04 05:35:12 2008 +0000 +++ b/lisp/calendar/todo-mode.el Fri Jan 04 06:18:31 2008 +0000 @@ -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 @@ 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 @@ "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 @@ (provide 'todo-mode) -;;; arch-tag: 6fd91be5-776e-4464-a109-da4ea0e4e497 +;; arch-tag: 6fd91be5-776e-4464-a109-da4ea0e4e497 ;;; todo-mode.el ends here diff -r c27df69a8670 -r 0c4a74c24677 lisp/ido.el --- a/lisp/ido.el Fri Jan 04 05:35:12 2008 +0000 +++ b/lisp/ido.el Fri Jan 04 06:18:31 2008 +0000 @@ -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 @@ :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-files -;(setq ido-ignore-files '("^ " "\\.c$" "\\.h$")) +;; 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\\'")) (defcustom ido-default-file-method 'raise-frame "*How to visit a new file when using `ido-find-file'. @@ -4655,5 +4654,5 @@ (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 -r c27df69a8670 -r 0c4a74c24677 lisp/iswitchb.el --- a/lisp/iswitchb.el Fri Jan 04 05:35:12 2008 +0000 +++ b/lisp/iswitchb.el Fri Jan 04 06:18:31 2008 +0000 @@ -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 @@ :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 -r c27df69a8670 -r 0c4a74c24677 lisp/progmodes/ada-mode.el --- a/lisp/progmodes/ada-mode.el Fri Jan 04 05:35:12 2008 +0000 +++ b/lisp/progmodes/ada-mode.el Fri Jan 04 06:18:31 2008 +0000 @@ -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 @@ ;; ------------------------------------------------------- (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 -r c27df69a8670 -r 0c4a74c24677 lisp/progmodes/ada-xref.el --- a/lisp/progmodes/ada-xref.el Fri Jan 04 05:35:12 2008 +0000 +++ b/lisp/progmodes/ada-xref.el Fri Jan 04 06:18:31 2008 +0000 @@ -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 @@ (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 @@ (provide 'ada-xref) -;;; arch-tag: 415a39fe-577b-4676-b3b1-6ff6db7ca24e +;; arch-tag: 415a39fe-577b-4676-b3b1-6ff6db7ca24e ;;; ada-xref.el ends here