* erc-ibuffer.el (erc-channel-modes):

* bs.el (bs--sort-by-mode, bs--get-mode-name):
* imenu.el (imenu-add-to-menubar):
* makesum.el (make-command-summary):
* mouse.el (mouse-major-mode-menu, mouse-popup-menubar, mouse-buffer-menu):
* msb.el (msb--mode-menu-cond):
* calc/calc-embed.el (calc-do-embedded):
* emacs-lisp/helper.el (Helper-describe-mode):
* mail/emacsbug.el (report-emacs-bug):
* progmodes/hideshow.el (hs-grok-mode-type):
* textmodes/sgml-mode.el (sgml-mode-facemenu-add-face-function):
* textmodes/table.el (*table--cell-describe-mode):
Pass mode-name through format-mode-line.
This commit is contained in:
Stefan Monnier 2008-01-04 06:29:12 +00:00
parent 3da360a745
commit 48d33090d0
14 changed files with 63 additions and 37 deletions

View file

@ -1,3 +1,18 @@
2008-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
* bs.el (bs--sort-by-mode, bs--get-mode-name):
* imenu.el (imenu-add-to-menubar):
* makesum.el (make-command-summary):
* mouse.el (mouse-major-mode-menu, mouse-popup-menubar, mouse-buffer-menu):
* msb.el (msb--mode-menu-cond):
* calc/calc-embed.el (calc-do-embedded):
* emacs-lisp/helper.el (Helper-describe-mode):
* mail/emacsbug.el (report-emacs-bug):
* progmodes/hideshow.el (hs-grok-mode-type):
* textmodes/sgml-mode.el (sgml-mode-facemenu-add-face-function):
* textmodes/table.el (*table--cell-describe-mode):
Pass mode-name through format-mode-line.
2008-01-04 Stefan Monnier <monnier@iro.umontreal.ca> 2008-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/ada-xref.el (ada-prj-find-prj-file): * progmodes/ada-xref.el (ada-prj-find-prj-file):

View file

@ -1,7 +1,7 @@
;;; bs.el --- menu for selecting and displaying buffers ;;; bs.el --- menu for selecting and displaying buffers
;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007 Free Software Foundation, Inc. ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de> ;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
;; Maintainer: Olaf Sylvester <Olaf.Sylvester@netsurf.de> ;; Maintainer: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
;; Keywords: convenience ;; Keywords: convenience
@ -369,9 +369,9 @@ A value of `always' means to show buffer regardless of the configuration.")
(defun bs--sort-by-mode (b1 b2) (defun bs--sort-by-mode (b1 b2)
"Compare buffers B1 and B2 by mode name." "Compare buffers B1 and B2 by mode name."
(save-excursion (save-current-buffer
(string< (progn (set-buffer b1) (format "%s" mode-name)) (string< (progn (set-buffer b1) (format-mode-line mode-name nil nil b1))
(progn (set-buffer b2) (format "%s" mode-name))))) (progn (set-buffer b2) (format-mode-line mode-name nil nil b2)))))
(defun bs--sort-by-size (b1 b2) (defun bs--sort-by-size (b1 b2)
"Compare buffers B1 and B2 by buffer size." "Compare buffers B1 and B2 by buffer size."
@ -1331,7 +1331,7 @@ ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
"Return the name of mode of current buffer for Buffer Selection Menu. "Return the name of mode of current buffer for Buffer Selection Menu.
START-BUFFER is the buffer where we started buffer selection. START-BUFFER is the buffer where we started buffer selection.
ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
mode-name) (format-mode-line mode-name nil nil buffer))
(defun bs--get-file-name (start-buffer all-buffers) (defun bs--get-file-name (start-buffer all-buffers)
"Return string for column 'File' in Buffer Selection Menu. "Return string for column 'File' in Buffer Selection Menu.
@ -1480,5 +1480,5 @@ name of buffer configuration."
;; Now provide feature bs ;; Now provide feature bs
(provide 'bs) (provide 'bs)
;;; arch-tag: c0d9ab34-bf06-4368-ae9d-af88878e6802 ;; arch-tag: c0d9ab34-bf06-4368-ae9d-af88878e6802
;;; bs.el ends here ;;; bs.el ends here

View file

@ -1,7 +1,7 @@
;;; calc-embed.el --- embed Calc in a buffer ;;; calc-embed.el --- embed Calc in a buffer
;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, ;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007 Free Software Foundation, Inc. ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: David Gillespie <daveg@synaptics.com> ;; Author: David Gillespie <daveg@synaptics.com>
;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com> ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
@ -254,7 +254,7 @@
(set-buffer-modified-p (buffer-modified-p)) (set-buffer-modified-p (buffer-modified-p))
(calc-embedded-restore-original-modes) (calc-embedded-restore-original-modes)
(or calc-embedded-quiet (or calc-embedded-quiet
(message "Back to %s mode" mode-name)))) (message "Back to %s mode" (format-mode-line mode-name)))))
(t (t
(if (buffer-name (aref calc-embedded-info 0)) (if (buffer-name (aref calc-embedded-info 0))
@ -1374,5 +1374,5 @@ The command \\[yank] can retrieve it from there."
(provide 'calc-embed) (provide 'calc-embed)
;;; arch-tag: 1b8f311e-fba1-40d3-b8c3-1d6f68fd26fc ;; arch-tag: 1b8f311e-fba1-40d3-b8c3-1d6f68fd26fc
;;; calc-embed.el ends here ;;; calc-embed.el ends here

View file

@ -1,7 +1,7 @@
;;; helper.el --- utility help package supporting help in electric modes ;;; helper.el --- utility help package supporting help in electric modes
;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, ;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
;; 2006, 2007 Free Software Foundation, Inc. ;; 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: K. Shane Hartman ;; Author: K. Shane Hartman
;; Maintainer: FSF ;; Maintainer: FSF
@ -120,10 +120,9 @@
(defun Helper-describe-mode () (defun Helper-describe-mode ()
"Describe the current mode." "Describe the current mode."
(interactive) (interactive)
(let ((name mode-name) (let ((name (format-mode-line mode-name))
(documentation (documentation major-mode))) (documentation (documentation major-mode)))
(save-excursion (with-current-buffer (get-buffer-create "*Help*")
(set-buffer (get-buffer-create "*Help*"))
(setq buffer-read-only nil) (setq buffer-read-only nil)
(erase-buffer) (erase-buffer)
(insert name " Mode\n" documentation) (insert name " Mode\n" documentation)
@ -158,5 +157,5 @@
(provide 'helper) (provide 'helper)
;;; arch-tag: a0984577-d3e9-4124-ae0d-c46fe740f6a9 ;; arch-tag: a0984577-d3e9-4124-ae0d-c46fe740f6a9
;;; helper.el ends here ;;; helper.el ends here

View file

@ -1,3 +1,8 @@
2008-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
* erc-ibuffer.el (erc-channel-modes):
Pass mode-name through format-mode-line
2007-12-09 Michael Olson <mwolson@gnu.org> 2007-12-09 Michael Olson <mwolson@gnu.org>
* erc-services.el (erc-nickserv-alist): Fix regexps for GRnet. * erc-services.el (erc-nickserv-alist): Fix regexps for GRnet.

View file

@ -1,6 +1,6 @@
;;; erc-ibuffer.el --- ibuffer integration with ERC ;;; erc-ibuffer.el --- ibuffer integration with ERC
;; Copyright (C) 2002, 2004, 2006, 2007 Free Software Foundation, Inc. ;; Copyright (C) 2002, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@delysid.org> ;; Author: Mario Lang <mlang@delysid.org>
;; Keywords: comm ;; Keywords: comm
@ -158,8 +158,8 @@
(format "l %d" erc-channel-user-limit) (format "l %d" erc-channel-user-limit)
"") "")
")") ")")
(if (not (eq major-mode 'erc-mode)) (if (not (derived-mode-p 'erc-mode))
mode-name (format-mode-line mode-name nil nil (current-buffer))
""))) "")))
(define-ibuffer-column erc-nick (:name "Nick") (define-ibuffer-column erc-nick (:name "Nick")

View file

@ -1,7 +1,7 @@
;;; imenu.el --- framework for mode-specific buffer indexes ;;; imenu.el --- framework for mode-specific buffer indexes
;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003, 2004, ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007 Free Software Foundation, Inc. ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Ake Stenhoff <etxaksf@aom.ericsson.se> ;; Author: Ake Stenhoff <etxaksf@aom.ericsson.se>
;; Lars Lindberg <lli@sypro.cap.se> ;; Lars Lindberg <lli@sypro.cap.se>
@ -954,7 +954,8 @@ See the command `imenu' for more information."
`(menu-item ,name ,(make-sparse-keymap "Imenu"))) `(menu-item ,name ,(make-sparse-keymap "Imenu")))
(use-local-map newmap) (use-local-map newmap)
(add-hook 'menu-bar-update-hook 'imenu-update-menubar)) (add-hook 'menu-bar-update-hook 'imenu-update-menubar))
(error "The mode `%s' does not support Imenu" mode-name))) (error "The mode `%s' does not support Imenu"
(format-mode-line mode-name))))
;;;###autoload ;;;###autoload
(defun imenu-add-menubar-index () (defun imenu-add-menubar-index ()

View file

@ -1,7 +1,7 @@
;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list ;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list
;; Copyright (C) 1985, 1994, 1997, 1998, 2000, 2001, 2002, 2003, ;; Copyright (C) 1985, 1994, 1997, 1998, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc. ;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: K. Shane Hartman ;; Author: K. Shane Hartman
;; Maintainer: FSF ;; Maintainer: FSF
@ -168,7 +168,9 @@ usually do not have translators to read other languages for them.\n\n")
default-enable-multibyte-characters)) default-enable-multibyte-characters))
(insert "\n") (insert "\n")
(insert (format "Major mode: %s\n" (insert (format "Major mode: %s\n"
(buffer-local-value 'mode-name from-buffer))) (format-mode-line
(buffer-local-value 'mode-name from-buffer)
nil nil from-buffer)))
(insert "\n") (insert "\n")
(insert "Minor modes in effect:\n") (insert "Minor modes in effect:\n")
(dolist (mode minor-mode-list) (dolist (mode minor-mode-list)

View file

@ -1,7 +1,7 @@
;;; makesum.el --- generate key binding summary for Emacs ;;; makesum.el --- generate key binding summary for Emacs
;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, ;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
;; 2006, 2007 Free Software Foundation, Inc. ;; 2006, 2007, 2008 Free Software Foundation, Inc.
;; Maintainer: FSF ;; Maintainer: FSF
;; Keywords: help ;; Keywords: help
@ -65,7 +65,7 @@ Previous contents of that buffer are killed first."
(if (re-search-forward "^Local Bindings:" nil t) (if (re-search-forward "^Local Bindings:" nil t)
(progn (progn
(forward-char -1) (forward-char -1)
(insert " for " cur-mode " Mode") (insert " for " (format-mode-line cur-mode) " Mode")
(while (search-forward "??\n" nil t) (while (search-forward "??\n" nil t)
(delete-region (point) (delete-region (point)
(progn (progn
@ -114,5 +114,5 @@ Previous contents of that buffer are killed first."
(provide 'makesum) (provide 'makesum)
;;; arch-tag: c2383336-fc89-46ad-8110-ded42bffaee3 ;; arch-tag: c2383336-fc89-46ad-8110-ded42bffaee3
;;; makesum.el ends here ;;; makesum.el ends here

View file

@ -1,7 +1,7 @@
;;; mouse.el --- window system-independent mouse support ;;; mouse.el --- window system-independent mouse support
;; Copyright (C) 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003, ;; Copyright (C) 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc. ;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Maintainer: FSF ;; Maintainer: FSF
;; Keywords: hardware, mouse ;; Keywords: hardware, mouse
@ -192,7 +192,8 @@ Default to the Edit menu if the major mode doesn't define a menu."
;; Make a keymap in which our last command leads to a menu or ;; Make a keymap in which our last command leads to a menu or
;; default to the edit menu. ;; default to the edit menu.
(newmap (if ancestor (newmap (if ancestor
(make-sparse-keymap (concat mode-name " Mode")) (make-sparse-keymap (concat (format-mode-line mode-name)
" Mode"))
menu-bar-edit-menu))) menu-bar-edit-menu)))
(if ancestor (if ancestor
;; Make our menu inherit from the desired keymap which we want ;; Make our menu inherit from the desired keymap which we want
@ -272,7 +273,8 @@ not it is actually displayed."
(or (null local-menu) (or (null local-menu)
(stringp local-title-or-map) (stringp local-title-or-map)
(setq local-menu (cons 'keymap (setq local-menu (cons 'keymap
(cons (concat mode-name " Mode Menu") (cons (concat (formal-mode-line mode-name)
" Mode Menu")
(cdr local-menu))))) (cdr local-menu)))))
(or (stringp global-title-or-map) (or (stringp global-title-or-map)
(setq global-menu (cons 'keymap (setq global-menu (cons 'keymap
@ -1861,7 +1863,7 @@ and selects that window."
(setq elt (list adjusted-major-mode (setq elt (list adjusted-major-mode
(if (stringp adjusted-major-mode) (if (stringp adjusted-major-mode)
adjusted-major-mode adjusted-major-mode
mode-name)) (format-mode-line mode-name nil nil buf)))
split-by-major-mode (cons elt split-by-major-mode))) split-by-major-mode (cons elt split-by-major-mode)))
(or (memq buf (cdr (cdr elt))) (or (memq buf (cdr (cdr elt)))
(setcdr (cdr elt) (cons buf (cdr (cdr elt)))))))) (setcdr (cdr elt) (cons buf (cdr (cdr elt))))))))

View file

@ -1,7 +1,7 @@
;;; msb.el --- customizable buffer-selection with multiple menus ;;; msb.el --- customizable buffer-selection with multiple menus
;; Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, ;; Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002,
;; 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. ;; 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Lars Lindberg <lars.lindberg@home.se> ;; Author: Lars Lindberg <lars.lindberg@home.se>
;; Maintainer: FSF ;; Maintainer: FSF
@ -829,7 +829,8 @@ results in
(with-current-buffer buffer (with-current-buffer buffer
(when (and (not (msb-invisible-buffer-p)) (when (and (not (msb-invisible-buffer-p))
(not (assq major-mode mode-list))) (not (assq major-mode mode-list)))
(push (cons major-mode mode-name) (push (cons major-mode
(format-mode-line mode-name nil nil buffer))
mode-list)))) mode-list))))
mode-list) mode-list)
(lambda (item1 item2) (lambda (item1 item2)

View file

@ -1,7 +1,7 @@
;;; hideshow.el --- minor mode cmds to selectively display code/comment blocks ;;; hideshow.el --- minor mode cmds to selectively display code/comment blocks
;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 ;; 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: Thien-Thi Nguyen <ttn@gnu.org> ;; Author: Thien-Thi Nguyen <ttn@gnu.org>
;; Dan Nicolaescu <dann@ics.uci.edu> ;; Dan Nicolaescu <dann@ics.uci.edu>
@ -632,7 +632,8 @@ function; and adjust-block-beginning function."
hs-forward-sexp-func (or (nth 4 lookup) 'forward-sexp) hs-forward-sexp-func (or (nth 4 lookup) 'forward-sexp)
hs-adjust-block-beginning (nth 5 lookup))) hs-adjust-block-beginning (nth 5 lookup)))
(setq hs-minor-mode nil) (setq hs-minor-mode nil)
(error "%s Mode doesn't support Hideshow Minor Mode" mode-name))) (error "%s Mode doesn't support Hideshow Minor Mode"
(format-mode-line mode-name))))
(defun hs-find-block-beginning () (defun hs-find-block-beginning ()
"Reposition point at block-start. "Reposition point at block-start.
@ -965,5 +966,5 @@ Key bindings:
(provide 'hideshow) (provide 'hideshow)
;;; arch-tag: 378b6852-e82a-466a-aee8-d9c73859a65e ;; arch-tag: 378b6852-e82a-466a-aee8-d9c73859a65e
;;; hideshow.el ends here ;;; hideshow.el ends here

View file

@ -1,7 +1,7 @@
;;; sgml-mode.el --- SGML- and HTML-editing modes -*- coding: iso-2022-7bit -*- ;;; sgml-mode.el --- SGML- and HTML-editing modes -*- coding: iso-2022-7bit -*-
;; Copyright (C) 1992, 1995, 1996, 1998, 2001, 2002, 2003, 2004, ;; Copyright (C) 1992, 1995, 1996, 1998, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007 Free Software Foundation, Inc. ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: James Clark <jjc@jclark.com> ;; Author: James Clark <jjc@jclark.com>
;; Maintainer: FSF ;; Maintainer: FSF
@ -397,7 +397,7 @@ a DOCTYPE or an XML declaration."
(setq face (funcall skeleton-transformation-function face)) (setq face (funcall skeleton-transformation-function face))
(setq facemenu-end-add-face (concat "</" face ">")) (setq facemenu-end-add-face (concat "</" face ">"))
(concat "<" face ">")) (concat "<" face ">"))
(error "Face not configured for %s mode" mode-name))) (error "Face not configured for %s mode" (format-mode-line mode-name))))
(defun sgml-fill-nobreak () (defun sgml-fill-nobreak ()
;; Don't break between a tag name and its first argument. ;; Don't break between a tag name and its first argument.

View file

@ -1,7 +1,7 @@
;;; table.el --- create and edit WYSIWYG text based embedded tables ;;; table.el --- create and edit WYSIWYG text based embedded tables
;; Copyright (C) 2000, 2001, 2002, 2003, 2004, ;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007 Free Software Foundation, Inc. ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Keywords: wp, convenience ;; Keywords: wp, convenience
;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com> ;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com>
@ -4061,7 +4061,7 @@ converts a table into plain text without frames. It is a companion to
(call-interactively 'describe-mode) (call-interactively 'describe-mode)
(with-output-to-temp-buffer "*Help*" (with-output-to-temp-buffer "*Help*"
(princ "Table mode: (in ") (princ "Table mode: (in ")
(princ mode-name) (princ (format-mode-line mode-name nil nil (current-buffer)))
(princ " mode) (princ " mode)
Table is not a mode technically. You can regard it as a pseudo mode Table is not a mode technically. You can regard it as a pseudo mode