diff options
| author | Chong Yidong | 2010-04-25 17:21:51 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-04-25 17:21:51 -0400 |
| commit | eb5ed549f4aa1fba7869ebb2d62cc974a4a1263a (patch) | |
| tree | 97cc3332d3eca4d86c83373da68b0afdc1f516dd | |
| parent | 3b0788f68ec9a0938dffcd9dd19894e3df84a376 (diff) | |
| download | emacs-eb5ed549f4aa1fba7869ebb2d62cc974a4a1263a.tar.gz emacs-eb5ed549f4aa1fba7869ebb2d62cc974a4a1263a.zip | |
Document Emacs 23.2 changes.
* functions.texi (Obsolete Functions): Document
set-advertised-calling-convention.
* minibuf.texi (Basic Completion): Document completion-in-region.
(Programmed Completion): Document completion-annotate-function.
* commands.texi (Reading One Event): Document read-key.
(Distinguish Interactive): Document KIND arg to
called-interactively-p. Delete obsolete interactive-p.
* elisp.texi (Top): Update node description.
* misc.texi (Printing): Document htmlfontify-buffer.
| -rw-r--r-- | doc/emacs/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/emacs/misc.texi | 10 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 14 | ||||
| -rw-r--r-- | doc/lispref/commands.texi | 86 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 29 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 92 | ||||
| -rw-r--r-- | etc/NEWS | 10 |
8 files changed, 169 insertions, 77 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 27955948e43..b2fc399c1df 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2010-04-25 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * misc.texi (Printing): Document htmlfontify-buffer. | ||
| 4 | |||
| 1 | 2010-04-21 Glenn Morris <rgm@gnu.org> | 5 | 2010-04-21 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * calendar.texi (Displaying the Diary, Format of Diary File): | 7 | * calendar.texi (Displaying the Diary, Format of Diary File): |
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 7944a6b85e7..df39a7d2291 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -1701,8 +1701,14 @@ process, type @kbd{M-x kill-emacs}. | |||
| 1701 | Emacs provides commands for printing hard copies of either an entire | 1701 | Emacs provides commands for printing hard copies of either an entire |
| 1702 | buffer or just part of one, with or without page headers. You can | 1702 | buffer or just part of one, with or without page headers. You can |
| 1703 | invoke the printing commands directly, as detailed in the following | 1703 | invoke the printing commands directly, as detailed in the following |
| 1704 | section, or using the @samp{File} menu on the menu bar. See also the | 1704 | section, or using the @samp{File} menu on the menu bar. |
| 1705 | hardcopy commands of Dired (@pxref{Misc File Ops}) and the diary | 1705 | |
| 1706 | @findex htmlfontify-buffer | ||
| 1707 | Aside from the commands described in this section, you can also | ||
| 1708 | ``print'' an Emacs buffer to HTML with @kbd{M-x htmlfontify-buffer}. | ||
| 1709 | This command converts the current buffer to a HTML file, replacing | ||
| 1710 | Emacs faces with CSS-based markup. In addition, see the hardcopy | ||
| 1711 | commands of Dired (@pxref{Misc File Ops}) and the diary | ||
| 1706 | (@pxref{Displaying the Diary}). | 1712 | (@pxref{Displaying the Diary}). |
| 1707 | 1713 | ||
| 1708 | @table @kbd | 1714 | @table @kbd |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 7c2a8bd08bd..c2fd0a5e77e 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2010-04-25 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * functions.texi (Obsolete Functions): Document | ||
| 4 | set-advertised-calling-convention. | ||
| 5 | |||
| 6 | * minibuf.texi (Basic Completion): Document completion-in-region. | ||
| 7 | (Programmed Completion): Document completion-annotate-function. | ||
| 8 | |||
| 9 | * commands.texi (Reading One Event): Document read-key. | ||
| 10 | (Distinguish Interactive): Document KIND arg to | ||
| 11 | called-interactively-p. Delete obsolete interactive-p. | ||
| 12 | |||
| 13 | * elisp.texi (Top): Update node description. | ||
| 14 | |||
| 1 | 2010-04-14 Juri Linkov <juri@jurta.org> | 15 | 2010-04-14 Juri Linkov <juri@jurta.org> |
| 2 | 16 | ||
| 3 | Fix @deffn without category. | 17 | Fix @deffn without category. |
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index b6d56ffc37a..463443f8e10 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -696,71 +696,67 @@ message when called from a keyboard macro. | |||
| 696 | because it allows callers to say ``treat this call as interactive.'' | 696 | because it allows callers to say ``treat this call as interactive.'' |
| 697 | But you can also do the job by testing @code{called-interactively-p}. | 697 | But you can also do the job by testing @code{called-interactively-p}. |
| 698 | 698 | ||
| 699 | @defun called-interactively-p | 699 | @defun called-interactively-p kind |
| 700 | This function returns @code{t} when the calling function was called | 700 | This function returns @code{t} when the calling function was called |
| 701 | using @code{call-interactively}. | 701 | using @code{call-interactively}. |
| 702 | 702 | ||
| 703 | If the containing function was called by Lisp evaluation (or with | 703 | The argument @var{kind} should be either the symbol @code{interactive} |
| 704 | @code{apply} or @code{funcall}), then it was not called interactively. | 704 | or the symbol @code{any}. If it is @code{interactive}, then |
| 705 | @code{called-interactively-p} returns @code{t} only if the call was | ||
| 706 | made directly by the user---e.g., if the user typed a key sequence | ||
| 707 | bound to the calling function, but @emph{not} if the user ran a | ||
| 708 | keyboard macro that called the function (@pxref{Keyboard Macros}). If | ||
| 709 | @var{kind} is @code{any}, @code{called-interactively-p} returns | ||
| 710 | @code{t} for any kind of interactive call, including keyboard macros. | ||
| 711 | |||
| 712 | If in doubt, use @code{any}; the only known proper use of | ||
| 713 | @code{interactive} is if you need to decide whether to display a | ||
| 714 | helpful message while a function is running. | ||
| 715 | |||
| 716 | A function is never considered to be called interactively if it was | ||
| 717 | called via Lisp evaluation (or with @code{apply} or @code{funcall}). | ||
| 705 | @end defun | 718 | @end defun |
| 706 | 719 | ||
| 707 | Here's an example of using @code{called-interactively-p}: | 720 | @noindent |
| 721 | Here is an example of using @code{called-interactively-p}: | ||
| 708 | 722 | ||
| 709 | @example | 723 | @example |
| 710 | @group | 724 | @group |
| 711 | (defun foo () | 725 | (defun foo () |
| 712 | (interactive) | 726 | (interactive) |
| 713 | (when (called-interactively-p) | 727 | (when (called-interactively-p 'any) |
| 714 | (message "foo")) | 728 | (message "Interactive!") |
| 715 | 'haha) | 729 | 'foo-called-interactively)) |
| 716 | @result{} foo | ||
| 717 | @end group | 730 | @end group |
| 718 | 731 | ||
| 719 | @group | 732 | @group |
| 720 | ;; @r{Type @kbd{M-x foo}.} | 733 | ;; @r{Type @kbd{M-x foo}.} |
| 721 | @print{} foo | 734 | @print{} Interactive! |
| 722 | @end group | 735 | @end group |
| 723 | 736 | ||
| 724 | @group | 737 | @group |
| 725 | (foo) | 738 | (foo) |
| 726 | @result{} haha | 739 | @result{} nil |
| 727 | @end group | 740 | @end group |
| 728 | @end example | 741 | @end example |
| 729 | 742 | ||
| 730 | Here is another example that contrasts direct and indirect | 743 | @noindent |
| 731 | calls to @code{called-interactively-p}. | 744 | Here is another example that contrasts direct and indirect calls to |
| 745 | @code{called-interactively-p}. | ||
| 732 | 746 | ||
| 733 | @example | 747 | @example |
| 734 | @group | 748 | @group |
| 735 | (defun bar () | 749 | (defun bar () |
| 736 | (interactive) | 750 | (interactive) |
| 737 | (setq foobar (list (foo) (called-interactively-p)))) | 751 | (message "%s" (list (foo) (called-interactively-p 'any)))) |
| 738 | @result{} bar | ||
| 739 | @end group | 752 | @end group |
| 740 | 753 | ||
| 741 | @group | 754 | @group |
| 742 | ;; @r{Type @kbd{M-x bar}.} | 755 | ;; @r{Type @kbd{M-x bar}.} |
| 743 | ;; @r{This does not display a message.} | 756 | @print{} (nil t) |
| 744 | @end group | ||
| 745 | |||
| 746 | @group | ||
| 747 | foobar | ||
| 748 | @result{} (nil t) | ||
| 749 | @end group | 757 | @end group |
| 750 | @end example | 758 | @end example |
| 751 | 759 | ||
| 752 | If you want to treat commands run in keyboard macros just like calls | ||
| 753 | from Lisp programs, test @code{interactive-p} instead of | ||
| 754 | @code{called-interactively-p}. | ||
| 755 | |||
| 756 | @defun interactive-p | ||
| 757 | This function returns @code{t} if the containing function (the one | ||
| 758 | whose code includes the call to @code{interactive-p}) was called in | ||
| 759 | direct response to user input. This means that it was called with the | ||
| 760 | function @code{call-interactively}, and that a keyboard macro is | ||
| 761 | not running, and that Emacs is not running in batch mode. | ||
| 762 | @end defun | ||
| 763 | |||
| 764 | @node Command Loop Info | 760 | @node Command Loop Info |
| 765 | @comment node-name, next, previous, up | 761 | @comment node-name, next, previous, up |
| 766 | @section Information from the Command Loop | 762 | @section Information from the Command Loop |
| @@ -2309,10 +2305,8 @@ and key sequences read from keyboard macros being executed. | |||
| 2309 | @cindex reading a single event | 2305 | @cindex reading a single event |
| 2310 | @cindex event, reading only one | 2306 | @cindex event, reading only one |
| 2311 | 2307 | ||
| 2312 | The lowest level functions for command input are those that read a | 2308 | The lowest level functions for command input are @code{read-event}, |
| 2313 | single event. | 2309 | @code{read-char}, and @code{read-char-exclusive}. |
| 2314 | |||
| 2315 | None of the three functions below suppresses quitting. | ||
| 2316 | 2310 | ||
| 2317 | @defun read-event &optional prompt inherit-input-method seconds | 2311 | @defun read-event &optional prompt inherit-input-method seconds |
| 2318 | This function reads and returns the next event of command input, waiting | 2312 | This function reads and returns the next event of command input, waiting |
| @@ -2409,11 +2403,31 @@ user generates an event which is not a character, | |||
| 2409 | gets a character. The arguments work as in @code{read-event}. | 2403 | gets a character. The arguments work as in @code{read-event}. |
| 2410 | @end defun | 2404 | @end defun |
| 2411 | 2405 | ||
| 2406 | None of the above functions suppress quitting. | ||
| 2407 | |||
| 2412 | @defvar num-nonmacro-input-events | 2408 | @defvar num-nonmacro-input-events |
| 2413 | This variable holds the total number of input events received so far | 2409 | This variable holds the total number of input events received so far |
| 2414 | from the terminal---not counting those generated by keyboard macros. | 2410 | from the terminal---not counting those generated by keyboard macros. |
| 2415 | @end defvar | 2411 | @end defvar |
| 2416 | 2412 | ||
| 2413 | We emphasize that, unlike @code{read-key-sequence}, the functions | ||
| 2414 | @code{read-event}, @code{read-char}, and @code{read-char-exclusive} do | ||
| 2415 | not perform the translations described in @ref{Translation Keymaps}. | ||
| 2416 | If you wish to read a single key taking these translations into | ||
| 2417 | account, use the function @code{read-key}: | ||
| 2418 | |||
| 2419 | @defun read-key &optional prompt | ||
| 2420 | This function reads a single key. It is ``intermediate'' between | ||
| 2421 | @code{read-key-sequence} and @code{read-event}. Unlike the former, it | ||
| 2422 | reads a single key, not a key sequence. Unlike the latter, it does | ||
| 2423 | not return a raw event, but decodes and translates the user input | ||
| 2424 | according to @code{input-decode-map}, @code{local-function-key-map}, | ||
| 2425 | and @code{key-translation-map} (@pxref{Translation Keymaps}). | ||
| 2426 | |||
| 2427 | The argument @var{prompt} is either a string to be displayed in the | ||
| 2428 | echo area as a prompt, or @code{nil}, meaning not to display a prompt. | ||
| 2429 | @end defun | ||
| 2430 | |||
| 2417 | @node Event Mod | 2431 | @node Event Mod |
| 2418 | @subsection Modifying and Translating Input Events | 2432 | @subsection Modifying and Translating Input Events |
| 2419 | 2433 | ||
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 96f963f5d1a..ed90db38614 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -649,7 +649,6 @@ Minibuffers | |||
| 649 | Completion | 649 | Completion |
| 650 | 650 | ||
| 651 | * Basic Completion:: Low-level functions for completing strings. | 651 | * Basic Completion:: Low-level functions for completing strings. |
| 652 | (These are too low level to use the minibuffer.) | ||
| 653 | * Minibuffer Completion:: Invoking the minibuffer with completion. | 652 | * Minibuffer Completion:: Invoking the minibuffer with completion. |
| 654 | * Completion Commands:: Minibuffer commands that do completion. | 653 | * Completion Commands:: Minibuffer commands that do completion. |
| 655 | * High-Level Completion:: Convenient special cases of completion | 654 | * High-Level Completion:: Convenient special cases of completion |
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 9e6834383ae..37e8726592a 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -1197,7 +1197,7 @@ was first made obsolete---for example, a date or a release number. | |||
| 1197 | @end defun | 1197 | @end defun |
| 1198 | 1198 | ||
| 1199 | You can define a function as an alias and declare it obsolete at the | 1199 | You can define a function as an alias and declare it obsolete at the |
| 1200 | same time using the macro @code{define-obsolete-function-alias}. | 1200 | same time using the macro @code{define-obsolete-function-alias}: |
| 1201 | 1201 | ||
| 1202 | @defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring | 1202 | @defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring |
| 1203 | This macro marks the function @var{obsolete-name} obsolete and also | 1203 | This macro marks the function @var{obsolete-name} obsolete and also |
| @@ -1210,6 +1210,33 @@ equivalent to the following: | |||
| 1210 | @end example | 1210 | @end example |
| 1211 | @end defmac | 1211 | @end defmac |
| 1212 | 1212 | ||
| 1213 | In addition, you can mark a certain a particular calling convention | ||
| 1214 | for a function as obsolete: | ||
| 1215 | |||
| 1216 | @defun set-advertised-calling-convention function signature | ||
| 1217 | This function specifies the argument list @var{signature} as the | ||
| 1218 | correct way to call @var{function}. This causes the Emacs byte | ||
| 1219 | compiler to issue a warning whenever it comes across an Emacs Lisp | ||
| 1220 | program that calls @var{function} any other way (however, it will | ||
| 1221 | still allow the code to be byte compiled). | ||
| 1222 | |||
| 1223 | For instance, in old versions of Emacs the @code{sit-for} function | ||
| 1224 | accepted three arguments, like this | ||
| 1225 | |||
| 1226 | @smallexample | ||
| 1227 | (sit-for seconds milliseconds nodisp) | ||
| 1228 | @end smallexample | ||
| 1229 | |||
| 1230 | However, calling @code{sit-for} this way is considered obsolete | ||
| 1231 | (@pxref{Waiting}). The old calling convention is deprecated like | ||
| 1232 | this: | ||
| 1233 | |||
| 1234 | @smallexample | ||
| 1235 | (set-advertised-calling-convention | ||
| 1236 | 'sit-for '(seconds &optional nodisp)) | ||
| 1237 | @end smallexample | ||
| 1238 | @end defun | ||
| 1239 | |||
| 1213 | @node Inline Functions | 1240 | @node Inline Functions |
| 1214 | @section Inline Functions | 1241 | @section Inline Functions |
| 1215 | @cindex inline functions | 1242 | @cindex inline functions |
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 45335c29839..d01d4d1ef26 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -626,7 +626,6 @@ for reading certain kinds of names with completion. | |||
| 626 | 626 | ||
| 627 | @menu | 627 | @menu |
| 628 | * Basic Completion:: Low-level functions for completing strings. | 628 | * Basic Completion:: Low-level functions for completing strings. |
| 629 | (These are too low level to use the minibuffer.) | ||
| 630 | * Minibuffer Completion:: Invoking the minibuffer with completion. | 629 | * Minibuffer Completion:: Invoking the minibuffer with completion. |
| 631 | * Completion Commands:: Minibuffer commands that do completion. | 630 | * Completion Commands:: Minibuffer commands that do completion. |
| 632 | * High-Level Completion:: Convenient special cases of completion | 631 | * High-Level Completion:: Convenient special cases of completion |
| @@ -640,31 +639,23 @@ for reading certain kinds of names with completion. | |||
| 640 | @node Basic Completion | 639 | @node Basic Completion |
| 641 | @subsection Basic Completion Functions | 640 | @subsection Basic Completion Functions |
| 642 | 641 | ||
| 643 | The completion functions @code{try-completion}, | 642 | The following completion functions have nothing in themselves to do |
| 644 | @code{all-completions} and @code{test-completion} have nothing in | 643 | with minibuffers. We describe them here to keep them near the |
| 645 | themselves to do with minibuffers. We describe them in this chapter | 644 | higher-level completion features that do use the minibuffer. |
| 646 | so as to keep them near the higher-level completion features that do | ||
| 647 | use the minibuffer. | ||
| 648 | |||
| 649 | If you store a completion alist in a variable, you should mark the | ||
| 650 | variable as ``risky'' with a non-@code{nil} | ||
| 651 | @code{risky-local-variable} property. | ||
| 652 | 645 | ||
| 653 | @defun try-completion string collection &optional predicate | 646 | @defun try-completion string collection &optional predicate |
| 654 | This function returns the longest common substring of all possible | 647 | This function returns the longest common substring of all possible |
| 655 | completions of @var{string} in @var{collection}. The value of | 648 | completions of @var{string} in @var{collection}. The value of |
| 656 | @var{collection} must be a list of strings or symbols, an alist, an | 649 | @var{collection} must be a list of strings or symbols, an alist, an |
| 657 | obarray, a hash table, or a function that implements a virtual set of | 650 | obarray, a hash table, or a completion function (@pxref{Programmed |
| 658 | strings (see below). | 651 | Completion}). |
| 659 | 652 | ||
| 660 | Completion compares @var{string} against each of the permissible | 653 | Completion compares @var{string} against each of the permissible |
| 661 | completions specified by @var{collection}; if the beginning of the | 654 | completions specified by @var{collection}. If no permissible |
| 662 | permissible completion equals @var{string}, it matches. If no permissible | 655 | completions match, @code{try-completion} returns @code{nil}. If there |
| 663 | completions match, @code{try-completion} returns @code{nil}. If only | 656 | is just one matching completion, and the match is exact, it returns |
| 664 | one permissible completion matches, and the match is exact, then | 657 | @code{t}. Otherwise, it returns the longest initial sequence common |
| 665 | @code{try-completion} returns @code{t}. Otherwise, the value is the | 658 | to all possible matching completions. |
| 666 | longest initial sequence common to all the permissible completions that | ||
| 667 | match. | ||
| 668 | 659 | ||
| 669 | If @var{collection} is an alist (@pxref{Association Lists}), the | 660 | If @var{collection} is an alist (@pxref{Association Lists}), the |
| 670 | permissible completions are the elements of the alist that are either | 661 | permissible completions are the elements of the alist that are either |
| @@ -688,13 +679,13 @@ Also, you cannot intern a given symbol in more than one obarray. | |||
| 688 | If @var{collection} is a hash table, then the keys that are strings | 679 | If @var{collection} is a hash table, then the keys that are strings |
| 689 | are the possible completions. Other keys are ignored. | 680 | are the possible completions. Other keys are ignored. |
| 690 | 681 | ||
| 691 | You can also use a symbol that is a function as @var{collection}. Then | 682 | You can also use a symbol that is a function as @var{collection}. |
| 692 | the function is solely responsible for performing completion; | 683 | Then the function is solely responsible for performing completion; |
| 693 | @code{try-completion} returns whatever this function returns. The | 684 | @code{try-completion} returns whatever this function returns. The |
| 694 | function is called with three arguments: @var{string}, @var{predicate} | 685 | function is called with three arguments: @var{string}, @var{predicate} |
| 695 | and @code{nil}. (The reason for the third argument is so that the same | 686 | and @code{nil} (the reason for the third argument is so that the same |
| 696 | function can be used in @code{all-completions} and do the appropriate | 687 | function can be used in @code{all-completions} and do the appropriate |
| 697 | thing in either case.) @xref{Programmed Completion}. | 688 | thing in either case). @xref{Programmed Completion}. |
| 698 | 689 | ||
| 699 | If the argument @var{predicate} is non-@code{nil}, then it must be a | 690 | If the argument @var{predicate} is non-@code{nil}, then it must be a |
| 700 | function of one argument, unless @var{collection} is a hash table, in | 691 | function of one argument, unless @var{collection} is a hash table, in |
| @@ -823,6 +814,10 @@ the values @var{string}, @var{predicate} and @code{lambda}; whatever | |||
| 823 | it returns, @code{test-completion} returns in turn. | 814 | it returns, @code{test-completion} returns in turn. |
| 824 | @end defun | 815 | @end defun |
| 825 | 816 | ||
| 817 | If you store a completion alist in a variable, you should mark the | ||
| 818 | variable as ``risky'' with a non-@code{nil} | ||
| 819 | @code{risky-local-variable} property. @xref{File Local Variables}. | ||
| 820 | |||
| 826 | @defvar completion-ignore-case | 821 | @defvar completion-ignore-case |
| 827 | If the value of this variable is non-@code{nil}, Emacs does not | 822 | If the value of this variable is non-@code{nil}, Emacs does not |
| 828 | consider case significant in completion. Note, however, that this | 823 | consider case significant in completion. Note, however, that this |
| @@ -855,6 +850,23 @@ Here is an example of use: | |||
| 855 | @end smallexample | 850 | @end smallexample |
| 856 | @end defmac | 851 | @end defmac |
| 857 | 852 | ||
| 853 | The function @code{completion-in-region} provides a convenient way to | ||
| 854 | perform completion on an arbitrary stretch of text in an Emacs buffer: | ||
| 855 | |||
| 856 | @defun completion-in-region start end collection &optional predicate | ||
| 857 | This function completes the text in the current buffer between the | ||
| 858 | positions @var{start} and @var{end}, using @var{collection}. The | ||
| 859 | argument @var{collection} has the same meaning as in | ||
| 860 | @code{try-completion} (@pxref{Basic Completion}). | ||
| 861 | |||
| 862 | This function inserts the completion text directly into the current | ||
| 863 | buffer. Unlike @code{completing-read} (@pxref{Minibuffer | ||
| 864 | Completion}), it does not activate the minibuffer. | ||
| 865 | |||
| 866 | For this function to work, point must be somewhere between @var{start} | ||
| 867 | and @var{end}. | ||
| 868 | @end defun | ||
| 869 | |||
| 858 | @node Minibuffer Completion | 870 | @node Minibuffer Completion |
| 859 | @subsection Completion and the Minibuffer | 871 | @subsection Completion and the Minibuffer |
| 860 | @cindex minibuffer completion | 872 | @cindex minibuffer completion |
| @@ -869,12 +881,12 @@ providing completion. It activates the minibuffer with prompt | |||
| 869 | @var{prompt}, which must be a string. | 881 | @var{prompt}, which must be a string. |
| 870 | 882 | ||
| 871 | The actual completion is done by passing @var{collection} and | 883 | The actual completion is done by passing @var{collection} and |
| 872 | @var{predicate} to the function @code{try-completion}. This happens | 884 | @var{predicate} to the function @code{try-completion} (@pxref{Basic |
| 873 | in certain commands bound in the local keymaps used for completion. | 885 | Completion}). This happens in certain commands bound in the local |
| 874 | Some of these commands also call @code{test-completion}. Thus, if | 886 | keymaps used for completion. Some of these commands also call |
| 875 | @var{predicate} is non-@code{nil}, it should be compatible with | 887 | @code{test-completion}. Thus, if @var{predicate} is non-@code{nil}, |
| 876 | @var{collection} and @code{completion-ignore-case}. @xref{Definition | 888 | it should be compatible with @var{collection} and |
| 877 | of test-completion}. | 889 | @code{completion-ignore-case}. @xref{Definition of test-completion}. |
| 878 | 890 | ||
| 879 | The value of the optional argument @var{require-match} determines how | 891 | The value of the optional argument @var{require-match} determines how |
| 880 | the user may exit the minibuffer: | 892 | the user may exit the minibuffer: |
| @@ -1603,8 +1615,10 @@ which performs completion according to the rules used in Emacs 21; and | |||
| 1603 | 1615 | ||
| 1604 | Sometimes it is not possible to create an alist or an obarray | 1616 | Sometimes it is not possible to create an alist or an obarray |
| 1605 | containing all the intended possible completions. In such a case, you | 1617 | containing all the intended possible completions. In such a case, you |
| 1606 | can supply your own function to compute the completion of a given string. | 1618 | can supply your own function to compute the completion of a given |
| 1607 | This is called @dfn{programmed completion}. | 1619 | string. This is called @dfn{programmed completion}. Emacs uses |
| 1620 | programmed completion when completing file names (@pxref{File Name | ||
| 1621 | Completion}). | ||
| 1608 | 1622 | ||
| 1609 | To use this feature, pass a symbol with a function definition as the | 1623 | To use this feature, pass a symbol with a function definition as the |
| 1610 | @var{collection} argument to @code{completing-read}. The function | 1624 | @var{collection} argument to @code{completing-read}. The function |
| @@ -1659,9 +1673,6 @@ unreliable to treat one differently just because it is also a possible | |||
| 1659 | function. So you must arrange for any function you wish to use for | 1673 | function. So you must arrange for any function you wish to use for |
| 1660 | completion to be encapsulated in a symbol. | 1674 | completion to be encapsulated in a symbol. |
| 1661 | 1675 | ||
| 1662 | Emacs uses programmed completion when completing file names. | ||
| 1663 | @xref{File Name Completion}. | ||
| 1664 | |||
| 1665 | @defun completion-table-dynamic function | 1676 | @defun completion-table-dynamic function |
| 1666 | This function is a convenient way to write a function that can act as | 1677 | This function is a convenient way to write a function that can act as |
| 1667 | programmed completion function. The argument @var{function} should be | 1678 | programmed completion function. The argument @var{function} should be |
| @@ -1671,6 +1682,19 @@ possible completions of it. You can think of | |||
| 1671 | and the interface for programmed completion functions. | 1682 | and the interface for programmed completion functions. |
| 1672 | @end defun | 1683 | @end defun |
| 1673 | 1684 | ||
| 1685 | @defvar completion-annotate-function | ||
| 1686 | The value of this variable, if non-@code{nil}, should be a function | ||
| 1687 | for ``annotating'' the entries in the @samp{*Completions*} buffer. | ||
| 1688 | The function should accept a single argument, the completion string | ||
| 1689 | for an entry. It should return an additional string to display next | ||
| 1690 | to that entry in the @samp{*Completions*} buffer, or @code{nil} if no | ||
| 1691 | additional string is to be displayed. | ||
| 1692 | |||
| 1693 | The function can determine the collection used for the current | ||
| 1694 | completion via the variable @code{minibuffer-completion-table} | ||
| 1695 | (@pxref{Completion Commands}). | ||
| 1696 | @end defvar | ||
| 1697 | |||
| 1674 | @node Yes-or-No Queries | 1698 | @node Yes-or-No Queries |
| 1675 | @section Yes-or-No Queries | 1699 | @section Yes-or-No Queries |
| 1676 | @cindex asking the user questions | 1700 | @cindex asking the user questions |
| @@ -437,6 +437,7 @@ System (CLOS). It is used by the other CEDET packages. | |||
| 437 | --- | 437 | --- |
| 438 | ** mpc.el is a front end for the Music Player Daemon. Run it with M-x mpc. | 438 | ** mpc.el is a front end for the Music Player Daemon. Run it with M-x mpc. |
| 439 | 439 | ||
| 440 | +++ | ||
| 440 | ** htmlfontify.el turns a fontified Emacs buffer into an HTML page. | 441 | ** htmlfontify.el turns a fontified Emacs buffer into an HTML page. |
| 441 | 442 | ||
| 442 | +++ | 443 | +++ |
| @@ -488,6 +489,7 @@ key binding to toggle image display. | |||
| 488 | ** All the default-FOO variables that hold the default value of the FOO | 489 | ** All the default-FOO variables that hold the default value of the FOO |
| 489 | variable, are now declared obsolete. | 490 | variable, are now declared obsolete. |
| 490 | 491 | ||
| 492 | +++ | ||
| 491 | ** read-key is a function halfway between read-event and read-key-sequence. | 493 | ** read-key is a function halfway between read-event and read-key-sequence. |
| 492 | It reads a single key, but obeys input and escape sequence decoding. | 494 | It reads a single key, but obeys input and escape sequence decoding. |
| 493 | 495 | ||
| @@ -500,18 +502,18 @@ This maximizes the frame. | |||
| 500 | virtual desktops. | 502 | virtual desktops. |
| 501 | 503 | ||
| 502 | ** Completion changes | 504 | ** Completion changes |
| 503 | 505 | --- | |
| 504 | *** completion-base-size is obsoleted by completion-base-position. | 506 | *** completion-base-size is obsoleted by completion-base-position. |
| 505 | This change causes a few backward incompatibilities, mostly with | 507 | This change causes a few backward incompatibilities, mostly with |
| 506 | choose-completion-string-functions where the `mini-p' argument has | 508 | choose-completion-string-functions where the `mini-p' argument has |
| 507 | been replaced by a `base-position' argument, and where the `base-size' | 509 | been replaced by a `base-position' argument, and where the `base-size' |
| 508 | argument is now always nil. | 510 | argument is now always nil. |
| 509 | 511 | +++ | |
| 510 | *** New function `completion-in-region' to use the standard completion | 512 | *** New function `completion-in-region' to use the standard completion |
| 511 | facilities on a particular region of text. | 513 | facilities on a particular region of text. |
| 512 | +++ | 514 | +++ |
| 513 | *** The 4th arg to all-completions (aka hide-spaces) is declared obsolete. | 515 | *** The 4th arg to all-completions (aka hide-spaces) is declared obsolete. |
| 514 | 516 | +++ | |
| 515 | *** completion-annotate-function specifies how to compute annotations | 517 | *** completion-annotate-function specifies how to compute annotations |
| 516 | for completions displayed in *Completions*. | 518 | for completions displayed in *Completions*. |
| 517 | 519 | ||
| @@ -528,9 +530,11 @@ any more. | |||
| 528 | +++ | 530 | +++ |
| 529 | *** New function `copy-directory', which copies a directory recursively. | 531 | *** New function `copy-directory', which copies a directory recursively. |
| 530 | 532 | ||
| 533 | +++ | ||
| 531 | ** called-interactively-p now takes one argument and replaces interactive-p | 534 | ** called-interactively-p now takes one argument and replaces interactive-p |
| 532 | which is now marked obsolete. | 535 | which is now marked obsolete. |
| 533 | 536 | ||
| 537 | +++ | ||
| 534 | ** New function set-advertised-calling-convention makes it possible | 538 | ** New function set-advertised-calling-convention makes it possible |
| 535 | to obsolete arguments as well as make some arguments mandatory. | 539 | to obsolete arguments as well as make some arguments mandatory. |
| 536 | 540 | ||