[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r110806: Fix and docfix for the mi
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r110806: Fix and docfix for the minibuffer-eldef-shorten-default feature. |
Date: |
Thu, 08 Nov 2012 04:43:38 +0800 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 110806
committer: Chong Yidong <address@hidden>
branch nick: emacs-24
timestamp: Thu 2012-11-08 04:43:38 +0800
message:
Fix and docfix for the minibuffer-eldef-shorten-default feature.
* lisp/minibuf-eldef.el (minibuffer-eldef-shorten-default): Convert to
a defcustom with an appropriate :set function.
(minibuffer-default--in-prompt-regexps): New function.
* doc/emacs/mini.texi (Basic Minibuffer): New node. Document
minibuffer-electric-default-mode.
* doc/emacs/display.texi (Visual Line Mode): Fix index entry.
modified:
doc/emacs/ChangeLog
doc/emacs/display.texi
doc/emacs/emacs.texi
doc/emacs/mini.texi
etc/NEWS
lisp/ChangeLog
lisp/minibuf-eldef.el
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog 2012-11-07 06:54:43 +0000
+++ b/doc/emacs/ChangeLog 2012-11-07 20:43:38 +0000
@@ -1,5 +1,10 @@
2012-11-07 Chong Yidong <address@hidden>
+ * mini.texi (Basic Minibuffer): New node. Document
+ minibuffer-electric-default-mode.
+
+ * display.texi (Visual Line Mode): Fix index entry.
+
* buffers.texi (Several Buffers): List Buffer Menu command anmes,
and index the keybindings. Document tabulated-list-sort.
(Kill Buffer): Capitalize Buffer Menu.
=== modified file 'doc/emacs/display.texi'
--- a/doc/emacs/display.texi 2012-11-05 18:01:20 +0000
+++ b/doc/emacs/display.texi 2012-11-07 20:43:38 +0000
@@ -1500,6 +1500,7 @@
edge. This makes the text easier to read, as wrapping does not occur
in the middle of words.
address@hidden mode, Visual Line
@cindex Visual Line mode
@findex visual-line-mode
@findex global-visual-line-mode
=== modified file 'doc/emacs/emacs.texi'
--- a/doc/emacs/emacs.texi 2012-10-27 05:03:52 +0000
+++ b/doc/emacs/emacs.texi 2012-11-07 20:43:38 +0000
@@ -261,6 +261,7 @@
The Minibuffer
+* Basic Minibuffer:: Basic usage of the minibuffer.
* Minibuffer File:: Entering file names with the minibuffer.
* Minibuffer Edit:: How to edit in the minibuffer.
* Completion:: An abbreviation facility for minibuffer input.
=== modified file 'doc/emacs/mini.texi'
--- a/doc/emacs/mini.texi 2012-10-18 03:27:17 +0000
+++ b/doc/emacs/mini.texi 2012-11-07 20:43:38 +0000
@@ -13,24 +13,54 @@
use the usual Emacs editing commands in the minibuffer to edit the
argument text.
address@hidden
+* Basic Minibuffer:: Basic usage of the minibuffer.
+* Minibuffer File:: Entering file names with the minibuffer.
+* Minibuffer Edit:: How to edit in the minibuffer.
+* Completion:: An abbreviation facility for minibuffer input.
+* Minibuffer History:: Reusing recent minibuffer arguments.
+* Repetition:: Re-executing commands that used the minibuffer.
+* Passwords:: Entering passwords in the echo area.
+* Yes or No Prompts:: Replying yes or no in the echo area.
address@hidden menu
+
address@hidden Basic Minibuffer
address@hidden Using the Minibuffer
+
@cindex prompt
When the minibuffer is in use, it appears in the echo area, with a
-cursor. The minibuffer starts with a @dfn{prompt} in a distinct
-color, usually ending with a colon. The prompt states what kind of
-input is expected, and how it will be used.
+cursor. The minibuffer starts with a @dfn{prompt}, usually ending
+with a colon. The prompt states what kind of input is expected, and
+how it will be used. The prompt is highlighted using the
address@hidden face (@pxref{Faces}).
The simplest way to enter a minibuffer argument is to type the text,
-then @key{RET} to submit the argument and exit the minibuffer. You
-can cancel the minibuffer, and the command that wants the argument, by
-typing @kbd{C-g}.
+then @key{RET} to submit the argument and exit the minibuffer.
+Alternatively, you can type @kbd{C-g} to exit the minibuffer by
+cancelling the command asking for the argument (@pxref{Quitting}).
@cindex default argument
- Sometimes, a @dfn{default argument} appears in the prompt, inside
+ Sometimes, the prompt shows a @dfn{default argument}, inside
parentheses before the colon. This default will be used as the
argument if you just type @key{RET}. For example, commands that read
buffer names usually show a buffer name as the default; you can type
@key{RET} to operate on that default buffer.
address@hidden Minibuffer Electric Default mode
address@hidden mode, Minibuffer Electric Default
address@hidden minibuffer-electric-default-mode
address@hidden minibuffer-eldef-shorten-default
+ If you enable Minibuffer Electric Default mode, a global minor mode,
+Emacs hides the default argument as soon as you modify the contents of
+the minibuffer (since typing @key{RET} would no longer submit that
+default). If you ever bring back the original minibuffer text, the
+prompt again shows the default. Furthermore, if you change the
+variable @code{minibuffer-eldef-shorten-default} to a address@hidden
+value, the default argument is displayed as @address@hidden
+instead of @samp{(default @var{default})}, saving some screen space.
+To enable this minor mode, type @kbd{M-x
+minibuffer-electric-default-mode}.
+
Since the minibuffer appears in the echo area, it can conflict with
other uses of the echo area. If an error message or an informative
message is emitted while the minibuffer is active, the message hides
@@ -38,16 +68,6 @@
the minibuffer comes back. While the minibuffer is in use, keystrokes
do not echo.
address@hidden
-* Minibuffer File:: Entering file names with the minibuffer.
-* Minibuffer Edit:: How to edit in the minibuffer.
-* Completion:: An abbreviation facility for minibuffer input.
-* Minibuffer History:: Reusing recent minibuffer arguments.
-* Repetition:: Re-executing commands that used the minibuffer.
-* Passwords:: Entering passwords in the echo area.
-* Yes or No Prompts:: Replying yes or no in the echo area.
address@hidden menu
-
@node Minibuffer File
@section Minibuffers for File Names
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2012-11-07 15:46:35 +0000
+++ b/etc/NEWS 2012-11-07 20:43:38 +0000
@@ -127,15 +127,14 @@
---
*** In minibuffer filename prompts, `C-M-f' and `C-M-b' now move to the
next and previous path separator, respectively.
-
++++
*** minibuffer-electric-default-mode can rewrite (default ...) to [...].
Just set minibuffer-eldef-shorten-default to t before enabling the mode.
** ImageMagick support, if available, is automatically enabled.
It is no longer necessary to call `imagemagick-register-types'
explicitly to install ImageMagick image types; that function is called
-automatically at startup, or when customizing a relevant imagemagick-
-option.
+automatically at startup, or when customizing an imagemagick- option.
+++
*** Setting `imagemagick-types-inhibit' to t now disables the use of
ImageMagick to view images. You must call imagemagick-register-types
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-11-07 08:56:16 +0000
+++ b/lisp/ChangeLog 2012-11-07 20:43:38 +0000
@@ -1,3 +1,9 @@
+2012-11-07 Chong Yidong <address@hidden>
+
+ * minibuf-eldef.el (minibuffer-eldef-shorten-default): Convert to
+ a defcustom with an appropriate :set function.
+ (minibuffer-default--in-prompt-regexps): New function.
+
2012-11-07 Glenn Morris <address@hidden>
* emacs-lisp/cl.el (define-setf-expander, defsetf)
=== modified file 'lisp/minibuf-eldef.el'
--- a/lisp/minibuf-eldef.el 2012-09-27 02:10:54 +0000
+++ b/lisp/minibuf-eldef.el 2012-11-07 20:43:38 +0000
@@ -33,13 +33,25 @@
;;; Code:
-(defvar minibuffer-eldef-shorten-default nil
- "If non-nil, shorten \"(default ...)\" to \"[...]\" in minibuffer prompts.")
+(defvar minibuffer-eldef-shorten-default)
-(defvar minibuffer-default-in-prompt-regexps
+(defun minibuffer-default--in-prompt-regexps ()
`(("\\( (default\\(?: is\\)? \\(.*\\))\\):? \\'"
1 ,(if minibuffer-eldef-shorten-default " [\\2]"))
- ("\\( \\[.*\\]\\):? *\\'" 1))
+ ("\\( \\[.*\\]\\):? *\\'" 1)))
+
+(defcustom minibuffer-eldef-shorten-default nil
+ "If non-nil, shorten \"(default ...)\" to \"[...]\" in minibuffer prompts."
+ :set (lambda (symbol value)
+ (set-default symbol value)
+ (setq-default minibuffer-default-in-prompt-regexps
+ (minibuffer-default--in-prompt-regexps)))
+ :type 'boolean
+ :group 'minibuffer
+ :version "24.3")
+
+(defvar minibuffer-default-in-prompt-regexps
+ (minibuffer-default--in-prompt-regexps)
"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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r110806: Fix and docfix for the minibuffer-eldef-shorten-default feature.,
Chong Yidong <=