comparison lisp/progmodes/ada-mode.el @ 87566:0c4a74c24677

* 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.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 04 Jan 2008 06:18:31 +0000
parents 5c852af4e53c
children 9e1ef9a0680b 606f2d163a64
comparison
equal deleted inserted replaced
87565:c27df69a8670 87566:0c4a74c24677
1 ;;; ada-mode.el --- major-mode for editing Ada sources 1 ;;; ada-mode.el --- major-mode for editing Ada sources
2 2
3 ;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 ;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007 Free Software Foundation, Inc. 4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
5 5
6 ;; Author: Rolf Ebert <ebert@inf.enst.fr> 6 ;; Author: Rolf Ebert <ebert@inf.enst.fr>
7 ;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de> 7 ;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
8 ;; Emmanuel Briot <briot@gnat.com> 8 ;; Emmanuel Briot <briot@gnat.com>
9 ;; Maintainer: Stephen Leake <stephen_leake@member.fsf.org> 9 ;; Maintainer: Stephen Leake <stephen_leake@member.fsf.org>
4809 ;; In addition, we provide an interface to the standard comment handling 4809 ;; In addition, we provide an interface to the standard comment handling
4810 ;; function for justifying the comments. 4810 ;; function for justifying the comments.
4811 ;; ------------------------------------------------------- 4811 ;; -------------------------------------------------------
4812 4812
4813 (defadvice comment-region (before ada-uncomment-anywhere disable) 4813 (defadvice comment-region (before ada-uncomment-anywhere disable)
4814 (if (and arg 4814 (if (and (consp arg) ;; a prefix with \C-u is of the form '(4), whereas
4815 (listp arg) ;; a prefix with \C-u is of the form '(4), whereas
4816 ;; \C-u 2 sets arg to '2' (fixed by S.Leake) 4815 ;; \C-u 2 sets arg to '2' (fixed by S.Leake)
4817 (string= mode-name "Ada")) 4816 (derived-mode-p 'ada-mode))
4818 (save-excursion 4817 (save-excursion
4819 (let ((cs (concat "^[ \t]*" (regexp-quote comment-start)))) 4818 (let ((cs (concat "^[ \t]*" (regexp-quote comment-start))))
4820 (goto-char beg) 4819 (goto-char beg)
4821 (while (re-search-forward cs end t) 4820 (while (re-search-forward cs end t)
4822 (replace-match comment-start)) 4821 (replace-match comment-start))