]> code.delx.au - gnu-emacs/blobdiff - lisp/minibuf-eldef.el
* lisp/loadup.el: Count byte-code functions as well.
[gnu-emacs] / lisp / minibuf-eldef.el
index a0fb127c9f041374955ab6fcb598eb8d5d8a7622..4387fc625c6563e3427430115d850f2649a0ff92 100644 (file)
@@ -1,16 +1,16 @@
 ;;; minibuf-eldef.el --- Only show defaults in prompts when applicable
 ;;
-;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2012 Free Software Foundation, Inc.
 ;;
 ;; Author: Miles Bader <miles@gnu.org>
 ;; Keywords: convenience
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,9 +18,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 ;;
@@ -36,8 +34,8 @@
 ;;; Code:
 
 (defvar minibuffer-default-in-prompt-regexps
-  '(("\\( (default\\>.*)\\):? \\'" . 1))
-  "*A list of regexps matching the parts of minibuffer prompts showing defaults.
+  '(("\\( (default\\>.*)\\):? \\'" . 1) ("\\( \\[.*\\]\\):? *\\'" . 1))
+  "A list of regexps matching the parts of minibuffer prompts showing defaults.
 When `minibuffer-electric-default-mode' is active, these regexps are
 used to identify the portions of prompts to elide.
 
@@ -51,7 +49,7 @@ regexp subexpression that matched.")
 
 ;; A list of minibuffers to which we've added a post-command-hook.
 (defvar minibuf-eldef-frobbed-minibufs nil)
-      
+
 ;;; The following are all local variables in the minibuffer
 
 ;; Input pre-inserted into the minibuffer before the user can edit it.
@@ -132,15 +130,17 @@ been set up by `minibuf-eldef-setup-minibuffer'."
 ;;; functions be already defined.  [This is arguably a bug in d-m-m]
 ;;;###autoload
 (define-minor-mode minibuffer-electric-default-mode
-  "Toggle Minibuffer Electric Default mode
-When active, minibuffer prompts that show a default value only show the
-default when it's applicable -- that is, when hitting RET would yield
-the default value.  If the user modifies the input such that hitting RET
-would enter a non-default value, the prompt is modified to remove the
-default indication.
-
-With prefix argument ARG, turn on if positive, otherwise off.
-Returns non-nil if the new state is enabled."
+  "Toggle Minibuffer Electric Default mode.
+With a prefix argument ARG, enable Minibuffer Electric Default
+mode if ARG is positive, and disable it otherwise.  If called
+from Lisp, enable the mode if ARG is omitted or nil.
+
+Minibuffer Electric Default mode is a global minor mode.  When
+enabled, minibuffer prompts that show a default value only show
+the default when it's applicable -- that is, when hitting RET
+would yield the default value.  If the user modifies the input
+such that hitting RET would enter a non-default value, the prompt
+is modified to remove the default indication."
   :global t
   :group 'minibuffer
   (if minibuffer-electric-default-mode