aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2012-02-15 20:11:06 +0100
committerJoakim Verona2012-02-15 20:11:06 +0100
commit61a7b858618b498f85b98d8ba312a34e2315dcea (patch)
treebea05440a546e6f07cdaaba644397d7f0e04f099
parent02db17e53bf46c91b2cb8ee33b43d8ae252a1681 (diff)
parent60236b0dca0416202da5c3e39564b85b2ae3c9fa (diff)
downloademacs-61a7b858618b498f85b98d8ba312a34e2315dcea.tar.gz
emacs-61a7b858618b498f85b98d8ba312a34e2315dcea.zip
upstream
-rw-r--r--admin/FOR-RELEASE2
-rw-r--r--doc/emacs/ChangeLog4
-rw-r--r--doc/emacs/ack.texi2
-rw-r--r--doc/emacs/sending.texi4
-rw-r--r--doc/lispref/ChangeLog28
-rw-r--r--doc/lispref/elisp.texi1
-rw-r--r--doc/lispref/keymaps.texi211
-rw-r--r--doc/lispref/macros.texi2
-rw-r--r--doc/lispref/minibuf.texi147
-rw-r--r--doc/lispref/modes.texi53
-rw-r--r--doc/lispref/processes.texi87
-rw-r--r--doc/lispref/variables.texi2
-rw-r--r--doc/lispref/vol1.texi1
-rw-r--r--doc/lispref/vol2.texi1
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/smtpmail.texi211
-rw-r--r--etc/NEWS38
-rw-r--r--lisp/ChangeLog31
-rw-r--r--lisp/custom.el6
-rw-r--r--lisp/gnus/ChangeLog10
-rw-r--r--lisp/gnus/shr.el5
-rw-r--r--lisp/mail/smtpmail.el45
-rw-r--r--lisp/minibuffer.el8
-rw-r--r--lisp/net/gnutls.el1
-rw-r--r--lisp/org/ChangeLog4
-rw-r--r--lisp/org/org-footnote.el6
-rw-r--r--lisp/shell.el5
-rw-r--r--lisp/url/ChangeLog10
-rw-r--r--lisp/url/url-future.el2
-rw-r--r--lisp/url/url-queue.el16
-rw-r--r--src/ChangeLog10
-rw-r--r--src/eval.c49
-rw-r--r--src/image.c2
33 files changed, 637 insertions, 372 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 75103ff3cec..f2c572cfd17 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -204,7 +204,7 @@ hooks.texi
204index.texi 204index.texi
205internals.texi 205internals.texi
206intro.texi cyd 206intro.texi cyd
207keymaps.texi 207keymaps.texi cyd
208lists.texi cyd 208lists.texi cyd
209loading.texi cyd 209loading.texi cyd
210locals.texi 210locals.texi
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index b24c6946281..0b6178d6195 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,7 @@
12012-02-15 Glenn Morris <rgm@gnu.org>
2
3 * sending.texi (Mail Sending): smtpmail-auth-credentials was removed.
4
12012-02-12 Glenn Morris <rgm@gnu.org> 52012-02-12 Glenn Morris <rgm@gnu.org>
2 6
3 * ack.texi (Acknowledgments): 7 * ack.texi (Acknowledgments):
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi
index 5afbb9b1442..77ee97b361e 100644
--- a/doc/emacs/ack.texi
+++ b/doc/emacs/ack.texi
@@ -1250,7 +1250,7 @@ Daiki Ueno wrote @file{starttls.el}, support for Transport Layer
1250Security protocol; @file{sasl-cram.el} and @file{sasl-digest.el} (with 1250Security protocol; @file{sasl-cram.el} and @file{sasl-digest.el} (with
1251Kenichi Okada), and @file{sasl.el}, support for Simple Authentication 1251Kenichi Okada), and @file{sasl.el}, support for Simple Authentication
1252and Security Layer (SASL); @file{plstore.el} for secure storage of 1252and Security Layer (SASL); @file{plstore.el} for secure storage of
1253propery lists; and the EasyPG (and its predecessor PGG) 1253property lists; and the EasyPG (and its predecessor PGG)
1254package, for GnuPG and PGP support. 1254package, for GnuPG and PGP support.
1255 1255
1256@item 1256@item
diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi
index 6f154ce2af6..a2cb5d9f8f2 100644
--- a/doc/emacs/sending.texi
+++ b/doc/emacs/sending.texi
@@ -377,8 +377,8 @@ sending mail via @code{smtpmail-send-it} (see below).
377Send mail using the through an external mail host, such as your 377Send mail using the through an external mail host, such as your
378Internet service provider's outgoing SMTP mail server. If you have 378Internet service provider's outgoing SMTP mail server. If you have
379not told Emacs how to contact the SMTP server, it prompts for this 379not told Emacs how to contact the SMTP server, it prompts for this
380information, which is saved in the variables 380information, which is saved in the @code{smtpmail-smtp-server} variable
381@code{smtpmail-smtp-server} and @code{smtpmail-auth-credentials}. 381and the file @file{~/.authinfo}.
382@xref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}. 382@xref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}.
383 383
384@item sendmail-send-it 384@item sendmail-send-it
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index c5848ca8b2d..1e369f3b627 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,31 @@
12012-02-15 Chong Yidong <cyd@gnu.org>
2
3 * minibuf.texi (Basic Completion): Define "completion table".
4 Move completion-in-region to Completion in Buffers node.
5 (Completion Commands): Use "completion table" terminology.
6 (Completion in Buffers): New node.
7
8 * modes.texi (Hooks): add-hook can be used for abnormal hooks too.
9 (Setting Hooks): Update minor mode usage example.
10 (Major Mode Conventions): Note that completion-at-point-functions
11 should be altered locally. Add xref to Completion in Buffers.
12
132012-02-15 Glenn Morris <rgm@gnu.org>
14
15 * processes.texi (Network): Document open-network-stream :parameters.
16
172012-02-14 Chong Yidong <cyd@gnu.org>
18
19 * keymaps.texi (Format of Keymaps): The CACHE component of keymaps
20 was removed on 2009-09-10. Update lisp-mode-map example.
21 (Inheritance and Keymaps): Minor clarification.
22 (Searching Keymaps): Remove out-of-place enumeration.
23 (Key Lookup): Remove unnecessary example (one was already given in
24 Format of Keymaps).
25 (Changing Key Bindings): Update suppress-keymap example.
26 (Menu Bar, Tool Bar): Copyedits.
27 (Tool Bar): Update tool-bar-map example.
28
12012-02-12 Chong Yidong <cyd@gnu.org> 292012-02-12 Chong Yidong <cyd@gnu.org>
2 30
3 * debugging.texi (Debugger Commands): Continuing is now allowed 31 * debugging.texi (Debugger Commands): Continuing is now allowed
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 42c3613dd0b..5dd8994f439 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -654,6 +654,7 @@ Completion
654 shell commands. 654 shell commands.
655* Completion Styles:: Specifying rules for performing completion. 655* Completion Styles:: Specifying rules for performing completion.
656* Programmed Completion:: Writing your own completion-function. 656* Programmed Completion:: Writing your own completion-function.
657* Completion in Buffers:: Completing text in ordinary buffers.
657 658
658Command Loop 659Command Loop
659 660
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index a8528a548fc..5652d94114e 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -173,13 +173,11 @@ ordinary binding applies to events of a particular @dfn{event type},
173which is always a character or a symbol. @xref{Classifying Events}. 173which is always a character or a symbol. @xref{Classifying Events}.
174In this kind of binding, @var{binding} is a command. 174In this kind of binding, @var{binding} is a command.
175 175
176@item (@var{type} @var{item-name} @r{[}@var{cache}@r{]} .@: @var{binding}) 176@item (@var{type} @var{item-name} .@: @var{binding})
177This specifies a binding which is also a simple menu item that 177This specifies a binding which is also a simple menu item that
178displays as @var{item-name} in the menu. @var{cache}, if present, 178displays as @var{item-name} in the menu. @xref{Simple Menu Items}.
179caches certain information for display in the menu. @xref{Simple Menu
180Items}.
181 179
182@item (@var{type} @var{item-name} @var{help-string} @r{[}@var{cache}@r{]} .@: @var{binding}) 180@item (@var{type} @var{item-name} @var{help-string} .@: @var{binding})
183This is a simple menu item with help string @var{help-string}. 181This is a simple menu item with help string @var{help-string}.
184 182
185@item (@var{type} menu-item .@: @var{details}) 183@item (@var{type} menu-item .@: @var{details})
@@ -234,8 +232,9 @@ other input events; thus, @kbd{M-@key{end}} has nothing to do with
234@kbd{@key{ESC} @key{end}}. 232@kbd{@key{ESC} @key{end}}.
235 233
236 Here as an example is the local keymap for Lisp mode, a sparse 234 Here as an example is the local keymap for Lisp mode, a sparse
237keymap. It defines bindings for @key{DEL} and @key{TAB}, plus @kbd{C-c 235keymap. It defines bindings for @key{DEL}, @kbd{C-c C-z},
238C-l}, @kbd{M-C-q}, and @kbd{M-C-x}. 236@kbd{C-M-q}, and @kbd{C-M-x} (the actual value also contains a menu
237binding, which is omitted here for the sake of brevity).
239 238
240@example 239@example
241@group 240@group
@@ -250,11 +249,8 @@ lisp-mode-map
250@end group 249@end group
251@group 250@group
252 (27 keymap 251 (27 keymap
253 ;; @r{@kbd{M-C-x}, treated as @kbd{@key{ESC} C-x}} 252 ;; @r{@kbd{C-M-x}, treated as @kbd{@key{ESC} C-x}}
254 (24 . lisp-send-defun) 253 (24 . lisp-send-defun))
255 keymap
256 ;; @r{@kbd{M-C-q}, treated as @kbd{@key{ESC} C-q}}
257 (17 . indent-sexp))
258@end group 254@end group
259@group 255@group
260 ;; @r{This part is inherited from @code{lisp-mode-shared-map}.} 256 ;; @r{This part is inherited from @code{lisp-mode-shared-map}.}
@@ -264,9 +260,8 @@ lisp-mode-map
264@end group 260@end group
265@group 261@group
266 (27 keymap 262 (27 keymap
267 ;; @r{@kbd{M-C-q}, treated as @kbd{@key{ESC} C-q}} 263 ;; @r{@kbd{C-M-q}, treated as @kbd{@key{ESC} C-q}}
268 (17 . indent-sexp)) 264 (17 . indent-sexp)))
269 (9 . lisp-indent-line))
270@end group 265@end group
271@end example 266@end example
272 267
@@ -441,10 +436,10 @@ This function returns a new keymap composed of the existing keymap(s)
441@var{maps}, and optionally inheriting from a parent keymap 436@var{maps}, and optionally inheriting from a parent keymap
442@var{parent}. @var{maps} can be a single keymap or a list of more 437@var{parent}. @var{maps} can be a single keymap or a list of more
443than one. When looking up a key in the resulting new map, Emacs 438than one. When looking up a key in the resulting new map, Emacs
444searches in each of the @var{maps}, and then in @var{parent}, stopping 439searches in each of the @var{maps} in turn, and then in @var{parent},
445at the first match. A @code{nil} binding in any one of @var{maps} 440stopping at the first match. A @code{nil} binding in any one of
446overrides any binding in @var{parent}, but not a non-@code{nil} binding 441@var{maps} overrides any binding in @var{parent}, but it does not
447in any other of the @var{maps}. 442override any non-@code{nil} binding in any other of the @var{maps}.
448@end defun 443@end defun
449 444
450@noindent For example, here is how Emacs sets the parent of 445@noindent For example, here is how Emacs sets the parent of
@@ -762,35 +757,23 @@ them:
762@end lisp 757@end lisp
763 758
764@noindent 759@noindent
765The @var{find-in} and @var{find-in-any} are pseudo functions that 760@var{find-in} and @var{find-in-any} are pseudo functions that search
766search in one keymap and in an alist of keymaps, respectively. 761in one keymap and in an alist of keymaps, respectively. (Searching a
767(Searching a single keymap for a binding is called @dfn{key lookup}; 762single keymap for a binding is called @dfn{key lookup}; see @ref{Key
768see @ref{Key Lookup}.) If the key sequence starts with a mouse event, 763Lookup}.) If the key sequence starts with a mouse event, or a
769or a symbolic prefix event followed by a mouse event, that event's 764symbolic prefix event followed by a mouse event, that event's position
770position is used instead of point and the current buffer. Mouse 765is used instead of point and the current buffer. Mouse events on an
771events on an embedded string use non-@code{nil} text properties from 766embedded string use non-@code{nil} text properties from that string
772that string instead of the buffer. 767instead of the buffer.
773 768
774@enumerate 769 When a match is found (@pxref{Key Lookup}), if the binding in the
775@item
776The function finally found may be remapped
777(@pxref{Remapping Commands}).
778
779@item
780Characters that are bound to @code{self-insert-command} are translated
781according to @code{translation-table-for-input} before insertion.
782
783@item
784@code{current-active-maps} returns a list of the
785currently active keymaps at point.
786
787@item
788When a match is found (@pxref{Key Lookup}), if the binding in the
789keymap is a function, the search is over. However if the keymap entry 770keymap is a function, the search is over. However if the keymap entry
790is a symbol with a value or a string, Emacs replaces the input key 771is a symbol with a value or a string, Emacs replaces the input key
791sequences with the variable's value or the string, and restarts the 772sequences with the variable's value or the string, and restarts the
792search of the active keymaps. 773search of the active keymaps.
793@end enumerate 774
775 The function finally found might also be remapped. @xref{Remapping
776Commands}.
794 777
795@node Controlling Active Maps 778@node Controlling Active Maps
796@section Controlling the Active Keymaps 779@section Controlling the Active Keymaps
@@ -1088,21 +1071,9 @@ lookup form a complete key, and the object is its binding, but the
1088binding is not executable as a command. 1071binding is not executable as a command.
1089@end table 1072@end table
1090 1073
1091 In short, a keymap entry may be a keymap, a command, a keyboard macro, 1074 In short, a keymap entry may be a keymap, a command, a keyboard
1092a symbol that leads to one of them, or an indirection or @code{nil}. 1075macro, a symbol that leads to one of them, or an indirection or
1093Here is an example of a sparse keymap with two characters bound to 1076@code{nil}.
1094commands and one bound to another keymap. This map is the normal value
1095of @code{emacs-lisp-mode-map}. Note that 9 is the code for @key{TAB},
1096127 for @key{DEL}, 27 for @key{ESC}, 17 for @kbd{C-q} and 24 for
1097@kbd{C-x}.
1098
1099@example
1100@group
1101(keymap (9 . lisp-indent-line)
1102 (127 . backward-delete-char-untabify)
1103 (27 keymap (17 . indent-sexp) (24 . eval-defun)))
1104@end group
1105@end example
1106 1077
1107@node Functions for Key Lookup 1078@node Functions for Key Lookup
1108@section Functions for Key Lookup 1079@section Functions for Key Lookup
@@ -1472,23 +1443,21 @@ that is used for some other purpose is likely to cause trouble; for
1472example, suppressing @code{global-map} would make it impossible to use 1443example, suppressing @code{global-map} would make it impossible to use
1473most of Emacs. 1444most of Emacs.
1474 1445
1475Most often, @code{suppress-keymap} is used to initialize local 1446This function can be used to initialize the local keymap of a major
1476keymaps of modes such as Rmail and Dired where insertion of text is not 1447mode for which insertion of text is not desirable. But usually such a
1477desirable and the buffer is read-only. Here is an example taken from 1448mode should be derived from @code{special-mode} (@pxref{Basic Major
1478the file @file{emacs/lisp/dired.el}, showing how the local keymap for 1449Modes}); then its keymap will automatically inherit from
1479Dired mode is set up: 1450@code{special-mode-map}, which is already suppressed. Here is how
1451@code{special-mode-map} is defined:
1480 1452
1481@smallexample 1453@smallexample
1482@group 1454@group
1483(setq dired-mode-map (make-keymap)) 1455(defvar special-mode-map
1484(suppress-keymap dired-mode-map) 1456 (let ((map (make-sparse-keymap)))
1485(define-key dired-mode-map "r" 'dired-rename-file) 1457 (suppress-keymap map)
1486(define-key dired-mode-map "\C-d" 'dired-flag-file-deleted) 1458 (define-key map "q" 'quit-window)
1487(define-key dired-mode-map "d" 'dired-flag-file-deleted) 1459 @dots{}
1488(define-key dired-mode-map "v" 'dired-view-file) 1460 map))
1489(define-key dired-mode-map "e" 'dired-find-file)
1490(define-key dired-mode-map "f" 'dired-find-file)
1491@dots{}
1492@end group 1461@end group
1493@end smallexample 1462@end smallexample
1494@end defun 1463@end defun
@@ -2064,12 +2033,10 @@ event type (it doesn't matter what event type) to a binding like this:
2064@noindent 2033@noindent
2065The @sc{car}, @var{item-string}, is the string to be displayed in the 2034The @sc{car}, @var{item-string}, is the string to be displayed in the
2066menu. It should be short---preferably one to three words. It should 2035menu. It should be short---preferably one to three words. It should
2067describe the action of the command it corresponds to. Note that it is 2036describe the action of the command it corresponds to. Note that not
2068not generally possible to display non-@acronym{ASCII} text in menus. It will 2037all graphical toolkits can display non-@acronym{ASCII} text in menus
2069work for keyboard menus and will work to a large extent when Emacs is 2038(it will work for keyboard menus and will work to a large extent with
2070built with the Gtk+ toolkit.@footnote{In this case, the text is first 2039the GTK+ toolkit).
2071encoded using the @code{utf-8} coding system and then rendered by the
2072toolkit as it sees fit.}
2073 2040
2074 You can also supply a second string, called the help string, as follows: 2041 You can also supply a second string, called the help string, as follows:
2075 2042
@@ -2418,18 +2385,6 @@ this; @key{SPC} is the default.)
2418she should type the corresponding character---the one whose binding is 2385she should type the corresponding character---the one whose binding is
2419that alternative. 2386that alternative.
2420 2387
2421@ignore
2422In a menu intended for keyboard use, each menu item must clearly
2423indicate what character to type. The best convention to use is to make
2424the character the first letter of the item string---that is something
2425users will understand without being told. We plan to change this; by
2426the time you read this manual, keyboard menus may explicitly name the
2427key for each alternative.
2428@end ignore
2429
2430 This way of using menus in an Emacs-like editor was inspired by the
2431Hierarkey system.
2432
2433@defvar menu-prompt-more-char 2388@defvar menu-prompt-more-char
2434This variable specifies the character to use to ask to see 2389This variable specifies the character to use to ask to see
2435the next line of a menu. Its initial value is 32, the code 2390the next line of a menu. Its initial value is 32, the code
@@ -2512,21 +2467,17 @@ can do it this way:
2512@subsection The Menu Bar 2467@subsection The Menu Bar
2513@cindex menu bar 2468@cindex menu bar
2514 2469
2515 Most window systems allow each frame to have a @dfn{menu bar}---a 2470 On graphical displays, there is usually a @dfn{menu bar} at the top
2516permanently displayed menu stretching horizontally across the top of 2471of each frame. @xref{Menu Bars,,,emacs, The GNU Emacs Manual}. Menu
2517the frame. (In order for a frame to display a menu bar, its 2472bar items are subcommands of the fake ``function key''
2518@code{menu-bar-lines} parameter must be greater than zero. 2473@code{menu-bar}, as defined in the active keymaps.
2519@xref{Layout Parameters}.)
2520
2521 The items of the menu bar are the subcommands of the fake ``function
2522key'' @code{menu-bar}, as defined in the active keymaps.
2523 2474
2524 To add an item to the menu bar, invent a fake ``function key'' of your 2475 To add an item to the menu bar, invent a fake ``function key'' of your
2525own (let's call it @var{key}), and make a binding for the key sequence 2476own (let's call it @var{key}), and make a binding for the key sequence
2526@code{[menu-bar @var{key}]}. Most often, the binding is a menu keymap, 2477@code{[menu-bar @var{key}]}. Most often, the binding is a menu keymap,
2527so that pressing a button on the menu bar item leads to another menu. 2478so that pressing a button on the menu bar item leads to another menu.
2528 2479
2529 When more than one active keymap defines the same fake function key 2480 When more than one active keymap defines the same ``function key''
2530for the menu bar, the item appears just once. If the user clicks on 2481for the menu bar, the item appears just once. If the user clicks on
2531that menu bar item, it brings up a single, combined menu containing 2482that menu bar item, it brings up a single, combined menu containing
2532all the subcommands of that item---the global subcommands, the local 2483all the subcommands of that item---the global subcommands, the local
@@ -2541,11 +2492,6 @@ were @code{nil}. @xref{Active Keymaps}.
2541 2492
2542@example 2493@example
2543@group 2494@group
2544(modify-frame-parameters (selected-frame)
2545 '((menu-bar-lines . 2)))
2546@end group
2547
2548@group
2549;; @r{Make a menu keymap (with a prompt string)} 2495;; @r{Make a menu keymap (with a prompt string)}
2550;; @r{and make it the menu bar item's definition.} 2496;; @r{and make it the menu bar item's definition.}
2551(define-key global-map [menu-bar words] 2497(define-key global-map [menu-bar words]
@@ -2618,20 +2564,17 @@ that the command does not actually have, it is ignored.
2618@subsection Tool bars 2564@subsection Tool bars
2619@cindex tool bar 2565@cindex tool bar
2620 2566
2621 A @dfn{tool bar} is a row of icons at the top of a frame, that execute 2567 A @dfn{tool bar} is a row of clickable icons at the top of a frame,
2622commands when you click on them---in effect, a kind of graphical menu 2568just below the menu bar. @xref{Tool Bars,,,emacs, The GNU Emacs
2623bar. 2569Manual}.
2624
2625 The frame parameter @code{tool-bar-lines} (X resource @samp{toolBar})
2626controls how many lines' worth of height to reserve for the tool bar. A
2627zero value suppresses the tool bar. If the value is nonzero, and
2628@code{auto-resize-tool-bars} is non-@code{nil}, the tool bar expands and
2629contracts automatically as needed to hold the specified contents.
2630 2570
2631 If the value of @code{auto-resize-tool-bars} is @code{grow-only}, 2571 On each frame, the frame parameter @code{tool-bar-lines} controls
2632the tool bar expands automatically, but does not contract automatically. 2572how many lines' worth of height to reserve for the tool bar. A zero
2633To contract the tool bar, the user has to redraw the frame by entering 2573value suppresses the tool bar. If the value is nonzero, and
2634@kbd{C-l}. 2574@code{auto-resize-tool-bars} is non-@code{nil}, the tool bar expands
2575and contracts automatically as needed to hold the specified contents.
2576If the value is @code{grow-only}, the tool bar expands automatically,
2577but does not contract automatically.
2635 2578
2636 The tool bar contents are controlled by a menu keymap attached to a 2579 The tool bar contents are controlled by a menu keymap attached to a
2637fake ``function key'' called @code{tool-bar} (much like the way the menu 2580fake ``function key'' called @code{tool-bar} (much like the way the menu
@@ -2683,17 +2626,17 @@ button in disabled state by applying an edge-detection algorithm to the
2683image. 2626image.
2684 2627
2685The @code{:rtl} property specifies an alternative image to use for 2628The @code{:rtl} property specifies an alternative image to use for
2686right-to-left languages. Only the Gtk+ version of Emacs supports this 2629right-to-left languages. Only the GTK+ version of Emacs supports this
2687at present. 2630at present.
2688 2631
2689Like the menu bar, the tool bar can display separators (@pxref{Menu 2632Like the menu bar, the tool bar can display separators (@pxref{Menu
2690Separators}). Tool bar separators are vertical rather than 2633Separators}). Tool bar separators are vertical rather than
2691horizontal, though, and only a single style is supported. Separators 2634horizontal, though, and only a single style is supported. They are
2692are represented in the tool bar keymap in the same way as for the 2635represented in the tool bar keymap by @code{(menu-item "--")} entries;
2693menu bar, i.e. using a @code{(menu-item "--"}) entry. The Gtk+ and 2636properties like @code{:visible} are not supported for tool bar
2694Nextstep tool bars render separators natively, otherwise Emacs selects 2637separators. Separators are rendered natively in GTK+ and Nextstep
2695a separator image that is appropriate for the display. Note that tool 2638tool bars; in the other cases, they are rendered using an image of a
2696bar separators do not support any properties, such as @code{:visible}. 2639vertical line.
2697 2640
2698The default tool bar is defined so that items specific to editing do not 2641The default tool bar is defined so that items specific to editing do not
2699appear for major modes whose command symbol has a @code{mode-class} 2642appear for major modes whose command symbol has a @code{mode-class}
@@ -2706,18 +2649,20 @@ using an indirection through @code{tool-bar-map}.
2706 2649
2707@defvar tool-bar-map 2650@defvar tool-bar-map
2708By default, the global map binds @code{[tool-bar]} as follows: 2651By default, the global map binds @code{[tool-bar]} as follows:
2652
2709@example 2653@example
2710(global-set-key [tool-bar] 2654(global-set-key [tool-bar]
2711 '(menu-item "tool bar" ignore 2655 `(menu-item ,(purecopy "tool bar") ignore
2712 :filter (lambda (ignore) tool-bar-map))) 2656 :filter tool-bar-make-keymap))
2713@end example 2657@end example
2658
2714@noindent 2659@noindent
2715Thus the tool bar map is derived dynamically from the value of variable 2660The function @code{tool-bar-make-keymap}, in turn, derives the actual
2716@code{tool-bar-map} and you should normally adjust the default (global) 2661tool bar map dynamically from the value of the variable
2717tool bar by changing that map. Major modes may replace the global bar 2662@code{tool-bar-map}. Hence, you should normally adjust the default
2718completely by making @code{tool-bar-map} buffer-local and set to a 2663(global) tool bar by changing that map. Some major modes, such as
2719keymap containing only the desired items. Info mode provides an 2664Info mode, completely replace the global tool bar by making
2720example. 2665@code{tool-bar-map} buffer-local and setting it to a different keymap.
2721@end defvar 2666@end defvar
2722 2667
2723There are two convenience functions for defining tool bar items, as 2668There are two convenience functions for defining tool bar items, as
diff --git a/doc/lispref/macros.texi b/doc/lispref/macros.texi
index dca88d2b7c7..de9e1c405f0 100644
--- a/doc/lispref/macros.texi
+++ b/doc/lispref/macros.texi
@@ -605,7 +605,7 @@ either.
605 605
606 Within a macro definition, you can use the @code{declare} form 606 Within a macro definition, you can use the @code{declare} form
607(@pxref{Defining Macros}) to specify how to @key{TAB} should indent 607(@pxref{Defining Macros}) to specify how to @key{TAB} should indent
608calls to the macro. An indentation specifiction is written like this: 608calls to the macro. An indentation specification is written like this:
609 609
610@example 610@example
611(declare (indent @var{indent-spec})) 611(declare (indent @var{indent-spec}))
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index a71138f5268..1224d80fdf8 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -633,6 +633,7 @@ for reading certain kinds of names with completion.
633 shell commands. 633 shell commands.
634* Completion Styles:: Specifying rules for performing completion. 634* Completion Styles:: Specifying rules for performing completion.
635* Programmed Completion:: Writing your own completion-function. 635* Programmed Completion:: Writing your own completion-function.
636* Completion in Buffers:: Completing text in ordinary buffers.
636@end menu 637@end menu
637 638
638@node Basic Completion 639@node Basic Completion
@@ -644,10 +645,12 @@ higher-level completion features that do use the minibuffer.
644 645
645@defun try-completion string collection &optional predicate 646@defun try-completion string collection &optional predicate
646This function returns the longest common substring of all possible 647This function returns the longest common substring of all possible
647completions of @var{string} in @var{collection}. The value of 648completions of @var{string} in @var{collection}.
648@var{collection} must be a list of strings, an alist whose keys are 649
649strings or symbols, an obarray, a hash table, or a completion function 650@cindex completion table
650(@pxref{Programmed Completion}). 651The @var{collection} argument is called the @dfn{completion table}.
652Its value must be a list of strings, an alist whose keys are strings
653or symbols, an obarray, a hash table, or a completion function.
651 654
652Completion compares @var{string} against each of the permissible 655Completion compares @var{string} against each of the permissible
653completions specified by @var{collection}. If no permissible 656completions specified by @var{collection}. If no permissible
@@ -678,13 +681,13 @@ Also, you cannot intern a given symbol in more than one obarray.
678If @var{collection} is a hash table, then the keys that are strings 681If @var{collection} is a hash table, then the keys that are strings
679are the possible completions. Other keys are ignored. 682are the possible completions. Other keys are ignored.
680 683
681You can also use a function as @var{collection}. 684You can also use a function as @var{collection}. Then the function is
682Then the function is solely responsible for performing completion; 685solely responsible for performing completion; @code{try-completion}
683@code{try-completion} returns whatever this function returns. The 686returns whatever this function returns. The function is called with
684function is called with three arguments: @var{string}, @var{predicate} 687three arguments: @var{string}, @var{predicate} and @code{nil} (the
685and @code{nil} (the reason for the third argument is so that the same 688reason for the third argument is so that the same function can be used
686function can be used in @code{all-completions} and do the appropriate 689in @code{all-completions} and do the appropriate thing in either
687thing in either case). @xref{Programmed Completion}. 690case). @xref{Programmed Completion}.
688 691
689If the argument @var{predicate} is non-@code{nil}, then it must be a 692If the argument @var{predicate} is non-@code{nil}, then it must be a
690function of one argument, unless @var{collection} is a hash table, in 693function of one argument, unless @var{collection} is a hash table, in
@@ -862,30 +865,13 @@ proper value is done the first time you do completion using @var{var}.
862It is done by calling @var{fun} with no arguments. The 865It is done by calling @var{fun} with no arguments. The
863value @var{fun} returns becomes the permanent value of @var{var}. 866value @var{fun} returns becomes the permanent value of @var{var}.
864 867
865Here is an example of use: 868Here is a usage example:
866 869
867@smallexample 870@smallexample
868(defvar foo (lazy-completion-table foo make-my-alist)) 871(defvar foo (lazy-completion-table foo make-my-alist))
869@end smallexample 872@end smallexample
870@end defmac 873@end defmac
871 874
872The function @code{completion-in-region} provides a convenient way to
873perform completion on an arbitrary stretch of text in an Emacs buffer:
874
875@defun completion-in-region start end collection &optional predicate
876This function completes the text in the current buffer between the
877positions @var{start} and @var{end}, using @var{collection}. The
878argument @var{collection} has the same meaning as in
879@code{try-completion} (@pxref{Basic Completion}).
880
881This function inserts the completion text directly into the current
882buffer. Unlike @code{completing-read} (@pxref{Minibuffer
883Completion}), it does not activate the minibuffer.
884
885For this function to work, point must be somewhere between @var{start}
886and @var{end}.
887@end defun
888
889@node Minibuffer Completion 875@node Minibuffer Completion
890@subsection Completion and the Minibuffer 876@subsection Completion and the Minibuffer
891@cindex minibuffer completion 877@cindex minibuffer completion
@@ -899,13 +885,14 @@ This function reads a string in the minibuffer, assisting the user by
899providing completion. It activates the minibuffer with prompt 885providing completion. It activates the minibuffer with prompt
900@var{prompt}, which must be a string. 886@var{prompt}, which must be a string.
901 887
902The actual completion is done by passing @var{collection} and 888The actual completion is done by passing the completion table
903@var{predicate} to the function @code{try-completion} (@pxref{Basic 889@var{collection} and the completion predicate @var{predicate} to the
904Completion}). This happens in certain commands bound in the local 890function @code{try-completion} (@pxref{Basic Completion}). This
905keymaps used for completion. Some of these commands also call 891happens in certain commands bound in the local keymaps used for
906@code{test-completion}. Thus, if @var{predicate} is non-@code{nil}, 892completion. Some of these commands also call @code{test-completion}.
907it should be compatible with @var{collection} and 893Thus, if @var{predicate} is non-@code{nil}, it should be compatible
908@code{completion-ignore-case}. @xref{Definition of test-completion}. 894with @var{collection} and @code{completion-ignore-case}.
895@xref{Definition of test-completion}.
909 896
910The value of the optional argument @var{require-match} determines how 897The value of the optional argument @var{require-match} determines how
911the user may exit the minibuffer: 898the user may exit the minibuffer:
@@ -1005,10 +992,11 @@ They are described in the following section.
1005in the minibuffer to do completion. 992in the minibuffer to do completion.
1006 993
1007@defvar minibuffer-completion-table 994@defvar minibuffer-completion-table
1008The value of this variable is the collection used for completion in 995The value of this variable is the completion table used for completion
1009the minibuffer. This is the global variable that contains what 996in the minibuffer. This is the global variable that contains what
1010@code{completing-read} passes to @code{try-completion}. It is used by 997@code{completing-read} passes to @code{try-completion}. It is used by
1011minibuffer completion commands such as @code{minibuffer-complete-word}. 998minibuffer completion commands such as
999@code{minibuffer-complete-word}.
1012@end defvar 1000@end defvar
1013 1001
1014@defvar minibuffer-completion-predicate 1002@defvar minibuffer-completion-predicate
@@ -1717,6 +1705,87 @@ completion via the variable @code{minibuffer-completion-table}
1717(@pxref{Completion Commands}). 1705(@pxref{Completion Commands}).
1718@end defvar 1706@end defvar
1719 1707
1708@node Completion in Buffers
1709@subsection Completion in Ordinary Buffers
1710@cindex inline completion
1711
1712@findex completion-at-point
1713 Although completion is usually done in the minibuffer, the
1714completion facility can also be used on the text in ordinary Emacs
1715buffers. In many major modes, in-buffer completion is performed by
1716the @kbd{C-M-i} or @kbd{M-@key{TAB}} command, bound to
1717@code{completion-at-point}. @xref{Symbol Completion,,, emacs, The GNU
1718Emacs Manual}. This command uses the abnormal hook variable
1719@code{completion-at-point-functions}:
1720
1721@defvar completion-at-point-functions
1722The value of this abnormal hook should be a list of functions, which
1723are used to compute a completion table for completing the text at
1724point. It can be used by major modes to provide mode-specific
1725completion tables (@pxref{Major Mode Conventions}).
1726
1727When the command @code{completion-at-point} runs, it calls the
1728functions in the list one by one, without any argument. Each function
1729should return @code{nil} if it is unable to produce a completion table
1730for the text at point. Otherwise it should return a list of the form
1731
1732@example
1733(@var{start} @var{end} @var{collection} . @var{props})
1734@end example
1735
1736@noindent
1737@var{start} and @var{end} delimit the text to complete (which should
1738enclose point). @var{collection} is a completion table for completing
1739that text, in a form suitable for passing as the second argument to
1740@code{try-completion} (@pxref{Basic Completion}); completion
1741alternatives will be generated from this completion table in the usual
1742way, via the completion styles defined in @code{completion-styles}
1743(@pxref{Completion Styles}). @var{props} is a property list for
1744additional information; the following optional properties are
1745recognized:
1746
1747@table @code
1748@item :predicate
1749The value should be a predicate that completion candidates need to
1750satisfy.
1751
1752@item :exclusive
1753If the value is @code{no}, then if the completion table fails to match
1754the text at point, then @code{completion-at-point} moves on to the
1755next function in @code{completion-at-point-functions} instead of
1756reporting a completion failure.
1757@end table
1758
1759A function in @code{completion-at-point-functions} may also return a
1760function. In that case, that returned function is called, with no
1761argument, and it is entirely responsible for performing the
1762completion. We discourage this usage; it is intended to help convert
1763old code to using @code{completion-at-point}.
1764
1765The first function in @code{completion-at-point-functions} to return a
1766non-@code{nil} value is used by @code{completion-at-point}. The
1767remaining functions are not called. The exception to this is when
1768there is a @code{:exclusive} specification, as described above.
1769@end defvar
1770
1771 The following function provides a convenient way to perform
1772completion on an arbitrary stretch of text in an Emacs buffer:
1773
1774@defun completion-in-region start end collection &optional predicate
1775This function completes the text in the current buffer between the
1776positions @var{start} and @var{end}, using @var{collection}. The
1777argument @var{collection} has the same meaning as in
1778@code{try-completion} (@pxref{Basic Completion}).
1779
1780This function inserts the completion text directly into the current
1781buffer. Unlike @code{completing-read} (@pxref{Minibuffer
1782Completion}), it does not activate the minibuffer.
1783
1784For this function to work, point must be somewhere between @var{start}
1785and @var{end}.
1786@end defun
1787
1788
1720@node Yes-or-No Queries 1789@node Yes-or-No Queries
1721@section Yes-or-No Queries 1790@section Yes-or-No Queries
1722@cindex asking the user questions 1791@cindex asking the user questions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 0b020bee0b0..94ae767586b 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -48,17 +48,16 @@ you it is normal. We try to make all hooks normal, as much as
48possible, so that you can use them in a uniform way. 48possible, so that you can use them in a uniform way.
49 49
50 Every major mode command is supposed to run a normal hook called the 50 Every major mode command is supposed to run a normal hook called the
51@dfn{mode hook} as the one of the last steps of initialization. This 51@dfn{mode hook} as one of the last steps of initialization. This makes
52makes it easy for a user to customize the behavior of the mode, by 52it easy for a user to customize the behavior of the mode, by overriding
53overriding the buffer-local variable assignments already made by the 53the buffer-local variable assignments already made by the mode. Most
54mode. Most minor mode functions also run a mode hook at the end. But 54minor mode functions also run a mode hook at the end. But hooks are
55hooks are used in other contexts too. For example, the hook 55used in other contexts too. For example, the hook @code{suspend-hook}
56@code{suspend-hook} runs just before Emacs suspends itself 56runs just before Emacs suspends itself (@pxref{Suspending Emacs}).
57(@pxref{Suspending Emacs}). 57
58 58 The recommended way to add a hook function to a hook is by calling
59 The recommended way to add a hook function to a normal hook is by 59@code{add-hook} (@pxref{Setting Hooks}). The hook functions may be any
60calling @code{add-hook} (see below). The hook functions may be any of 60of the valid kinds of functions that @code{funcall} accepts (@pxref{What
61the valid kinds of functions that @code{funcall} accepts (@pxref{What
62Is a Function}). Most normal hook variables are initially void; 61Is a Function}). Most normal hook variables are initially void;
63@code{add-hook} knows how to deal with this. You can add hooks either 62@code{add-hook} knows how to deal with this. You can add hooks either
64globally or buffer-locally with @code{add-hook}. 63globally or buffer-locally with @code{add-hook}.
@@ -178,7 +177,7 @@ calls @code{wrap-function} with arguments @code{fun} and @code{args}.
178in Lisp Interaction mode: 177in Lisp Interaction mode:
179 178
180@example 179@example
181(add-hook 'lisp-interaction-mode-hook 'turn-on-auto-fill) 180(add-hook 'lisp-interaction-mode-hook 'auto-fill-mode)
182@end example 181@end example
183 182
184@defun add-hook hook function &optional append local 183@defun add-hook hook function &optional append local
@@ -202,13 +201,13 @@ If @var{function} has a non-@code{nil} property
202changing major modes) won't delete it from the hook variable's local 201changing major modes) won't delete it from the hook variable's local
203value. 202value.
204 203
205It is best to design your hook functions so that the order in which 204For a normal hook, hook functions should be designed so that the order
206they are executed does not matter. Any dependence on the order is 205in which they are executed does not matter. Any dependence on the order
207asking for trouble. However, the order is predictable: normally, 206is asking for trouble. However, the order is predictable: normally,
208@var{function} goes at the front of the hook list, so it will be 207@var{function} goes at the front of the hook list, so it is executed
209executed first (barring another @code{add-hook} call). If the 208first (barring another @code{add-hook} call). If the optional argument
210optional argument @var{append} is non-@code{nil}, the new hook 209@var{append} is non-@code{nil}, the new hook function goes at the end of
211function goes at the end of the hook list and will be executed last. 210the hook list and is executed last.
212 211
213@code{add-hook} can handle the cases where @var{hook} is void or its 212@code{add-hook} can handle the cases where @var{hook} is void or its
214value is a single function; it sets or changes the value to a list of 213value is a single function; it sets or changes the value to a list of
@@ -302,8 +301,8 @@ initialization, function and variable names, and hooks.
302 301
303 If you use the @code{define-derived-mode} macro, it will take care of 302 If you use the @code{define-derived-mode} macro, it will take care of
304many of these conventions automatically. @xref{Derived Modes}. Note 303many of these conventions automatically. @xref{Derived Modes}. Note
305also that fundamental mode is an exception to many of these conventions, 304also that Fundamental mode is an exception to many of these conventions,
306because its definition is to present the global state of Emacs. 305because it represents the default state of Emacs.
307 306
308 The following list of conventions is only partial. Each major mode 307 The following list of conventions is only partial. Each major mode
309should aim for consistency in general with other Emacs major modes, as 308should aim for consistency in general with other Emacs major modes, as
@@ -460,8 +459,9 @@ The mode can specify a local value for
460this mode. 459this mode.
461 460
462@item 461@item
463The mode can specify how to complete various keywords by adding 462The mode can specify how to complete various keywords by adding one or
464to the special hook @code{completion-at-point-functions}. 463more buffer-local entries to the special hook
464@code{completion-at-point-functions}. @xref{Completion in Buffers}.
465 465
466@item 466@item
467Use @code{defvar} or @code{defcustom} to set mode-related variables, so 467Use @code{defvar} or @code{defcustom} to set mode-related variables, so
@@ -555,16 +555,15 @@ In the comments that document the file, you should provide a sample
555@cindex mode loading 555@cindex mode loading
556The top-level forms in the file defining the mode should be written so 556The top-level forms in the file defining the mode should be written so
557that they may be evaluated more than once without adverse consequences. 557that they may be evaluated more than once without adverse consequences.
558Even if you never load the file more than once, someone else will.
559@end itemize 558@end itemize
560 559
561@node Auto Major Mode 560@node Auto Major Mode
562@subsection How Emacs Chooses a Major Mode 561@subsection How Emacs Chooses a Major Mode
563@cindex major mode, automatic selection 562@cindex major mode, automatic selection
564 563
565 Based on information in the file name or in the file itself, Emacs 564 When Emacs visits a file, it automatically selects a major mode for
566automatically selects a major mode for the new buffer when a file is 565the buffer based on information in the file name or in the file itself.
567visited. It also processes local variables specified in the file text. 566It also processes local variables specified in the file text.
568 567
569@deffn Command normal-mode &optional find-file 568@deffn Command normal-mode &optional find-file
570This function establishes the proper major mode and buffer-local variable 569This function establishes the proper major mode and buffer-local variable
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 4cfc954cd1f..d91800fcb80 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -1939,9 +1939,13 @@ queued but input may be lost. You can use the function
1939@code{process-command} to determine whether a network connection or 1939@code{process-command} to determine whether a network connection or
1940server is stopped; a non-@code{nil} value means yes. 1940server is stopped; a non-@code{nil} value means yes.
1941 1941
1942@defun open-network-stream name buffer-or-name host service 1942@cindex network connection, encrypted
1943This function opens a TCP connection, and returns a process object 1943@cindex encrypted network connections
1944that represents the connection. 1944@cindex TLS network connections
1945@cindex STARTTLS network connections
1946@defun open-network-stream name buffer-or-name host service &rest parameters
1947This function opens a TCP connection, with optional encryption, and
1948returns a process object that represents the connection.
1945 1949
1946The @var{name} argument specifies the name for the process object. It 1950The @var{name} argument specifies the name for the process object. It
1947is modified as necessary to make it unique. 1951is modified as necessary to make it unique.
@@ -1955,6 +1959,83 @@ associated with any buffer.
1955The arguments @var{host} and @var{service} specify where to connect to; 1959The arguments @var{host} and @var{service} specify where to connect to;
1956@var{host} is the host name (a string), and @var{service} is the name of 1960@var{host} is the host name (a string), and @var{service} is the name of
1957a defined network service (a string) or a port number (an integer). 1961a defined network service (a string) or a port number (an integer).
1962
1963@c FIXME? Is this too lengthy for the printed manual?
1964The remaining arguments @var{parameters} are keyword/argument pairs
1965that are mainly relevant to encrypted connections:
1966
1967@table @code
1968
1969@item :nowait @var{boolean}
1970If non-@code{nil}, try to make an asynchronous connection.
1971
1972@item :type @var{type}
1973The type of connection. Options are:
1974
1975@table @code
1976@item plain
1977An ordinary, unencrypted connection.
1978@item tls
1979@itemx ssl
1980A TLS (``Transport Layer Security'') connection.
1981@item nil
1982@itemx network
1983Start with a plain connection, and if parameters @samp{:success}
1984and @samp{:capability-command} are supplied, try to upgrade to an encrypted
1985connection via STARTTLS. If that fails, retain the unencrypted connection.
1986@item starttls
1987As for @code{nil}, but if STARTTLS fails drop the connection.
1988@item shell
1989A shell connection.
1990@end table
1991
1992@item :always-query-capabilities @var{boolean}
1993If non-@code{nil}, always ask for the server's capabilities, even when
1994doing a @samp{plain} connection.
1995
1996@item :capability-command @var{capability-command}
1997Command string to query the host capabilities.
1998
1999@item :end-of-command @var{regexp}
2000@itemx :end-of-capability @var{regexp}
2001Regular expression matching the end of a command, or the end of the
2002command @var{capability-command}. The latter defaults to the former.
2003
2004@item :starttls-function @var{function}
2005Function of one argument (the response to @var{capability-command}),
2006which returns either @code{nil}, or the command to activate STARTTLS
2007if supported.
2008
2009@item :success @var{regexp}
2010Regular expression matching a successful STARTTLS negotiation.
2011
2012@item :use-starttls-if-possible @var{boolean}
2013If non-@code{nil}, do opportunistic STARTTLS upgrades even if Emacs
2014doesn't have built-in TLS support.
2015
2016@item :client-certificate @var{list-or-t}
2017Either a list of the form @code{(@var{key-file} @var{cert-file})},
2018naming the certificate key file and certificate file itself, or
2019@code{t}, meaning to query @code{auth-source} for this information
2020(@pxref{Top,,auth-source, auth, Emacs auth-source Library}).
2021Only used for TLS or STARTTLS.
2022
2023@item :return-list @var{cons-or-nil}
2024The return value of this function. If omitted or @code{nil}, return a
2025process object. Otherwise, a cons of the form @code{(@var{process-object}
2026. @var{plist})}, where @var{plist} has keywords:
2027
2028@table @code
2029@item :greeting @var{string-or-nil}
2030If non-@code{nil}, the greeting string returned by the host.
2031@item :capabilities @var{string-or-nil}
2032If non-@code{nil}, the host's capability string.
2033@item :type @var{symbol}
2034The connection type: @samp{plain} or @samp{tls}.
2035@end table
2036
2037@end table
2038
1958@end defun 2039@end defun
1959 2040
1960@node Network Servers 2041@node Network Servers
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index ab3a4edc0ac..94e71c96d0a 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -303,7 +303,7 @@ If a variable is void, trying to evaluate the variable signals a
303 303
304 Under lexical binding rules, the value cell only holds the 304 Under lexical binding rules, the value cell only holds the
305variable's global value, i.e.@: the value outside of any lexical 305variable's global value, i.e.@: the value outside of any lexical
306binding contruct. When a variable is lexically bound, the local value 306binding construct. When a variable is lexically bound, the local value
307is determined by the lexical environment; the variable may have a 307is determined by the lexical environment; the variable may have a
308local value if its symbol's value cell is unassigned. 308local value if its symbol's value cell is unassigned.
309 309
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi
index cc96726745f..dbab287b273 100644
--- a/doc/lispref/vol1.texi
+++ b/doc/lispref/vol1.texi
@@ -675,6 +675,7 @@ Completion
675 shell commands. 675 shell commands.
676* Completion Styles:: Specifying rules for performing completion. 676* Completion Styles:: Specifying rules for performing completion.
677* Programmed Completion:: Writing your own completion-function. 677* Programmed Completion:: Writing your own completion-function.
678* Completion in Buffers:: Completing text in ordinary buffers.
678 679
679Command Loop 680Command Loop
680 681
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi
index 33246cb567d..38e2f1dc5e9 100644
--- a/doc/lispref/vol2.texi
+++ b/doc/lispref/vol2.texi
@@ -674,6 +674,7 @@ Completion
674 shell commands. 674 shell commands.
675* Completion Styles:: Specifying rules for performing completion. 675* Completion Styles:: Specifying rules for performing completion.
676* Programmed Completion:: Writing your own completion-function. 676* Programmed Completion:: Writing your own completion-function.
677* Completion in Buffers:: Completing text in ordinary buffers.
677 678
678Command Loop 679Command Loop
679 680
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index adad93ef89c..a88ac5f0bd4 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
12012-02-15 Glenn Morris <rgm@gnu.org>
2
3 * smtpmail.texi (Emacs Speaks SMTP): General update for 24.1.
4 (Encryption): New chapter, split out from previous.
5
12012-02-13 Lars Ingebrigtsen <larsi@gnus.org> 62012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
2 7
3 * gnus.texi (Customizing the IMAP Connection): Mention 8 * gnus.texi (Customizing the IMAP Connection): Mention
diff --git a/doc/misc/smtpmail.texi b/doc/misc/smtpmail.texi
index af09783f445..4e4df3f0bbb 100644
--- a/doc/misc/smtpmail.texi
+++ b/doc/misc/smtpmail.texi
@@ -47,6 +47,7 @@ developing GNU and promoting software freedom.''
47* How Mail Works:: Brief introduction to mail concepts. 47* How Mail Works:: Brief introduction to mail concepts.
48* Emacs Speaks SMTP:: How to use the SMTP library in Emacs. 48* Emacs Speaks SMTP:: How to use the SMTP library in Emacs.
49* Authentication:: Authenticating yourself to the server. 49* Authentication:: Authenticating yourself to the server.
50* Encryption:: Protecting your connection to the server.
50* Queued delivery:: Sending mail without an internet connection. 51* Queued delivery:: Sending mail without an internet connection.
51* Server workarounds:: Mail servers with special requirements. 52* Server workarounds:: Mail servers with special requirements.
52* Debugging:: Tracking down problems. 53* Debugging:: Tracking down problems.
@@ -129,24 +130,37 @@ be useful if you don't have a MTA set up on your host, or if your
129machine is often disconnected from the internet. 130machine is often disconnected from the internet.
130 131
131 Sending mail via SMTP requires configuring your mail user agent 132 Sending mail via SMTP requires configuring your mail user agent
132(@pxref{Mail Methods,,,emacs}) to use the SMTP library. How to do 133(@pxref{Mail Methods,,,emacs}) to use the SMTP library. If you
133this should be described for each mail user agent; for the default 134have not configured anything, then in Emacs 24.1 and later the first
134mail user agent the variable @code{send-mail-function} (@pxref{Mail 135time you try to send a mail Emacs will ask how you want to send
135Sending,,,emacs}) is used; for the Message and Gnus user agents the 136mail. To use this library, answer @samp{smtp} when prompted. Emacs
136variable @code{message-send-mail-function} (@pxref{Mail 137then asks for the name of the SMTP server.
137Variables,,,message}) is used. 138
138 139 If you prefer, or if you are using a non-standard mail user agent,
139@example 140you can configure this yourself. The normal way to do this is to set
140;; If you use the default mail user agent. 141the variable @code{send-mail-function} (@pxref{Mail
142Sending,,,emacs}) to the value you want to use. To use this library:
143
144@smallexample
141(setq send-mail-function 'smtpmail-send-it) 145(setq send-mail-function 'smtpmail-send-it)
142;; If you use Message or Gnus. 146@end smallexample
143(setq message-send-mail-function 'smtpmail-send-it) 147
144@end example 148@noindent
149The default value for this variable is @code{sendmail-query-once},
150which interactively asks how you want to send mail.
151
152Your mail user agent might use a different variable for this purpose.
153It should inherit from @code{send-mail-function}, but if it does not,
154or if you prefer, you can set that variable directly. Consult your
155mail user agent's documentation for more details. For example,
156(@pxref{Mail Variables,,,message}).
145 157
146 Before using SMTP you must find out the hostname of the SMTP server 158 Before using SMTP you must find out the hostname of the SMTP server
147to use. Your system administrator should provide you with this 159to use. Your system administrator or mail service provider should
148information, but often it is the same as the server you receive mail 160supply this information. Often it is some variant of the server you
149from. 161receive mail from. If your email address is
162@samp{yourname@@example.com}, then the name of the SMTP server is
163may be something like @samp{smtp.example.com}.
150 164
151@table @code 165@table @code
152@item smtpmail-smtp-server 166@item smtpmail-smtp-server
@@ -201,101 +215,114 @@ The following example illustrates what you could put in
201@node Authentication 215@node Authentication
202@chapter Authentication 216@chapter Authentication
203 217
218@cindex password
219@cindex user name
220Most SMTP servers require clients to authenticate themselves before
221they are allowed to send mail. Authentication usually involves
222supplying a user name and password.
223
224If you have not configured anything, then the first time you try to
225send mail via a server, Emacs (version 24.1 and later) prompts you
226for the user name and password to use, and then offers to save the
227information. By default, Emacs stores authentication information in
228a file @file{~/.authinfo}.
229
230@cindex authinfo
231The basic format of the @file{~/.authinfo} file is one line for each
232set of credentials. Each line consists of pairs of variables and
233values. A simple example would be:
234
235@smallexample
236machine mail.example.org port 25 login myuser password mypassword
237@end smallexample
238
239@noindent
240This specifies that when using the SMTP server called @samp{mail.example.org}
241on port 25, Emacs should send the user name @samp{myuser} and the
242password @samp{mypassword}. Either or both of the login and password
243fields may be absent, in which case Emacs prompts for the information
244when you try to send mail. (This replaces the old
245@code{smtpmail-auth-credentials} variable used prior to Emacs 24.1.)
246
247@vindex smtpmail-smtp-user
248 When the SMTP library connects to a host on a certain port, it
249searches the @file{~/.authinfo} file for a matching entry. If an
250entry is found, the authentication process is invoked and the
251credentials are used. If the variable @code{smtpmail-smtp-user} is
252set to a non-@code{nil} value, then only entries for that user are
253considered. For more information on the @file{~/.authinfo}
254file, @pxref{Top,,auth-source, auth, Emacs auth-source Library}.
255
204@cindex SASL 256@cindex SASL
205@cindex CRAM-MD5 257@cindex CRAM-MD5
258@cindex PLAIN
206@cindex LOGIN 259@cindex LOGIN
260The process by which the SMTP library authenticates you to the server
261is known as ``Simple Authentication and Security Layer'' (SASL).
262There are various SASL mechanisms, and this library supports three of
263them: CRAM-MD5, PLAIN, and LOGIN. It tries each of them, in that order,
264until one succeeds. The first uses a form of encryption to obscure
265your password, while the other two do not.
266
267
268@node Encryption
269@chapter Encryption
270
207@cindex STARTTLS 271@cindex STARTTLS
208@cindex TLS 272@cindex TLS
209@cindex SSL 273@cindex SSL
210Many environments require SMTP clients to authenticate themselves 274For greater security, you can encrypt your connection to the SMTP
211before they are allowed to route mail via a server. The two following 275server. If this is to work, both Emacs and the server must support it.
212variables contains the authentication information needed for this. 276
213 277The SMTP library supports the ``Transport Layer Security'' (TLS), and
214The first variable, @code{smtpmail-auth-credentials}, instructs the 278the older ``Secure Sockets Layer'' (SSL) encryption mechanisms.
215SMTP library to use a SASL authentication step, currently only the 279It also supports STARTTLS, which is a variant of TLS in which the
216CRAM-MD5 and LOGIN mechanisms are supported and will be selected in 280initial connection to the server is made in plain text, requesting a
217that order if the server support both. 281switch to an encrypted channel for the rest of the process.
218 282
219The second variable, @code{smtpmail-starttls-credentials}, instructs 283@vindex smtpmail-stream-type
220the SMTP library to connect to the server using STARTTLS. This means 284The variable @code{smtpmail-stream-type} controls what form of
221the protocol exchange may be integrity protected and confidential by 285connection the SMTP library uses. The default value is @code{nil},
222using the Transport Layer Security (TLS) protocol, and optionally also 286which means to use a plain connection, but try to switch to a STARTTLS
223authentication of the client and server. 287encrypted connection if the server supports it. Other possible values
224 288are: @code{starttls} - insist on STARTTLS; @code{ssl} - use TLS/SSL;
225TLS is a security protocol that is also known as SSL, although 289and @code{plain} - no encryption.
226strictly speaking, SSL is an older variant of TLS. TLS is backwards 290
227compatible with SSL. In most mundane situations, the two terms are 291Use of any form of TLS/SSL requires support in Emacs. You can either
228equivalent. 292use the built-in support (in Emacs 24.1 and later), or the
229 293@file{starttls.el} Lisp library. The built-in support uses the GnuTLS
230The TLS feature uses the elisp package @file{starttls.el} (see it for 294@footnote{@url{http://www.gnu.org/software/gnutls/}} library.
231more information on customization), which in turn require that at 295If your Emacs has GnuTLS support built-in, the function
232least one of the following external tools are installed: 296@code{gnutls-available-p} is defined and returns non-@code{nil}.
297Otherwise, you must use the @file{starttls.el} library (see that file for
298more information on customization options, etc.). The Lisp library
299requires one of the following external tools to be installed:
233 300
234@enumerate 301@enumerate
235@item 302@item
236The GnuTLS command line tool @samp{gnutls-cli}, you can get it from 303The GnuTLS command line tool @samp{gnutls-cli}, which you can get from
237@url{http://www.gnu.org/software/gnutls/}. This is the recommended 304@url{http://www.gnu.org/software/gnutls/}. This is the recommended
238tool, mainly because it can verify the server certificates. 305tool, mainly because it can verify server certificates.
239 306
240@item 307@item
241The @samp{starttls} external program, you can get it from 308The @samp{starttls} external program, which you can get from
242@file{starttls-*.tar.gz} from @uref{ftp://ftp.opaopa.org/pub/elisp/}. 309@file{starttls-*.tar.gz} from @uref{ftp://ftp.opaopa.org/pub/elisp/}.
243@end enumerate 310@end enumerate
244 311
245It is not uncommon to use both these mechanisms, e.g., to use STARTTLS 312@cindex certificates
246to achieve integrity and confidentiality and then use SASL for client 313@cindex keys
247authentication. 314The SMTP server may also request that you verify your identity by
315sending a certificate and the associated encryption key to the server.
316If you need to do this, you can use an @file{~/.authinfo} entry like this:
248 317
249@table @code 318@smallexample
250@item smtpmail-auth-credentials 319machine mail.example.org port 25 key "~/.my_smtp_tls.key" cert "~/.my_smtp_tls.cert"
251@vindex smtpmail-auth-credentials 320@end smallexample
252 The variable @code{smtpmail-auth-credentials} contains a list of
253hostname, port, username and password tuples. When the SMTP library
254connects to a host on a certain port, this variable is searched to
255find a matching entry for that hostname and port. If an entry is
256found, the authentication process is invoked and the credentials are
257used.
258
259The hostname field follows the same format as
260@code{smtpmail-smtp-server} (i.e., a string) and the port field the
261same format as @code{smtpmail-smtp-service} (i.e., a string or an
262integer). The username and password fields, which either can be
263@code{nil} to indicate that the user is prompted for the value
264interactively, should be strings with the username and password,
265respectively, information that is normally provided by system
266administrators.
267
268@item smtpmail-starttls-credentials
269@vindex smtpmail-starttls-credentials
270 The variable @code{smtpmail-starttls-credentials} contains a list of
271tuples with hostname, port, name of file containing client key, and
272name of file containing client certificate. The processing is similar
273to the previous variable. The client key and certificate may be
274@code{nil} if you do not wish to use client authentication.
275@end table
276 321
277The following example illustrates what you could put in 322@noindent
278@file{~/.emacs} to enable both SASL authentication and STARTTLS. The 323(This replaces the old @code{smtpmail-starttls-credentials} variable used
279server name (@code{smtpmail-smtp-server}) is @var{hostname}, the 324prior to Emacs 24.1.)
280server port (@code{smtpmail-smtp-service}) is @var{port}, and the
281username and password are @var{username} and @var{password}
282respectively.
283 325
284@example
285;; Authenticate using this username and password against my server.
286(setq smtpmail-auth-credentials
287 '(("@var{hostname}" "@var{port}" "@var{username}" "@var{password}")))
288
289;; Note that if @var{port} is an integer, you must not quote it as a
290;; string. Normally @var{port} should be the integer 25, and the example
291;; become:
292(setq smtpmail-auth-credentials
293 '(("@var{hostname}" 25 "@var{username}" "@var{password}")))
294
295;; Use STARTTLS without authentication against the server.
296(setq smtpmail-starttls-credentials
297 '(("@var{hostname}" "@var{port}" nil nil)))
298@end example
299 326
300@node Queued delivery 327@node Queued delivery
301@chapter Queued delivery 328@chapter Queued delivery
diff --git a/etc/NEWS b/etc/NEWS
index 262379cc918..4c6552f7db5 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -141,22 +141,22 @@ For example, this is used by Rmail to optionally delete a mail window.
141 141
142*** smtpmail 142*** smtpmail
143 143
144**** smtpmail now uses encrypted connections (via STARTTLS) if the 144+++
145mail server supports them. It also uses the auth-source framework for 145**** smtpmail now uses encrypted connections (via STARTTLS) by default
146getting credentials. 146if the mail server supports them. This uses either built-in GnuTLS
147support, or the starttls.el library. Customize `smtpmail-stream-type'
148to change this.
147 149
150+++
148**** The variable `smtpmail-auth-credentials' has been removed. 151**** The variable `smtpmail-auth-credentials' has been removed.
149That variable used to have the default value "~/.authinfo", in which 152By default, the information is now stored in the file ~/.authinfo.
150case you won't see any difference. But if you changed it to be a list 153This was the default value of smtpmail-auth-credentials.
151of user names and passwords, that setting is now ignored; you will be 154If you had customized smtpmail-auth-credentials to a list of user
152prompted for the user name and the password, which will then be saved 155names and passwords, those settings will not be used. Your first
153to ~/.authinfo. (To control where and how the credentials are stored, 156connection to the smtp server will prompt for the user name and password,
154see the auth-source manual. You may want to change the auth-source 157and then offer to save them to the ~/.authinfo file. Or you can
155preferences if you want to store the credentials encrypted, for 158manually copy the credentials to your ~/.authinfo files. For example,
156instance.) 159if you had
157
158You can also manually copy the credentials to your ~/.authinfo file.
159For example, if you had
160 160
161 (setq smtpmail-auth-credentials 161 (setq smtpmail-auth-credentials
162 '(("mail.example.org" 25 "jim" "s!cret"))) 162 '(("mail.example.org" 25 "jim" "s!cret")))
@@ -165,6 +165,10 @@ then the equivalent line in ~/.authinfo would be
165 165
166 machine mail.example.org port 25 login jim password s!cret 166 machine mail.example.org port 25 login jim password s!cret
167 167
168See the auth-source manual for more information, e.g. on encrypting
169the credentials file.
170
171+++
168**** The variable `smtpmail-starttls-credentials' has been removed. 172**** The variable `smtpmail-starttls-credentials' has been removed.
169 173
170If you had that set, then you need to put 174If you had that set, then you need to put
@@ -1107,7 +1111,10 @@ font-lock-defaults-alist (font-lock-defaults), and e (float-e).
1107** The following obsolete files were removed: 1111** The following obsolete files were removed:
1108sc.el, x-menu.el, rnews.el, rnewspost.el 1112sc.el, x-menu.el, rnews.el, rnewspost.el
1109 1113
1110** FIXME finder-inf.el changes. 1114---
1115** The format of the finder-inf.el file has changed, since the finder
1116mechanism is now based on the package concept. The variable
1117finder-package-info is replaced by package--builtins and finder-keywords-hash.
1111 1118
1112 1119
1113* Lisp changes in Emacs 24.1 1120* Lisp changes in Emacs 24.1
@@ -1282,6 +1289,7 @@ behavior of `completing-read'.
1282** `glyphless-char-display' can now distinguish between graphical and 1289** `glyphless-char-display' can now distinguish between graphical and
1283text terminal display, via a char-table entry that is a cons cell. 1290text terminal display, via a char-table entry that is a cons cell.
1284 1291
1292+++
1285** `open-network-stream' can now be used to open an encrypted stream. 1293** `open-network-stream' can now be used to open an encrypted stream.
1286It now accepts an optional `:type' parameter for initiating a TLS 1294It now accepts an optional `:type' parameter for initiating a TLS
1287connection, directly or via STARTTLS. To do STARTTLS, additional 1295connection, directly or via STARTTLS. To do STARTTLS, additional
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5c7e8f2e8f8..bdbe99d5452 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,34 @@
12012-02-15 Glenn Morris <rgm@gnu.org>
2
3 * shell.el (shell-delimiter-argument-list):
4 Revert 2011-02-17 change. (Bug#8027)
5
62012-02-15 Chong Yidong <cyd@gnu.org>
7
8 * minibuffer.el (completion-at-point-functions): Doc fix.
9
10 * custom.el (defcustom): Doc fix; note use of defvar.
11
122012-02-15 Glenn Morris <rgm@gnu.org>
13
14 * mail/smtpmail.el (smtpmail-smtp-user, smtpmail-stream-type):
15 Doc fixes.
16
172012-02-14 Glenn Morris <rgm@gnu.org>
18
19 * mail/smtpmail.el (smtpmail-query-smtp-server): Give it a doc.
20
212012-02-14 Lars Ingebrigtsen <larsi@gnus.org>
22
23 * mail/smtpmail.el (smtpmail-query-smtp-server): Fix typo in the
24 way the ports list is computed.
25 (smtpmail-query-smtp-server): Prompt the user for a port number if
26 we can't connect to any of the standard ports (bug#10810).
27
282012-02-14 Teodor Zlatanov <tzz@lifelogs.com>
29
30 * net/gnutls.el (gnutls-trustfiles): Add Cygwin location.
31
12012-02-13 Glenn Morris <rgm@gnu.org> 322012-02-13 Glenn Morris <rgm@gnu.org>
2 33
3 * minibuffer.el (read-file-name): Doc fix. (Bug#10798) 34 * minibuffer.el (read-file-name): Doc fix. (Bug#10798)
diff --git a/lisp/custom.el b/lisp/custom.el
index 2d880d23955..810b78144a4 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -208,7 +208,11 @@ is unbound. The expression itself is also stored, so that
208Customize can re-evaluate it later to get the standard value. 208Customize can re-evaluate it later to get the standard value.
209DOC is the variable documentation. 209DOC is the variable documentation.
210 210
211The remaining arguments should have the form 211This macro uses `defvar' as a subroutine, which also marks the
212variable as \"special\", so that it is always dynamically bound
213even when `lexical-binding' is t.
214
215The remaining arguments to `defcustom' should have the form
212 216
213 [KEYWORD VALUE]... 217 [KEYWORD VALUE]...
214 218
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 99554cd9ffe..9ac21e5a33e 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,13 @@
12012-02-15 Lars Ingebrigtsen <larsi@gnus.org>
2
3 * shr.el (shr-remove-trailing-whitespace): Really delete the padding on
4 too-wide lines.
5
62012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7
8 * shr.el (shr-rescale-image): Undo previous change; see
9 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10
12012-02-13 Lars Ingebrigtsen <larsi@gnus.org> 112012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
2 12
3 * nnimap.el (nnimap-record-commands): New variable. 13 * nnimap.el (nnimap-record-commands): New variable.
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 47622f5183d..f3d75032926 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -160,7 +160,7 @@ DOM should be a parse tree as generated by
160 (goto-char start) 160 (goto-char start)
161 (while (not (eobp)) 161 (while (not (eobp))
162 (end-of-line) 162 (end-of-line)
163 (when (> (current-column) width) 163 (when (> (shr-previous-newline-padding-width (current-column)) width)
164 (dolist (overlay (overlays-at (point))) 164 (dolist (overlay (overlays-at (point)))
165 (when (overlay-get overlay 'before-string) 165 (when (overlay-get overlay 'before-string)
166 (overlay-put overlay 'before-string nil)))) 166 (overlay-put overlay 'before-string nil))))
@@ -557,8 +557,7 @@ the URL of the image to the kill buffer instead."
557 (insert alt))) 557 (insert alt)))
558 558
559(defun shr-rescale-image (data) 559(defun shr-rescale-image (data)
560 (let* ((max-image-size nil) 560 (let ((image (create-image data nil t :ascent 100)))
561 (image (create-image data nil t :ascent 100)))
562 (if (or (not (fboundp 'imagemagick-types)) 561 (if (or (not (fboundp 'imagemagick-types))
563 (not (get-buffer-window (current-buffer)))) 562 (not (get-buffer-window (current-buffer))))
564 image 563 image
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 99283bebf9d..3233cff2768 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -1,6 +1,6 @@
1;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail 1;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail
2 2
3;; Copyright (C) 1995-1996, 2001-2012 Free Software Foundation, Inc. 3;; Copyright (C) 1995-1996, 2001-2012 Free Software Foundation, Inc.
4 4
5;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp> 5;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
6;; Maintainer: Simon Josefsson <simon@josefsson.org> 6;; Maintainer: Simon Josefsson <simon@josefsson.org>
@@ -86,7 +86,8 @@ The default value would be \"smtp\" or 25."
86 :group 'smtpmail) 86 :group 'smtpmail)
87 87
88(defcustom smtpmail-smtp-user nil 88(defcustom smtpmail-smtp-user nil
89 "User name to use when looking up credentials." 89 "User name to use when looking up credentials in the authinfo file.
90If non-nil, only consider credentials for the specified user."
90 :version "24.1" 91 :version "24.1"
91 :type '(choice (const nil) string) 92 :type '(choice (const nil) string)
92 :group 'smtpmail) 93 :group 'smtpmail)
@@ -99,11 +100,10 @@ don't define this value."
99 :group 'smtpmail) 100 :group 'smtpmail)
100 101
101(defcustom smtpmail-stream-type nil 102(defcustom smtpmail-stream-type nil
102 "Connection type SMTP connections. 103 "Type of SMTP connections to use.
103This may be either nil (possibly upgraded to STARTTLS if 104This may be either nil (possibly upgraded to STARTTLS if possible),
104possible), or `starttls' (refuse to send if STARTTLS isn't 105or `starttls' (refuse to send if STARTTLS isn't available), or `plain'
105available), or `plain' (never use STARTTLS), or `ssl' (to use 106\(never use STARTTLS), or `ssl' (to use TLS/SSL)."
106TLS/SSL)."
107 :version "24.1" 107 :version "24.1"
108 :group 'smtpmail 108 :group 'smtpmail
109 :type '(choice (const :tag "Possibly upgrade to STARTTLS" nil) 109 :type '(choice (const :tag "Possibly upgrade to STARTTLS" nil)
@@ -596,18 +596,31 @@ The list is in preference order.")
596 (mapconcat 'identity (cdr response) "\n")) 596 (mapconcat 'identity (cdr response) "\n"))
597 597
598(defun smtpmail-query-smtp-server () 598(defun smtpmail-query-smtp-server ()
599 "Query for an SMTP server and try to contact it.
600If the contact succeeds, customizes and saves `smtpmail-smtp-server'
601and `smtpmail-smtp-service'. This tries standard SMTP ports, and if
602none works asks you to supply one. If you know that you need to use
603a non-standard port, you can set `smtpmail-smtp-service' in advance.
604Returns an error if the server cannot be contacted."
599 (let ((server (read-string "Outgoing SMTP mail server: ")) 605 (let ((server (read-string "Outgoing SMTP mail server: "))
600 (ports '("smtp" 587)) 606 (ports '(25 587))
601 stream port) 607 stream port prompted)
602 (when (and smtpmail-smtp-server 608 (when (and smtpmail-smtp-service
603 (not (member smtpmail-smtp-server ports))) 609 (not (member smtpmail-smtp-service ports)))
604 (push smtpmail-smtp-server ports)) 610 (push smtpmail-smtp-service ports))
605 (while (and (not smtpmail-smtp-server) 611 (while (and (not smtpmail-smtp-server)
606 (setq port (pop ports))) 612 (setq port (pop ports)))
607 (when (setq stream (condition-case () 613 (if (not (setq stream (condition-case ()
608 (open-network-stream "smtp" nil server port) 614 (open-network-stream "smtp" nil server port)
609 (quit nil) 615 (quit nil)
610 (error nil))) 616 (error nil))))
617 ;; We've used up the list of default ports, so query the user.
618 (when (and (not ports)
619 (not prompted))
620 (push (read-number (format "Port number to use when contacting %s? "
621 server))
622 ports)
623 (setq prompted t))
611 (customize-save-variable 'smtpmail-smtp-server server) 624 (customize-save-variable 'smtpmail-smtp-server server)
612 (customize-save-variable 'smtpmail-smtp-service port) 625 (customize-save-variable 'smtpmail-smtp-service port)
613 (delete-process stream))) 626 (delete-process stream)))
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 611df1eb6d9..8564cc2009b 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1550,16 +1550,16 @@ the mode if ARG is omitted or nil."
1550Each function on this hook is called in turns without any argument and should 1550Each function on this hook is called in turns without any argument and should
1551return either nil to mean that it is not applicable at point, 1551return either nil to mean that it is not applicable at point,
1552or a function of no argument to perform completion (discouraged), 1552or a function of no argument to perform completion (discouraged),
1553or a list of the form (START END COLLECTION &rest PROPS) where 1553or a list of the form (START END COLLECTION . PROPS) where
1554 START and END delimit the entity to complete and should include point, 1554 START and END delimit the entity to complete and should include point,
1555 COLLECTION is the completion table to use to complete it, and 1555 COLLECTION is the completion table to use to complete it, and
1556 PROPS is a property list for additional information. 1556 PROPS is a property list for additional information.
1557Currently supported properties are all the properties that can appear in 1557Currently supported properties are all the properties that can appear in
1558`completion-extra-properties' plus: 1558`completion-extra-properties' plus:
1559 `:predicate' a predicate that completion candidates need to satisfy. 1559 `:predicate' a predicate that completion candidates need to satisfy.
1560 `:exclusive' If `no', means that if the completion data does not match the 1560 `:exclusive' If `no', means that if the completion table fails to
1561 text at point failure, then instead of reporting a completion failure, 1561 match the text at point, then instead of reporting a completion
1562 the completion should try the next completion function.") 1562 failure, the completion should try the next completion function.")
1563 1563
1564(defvar completion--capf-misbehave-funs nil 1564(defvar completion--capf-misbehave-funs nil
1565 "List of functions found on `completion-at-point-functions' that misbehave. 1565 "List of functions found on `completion-at-point-functions' that misbehave.
diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el
index 9b734637103..2fd276cf1c6 100644
--- a/lisp/net/gnutls.el
+++ b/lisp/net/gnutls.el
@@ -56,6 +56,7 @@ set this variable to \"normal:-dhe-rsa\"."
56 "/etc/ssl/certs/ca-certificates.crt" ; Debian, Ubuntu, Gentoo and Arch Linux 56 "/etc/ssl/certs/ca-certificates.crt" ; Debian, Ubuntu, Gentoo and Arch Linux
57 "/etc/pki/tls/certs/ca-bundle.crt" ; Fedora and RHEL 57 "/etc/pki/tls/certs/ca-bundle.crt" ; Fedora and RHEL
58 "/etc/ssl/ca-bundle.pem" ; Suse 58 "/etc/ssl/ca-bundle.pem" ; Suse
59 "/usr/ssl/cert/ca-bundle.crt" ; Cygwin
59 ) 60 )
60 "List of CA bundle location filenames or a function returning said list. 61 "List of CA bundle location filenames or a function returning said list.
61The files may be in PEM or DER format, as per the GnuTLS documentation. 62The files may be in PEM or DER format, as per the GnuTLS documentation.
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 2a188c5a736..a2f83eecce5 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,7 @@
12012-02-14 Chong Yidong <cyd@gnu.org>
2
3 * org-footnote.el: Remove bogus defvar values (Bug#10745).
4
12012-01-05 Eric Schulte <eric.schulte@gmx.com> 52012-01-05 Eric Schulte <eric.schulte@gmx.com>
2 6
3 * ob.el (org-babel-expand-noweb-references): Resurrect dropped 7 * ob.el (org-babel-expand-noweb-references): Resurrect dropped
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el
index f9cf59c879c..573bd648959 100644
--- a/lisp/org/org-footnote.el
+++ b/lisp/org/org-footnote.el
@@ -475,7 +475,7 @@ or new, let the user edit the definition of the footnote."
475 (org-footnote-create-definition label) 475 (org-footnote-create-definition label)
476 (org-footnote-auto-adjust-maybe))))) 476 (org-footnote-auto-adjust-maybe)))))
477 477
478(defvar org-blank-before-new-entry nil) ; silence byte-compiler 478(defvar org-blank-before-new-entry) ; silence byte-compiler
479(defun org-footnote-create-definition (label) 479(defun org-footnote-create-definition (label)
480 "Start the definition of a footnote with label LABEL." 480 "Start the definition of a footnote with label LABEL."
481 (interactive "sLabel: ") 481 (interactive "sLabel: ")
@@ -595,8 +595,8 @@ With prefix arg SPECIAL, offer additional commands in a menu."
595(defvar org-footnote-insert-pos-for-preprocessor 'point-max 595(defvar org-footnote-insert-pos-for-preprocessor 'point-max
596 "See `org-footnote-normalize'.") 596 "See `org-footnote-normalize'.")
597 597
598(defvar org-export-footnotes-seen nil) ; silence byte-compiler 598(defvar org-export-footnotes-seen) ; silence byte-compiler
599(defvar org-export-footnotes-data nil) ; silence byte-compiler 599(defvar org-export-footnotes-data) ; silence byte-compiler
600 600
601;;;###autoload 601;;;###autoload
602(defun org-footnote-normalize (&optional sort-only export-props) 602(defun org-footnote-normalize (&optional sort-only export-props)
diff --git a/lisp/shell.el b/lisp/shell.el
index e7a8953ecbe..b4b388655c8 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -153,13 +153,14 @@ This is a fine thing to set in your `.emacs' file."
153 :type '(repeat (string :tag "Suffix")) 153 :type '(repeat (string :tag "Suffix"))
154 :group 'shell) 154 :group 'shell)
155 155
156(defcustom shell-delimiter-argument-list nil ; '(?\| ?& ?< ?> ?\( ?\) ?\;) 156(defcustom shell-delimiter-argument-list '(?\| ?& ?< ?> ?\( ?\) ?\;)
157 "List of characters to recognize as separate arguments. 157 "List of characters to recognize as separate arguments.
158This variable is used to initialize `comint-delimiter-argument-list' in the 158This variable is used to initialize `comint-delimiter-argument-list' in the
159shell buffer. The value may depend on the operating system or shell." 159shell buffer. The value may depend on the operating system or shell."
160 :type '(choice (const nil) 160 :type '(choice (const nil)
161 (repeat :tag "List of characters" character)) 161 (repeat :tag "List of characters" character))
162 :version "24.1" ; changed to nil (bug#8027) 162 ;; Reverted.
163;; :version "24.1" ; changed to nil (bug#8027)
163 :group 'shell) 164 :group 'shell)
164 165
165(defvar shell-file-name-chars 166(defvar shell-file-name-chars
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index c53f7294aef..8f3e3997869 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,13 @@
12012-02-14 Lars Ingebrigtsen <larsi@gnus.org>
2
3 * url-queue.el (url-queue-kill-job): Refactored out code.
4 (url-queue-remove-jobs-from-host): Use it to kill jobs that are in
5 flight.
6
72012-02-14 Teodor Zlatanov <tzz@lifelogs.com>
8
9 * url-future.el: Minor doc update.
10
12012-02-14 Leo Liu <sdl.web@gmail.com> 112012-02-14 Leo Liu <sdl.web@gmail.com>
2 12
3 * url-future.el: Fix last change. 13 * url-future.el: Fix last change.
diff --git a/lisp/url/url-future.el b/lisp/url/url-future.el
index 38ac09c06bb..8cdd6916a35 100644
--- a/lisp/url/url-future.el
+++ b/lisp/url/url-future.el
@@ -36,7 +36,7 @@
36;; So, to get the value: 36;; So, to get the value:
37;; (when (url-future-completed-p future) (url-future-value future)) 37;; (when (url-future-completed-p future) (url-future-value future))
38 38
39;; See the ERT tests and the code for further details. 39;; See `url-future-tests' and the code below for further details.
40 40
41;;; Code: 41;;; Code:
42 42
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index 9dfee485918..1fc33dd22f1 100644
--- a/lisp/url/url-queue.el
+++ b/lisp/url/url-queue.el
@@ -127,6 +127,7 @@ The variable `url-queue-timeout' sets a timeout."
127 host) 127 host)
128 (push job jobs))) 128 (push job jobs)))
129 (dolist (job jobs) 129 (dolist (job jobs)
130 (url-queue-kill-job job)
130 (setq url-queue (delq job url-queue))))) 131 (setq url-queue (delq job url-queue)))))
131 132
132(defun url-queue-start-retrieve (job) 133(defun url-queue-start-retrieve (job)
@@ -146,14 +147,17 @@ The variable `url-queue-timeout' sets a timeout."
146 url-queue-timeout)) 147 url-queue-timeout))
147 (push job dead-jobs))) 148 (push job dead-jobs)))
148 (dolist (job dead-jobs) 149 (dolist (job dead-jobs)
149 (when (bufferp (url-queue-buffer job)) 150 (url-queue-kill-job job)
150 (while (get-buffer-process (url-queue-buffer job))
151 (ignore-errors
152 (delete-process (get-buffer-process (url-queue-buffer job)))))
153 (ignore-errors
154 (kill-buffer (url-queue-buffer job))))
155 (setq url-queue (delq job url-queue))))) 151 (setq url-queue (delq job url-queue)))))
156 152
153(defun url-queue-kill-job (job)
154 (when (bufferp (url-queue-buffer job))
155 (while (get-buffer-process (url-queue-buffer job))
156 (ignore-errors
157 (delete-process (get-buffer-process (url-queue-buffer job)))))
158 (ignore-errors
159 (kill-buffer (url-queue-buffer job)))))
160
157(provide 'url-queue) 161(provide 'url-queue)
158 162
159;;; url-queue.el ends here 163;;; url-queue.el ends here
diff --git a/src/ChangeLog b/src/ChangeLog
index 7893cd68396..12b4fa97c33 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12012-02-15 Paul Eggert <eggert@cs.ucla.edu>
2
3 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
5
62012-02-15 Chong Yidong <cyd@gnu.org>
7
8 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9 marked as special. Also, starting docstrings with * is obsolete.
10
12012-02-13 Andreas Schwab <schwab@linux-m68k.org> 112012-02-13 Andreas Schwab <schwab@linux-m68k.org>
2 12
3 * gnutls.c (emacs_gnutls_write): Fix last change. 13 * gnutls.c (emacs_gnutls_write): Fix last change.
diff --git a/src/eval.c b/src/eval.c
index dbd06e7c1b1..344228741cb 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -780,17 +780,15 @@ The return value is BASE-VARIABLE. */)
780 780
781DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0, 781DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0,
782 doc: /* Define SYMBOL as a variable, and return SYMBOL. 782 doc: /* Define SYMBOL as a variable, and return SYMBOL.
783You are not required to define a variable in order to use it, 783You are not required to define a variable in order to use it, but
784but the definition can supply documentation and an initial value 784defining it lets you supply an initial value and documentation, which
785in a way that tags can recognize. 785can be referred to by the Emacs help facilities and other programming
786 786tools. The `defvar' form also declares the variable as \"special\",
787INITVALUE is evaluated, and used to set SYMBOL, only if SYMBOL's value is void. 787so that it is always dynamically bound even if `lexical-binding' is t.
788If SYMBOL is buffer-local, its default value is what is set; 788
789 buffer-local values are not affected. 789The optional argument INITVALUE is evaluated, and used to set SYMBOL,
790INITVALUE and DOCSTRING are optional. 790only if SYMBOL's value is void. If SYMBOL is buffer-local, its
791If DOCSTRING starts with *, this variable is identified as a user option. 791default value is what is set; buffer-local values are not affected.
792 This means that M-x set-variable recognizes it.
793 See also `user-variable-p'.
794If INITVALUE is missing, SYMBOL's value is not set. 792If INITVALUE is missing, SYMBOL's value is not set.
795 793
796If SYMBOL has a local binding, then this form affects the local 794If SYMBOL has a local binding, then this form affects the local
@@ -799,6 +797,13 @@ load a file defining variables, with this form or with `defconst' or
799`defcustom', you should always load that file _outside_ any bindings 797`defcustom', you should always load that file _outside_ any bindings
800for these variables. \(`defconst' and `defcustom' behave similarly in 798for these variables. \(`defconst' and `defcustom' behave similarly in
801this respect.) 799this respect.)
800
801The optional argument DOCSTRING is a documentation string for the
802variable.
803
804To define a user option, use `defcustom' instead of `defvar'.
805The function `user-variable-p' also identifies a variable as a user
806option if its DOCSTRING starts with *, but this behavior is obsolete.
802usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) 807usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
803 (Lisp_Object args) 808 (Lisp_Object args)
804{ 809{
@@ -873,15 +878,19 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
873 878
874DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0, 879DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0,
875 doc: /* Define SYMBOL as a constant variable. 880 doc: /* Define SYMBOL as a constant variable.
876The intent is that neither programs nor users should ever change this value. 881This declares that neither programs nor users should ever change the
877Always sets the value of SYMBOL to the result of evalling INITVALUE. 882value. This constancy is not actually enforced by Emacs Lisp, but
878If SYMBOL is buffer-local, its default value is what is set; 883SYMBOL is marked as a special variable so that it is never lexically
879 buffer-local values are not affected. 884bound.
880DOCSTRING is optional. 885
881 886The `defconst' form always sets the value of SYMBOL to the result of
882If SYMBOL has a local binding, then this form sets the local binding's 887evalling INITVALUE. If SYMBOL is buffer-local, its default value is
883value. However, you should normally not make local bindings for 888what is set; buffer-local values are not affected. If SYMBOL has a
884variables defined with this form. 889local binding, then this form sets the local binding's value.
890However, you should normally not make local bindings for variables
891defined with this form.
892
893The optional DOCSTRING specifies the variable's documentation string.
885usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) 894usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
886 (Lisp_Object args) 895 (Lisp_Object args)
887{ 896{
diff --git a/src/image.c b/src/image.c
index b2951dd70fb..73490fe2865 100644
--- a/src/image.c
+++ b/src/image.c
@@ -976,7 +976,7 @@ or omitted means use the selected frame. */)
976 976
977static void free_image (struct frame *f, struct image *img); 977static void free_image (struct frame *f, struct image *img);
978 978
979#define MAX_IMAGE_SIZE 6.0 979#define MAX_IMAGE_SIZE 10.0
980/* Allocate and return a new image structure for image specification 980/* Allocate and return a new image structure for image specification
981 SPEC. SPEC has a hash value of HASH. */ 981 SPEC. SPEC has a hash value of HASH. */
982 982