aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2012-03-20 18:54:57 +0100
committerJoakim Verona2012-03-20 18:54:57 +0100
commitb827329a89291ed68dd017c53976be7ce5ed3b22 (patch)
treea020a2c4bd3e27be292cfab0973aa85cb0c0c52a
parent28d5f38df4f3b2f2cd9bc36494b3c0d8034c6f6b (diff)
parentf0bcceb9955d5aef6a131a86c4f74cc3e6e4c9ec (diff)
downloademacs-b827329a89291ed68dd017c53976be7ce5ed3b22.tar.gz
emacs-b827329a89291ed68dd017c53976be7ce5ed3b22.zip
upstream
-rw-r--r--admin/FOR-RELEASE5
-rw-r--r--doc/emacs/ChangeLog15
-rw-r--r--doc/emacs/dired.texi6
-rw-r--r--doc/emacs/help.texi3
-rw-r--r--doc/emacs/mule.texi6
-rw-r--r--doc/emacs/package.texi45
-rw-r--r--doc/lispref/ChangeLog49
-rw-r--r--doc/lispref/display.texi122
-rw-r--r--doc/lispref/frames.texi3
-rw-r--r--doc/lispref/internals.texi180
-rw-r--r--doc/lispref/modes.texi4
-rw-r--r--doc/lispref/os.texi386
-rw-r--r--doc/lispref/package.texi41
-rw-r--r--etc/ChangeLog5
-rw-r--r--etc/HELLO5
-rw-r--r--etc/NEWS7
-rw-r--r--leim/ChangeLog4
-rw-r--r--leim/quail/indian.el2
-rw-r--r--lisp/ChangeLog136
-rw-r--r--lisp/calendar/calendar.el28
-rw-r--r--lisp/comint.el49
-rw-r--r--lisp/emacs-lisp/copyright.el2
-rw-r--r--lisp/emacs-lisp/ring.el33
-rw-r--r--lisp/emacs-lisp/tabulated-list.el9
-rw-r--r--lisp/faces.el5
-rw-r--r--lisp/font-lock.el2
-rw-r--r--lisp/gnus/ChangeLog24
-rw-r--r--lisp/gnus/gnus-msg.el1
-rw-r--r--lisp/gnus/gnus-sum.el4
-rw-r--r--lisp/gnus/shr.el49
-rw-r--r--lisp/htmlfontify.el159
-rw-r--r--lisp/imenu.el18
-rw-r--r--lisp/mail/sendmail.el7
-rw-r--r--lisp/net/rcirc.el18
-rw-r--r--lisp/progmodes/cc-engine.el57
-rw-r--r--lisp/progmodes/cc-mode.el4
-rw-r--r--lisp/progmodes/perl-mode.el6
-rw-r--r--lisp/subr.el20
-rw-r--r--lisp/tar-mode.el3
-rw-r--r--lisp/textmodes/artist.el3
-rw-r--r--lisp/textmodes/ispell.el90
-rw-r--r--lisp/url/ChangeLog5
-rw-r--r--lisp/url/url-queue.el17
-rw-r--r--lisp/vc/vc-hg.el47
-rw-r--r--lisp/view.el18
-rw-r--r--src/ChangeLog18
-rw-r--r--src/dispnew.c29
-rw-r--r--src/ftfont.c2
-rw-r--r--src/xdisp.c25
49 files changed, 1157 insertions, 619 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index fe3bab7feb0..73ff5ab7810 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -203,8 +203,7 @@ hash.texi cyd
203help.texi cyd 203help.texi cyd
204hooks.texi rgm 204hooks.texi rgm
205index.texi 205index.texi
206internals.texi rgm (I don't know much about this, so it would be 206internals.texi rgm cyd
207 good if someone else could at least look at the FIXME? comments.)
208intro.texi cyd 207intro.texi cyd
209keymaps.texi cyd 208keymaps.texi cyd
210lists.texi cyd 209lists.texi cyd
@@ -217,7 +216,7 @@ modes.texi cyd
217nonascii.texi cyd 216nonascii.texi cyd
218numbers.texi cyd 217numbers.texi cyd
219objects.texi cyd 218objects.texi cyd
220os.texi 219os.texi cyd
221package.texi rgm 220package.texi rgm
222positions.texi cyd 221positions.texi cyd
223processes.texi 222processes.texi
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 5a1d1394b23..f5ccba1005f 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,18 @@
12012-03-17 Chong Yidong <cyd@gnu.org>
2
3 * package.texi (Package Installation): Document use of
4 package-initialize in init file.
5
62012-03-16 Glenn Morris <rgm@gnu.org>
7
8 * help.texi (Language Help):
9 * mule.texi (International Chars):
10 etc/HELLO is for character demonstration.
11
122012-03-15 Dani Moncayo <dmoncayo@gmail.com> (tiny change)
13
14 * dired.texi (Shell Commands in Dired): Fix typo.
15
12012-03-04 Chong Yidong <cyd@gnu.org> 162012-03-04 Chong Yidong <cyd@gnu.org>
2 17
3 * killing.texi (Clipboard): Document clipboard manager. 18 * killing.texi (Clipboard): Document clipboard manager.
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index e048237a4e2..7dd290939fe 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -823,9 +823,9 @@ replaces each occurrence.
823 823
824@item 824@item
825If the command string contains neither @samp{*} nor @samp{?}, Emacs 825If the command string contains neither @samp{*} nor @samp{?}, Emacs
826runs the shell command once for each file, adding the file name is 826runs the shell command once for each file, adding the file name at the
827added at the end. For example, @kbd{! uudecode @key{RET}} runs 827end. For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on
828@code{uudecode} on each file. 828each file.
829@end itemize 829@end itemize
830 830
831 To iterate over the file names in a more complicated fashion, use an 831 To iterate over the file names in a more complicated fashion, use an
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index 05a3e546322..84da0a9a681 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -464,7 +464,8 @@ listing the associated character sets, coding systems, and input
464methods, as well as some sample text for that language environment. 464methods, as well as some sample text for that language environment.
465 465
466 The command @kbd{C-h h} (@code{view-hello-file}) displays the file 466 The command @kbd{C-h h} (@code{view-hello-file}) displays the file
467@file{etc/HELLO}, which shows how to say ``hello'' in many languages. 467@file{etc/HELLO}, which demonstrates various character sets by showing
468how to say ``hello'' in many languages.
468 469
469 The command @kbd{C-h I} (@code{describe-input-method}) describes an 470 The command @kbd{C-h I} (@code{describe-input-method}) describes an
470input method---either a specified input method, or by default the 471input method---either a specified input method, or by default the
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index aebff1e463a..aeaec2c502e 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1997, 1999-2012 Free Software Foundation, Inc. 2@c Copyright (C) 1997, 1999-2012 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@node International, Modes, Frames, Top 4@node International, Modes, Frames, Top
5@chapter International Character Set Support 5@chapter International Character Set Support
@@ -137,8 +137,8 @@ writing files, and when exchanging data with subprocesses.
137@cindex undisplayable characters 137@cindex undisplayable characters
138@cindex @samp{?} in display 138@cindex @samp{?} in display
139 The command @kbd{C-h h} (@code{view-hello-file}) displays the file 139 The command @kbd{C-h h} (@code{view-hello-file}) displays the file
140@file{etc/HELLO}, which shows how to say ``hello'' in many languages. 140@file{etc/HELLO}, which illustrates various scripts by showing
141This illustrates various scripts. If some characters can't be 141how to say ``hello'' in many languages. If some characters can't be
142displayed on your terminal, they appear as @samp{?} or as hollow boxes 142displayed on your terminal, they appear as @samp{?} or as hollow boxes
143(@pxref{Undisplayable Characters}). 143(@pxref{Undisplayable Characters}).
144 144
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi
index 7e2aa20d52e..91b25cfa00e 100644
--- a/doc/emacs/package.texi
+++ b/doc/emacs/package.texi
@@ -157,25 +157,38 @@ directory name of the package archive. You can alter this list if you
157wish to use third party package archives---but do so at your own risk, 157wish to use third party package archives---but do so at your own risk,
158and use only third parties that you think you can trust! 158and use only third parties that you think you can trust!
159 159
160 Once a package is downloaded and installed, it takes effect in the 160 Once a package is downloaded and installed, it is @dfn{loaded} into
161current Emacs session. What ``taking effect'' means depends on the 161the current Emacs session. Loading a package is not quite the same as
162package; most packages just make some new commands available, while 162loading a Lisp library (@pxref{Lisp Libraries}); its effect varies
163others have more wide-ranging effects on the Emacs session. For such 163from package to package. Most packages just make some new commands
164information, consult the package's help buffer. 164available, while others have more wide-ranging effects on the Emacs
165 165session. For such information, consult the package's help buffer.
166 By default, Emacs also automatically loads all installed packages 166
167(causing them to ``take effect'') in subsequent Emacs sessions. This 167 By default, Emacs also automatically loads all installed packages in
168happens at startup, after processing the init file (@pxref{Init 168subsequent Emacs sessions. This happens at startup, after processing
169File}). As an exception, Emacs does not load packages at startup if 169the init file (@pxref{Init File}). As an exception, Emacs does not
170invoked with the @samp{-q} or @samp{--no-init-file} options 170load packages at startup if invoked with the @samp{-q} or
171(@pxref{Initial Options}). 171@samp{--no-init-file} options (@pxref{Initial Options}).
172 172
173@vindex package-enable-at-startup 173@vindex package-enable-at-startup
174@findex package-initialize
175 To disable automatic package loading, change the variable 174 To disable automatic package loading, change the variable
176@code{package-enable-at-startup} to @code{nil}. If you do this, you 175@code{package-enable-at-startup} to @code{nil}.
177can use the command @kbd{M-x package-initialize} to load your 176
178packages. 177@findex package-initialize
178 The reason automatic package loading occurs after loading the init
179file is that user options only receive their customized values after
180loading the init file, including user options which affect the
181packaging system. In some circumstances, you may want to load
182packages explicitly in your init file (usually because some other code
183in your init file depends on a package). In that case, your init file
184should call the function @code{package-initialize}. It is up to you
185to ensure that relevant user options, such as @code{package-load-list}
186(see below), are set up prior to the @code{package-initialize} call.
187You should also set @code{package-enable-at-startup} to @code{nil}, to
188avoid loading the packages again after processing the init file.
189Alternatively, you may choose to completely inhibit package loading at
190startup, and invoke the command @kbd{M-x package-initialize} to load
191your packages manually.
179 192
180@vindex package-load-list 193@vindex package-load-list
181 For finer control over package loading, you can use the variable 194 For finer control over package loading, you can use the variable
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 3584c89d5fe..43ae349cb4c 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,52 @@
12012-03-20 Chong Yidong <cyd@gnu.org>
2
3 * display.texi (Forcing Redisplay): Various rewrites to reflect
4 new value of redisplay-dont-pause.
5 (Truncation): Copyedits.
6
72012-03-20 Glenn Morris <rgm@gnu.org>
8
9 * os.texi (Startup Summary): Don't mention initial-buffer-choice = t.
10 Add summary table of some relevant command-line options.
11
122012-03-18 Chong Yidong <cyd@gnu.org>
13
14 * internals.texi (Building Emacs, Garbage Collection): Copyedits.
15 (Writing Emacs Primitives): Re-organize discussion of functions
16 with variable Lisp arguments are handled. Delete an obsolete
17 remark, previously tagged as FIXME.
18
19 * os.texi (Idle Timers): Minor clarification.
20 (Idle Timers): Link to Time of Day for description of time list.
21
222012-03-18 Glenn Morris <rgm@gnu.org>
23
24 * os.texi (System Interface): Flow control was removed.
25 (Startup Summary): General update.
26 (Init File): Don't mention compiling it.
27
282012-03-17 Chong Yidong <cyd@gnu.org>
29
30 * os.texi (Startup Summary): Mention package loading.
31 (Init File): Don't refer to .emacs in section title. Copyedits.
32 (Terminal-Specific): Give a realistic example.
33 (Command-Line Arguments): Reference Entering Emacs instead of
34 repeating the spiel about not restarting Emacs.
35 (Time of Day): Discuss time representation at beginning of node.
36 (Sound Output): Copyedits.
37
38 * package.texi (Packaging Basics): Document package-initialize.
39
402012-03-17 Eli Zaretskii <eliz@gnu.org>
41
42 * frames.texi (Initial Parameters): Add an index entry for
43 minibuffer-only frame.
44
452012-03-16 Glenn Morris <rgm@gnu.org>
46
47 * modes.texi (Major Mode Conventions): Mention the strange
48 relationship between View mode and special modes. (Bug#10650)
49
12012-03-11 Chong Yidong <cyd@gnu.org> 502012-03-11 Chong Yidong <cyd@gnu.org>
2 51
3 * windows.texi (Window Configurations): save-window-excursion is 52 * windows.texi (Window Configurations): save-window-excursion is
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index c70418be52b..b68b0697936 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -86,59 +86,57 @@ attempt to redisplay, in the middle of Lisp code, without actually
86waiting for input. 86waiting for input.
87 87
88@defun redisplay &optional force 88@defun redisplay &optional force
89This function tries immediately to redisplay, provided there are no 89This function tries immediately to redisplay. The optional argument
90pending input events. 90@var{force}, if non-@code{nil}, forces the redisplay to be performed,
91 91instead of being preempted, even if input is pending and the variable
92If the optional argument @var{force} is non-@code{nil}, it does all 92@code{redisplay-dont-pause} is @code{nil} (see below). If
93pending redisplay work even if input is available, with no 93@code{redisplay-dont-pause} is non-@code{nil} (the default), this
94pre-emption. 94function redisplays in any case, i.e.@: @var{force} does nothing.
95 95
96The function returns @code{t} if it actually tried to redisplay, and 96The function returns @code{t} if it actually tried to redisplay, and
97@code{nil} otherwise. A value of @code{t} does not mean that 97@code{nil} otherwise. A value of @code{t} does not mean that
98redisplay proceeded to completion; it could have been pre-empted by 98redisplay proceeded to completion; it could have been preempted by
99newly arriving terminal input. 99newly arriving input.
100@end defun
101
102 @code{redisplay} with no argument tries immediately to redisplay,
103but has no effect on the usual rules for what parts of the screen to
104redisplay. By contrast, the following function adds certain windows
105to the pending redisplay work (as if their contents had completely
106changed), but doesn't immediately try to do any redisplay work.
107
108@defun force-window-update &optional object
109This function forces some or all windows to be updated on next
110redisplay. If @var{object} is a window, it requires eventual
111redisplay of that window. If @var{object} is a buffer or buffer name,
112it requires eventual redisplay of all windows displaying that buffer.
113If @var{object} is @code{nil} (or omitted), it requires eventual
114redisplay of all windows.
115@end defun 100@end defun
116 101
117 @code{force-window-update} does not do a redisplay immediately.
118(Emacs will do that when it waits for input.) Rather, its effect is
119to put more work on the queue to be done by redisplay whenever there
120is a chance.
121
122@defvar redisplay-dont-pause 102@defvar redisplay-dont-pause
123If this variable is non-@code{nil}, pending input does not prevent or 103If this variable is @code{nil}, arriving input events preempt
124halt redisplay; redisplay occurs, and finishes, regardless of whether 104redisplay; Emacs avoids starting a redisplay, and stops any redisplay
125input is available. If it is @code{nil}, Emacs redisplay stops if 105that is in progress, until the input has been processed. In
126input arrives, and does not happen at all if input is available before 106particular, @code{(redisplay)} returns @code{nil} without actually
127it starts. The default is @code{t}. 107redisplaying, if there is pending input.
108
109The default value is @code{t}, which means that pending input does not
110preempt redisplay.
128@end defvar 111@end defvar
129 112
130@defvar redisplay-preemption-period 113@defvar redisplay-preemption-period
131This variable specifies how many seconds Emacs waits between checks 114If @code{redisplay-dont-pause} is @code{nil}, this variable specifies
132for new input during redisplay. (The default is 0.1 seconds.) If 115how many seconds Emacs waits between checks for new input during
133input has arrived when Emacs checks, it pre-empts redisplay and 116redisplay; if input arrives during this interval, redisplay stops and
134processes the available input before trying again to redisplay. 117the input is processed. The default value is 0.1; if the value is
118@code{nil}, Emacs does not check for input during redisplay.
119
120This variable has no effect when @code{redisplay-dont-pause} is
121non-@code{nil} (the default).
122@end defvar
135 123
136If this variable is @code{nil}, Emacs does not check for input during 124 Although @code{redisplay} tries immediately to redisplay, it does
137redisplay, and redisplay cannot be preempted by input. 125not change how Emacs decides which parts of its frame(s) to redisplay.
126By contrast, the following function adds certain windows to the
127pending redisplay work (as if their contents had completely changed),
128but does not immediately try to perform redisplay.
138 129
139This variable is only obeyed on graphical terminals. For 130@defun force-window-update &optional object
140text terminals, see @ref{Terminal Output}. 131This function forces some or all windows to be updated the next time
141@end defvar 132Emacs does a redisplay. If @var{object} is a window, that window is
133to be updated. If @var{object} is a buffer or buffer name, all
134windows displaying that buffer are to be updated. If @var{object} is
135@code{nil} (or omitted), all windows are to be updated.
136
137This function does not do a redisplay immediately; Emacs does that as
138it waits for input, or when the function @code{redisplay} is called.
139@end defun
142 140
143@node Truncation 141@node Truncation
144@section Truncation 142@section Truncation
@@ -169,7 +167,7 @@ If this buffer-local variable is non-@code{nil}, lines that extend
169beyond the right edge of the window are truncated; otherwise, they are 167beyond the right edge of the window are truncated; otherwise, they are
170continued. As a special exception, the variable 168continued. As a special exception, the variable
171@code{truncate-partial-width-windows} takes precedence in 169@code{truncate-partial-width-windows} takes precedence in
172@dfn{partial-width} windows (i.e., windows that do not occupy the 170@dfn{partial-width} windows (i.e.@: windows that do not occupy the
173entire frame width). 171entire frame width).
174@end defopt 172@end defopt
175 173
@@ -192,37 +190,37 @@ a window, that forces truncation.
192 190
193@defvar wrap-prefix 191@defvar wrap-prefix
194If this buffer-local variable is non-@code{nil}, it defines a 192If this buffer-local variable is non-@code{nil}, it defines a
195``prefix'' that is prepended to every continuation line at 193@dfn{wrap prefix} which Emacs displays at the start of every
196display time. (If lines are truncated, the wrap-prefix is never 194continuation line. (If lines are truncated, @code{wrap-prefix} is
197used.) It may be a string or an image (@pxref{Other Display Specs}), 195never used.) Its value may be a string or an image (@pxref{Other
198or a stretch of whitespace such as specified by the @code{:width} or 196Display Specs}), or a stretch of whitespace such as specified by the
199@code{:align-to} display properties (@pxref{Specified Space}). The 197@code{:width} or @code{:align-to} display properties (@pxref{Specified
200value is interpreted in the same way as a @code{display} text 198Space}). The value is interpreted in the same way as a @code{display}
201property. @xref{Display Property}. 199text property. @xref{Display Property}.
202 200
203A wrap-prefix may also be specified for regions of text, using the 201A wrap prefix may also be specified for regions of text, using the
204@code{wrap-prefix} text or overlay property. This takes precedence 202@code{wrap-prefix} text or overlay property. This takes precedence
205over the @code{wrap-prefix} variable. @xref{Special Properties}. 203over the @code{wrap-prefix} variable. @xref{Special Properties}.
206@end defvar 204@end defvar
207 205
208@defvar line-prefix 206@defvar line-prefix
209If this buffer-local variable is non-@code{nil}, it defines a 207If this buffer-local variable is non-@code{nil}, it defines a
210``prefix'' that is prepended to every non-continuation line at 208@dfn{line prefix} which Emacs displays at the start of every
211display time. It may be a string or an image (@pxref{Other Display 209non-continuation line. Its value may be a string or an image
212Specs}), or a stretch of whitespace such as specified by the 210(@pxref{Other Display Specs}), or a stretch of whitespace such as
213@code{:width} or @code{:align-to} display properties (@pxref{Specified 211specified by the @code{:width} or @code{:align-to} display properties
214Space}). The value is interpreted in the same way as a @code{display} 212(@pxref{Specified Space}). The value is interpreted in the same way
215text property. @xref{Display Property}. 213as a @code{display} text property. @xref{Display Property}.
216 214
217A line-prefix may also be specified for regions of text using the 215A line prefix may also be specified for regions of text using the
218@code{line-prefix} text or overlay property. This takes precedence 216@code{line-prefix} text or overlay property. This takes precedence
219over the @code{line-prefix} variable. @xref{Special Properties}. 217over the @code{line-prefix} variable. @xref{Special Properties}.
220@end defvar 218@end defvar
221 219
222 If your buffer contains @emph{very} long lines, and you use 220 If your buffer contains @emph{very} long lines, and you use
223continuation to display them, computing the continuation lines can 221continuation to display them, computing the continuation lines can
224make Emacs redisplay slow. The column computation and indentation 222make redisplay slow. The column computation and indentation functions
225functions also become slow. Then you might find it advisable to set 223also become slow. Then you might find it advisable to set
226@code{cache-long-line-scans} to @code{t}. 224@code{cache-long-line-scans} to @code{t}.
227 225
228@defvar cache-long-line-scans 226@defvar cache-long-line-scans
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index a01ad051489..125d6071cab 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -420,10 +420,11 @@ the initial frame, specify the same parameters in
420@code{initial-frame-alist} with values that match the X resources. 420@code{initial-frame-alist} with values that match the X resources.
421@end defopt 421@end defopt
422 422
423If these parameters specify a separate minibuffer-only frame with 423If these parameters specify a separate @dfn{minibuffer-only frame} with
424@code{(minibuffer . nil)}, and you have not created one, Emacs creates 424@code{(minibuffer . nil)}, and you have not created one, Emacs creates
425one for you. 425one for you.
426 426
427@cindex minibuffer-only frame
427@defopt minibuffer-frame-alist 428@defopt minibuffer-frame-alist
428This variable's value is an alist of parameter values used when 429This variable's value is an alist of parameter values used when
429creating an initial minibuffer-only frame. This is the 430creating an initial minibuffer-only frame. This is the
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 55b18edf2ec..edf892e751a 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -28,42 +28,39 @@ internal aspects of GNU Emacs that may be of interest to C programmers.
28 This section explains the steps involved in building the Emacs 28 This section explains the steps involved in building the Emacs
29executable. You don't have to know this material to build and install 29executable. You don't have to know this material to build and install
30Emacs, since the makefiles do all these things automatically. This 30Emacs, since the makefiles do all these things automatically. This
31information is pertinent to Emacs maintenance. 31information is pertinent to Emacs developers.
32 32
33 Compilation of the C source files in the @file{src} directory 33 Compilation of the C source files in the @file{src} directory
34produces an executable file called @file{temacs}, also called a 34produces an executable file called @file{temacs}, also called a
35@dfn{bare impure Emacs}. It contains the Emacs Lisp interpreter and I/O 35@dfn{bare impure Emacs}. It contains the Emacs Lisp interpreter and
36routines, but not the editing commands. 36I/O routines, but not the editing commands.
37 37
38@cindex @file{loadup.el} 38@cindex @file{loadup.el}
39 The command @w{@samp{temacs -l loadup}} uses @file{temacs} to create 39 The command @w{@command{temacs -l loadup}} would run @file{temacs}
40the real runnable Emacs executable. These arguments direct 40and direct it to load @file{loadup.el}. The @code{loadup} library
41@file{temacs} to evaluate the Lisp files specified in the file 41loads additional Lisp libraries, which set up the normal Emacs editing
42@file{loadup.el}. These files set up the normal Emacs editing 42environment. After this step, the Emacs executable is no longer
43environment, resulting in an Emacs that is still impure but no longer 43@dfn{bare}.
44bare.
45 44
46@cindex dumping Emacs 45@cindex dumping Emacs
47 It takes some time to load the standard Lisp files. Luckily, 46 Because it takes some time to load the standard Lisp files, the
48you don't have to do this each time you run Emacs; @file{temacs} can 47@file{temacs} executable usually isn't run directly by users.
49dump out an executable program called @file{emacs} that has these files 48Instead, as one of the last steps of building Emacs, the command
50preloaded. @file{emacs} starts more quickly because it does not need to 49@samp{temacs -batch -l loadup dump} is run. The special @samp{dump}
51load the files. This is the Emacs executable that is normally 50argument causes @command{temacs} to dump out an executable program,
52installed. 51called @file{emacs}, which has all the standard Lisp files preloaded.
53 52(The @samp{-batch} argument prevents @file{temacs} from trying to
53initialize any of its data on the terminal, so that the tables of
54terminal information are empty in the dumped Emacs.)
55
56@cindex preloaded Lisp files
54@vindex preloaded-file-list 57@vindex preloaded-file-list
55@cindex dumped Lisp files 58 The dumped @file{emacs} executable (also called a @dfn{pure} Emacs)
56 To create @file{emacs}, use the command @samp{temacs -batch -l loadup 59is the one which is installed. The variable
57dump}. The purpose of @samp{-batch} here is to prevent @file{temacs} 60@code{preloaded-file-list} stores a list of the Lisp files preloaded
58from trying to initialize any of its data on the terminal; this ensures 61into the dumped Emacs. If you port Emacs to a new operating system,
59that the tables of terminal information are empty in the dumped Emacs. 62and are not able to implement dumping, then Emacs must load
60The argument @samp{dump} tells @file{loadup.el} to dump a new executable 63@file{loadup.el} each time it starts.
61named @file{emacs}. The variable @code{preloaded-file-list} stores a
62list of the Lisp files that were dumped with the @file{emacs} executable.
63
64 If you port Emacs to a new operating system, and are not able to
65implement dumping, then Emacs must load @file{loadup.el} each time it
66starts.
67 64
68@cindex @file{site-load.el} 65@cindex @file{site-load.el}
69 You can specify additional files to preload by writing a library named 66 You can specify additional files to preload by writing a library named
@@ -163,7 +160,7 @@ all the new data created during an Emacs session are kept
163in the preloaded standard Lisp files---data that should never change 160in the preloaded standard Lisp files---data that should never change
164during actual use of Emacs. 161during actual use of Emacs.
165 162
166 Pure storage is allocated only while @file{temacs} is loading the 163 Pure storage is allocated only while @command{temacs} is loading the
167standard preloaded Lisp libraries. In the file @file{emacs}, it is 164standard preloaded Lisp libraries. In the file @file{emacs}, it is
168marked as read-only (on operating systems that permit this), so that 165marked as read-only (on operating systems that permit this), so that
169the memory space can be shared by all the Emacs jobs running on the 166the memory space can be shared by all the Emacs jobs running on the
@@ -214,31 +211,27 @@ You should not change this flag in a running Emacs.
214 211
215@node Garbage Collection 212@node Garbage Collection
216@section Garbage Collection 213@section Garbage Collection
217@cindex garbage collection
218 214
219@cindex memory allocation 215@cindex memory allocation
220 When a program creates a list or the user defines a new function (such 216 When a program creates a list or the user defines a new function
221as by loading a library), that data is placed in normal storage. If 217(such as by loading a library), that data is placed in normal storage.
222normal storage runs low, then Emacs asks the operating system to 218If normal storage runs low, then Emacs asks the operating system to
223allocate more memory in blocks of 1k bytes. Each block is used for one 219allocate more memory. Different types of Lisp objects, such as
224type of Lisp object, so symbols, cons cells, markers, etc., are 220symbols, cons cells, markers, etc., are segregated in distinct blocks
225segregated in distinct blocks in memory. (Vectors, long strings, 221in memory. (Vectors, long strings, buffers and certain other editing
226buffers and certain other editing types, which are fairly large, are 222types, which are fairly large, are allocated in individual blocks, one
227allocated in individual blocks, one per object, while small strings are 223per object, while small strings are packed into blocks of 8k bytes.)
228packed into blocks of 8k bytes.)
229
230 It is quite common to use some storage for a while, then release it by
231(for example) killing a buffer or deleting the last pointer to an
232object. Emacs provides a @dfn{garbage collector} to reclaim this
233abandoned storage. (This name is traditional, but ``garbage recycler''
234might be a more intuitive metaphor for this facility.)
235 224
236 The garbage collector operates by finding and marking all Lisp objects 225@cindex garbage collection
237that are still accessible to Lisp programs. To begin with, it assumes 226 It is quite common to use some storage for a while, then release it
238all the symbols, their values and associated function definitions, and 227by (for example) killing a buffer or deleting the last pointer to an
239any data presently on the stack, are accessible. Any objects that can 228object. Emacs provides a @dfn{garbage collector} to reclaim this
240be reached indirectly through other accessible objects are also 229abandoned storage. The garbage collector operates by finding and
241accessible. 230marking all Lisp objects that are still accessible to Lisp programs.
231To begin with, it assumes all the symbols, their values and associated
232function definitions, and any data presently on the stack, are
233accessible. Any objects that can be reached indirectly through other
234accessible objects are also accessible.
242 235
243 When marking is finished, all objects still unmarked are garbage. No 236 When marking is finished, all objects still unmarked are garbage. No
244matter what the Lisp program or the user does, it is impossible to refer 237matter what the Lisp program or the user does, it is impossible to refer
@@ -336,11 +329,9 @@ The total size of all strings, in characters.
336The total number of elements of existing vectors. 329The total number of elements of existing vectors.
337 330
338@item used-floats 331@item used-floats
339@c Emacs 19 feature
340The number of floats in use. 332The number of floats in use.
341 333
342@item free-floats 334@item free-floats
343@c Emacs 19 feature
344The number of floats for which space has been obtained from the 335The number of floats for which space has been obtained from the
345operating system, but that are not currently being used. 336operating system, but that are not currently being used.
346 337
@@ -417,7 +408,6 @@ memory used by Lisp data, broken down by data type. By contrast, the
417function @code{memory-limit} provides information on the total amount of 408function @code{memory-limit} provides information on the total amount of
418memory Emacs is currently using. 409memory Emacs is currently using.
419 410
420@c Emacs 19 feature
421@defun memory-limit 411@defun memory-limit
422This function returns the address of the last byte Emacs has allocated, 412This function returns the address of the last byte Emacs has allocated,
423divided by 1024. We divide the value by 1024 to make sure it fits in a 413divided by 1024. We divide the value by 1024 to make sure it fits in a
@@ -428,7 +418,7 @@ memory usage.
428@end defun 418@end defun
429 419
430@defvar memory-full 420@defvar memory-full
431This variable is @code{t} if Emacs is close to out of memory for Lisp 421This variable is @code{t} if Emacs is nearly out of memory for Lisp
432objects, and @code{nil} otherwise. 422objects, and @code{nil} otherwise.
433@end defvar 423@end defvar
434 424
@@ -519,8 +509,9 @@ appearance.)
519@smallexample 509@smallexample
520@group 510@group
521DEFUN ("or", For, Sor, 0, UNEVALLED, 0, 511DEFUN ("or", For, Sor, 0, UNEVALLED, 0,
522 doc: /* Eval args until one of them yields non-nil, then return that 512 doc: /* Eval args until one of them yields non-nil, then return
523value. The remaining args are not evalled at all. 513that value.
514The remaining args are not evalled at all.
524If all args return nil, return nil. 515If all args return nil, return nil.
525@end group 516@end group
526@group 517@group
@@ -566,14 +557,11 @@ This is the name of the Lisp symbol to define as the function name; in
566the example above, it is @code{or}. 557the example above, it is @code{or}.
567 558
568@item fname 559@item fname
569This is the C function name for this function. This is 560This is the C function name for this function. This is the name that
570the name that is used in C code for calling the function. The name is, 561is used in C code for calling the function. The name is, by
571by convention, @samp{F} prepended to the Lisp name, with all dashes 562convention, @samp{F} prepended to the Lisp name, with all dashes
572(@samp{-}) in the Lisp name changed to underscores. Thus, to call this 563(@samp{-}) in the Lisp name changed to underscores. Thus, to call
573function from C code, call @code{For}. Remember that the arguments must 564this function from C code, call @code{For}.
574be of type @code{Lisp_Object}; various macros and functions for creating
575values of type @code{Lisp_Object} are declared in the file
576@file{lisp.h}.
577 565
578@item sname 566@item sname
579This is a C variable name to use for a structure that holds the data for 567This is a C variable name to use for a structure that holds the data for
@@ -627,38 +615,35 @@ too.
627@end table 615@end table
628 616
629 After the call to the @code{DEFUN} macro, you must write the 617 After the call to the @code{DEFUN} macro, you must write the
630argument list that every C function must have, including the types for 618argument list for the C function, including the types for the
631the arguments. For a function with a fixed maximum number of 619arguments. If the primitive accepts a fixed maximum number of Lisp
632arguments, declare a C argument for each Lisp argument, and give them 620arguments, there must be one C argument for each Lisp argument, and
633all type @code{Lisp_Object}. When a Lisp function has no upper limit 621each argument must be of type @code{Lisp_Object}. (Various macros and
634on the number of arguments, its implementation in C actually receives 622functions for creating values of type @code{Lisp_Object} are declared
635exactly two arguments: the first is the number of Lisp arguments, and 623in the file @file{lisp.h}.) If the primitive has no upper limit on
636the second is the address of a block containing their values. They 624the number of Lisp arguments, it must have exactly two C arguments:
637have types @code{int} and @w{@code{Lisp_Object *}}. 625the first is the number of Lisp arguments, and the second is the
626address of a block containing their values. These have types
627@code{int} and @w{@code{Lisp_Object *}} respectively.
638 628
639@cindex @code{GCPRO} and @code{UNGCPRO} 629@cindex @code{GCPRO} and @code{UNGCPRO}
640@cindex protect C variables from garbage collection 630@cindex protect C variables from garbage collection
641 Within the function @code{For} itself, note the use of the macros 631 Within the function @code{For} itself, note the use of the macros
642@code{GCPRO1} and @code{UNGCPRO}. @code{GCPRO1} is used to 632@code{GCPRO1} and @code{UNGCPRO}. These macros are defined for the
643``protect'' a variable from garbage collection---to inform the garbage 633sake of the few platforms which do not use Emacs' default
644collector that it must look in that variable and regard its contents 634stack-marking garbage collector. The @code{GCPRO1} macro ``protects''
645as an accessible object. GC protection is necessary whenever you call 635a variable from garbage collection, explicitly informing the garbage
646@code{eval_sub} (or @code{Feval}) either directly or indirectly. 636collector that that variable and all its contents must be as
647At such a time, any Lisp object that this function may refer to again 637accessible. GC protection is necessary in any function which can
648must be protected somehow. 638perform Lisp evaluation by calling @code{eval_sub} or @code{Feval} as
639a subroutine, either directly or indirectly.
649 640
650 It suffices to ensure that at least one pointer to each object is 641 It suffices to ensure that at least one pointer to each object is
651GC-protected; that way, the object cannot be recycled, so all pointers 642GC-protected. Thus, a particular local variable can do without
652to it remain valid. Thus, a particular local variable can do without
653protection if it is certain that the object it points to will be 643protection if it is certain that the object it points to will be
654preserved by some other pointer (such as another local variable that 644preserved by some other pointer (such as another local variable that
655has a @code{GCPRO}). 645has a @code{GCPRO}). Otherwise, the local variable needs a
656@ignore 646@code{GCPRO}.
657@footnote{Formerly, strings were a special exception; in older Emacs
658versions, every local variable that might point to a string needed a
659@code{GCPRO}.}.
660@end ignore
661Otherwise, the local variable needs a @code{GCPRO}.
662 647
663 The macro @code{GCPRO1} protects just one local variable. If you 648 The macro @code{GCPRO1} protects just one local variable. If you
664want to protect two variables, use @code{GCPRO2} instead; repeating 649want to protect two variables, use @code{GCPRO2} instead; repeating
@@ -667,34 +652,17 @@ want to protect two variables, use @code{GCPRO2} instead; repeating
667implicitly use local variables such as @code{gcpro1}; you must declare 652implicitly use local variables such as @code{gcpro1}; you must declare
668these explicitly, with type @code{struct gcpro}. Thus, if you use 653these explicitly, with type @code{struct gcpro}. Thus, if you use
669@code{GCPRO2}, you must declare @code{gcpro1} and @code{gcpro2}. 654@code{GCPRO2}, you must declare @code{gcpro1} and @code{gcpro2}.
670Alas, we can't explain all the tricky details here.
671 655
672 @code{UNGCPRO} cancels the protection of the variables that are 656 @code{UNGCPRO} cancels the protection of the variables that are
673protected in the current function. It is necessary to do this 657protected in the current function. It is necessary to do this
674explicitly. 658explicitly.
675 659
676 Built-in functions that take a variable number of arguments actually
677accept two arguments at the C level: the number of Lisp arguments, and
678a @code{Lisp_Object *} pointer to a C vector containing those Lisp
679arguments. This C vector may be part of a Lisp vector, but it need
680not be. The responsibility for using @code{GCPRO} to protect the Lisp
681arguments from GC if necessary rests with the caller in this case,
682since the caller allocated or found the storage for them.
683
684 You must not use C initializers for static or global variables unless 660 You must not use C initializers for static or global variables unless
685the variables are never written once Emacs is dumped. These variables 661the variables are never written once Emacs is dumped. These variables
686with initializers are allocated in an area of memory that becomes 662with initializers are allocated in an area of memory that becomes
687read-only (on certain operating systems) as a result of dumping Emacs. 663read-only (on certain operating systems) as a result of dumping Emacs.
688@xref{Pure Storage}. 664@xref{Pure Storage}.
689 665
690@c FIXME is this still true? I don't think so...
691 Do not use static variables within functions---place all static
692variables at top level in the file. This is necessary because Emacs on
693some operating systems defines the keyword @code{static} as a null
694macro. (This definition is used because those systems put all variables
695declared static in a place that becomes read-only after dumping, whether
696they have initializers or not.)
697
698@cindex @code{defsubr}, Lisp symbol for a primitive 666@cindex @code{defsubr}, Lisp symbol for a primitive
699 Defining the C function is not enough to make a Lisp primitive 667 Defining the C function is not enough to make a Lisp primitive
700available; you must also create the Lisp symbol for the primitive and 668available; you must also create the Lisp symbol for the primitive and
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index b0e9d4a3139..946dcb91317 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -525,6 +525,10 @@ mode when creating new buffers (@pxref{Auto Major Mode}), but with such
525@code{special} modes, Fundamental mode is used instead. Modes such as 525@code{special} modes, Fundamental mode is used instead. Modes such as
526Dired, Rmail, and Buffer List use this feature. 526Dired, Rmail, and Buffer List use this feature.
527 527
528The function @code{view-buffer} does not enable View mode in buffers
529whose mode-class is special, because such modes usually provide their
530own View-like bindings.
531
528The @code{define-derived-mode} macro automatically marks the derived 532The @code{define-derived-mode} macro automatically marks the derived
529mode as special if the parent mode is special. Special mode is a 533mode as special if the parent mode is special. Special mode is a
530convenient parent for such modes to inherit from; @xref{Basic Major 534convenient parent for such modes to inherit from; @xref{Basic Major
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index f7df5f4bf87..2563bc57aef 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -8,8 +8,7 @@
8@chapter Operating System Interface 8@chapter Operating System Interface
9 9
10 This chapter is about starting and getting out of Emacs, access to 10 This chapter is about starting and getting out of Emacs, access to
11values in the operating system environment, and terminal input, output, 11values in the operating system environment, and terminal input, output.
12and flow control.
13 12
14 @xref{Building Emacs}, for related information. @xref{Display}, for 13 @xref{Building Emacs}, for related information. @xref{Display}, for
15additional operating system status information pertaining to the 14additional operating system status information pertaining to the
@@ -60,7 +59,7 @@ can customize these actions.
60@cindex @file{startup.el} 59@cindex @file{startup.el}
61 60
62 When Emacs is started up, it performs the following operations 61 When Emacs is started up, it performs the following operations
63(which are defined in @file{startup.el}): 62(see @code{normal-top-level} in @file{startup.el}):
64 63
65@enumerate 64@enumerate
66@item 65@item
@@ -70,6 +69,15 @@ adds the directory's subdirectories to the list, and those are scanned
70in their turn. The files @file{subdirs.el} are normally generated 69in their turn. The files @file{subdirs.el} are normally generated
71automatically when Emacs is installed. 70automatically when Emacs is installed.
72 71
72@item
73It registers input methods by loading any @file{leim-list.el} file
74found in the @code{load-path}.
75
76@c It removes PWD from the environment if it is not accurate.
77@c It abbreviates default-directory.
78
79@c Now normal-top-level calls command-line.
80
73@vindex before-init-time 81@vindex before-init-time
74@item 82@item
75It sets the variable @code{before-init-time} to the value of 83It sets the variable @code{before-init-time} to the value of
@@ -77,32 +85,49 @@ It sets the variable @code{before-init-time} to the value of
77@code{after-init-time} to @code{nil}, which signals to Lisp programs 85@code{after-init-time} to @code{nil}, which signals to Lisp programs
78that Emacs is being initialized. 86that Emacs is being initialized.
79 87
88@c set-locale-environment
89@item
90It sets the language environment and the terminal coding system,
91if requested by environment variables such as @code{LANG}.
92
93@item
94It does some basic parsing of the command-line arguments.
95
80@vindex initial-window-system@r{, and startup} 96@vindex initial-window-system@r{, and startup}
81@vindex window-system-initialization-alist 97@vindex window-system-initialization-alist
82@item 98@item
83It loads the initialization library for the window system specified by 99If not running in batch mode, it initializes the window system that
84the variable @code{initial-window-system} (@pxref{Window Systems, 100the variable @code{initial-window-system} specifies (@pxref{Window
85initial-window-system}). This library's name is 101Systems, initial-window-system}). The initialization function for
86@file{term/@var{windowsystem}-win.el}, where @var{windowsystem} is the 102each supported window system is specified by
87value of @code{initial-window-system}. From that library, it calls 103@code{window-system-initialization-alist}. If the value
88the appropriate initialization function. The initialization function 104of @code{initial-window-system} is @var{windowsystem}, then the
89for each supported window system is specified by 105appropriate initialization function is defined in the file
90@code{window-system-initialization-alist}. 106@file{term/@var{windowsystem}-win.el}. This file should have been
107compiled into the Emacs executable when it was built.
91 108
92@item 109@item
93It sets the language environment and the terminal coding system, 110It runs the normal hook @code{before-init-hook}.
94if requested by environment variables such as @code{LANG}.
95 111
96@item 112@item
97It processes the initial options. (Some of them are handled 113If appropriate (e.g., not in batch mode or started as a daemon), it
98even earlier than this.) 114creates a graphical frame.
99 115
100@item 116@item
101It runs the normal hook @code{before-init-hook}. 117It initializes the initial frame's faces, and sets up the menu bar
118and tool bar if needed. If graphical frames are supported, it sets up
119the tool bar even if the current frame is not a graphical one, since a
120graphical frame may be created later on.
102 121
103@item 122@item
104It initializes the initial frame's faces, and turns on the menu bar 123It use @code{custom-reevaluate-setting} to re-initialize the members
105and tool bar if needed. 124of the list @code{custom-delayed-init-variables}. These are any
125pre-loaded user options whose default value depends on the run-time,
126rather than build-time, context.
127@xref{Building Emacs, custom-initialize-delay}.
128
129@c @item
130@c It registers the colors available for tty frames.
106 131
107@item 132@item
108It loads the library @file{site-start}, if it exists. This is not 133It loads the library @file{site-start}, if it exists. This is not
@@ -127,6 +152,11 @@ It loads your abbrevs from the file specified by
127(@pxref{Abbrev Files, abbrev-file-name}). This is not done if the 152(@pxref{Abbrev Files, abbrev-file-name}). This is not done if the
128option @samp{--batch} was specified. 153option @samp{--batch} was specified.
129 154
155@item
156If @code{package-enable-at-startup} is non-@code{nil}, it calls the
157function @code{package-initialize} to activate any optional Emacs Lisp
158package that has been installed. @xref{Packaging Basics}.
159
130@vindex after-init-time 160@vindex after-init-time
131@item 161@item
132It sets the variable @code{after-init-time} to the value of 162It sets the variable @code{after-init-time} to the value of
@@ -149,13 +179,17 @@ Lisp library, which is specified by the variable
149@code{term-file-prefix} (@pxref{Terminal-Specific}). This is not done 179@code{term-file-prefix} (@pxref{Terminal-Specific}). This is not done
150in @code{--batch} mode, nor if @code{term-file-prefix} is @code{nil}. 180in @code{--batch} mode, nor if @code{term-file-prefix} is @code{nil}.
151 181
182@c Now command-line calls command-line-1.
183
152@item 184@item
153It displays the initial echo area message, unless you have suppressed 185It displays the initial echo area message, unless you have suppressed
154that with @code{inhibit-startup-echo-area-message}. 186that with @code{inhibit-startup-echo-area-message}.
155 187
156@item 188@item
157It processes the action arguments from the command line. 189It processes any command-line options that were not handled earlier.
158 190
191@c This next one is back in command-line, but the remaining bits of
192@c command-line-1 are not done if noninteractive.
159@item 193@item
160It now exits if the option @code{--batch} was specified. 194It now exits if the option @code{--batch} was specified.
161 195
@@ -164,6 +198,15 @@ If @code{initial-buffer-choice} is a string, it visits the file with
164that name. Furthermore, if the @samp{*scratch*} buffer exists and is 198that name. Furthermore, if the @samp{*scratch*} buffer exists and is
165empty, it inserts @code{initial-scratch-message} into that buffer. 199empty, it inserts @code{initial-scratch-message} into that buffer.
166 200
201@c To make things nice and confusing, the next three items can be
202@c called from two places. If displaying a startup screen, they are
203@c called in command-line-1 before the startup screen is shown.
204@c inhibit-startup-hooks is then set and window-setup-hook set to nil.
205@c If not displaying a startup screen, they are are called in
206@c normal-top-level.
207@c FIXME? So it seems they can be called before or after the
208@c daemon/session restore step?
209
167@item 210@item
168It runs @code{emacs-startup-hook} and then @code{term-setup-hook}. 211It runs @code{emacs-startup-hook} and then @code{term-setup-hook}.
169 212
@@ -176,23 +219,38 @@ specify.
176It runs @code{window-setup-hook}. @xref{Window Systems}. 219It runs @code{window-setup-hook}. @xref{Window Systems}.
177 220
178@item 221@item
179If the option @code{--daemon} was specified, it calls
180@code{server-start} and detaches from the controlling terminal.
181@xref{Emacs Server,,, emacs, The GNU Emacs Manual}.
182
183@item
184It displays the @dfn{startup screen}, which is a special buffer that 222It displays the @dfn{startup screen}, which is a special buffer that
185contains information about copyleft and basic Emacs usage. This is 223contains information about copyleft and basic Emacs usage. This is
186not done if @code{initial-buffer-choice} or 224not done if @code{initial-buffer-choice} or
187@code{inhibit-startup-screen} are @code{nil}, nor if the 225@code{inhibit-startup-screen} are @code{nil}, nor if the
188@samp{--no-splash} or @samp{-Q} command-line options were specified. 226@samp{--no-splash} or @samp{-Q} command-line options were specified.
189 227
228@c End of command-line-1.
229
230@c Back to command-line from command-line-1.
231
232@c This is the point at which we actually exit in batch mode, but the
233@c last few bits of command-line-1 are not done in batch mode.
234
235@item
236If the option @code{--daemon} was specified, it calls
237@code{server-start} and detaches from the controlling terminal.
238@xref{Emacs Server,,, emacs, The GNU Emacs Manual}.
239
190@item 240@item
191If started by the X session manager, it calls 241If started by the X session manager, it calls
192@code{emacs-session-restore} passing it as argument the ID of the 242@code{emacs-session-restore} passing it as argument the ID of the
193previous session. @xref{Session Management}. 243previous session. @xref{Session Management}.
244
245@c End of command-line.
246
247@c Back to normal-top-level from command-line.
248
194@end enumerate 249@end enumerate
195 250
251@noindent
252The following options affect some aspects of the startup sequence.
253
196@defopt inhibit-startup-screen 254@defopt inhibit-startup-screen
197This variable, if non-@code{nil}, inhibits the startup screen. In 255This variable, if non-@code{nil}, inhibits the startup screen. In
198that case, Emacs typically displays the @samp{*scratch*} buffer; but 256that case, Emacs typically displays the @samp{*scratch*} buffer; but
@@ -210,9 +268,13 @@ aliases for this variable.
210 268
211@defopt initial-buffer-choice 269@defopt initial-buffer-choice
212This variable, if non-@code{nil}, determines a file or buffer for 270This variable, if non-@code{nil}, determines a file or buffer for
213Emacs to display after starting up, instead of the startup screen. If 271Emacs to display after starting up, instead of the startup screen.
214its value is @code{t}, Emacs displays the @samp{*scratch*} buffer. If 272@ignore
215its value is a string, that specifies the name of a file for Emacs to 273@c I do not think this should be mentioned. AFAICS it is just a dodge
274@c around inhibit-startup-screen not being settable on a site-wide basis.
275If its value is @code{t}, Emacs displays the @samp{*scratch*} buffer.
276@end ignore
277If its value is a string, that specifies the name of a file for Emacs to
216visit. 278visit.
217@end defopt 279@end defopt
218 280
@@ -228,7 +290,7 @@ form to your init file:
228 290
229Emacs explicitly checks for an expression as shown above in your init 291Emacs explicitly checks for an expression as shown above in your init
230file; your login name must appear in the expression as a Lisp string 292file; your login name must appear in the expression as a Lisp string
231constant. Other methods of setting 293constant. You can also use the Custom interface. Other methods of setting
232@code{inhibit-startup-echo-area-message} to the same value do not 294@code{inhibit-startup-echo-area-message} to the same value do not
233inhibit the startup message. This way, you can easily inhibit the 295inhibit the startup message. This way, you can easily inhibit the
234message for yourself if you wish, but thoughtless copying of your init 296message for yourself if you wish, but thoughtless copying of your init
@@ -241,18 +303,49 @@ inserted into the @samp{*scratch*} buffer when Emacs starts up. If it
241is @code{nil}, the @samp{*scratch*} buffer is empty. 303is @code{nil}, the @samp{*scratch*} buffer is empty.
242@end defopt 304@end defopt
243 305
306@noindent
307The following command-line options affect some aspects of the startup
308sequence. @xref{Initial Options,,, emacs, The GNU Emacs Manual}.
309
310@table @code
311@item --no-splash
312Do not display a splash screen.
313
314@item --batch
315Run without an interactive terminal. @xref{Batch Mode}.
316
317@item --daemon
318Do not initialize any display; just start a server in the background.
319
320@item --no-init-file
321@itemx -Q
322Do not load either the init file, or the @file{default} library.
323
324@item --no-site-file
325Do not load the @file{site-start} library.
326
327@item --quick
328@itemx -Q
329Equivalent to @samp{-q --no-site-file --no-splash}.
330@c and --no-site-lisp, but let's not mention that here.
331@end table
332
333
244@node Init File 334@node Init File
245@subsection The Init File, @file{.emacs} 335@subsection The Init File
246@cindex init file 336@cindex init file
247@cindex @file{.emacs} 337@cindex @file{.emacs}
338@cindex @file{init.el}
248 339
249 When you start Emacs, it normally attempts to load your @dfn{init 340 When you start Emacs, it normally attempts to load your @dfn{init
250file}. This is either a file named @file{.emacs} or @file{.emacs.el} 341file}. This is either a file named @file{.emacs} or @file{.emacs.el}
251in your home directory, or a file named @file{init.el} in a 342in your home directory, or a file named @file{init.el} in a
252subdirectory named @file{.emacs.d} in your home directory. Whichever 343subdirectory named @file{.emacs.d} in your home directory.
253place you use, you can also compile the file (@pxref{Byte 344@ignore
345Whichever place you use, you can also compile the file (@pxref{Byte
254Compilation}); then the actual file loaded will be @file{.emacs.elc} 346Compilation}); then the actual file loaded will be @file{.emacs.elc}
255or @file{init.elc}. 347or @file{init.elc}.
348@end ignore
256 349
257 The command-line switches @samp{-q}, @samp{-Q}, and @samp{-u} 350 The command-line switches @samp{-q}, @samp{-Q}, and @samp{-u}
258control whether and where to find the init file; @samp{-q} (and the 351control whether and where to find the init file; @samp{-q} (and the
@@ -267,13 +360,13 @@ file. If those environment variables are absent, though, Emacs uses
267your user-id to find your home directory. 360your user-id to find your home directory.
268 361
269@cindex default init file 362@cindex default init file
270 A site may have a @dfn{default init file}, which is the library 363 An Emacs installation may have a @dfn{default init file}, which is a
271named @file{default.el}. Emacs finds the @file{default.el} file 364Lisp library named @file{default.el}. Emacs finds this file through
272through the standard search path for libraries (@pxref{How Programs Do 365the standard search path for libraries (@pxref{How Programs Do
273Loading}). The Emacs distribution does not come with this file; sites 366Loading}). The Emacs distribution does not come with this file; it is
274may provide one for local customizations. If the default init file 367intended for local customizations. If the default init file exists,
275exists, it is loaded whenever you start Emacs, except in batch mode or 368it is loaded whenever you start Emacs, except in batch mode or if
276if @samp{-q} (or @samp{-Q}) is specified. But your own personal init 369@samp{-q} (or @samp{-Q}) is specified. But your own personal init
277file, if any, is loaded first; if it sets @code{inhibit-default-init} 370file, if any, is loaded first; if it sets @code{inhibit-default-init}
278to a non-@code{nil} value, then Emacs does not subsequently load the 371to a non-@code{nil} value, then Emacs does not subsequently load the
279@file{default.el} file. 372@file{default.el} file.
@@ -343,23 +436,22 @@ in the normal manner, by searching the @code{load-path} directories, and
343trying the @samp{.elc} and @samp{.el} suffixes. 436trying the @samp{.elc} and @samp{.el} suffixes.
344 437
345@cindex Termcap 438@cindex Termcap
346 The usual function of a terminal-specific library is to enable 439 The usual role of a terminal-specific library is to enable special
347special keys to send sequences that Emacs can recognize. It may also 440keys to send sequences that Emacs can recognize. It may also need to
348need to set or add to @code{input-decode-map} if the Termcap or 441set or add to @code{input-decode-map} if the Termcap or Terminfo entry
349Terminfo entry does not specify all the terminal's function keys. 442does not specify all the terminal's function keys. @xref{Terminal
350@xref{Terminal Input}. 443Input}.
351 444
352 When the name of the terminal type contains a hyphen, and no library 445 When the name of the terminal type contains a hyphen, and no library
353is found whose name is identical to the terminal's name, Emacs strips 446is found whose name is identical to the terminal's name, Emacs strips
354from the terminal's name the last hyphen and everything that follows 447from the terminal's name the last hyphen and everything that follows
355it, and tries again. This process is repeated until Emacs finds a 448it, and tries again. This process is repeated until Emacs finds a
356matching library or until there are no more hyphens in the name (the 449matching library, or until there are no more hyphens in the name
357latter means the terminal doesn't have any library specific to it). 450(i.g.@: there is no terminal-specific library). For example, if the
358Thus, for example, if there are no @samp{aaa-48} and @samp{aaa-30} 451terminal name is @samp{xterm-256color} and there is no
359libraries, Emacs will try the same library @file{term/aaa.el} for 452@file{term/xterm-256color.el} library, Emacs tries to load
360terminal types @samp{aaa-48} and @samp{aaa-30-rv}. If necessary, the 453@file{term/xterm.el}. If necessary, the terminal library can evaluate
361library can evaluate @code{(getenv "TERM")} to find the full name of 454@code{(getenv "TERM")} to find the full name of the terminal type.
362the terminal type.@refill
363 455
364 Your init file can prevent the loading of the 456 Your init file can prevent the loading of the
365terminal-specific library by setting the variable 457terminal-specific library by setting the variable
@@ -376,8 +468,8 @@ have their own libraries. @xref{Hooks}.
376 468
377@defvar term-file-prefix 469@defvar term-file-prefix
378@cindex @code{TERM} environment variable 470@cindex @code{TERM} environment variable
379If the @code{term-file-prefix} variable is non-@code{nil}, Emacs loads 471If the value of this variable is non-@code{nil}, Emacs loads a
380a terminal-specific initialization file as follows: 472terminal-specific initialization file as follows:
381 473
382@example 474@example
383(load (concat term-file-prefix (getenv "TERM"))) 475(load (concat term-file-prefix (getenv "TERM")))
@@ -409,29 +501,14 @@ feature.
409@subsection Command-Line Arguments 501@subsection Command-Line Arguments
410@cindex command-line arguments 502@cindex command-line arguments
411 503
412 You can use command-line arguments to request various actions when you 504 You can use command-line arguments to request various actions when
413start Emacs. Since you do not need to start Emacs more than once per 505you start Emacs. Command-line arguments should not be commonly used,
414day, and will often leave your Emacs session running longer than that, 506since the recommended way of using Emacs is to start it just once,
415command-line arguments are hardly ever used. As a practical matter, it 507after logging in, and do all editing in the same Emacs session
416is best to avoid making the habit of using them, since this habit would 508(@pxref{Entering Emacs,,, emacs, The GNU Emacs Manual}); nonetheless,
417encourage you to kill and restart Emacs unnecessarily often. These 509they can be useful when invoking Emacs from session scripts or
418options exist for two reasons: to be compatible with other editors (for 510debugging Emacs itself. This section describes how Emacs processes
419invocation by other programs) and to enable shell scripts to run 511command-line arguments.
420specific Lisp programs.
421
422 This section describes how Emacs processes command-line arguments,
423and how you can customize them.
424
425@ignore
426 (Note that some other editors require you to start afresh each time
427you want to edit a file. With this kind of editor, you will probably
428specify the file as a command-line argument. The recommended way to
429use GNU Emacs is to start it only once, just after you log in, and do
430all your editing in the same Emacs process. Each time you want to edit
431a different file, you visit it with the existing Emacs, which eventually
432comes to have many files in it ready for editing. Usually you do not
433kill the Emacs until you are about to log out.)
434@end ignore
435 512
436@defun command-line 513@defun command-line
437This function parses the command line that Emacs was called with, 514This function parses the command line that Emacs was called with,
@@ -525,9 +602,7 @@ as a file name to visit.
525 602
526 There are two ways to get out of Emacs: you can kill the Emacs job, 603 There are two ways to get out of Emacs: you can kill the Emacs job,
527which exits permanently, or you can suspend it, which permits you to 604which exits permanently, or you can suspend it, which permits you to
528reenter the Emacs process later. As a practical matter, you seldom kill 605reenter the Emacs process later.
529Emacs---only when you are about to log out. Suspending is much more
530common.
531 606
532@menu 607@menu
533* Killing Emacs:: Exiting Emacs irreversibly. 608* Killing Emacs:: Exiting Emacs irreversibly.
@@ -1105,24 +1180,47 @@ The value may be a floating point number.
1105@node Time of Day 1180@node Time of Day
1106@section Time of Day 1181@section Time of Day
1107 1182
1108 This section explains how to determine the current time and the time 1183 This section explains how to determine the current time and time
1109zone. 1184zone.
1110 1185
1186@cindex epoch
1187 Most of these functions represent time as a list of either three
1188integers, @code{(@var{sec-high} @var{sec-low} @var{microsec})}, or of
1189two integers, @code{(@var{sec-high} @var{sec-low})}. The integers
1190@var{sec-high} and @var{sec-low} give the high and low bits of an
1191integer number of seconds. This integer number,
1192@ifnottex
1193@var{high} * 2**16 + @var{low},
1194@end ifnottex
1195@tex
1196$high*2^{16}+low$,
1197@end tex
1198is the number of seconds from the @dfn{epoch} (0:00 January 1, 1970
1199UTC) to the specified time. The third list element @var{microsec}, if
1200present, gives the number of microseconds from the start of that
1201second to the specified time.
1202
1203 The return value of @code{current-time} represents time using three
1204integers, while the timestamps in the return value of
1205@code{file-attributes} use two integers (@pxref{Definition of
1206file-attributes}). In function arguments, e.g.@: the @var{time-value}
1207argument to @code{current-time-string}, both two- and three-integer
1208lists are accepted. You can convert times from the list
1209representation into standard human-readable strings using
1210@code{current-time}, or to other forms using the @code{decode-time}
1211and @code{format-time-string} functions documented in the following
1212sections.
1213
1111@defun current-time-string &optional time-value 1214@defun current-time-string &optional time-value
1112This function returns the current time and date as a human-readable 1215This function returns the current time and date as a human-readable
1113string. The format of the string is unvarying; the number of characters 1216string. The format of the string is unvarying; the number of
1114used for each part is always the same, so you can reliably use 1217characters used for each part is always the same, so you can reliably
1115@code{substring} to extract pieces of it. It is wise to count the 1218use @code{substring} to extract pieces of it. You should count
1116characters from the beginning of the string rather than from the end, as 1219characters from the beginning of the string rather than from the end,
1117additional information may some day be added at the end. 1220as additional information may some day be added at the end.
1118 1221
1119The argument @var{time-value}, if given, specifies a time to format 1222The argument @var{time-value}, if given, specifies a time to format
1120instead of the current time. This argument should have the same form 1223(represented as a list of integers), instead of the current time.
1121as the times obtained from @code{current-time} (see below) and from
1122@code{file-attributes} (@pxref{Definition of file-attributes}). It
1123should be a list whose first two elements are integers; a third
1124(microsecond) element, if present, is ignored. @var{time-value} can
1125also be a cons of two integers, but this usage is obsolete.
1126 1224
1127@example 1225@example
1128@group 1226@group
@@ -1133,33 +1231,16 @@ also be a cons of two integers, but this usage is obsolete.
1133@end defun 1231@end defun
1134 1232
1135@defun current-time 1233@defun current-time
1136This function returns the system's time value as a list of three 1234This function returns the current time, represented as a list of three
1137integers: @code{(@var{high} @var{low} @var{microsec})}. The integers 1235integers @code{(@var{sec-high} @var{sec-low} @var{microsec})}. On
1138@var{high} and @var{low} combine to give the number of seconds since 1236systems with only one-second time resolutions, @var{microsec} is 0.
11390:00 January 1, 1970 UTC (Coordinated Universal Time), which is
1140@ifnottex
1141@var{high} * 2**16 + @var{low}.
1142@end ifnottex
1143@tex
1144$high*2^{16}+low$.
1145@end tex
1146
1147The third element, @var{microsec}, gives the microseconds since the
1148start of the current second (or 0 for systems that return time with
1149the resolution of only one second).
1150
1151The first two elements can be compared with file time values such as you
1152get with the function @code{file-attributes}.
1153@xref{Definition of file-attributes}.
1154@end defun 1237@end defun
1155 1238
1156@defun float-time &optional time-value 1239@defun float-time &optional time-value
1157This function returns the current time as a floating-point number of 1240This function returns the current time as a floating-point number of
1158seconds since the epoch. The argument @var{time-value}, if given, 1241seconds since the epoch. The optional argument @var{time-value}, if
1159specifies a time to convert instead of the current time. The argument 1242given, specifies a time (represented as a list of integers) to convert
1160should have the same form as for @code{current-time-string} (see 1243instead of the current time.
1161above). Thus, it accepts the output of @code{current-time} and
1162@code{file-attributes} (@pxref{Definition of file-attributes}).
1163 1244
1164@emph{Warning}: Since the result is floating point, it may not be 1245@emph{Warning}: Since the result is floating point, it may not be
1165exact. Do not use this function if precise time stamps are required. 1246exact. Do not use this function if precise time stamps are required.
@@ -1180,11 +1261,8 @@ adjustment, then the value is constant through time.
1180If the operating system doesn't supply all the information necessary to 1261If the operating system doesn't supply all the information necessary to
1181compute the value, the unknown elements of the list are @code{nil}. 1262compute the value, the unknown elements of the list are @code{nil}.
1182 1263
1183The argument @var{time-value}, if given, specifies a time to analyze 1264The argument @var{time-value}, if given, specifies a time (represented
1184instead of the current time. The argument should have the same form 1265as a list of integers) to analyze instead of the current time.
1185as for @code{current-time-string} (see above). Thus, you can use
1186times obtained from @code{current-time} (see above) and from
1187@code{file-attributes}. @xref{Definition of file-attributes}.
1188@end defun 1266@end defun
1189 1267
1190The current time zone is determined by the @samp{TZ} environment 1268The current time zone is determined by the @samp{TZ} environment
@@ -1196,16 +1274,15 @@ time zone.
1196@node Time Conversion 1274@node Time Conversion
1197@section Time Conversion 1275@section Time Conversion
1198 1276
1199 These functions convert time values (lists of two or three integers) 1277 These functions convert time values (lists of two or three integers,
1200to calendrical information and vice versa. You can get time values 1278as explained in the previous section) into calendrical information and
1201from the functions @code{current-time} (@pxref{Time of Day}) and 1279vice versa.
1202@code{file-attributes} (@pxref{Definition of file-attributes}).
1203 1280
1204 Many 32-bit operating systems are limited to time values that contain 32 bits 1281 Many 32-bit operating systems are limited to time values containing
1205of information; these systems typically handle only the times from 128232 bits of information; these systems typically handle only the times
12061901-12-13 20:45:52 UTC through 2038-01-19 03:14:07 UTC. However, 64-bit 1283from 1901-12-13 20:45:52 UTC through 2038-01-19 03:14:07 UTC.
1207and some 32-bit operating systems have larger time values, and can 1284However, 64-bit and some 32-bit operating systems have larger time
1208represent times far in the past or future. 1285values, and can represent times far in the past or future.
1209 1286
1210 Time conversion functions always use the Gregorian calendar, even 1287 Time conversion functions always use the Gregorian calendar, even
1211for dates before the Gregorian calendar was introduced. Year numbers 1288for dates before the Gregorian calendar was introduced. Year numbers
@@ -1718,9 +1795,9 @@ certain length of time. Aside from how to set them up, idle timers
1718work just like ordinary timers. 1795work just like ordinary timers.
1719 1796
1720@deffn Command run-with-idle-timer secs repeat function &rest args 1797@deffn Command run-with-idle-timer secs repeat function &rest args
1721Set up a timer which runs when Emacs has been idle for @var{secs} 1798Set up a timer which runs the next time Emacs is idle for @var{secs}
1722seconds. The value of @var{secs} may be an integer or a floating point 1799seconds. The value of @var{secs} may be an integer or a floating
1723number; a value of the type returned by @code{current-idle-time} 1800point number; a value of the type returned by @code{current-idle-time}
1724is also allowed. 1801is also allowed.
1725 1802
1726If @var{repeat} is @code{nil}, the timer runs just once, the first time 1803If @var{repeat} is @code{nil}, the timer runs just once, the first time
@@ -1733,13 +1810,13 @@ can use in calling @code{cancel-timer} (@pxref{Timers}).
1733@end deffn 1810@end deffn
1734 1811
1735@cindex idleness 1812@cindex idleness
1736 Emacs becomes ``idle'' when it starts waiting for user input, and it 1813 Emacs becomes @dfn{idle} when it starts waiting for user input, and
1737remains idle until the user provides some input. If a timer is set for 1814it remains idle until the user provides some input. If a timer is set
1738five seconds of idleness, it runs approximately five seconds after Emacs 1815for five seconds of idleness, it runs approximately five seconds after
1739first becomes idle. Even if @var{repeat} is non-@code{nil}, this timer 1816Emacs first becomes idle. Even if @var{repeat} is non-@code{nil},
1740will not run again as long as Emacs remains idle, because the duration 1817this timer will not run again as long as Emacs remains idle, because
1741of idleness will continue to increase and will not go down to five 1818the duration of idleness will continue to increase and will not go
1742seconds again. 1819down to five seconds again.
1743 1820
1744 Emacs can do various things while idle: garbage collect, autosave or 1821 Emacs can do various things while idle: garbage collect, autosave or
1745handle data from a subprocess. But these interludes during idleness do 1822handle data from a subprocess. But these interludes during idleness do
@@ -1753,22 +1830,12 @@ minutes, and even if there have been garbage collections and autosaves.
1753input. Then it becomes idle again, and all the idle timers that are 1830input. Then it becomes idle again, and all the idle timers that are
1754set up to repeat will subsequently run another time, one by one. 1831set up to repeat will subsequently run another time, one by one.
1755 1832
1756@c Emacs 19 feature
1757@defun current-idle-time 1833@defun current-idle-time
1758If Emacs is idle, this function returns the length of time Emacs has 1834If Emacs is idle, this function returns the length of time Emacs has
1759been idle, as a list of three integers: @code{(@var{high} @var{low} 1835been idle, as a list of three integers: @code{(@var{sec-high}
1760@var{microsec})}. The integers @var{high} and @var{low} combine to 1836@var{sec-low} @var{microsec})}, where @var{high} and @var{low} are the
1761give the number of seconds of idleness, which is 1837high and low bits for the number of seconds and @var{microsec} is the
1762@ifnottex 1838additional number of microseconds (@pxref{Time of Day}).
1763@var{high} * 2**16 + @var{low}.
1764@end ifnottex
1765@tex
1766$high*2^{16}+low$.
1767@end tex
1768
1769The third element, @var{microsec}, gives the microseconds since the
1770start of the current second (or 0 for systems that return time with
1771the resolution of only one second).
1772 1839
1773When Emacs is not idle, @code{current-idle-time} returns @code{nil}. 1840When Emacs is not idle, @code{current-idle-time} returns @code{nil}.
1774This is a convenient way to test whether Emacs is idle. 1841This is a convenient way to test whether Emacs is idle.
@@ -1801,9 +1868,9 @@ Here's an example:
1801@end smallexample 1868@end smallexample
1802@end defun 1869@end defun
1803 1870
1804 Some idle timer functions in user Lisp packages have a loop that 1871 Do not write an idle timer function containing a loop which does a
1805does a certain amount of processing each time around, and exits when 1872certain amount of processing each time around, and exits when
1806@code{(input-pending-p)} is non-@code{nil}. That approach seems very 1873@code{(input-pending-p)} is non-@code{nil}. This approach seems very
1807natural but has two problems: 1874natural but has two problems:
1808 1875
1809@itemize 1876@itemize
@@ -1816,9 +1883,9 @@ It blocks out any idle timers that ought to run during that time.
1816@end itemize 1883@end itemize
1817 1884
1818@noindent 1885@noindent
1819To avoid these problems, don't use that technique. Instead, write 1886The correct approach is for the idle timer to reschedule itself after
1820such idle timers to reschedule themselves after a brief pause, using 1887a brief pause, using the method in the @code{timer-function} example
1821the method in the @code{timer-function} example above. 1888above.
1822 1889
1823@node Terminal Input 1890@node Terminal Input
1824@section Terminal Input 1891@section Terminal Input
@@ -2014,9 +2081,8 @@ See also @code{open-dribble-file} in @ref{Recording Input}.
2014@cindex sound 2081@cindex sound
2015 2082
2016 To play sound using Emacs, use the function @code{play-sound}. Only 2083 To play sound using Emacs, use the function @code{play-sound}. Only
2017certain systems are supported; if you call @code{play-sound} on a system 2084certain systems are supported; if you call @code{play-sound} on a
2018which cannot really do the job, it gives an error. Emacs version 20 and 2085system which cannot really do the job, it gives an error.
2019earlier did not support sound at all.
2020 2086
2021 The sound must be stored as a file in RIFF-WAVE format (@samp{.wav}) 2087 The sound must be stored as a file in RIFF-WAVE format (@samp{.wav})
2022or Sun Audio format (@samp{.au}). 2088or Sun Audio format (@samp{.au}).
diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi
index eb3612dc868..b17f13b6b89 100644
--- a/doc/lispref/package.texi
+++ b/doc/lispref/package.texi
@@ -15,6 +15,8 @@ install, uninstall, and upgrade it.
15 15
16 The following sections describe how to create a package, and how to 16 The following sections describe how to create a package, and how to
17put it in a @dfn{package archive} for others to download. 17put it in a @dfn{package archive} for others to download.
18@xref{Packages,,, emacs, The GNU Emacs Manual}, for a description of
19user-level features of the packaging system.
18 20
19@menu 21@menu
20* Packaging Basics:: The basic concepts of Emacs Lisp packages. 22* Packaging Basics:: The basic concepts of Emacs Lisp packages.
@@ -91,17 +93,34 @@ definitions are saved to a file named @file{@var{name}-autoloads.el}
91in the content directory. They are typically used to autoload the 93in the content directory. They are typically used to autoload the
92principal user commands defined in the package, but they can also 94principal user commands defined in the package, but they can also
93perform other tasks, such as adding an element to 95perform other tasks, such as adding an element to
94@code{auto-mode-alist} (@pxref{Auto Major Mode}). During this time, 96@code{auto-mode-alist} (@pxref{Auto Major Mode}). Note that a package
95Emacs will also byte-compile the Lisp files. 97typically does @emph{not} autoload every function and variable defined
96 98within it---only the handful of commands typically called to begin
97 After installation, and (by default) each time Emacs is started, the 99using the package. Emacs then byte-compiles every Lisp file in the
98installed package is @dfn{activated}. During activation, Emacs adds 100package.
99the package's content directory to @code{load-path}, and evaluates the 101
100autoload definitions in @file{@var{name}-autoloads.el}. 102 After installation, the installed package is @dfn{loaded}: Emacs
101 103adds the package's content directory to @code{load-path}, and
102 Note that a package typically does @emph{not} autoload every 104evaluates the autoload definitions in @file{@var{name}-autoloads.el}.
103function and variable defined within it---only the handful of commands 105
104typically called to begin using the package. 106 Whenever Emacs starts up, it automatically calls the function
107@code{package-initialize} to load installed packages. This is done
108after loading the init file and abbrev file (if any) and before
109running @code{after-init-hook} (@pxref{Startup Summary}). Automatic
110package loading is disabled if the user option
111@code{package-enable-at-startup} is @code{nil}.
112
113@deffn Command package-initialize &optional no-activate
114This function initializes Emacs' internal record of which packages are
115installed, and loads them. The user option @code{package-load-list}
116specifies which packages to load; by default, all installed packages
117are loaded. @xref{Package Installation,,, emacs, The GNU Emacs
118Manual}.
119
120The optional argument @var{no-activate}, if non-@code{nil}, causes
121Emacs to update its record of installed packages without actually
122loading them; it is for internal use only.
123@end deffn
105 124
106@node Simple Packages 125@node Simple Packages
107@section Simple Packages 126@section Simple Packages
diff --git a/etc/ChangeLog b/etc/ChangeLog
index da9b8c180c4..94a9ae6ed4d 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
12012-03-16 Glenn Morris <rgm@gnu.org>
2
3 * HELLO: Say that this is not a comprehensive list.
4 Remove "duplicate" entry. (Bug#11024)
5
12012-02-20 Paul Eggert <eggert@cs.ucla.edu> 62012-02-20 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * emacs-buffer.gdb ($valmask): Don't assume EMACS_INT fits in 'long'. 8 * emacs-buffer.gdb ($valmask): Don't assume EMACS_INT fits in 'long'.
diff --git a/etc/HELLO b/etc/HELLO
index d95f010aa6e..d6857235f68 100644
--- a/etc/HELLO
+++ b/etc/HELLO
@@ -1,4 +1,6 @@
1This is a list of ways to say hello in various languages. 1This is a list of ways to say hello in various languages.
2It is not intended to be comprehensive, but to demonstrate
3some of the character sets that Emacs supports.
2 4
3Non-ASCII examples: 5Non-ASCII examples:
4 Europe: ,A!(BHola!, Gr,A|_(B Gott, Hyv,Add(B p,Ad(Biv,Add(B, Tere ,Au(Bhtust, Bon,Cu(Bu 6 Europe: ,A!(BHola!, Gr,A|_(B Gott, Hyv,Add(B p,Ad(Biv,Add(B, Tere ,Au(Bhtust, Bon,Cu(Bu
@@ -46,7 +48,6 @@ Lao ((1>RJRERG(B) (1JP:R-4U(B / (1"mcKib*!4U(B
46Malayalam ($,1@N@R@O@^@S@"(B) $,1@H@N@X@m@5@^@P@"(B 48Malayalam ($,1@N@R@O@^@S@"(B) $,1@H@N@X@m@5@^@P@"(B
47Maltese (il-Malti) Bon,Cu(Bu / Sa,C11(Ba 49Maltese (il-Malti) Bon,Cu(Bu / Sa,C11(Ba
48Mathematics $,1x (B p $,1x((B world $,1s"(B hello p $,2!a(B 50Mathematics $,1x (B p $,1x((B world $,1s"(B hello p $,2!a(B
49Nederlands, Vlaams Hallo / Dag
50Norwegian (norsk) Hei / God dag 51Norwegian (norsk) Hei / God dag
51Oriya ($,1:s;\;?:f(B) $,1;6;A;#;?;,;G(B 52Oriya ($,1:s;\;?:f(B) $,1;6;A;#;?;,;G(B
52Polish (j,Bj(Bzyk polski) Dzie,Bq(B dobry! / Cze,B6f(B! 53Polish (j,Bj(Bzyk polski) Dzie,Bq(B dobry! / Cze,B6f(B!
@@ -55,7 +56,7 @@ Sinhala ($,1B#B2ABB$A}(B) $,1AFAzB4AvB=B AqB*(B
55Slovak (sloven,Bh(Bina) Dobr,A}(B de,Br(B 56Slovak (sloven,Bh(Bina) Dobr,A}(B de,Br(B
56Slovenian (sloven,B9h(Bina) Pozdravljeni! 57Slovenian (sloven,B9h(Bina) Pozdravljeni!
57Spanish (espa,Aq(Bol) ,A!(BHola! 58Spanish (espa,Aq(Bol) ,A!(BHola!
58Swedish (p,Ae(B svenska) Hej / Goddag / Hall,Ae(B 59Swedish (svenska) Hej / Goddag / Hall,Ae(B
59Tamil ($,1<D<N<_<T<m(B) $,1<U<C<5<m<5<N<m(B 60Tamil ($,1<D<N<_<T<m(B) $,1<U<C<5<m<5<N<m(B
60Telugu ($,1=d>&=r>!=W>!(B) $,1=h=n=x>-=U=~=p=B(B 61Telugu ($,1=d>&=r>!=W>!(B) $,1=h=n=x>-=U=~=p=B(B
61Thai (,T@RIRd7B(B) ,TJGQJ4U$CQ:(B / ,TJGQJ4U$hP(B 62Thai (,T@RIRd7B(B) ,TJGQJ4U$CQ:(B / ,TJGQJ4U$hP(B
diff --git a/etc/NEWS b/etc/NEWS
index 1d56a0044c6..78b306f057e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -469,6 +469,11 @@ been shown in a specific window.
469This is handy for minibuffer-only frames, and is also used for the feature 469This is handy for minibuffer-only frames, and is also used for the feature
470where mouse-1 pops up *Messages*"', which can now easily be changed. 470where mouse-1 pops up *Messages*"', which can now easily be changed.
471 471
472---
473** Minibuffers set `truncate-lines' to nil.
474If you want to change the value to something else, you could use
475for example minibuffer-setup-hook.
476
472 477
473* Editing Changes in Emacs 24.1 478* Editing Changes in Emacs 24.1
474 479
@@ -1371,7 +1376,7 @@ This can be useful when `inhibit-quit' is set.
1371 1376
1372+++ 1377+++
1373** The new function `server-eval-at' allows evaluation of Lisp forms on 1378** The new function `server-eval-at' allows evaluation of Lisp forms on
1374named Emacs server instances, using TCP sockets. 1379named Emacs server instances.
1375 1380
1376+++ 1381+++
1377** `call-process' and `call-process-region' allow a `(:file "file")' spec 1382** `call-process' and `call-process-region' allow a `(:file "file")' spec
diff --git a/leim/ChangeLog b/leim/ChangeLog
index 40e570c99c1..e5900eb7410 100644
--- a/leim/ChangeLog
+++ b/leim/ChangeLog
@@ -1,3 +1,7 @@
12012-03-16 Kenichi Handa <handa@m17n.org>
2
3 * quail/indian.el (telugu-inscript): Fix typo. (Bug#10936)
4
12012-03-13 Йордан Миладинов <jordanmiladinov@gmail.com> (tiny change) 52012-03-13 Йордан Миладинов <jordanmiladinov@gmail.com> (tiny change)
2 6
3 * quail/cyrillic.el (bulgarian-alt-phonetic): 7 * quail/cyrillic.el (bulgarian-alt-phonetic):
diff --git a/leim/quail/indian.el b/leim/quail/indian.el
index 85ea7460b42..7ffb20f6411 100644
--- a/leim/quail/indian.el
+++ b/leim/quail/indian.el
@@ -440,7 +440,7 @@ Full key sequences are listed below:")
440(if nil 440(if nil
441 (quail-define-package "telugu-inscript" "Telugu" "TlgIS" t "Telugu keyboard Inscript")) 441 (quail-define-package "telugu-inscript" "Telugu" "TlgIS" t "Telugu keyboard Inscript"))
442(quail-define-inscript-package 442(quail-define-inscript-package
443 indian-dev-base-table inscript-dev-keytable 443 indian-tlg-base-table inscript-dev-keytable
444 "telugu-inscript" "Telugu" "TlgIS" 444 "telugu-inscript" "Telugu" "TlgIS"
445 "Telugu keyboard Inscript.") 445 "Telugu keyboard Inscript.")
446 446
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bd0e6f865cd..ed5dc39021b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,139 @@
12012-03-20 Chong Yidong <cyd@gnu.org>
2
3 * emacs-lisp/tabulated-list.el (tabulated-list-print-entry): Use
4 string-width and truncate-string-width to handle arbitrary
5 characters.
6
72012-03-20 Tassilo Horn <tassilo@member.fsf.org>
8
9 * textmodes/artist.el (artist-menu-map): Bind Rectangle menu item
10 to draw rectangles, not squares. (Regression introduced by revno
11 2011-03-02T03:48:01Z!cyd@stupidchicken.com)
12
132012-03-18 Chong Yidong <cyd@gnu.org>
14
15 * faces.el (face-spec-reset-face): Don't call display-graphic-p if
16 it is not yet defined (for temacs).
17
182012-03-18 Leo Liu <sdl.web@gmail.com>
19
20 * net/rcirc.el (rcirc-cmd-quit): Allow quiting all servers with
21 prefix.
22
232012-03-17 Eli Zaretskii <eliz@gnu.org>
24
25 * textmodes/ispell.el (ispell-skip-tib, ispell-keep-choices-win)
26 (ispell-choices-win-default-height, ispell-silently-savep)
27 (ispell-dictionary-alist, ispell-encoding8-command)
28 (ispell-check-version, ispell-aspell-find-dictionary)
29 (ispell-valid-dictionary-list, ispell-words-keyword)
30 (ispell-get-word, ispell-internal-change-dictionary)
31 (ispell-region, ispell-skip-region-list)
32 (ispell-begin-skip-region-regexp, ispell-ignore-fcc)
33 (ispell-process-line, ispell-minor-mode, ispell-minor-check)
34 (ispell-message-text-end, ispell-message)
35 (ispell-buffer-local-parsing): Doc fix.
36
372012-03-13 Jambunathan K <kjambunathan@gmail.com>
38
39 * htmlfontify.el: Add support for code block fontification for ODT
40 export (Bug #9914).
41 (hfy-optimisations): Define new option
42 `body-text-only'
43 (hfy-fontify-buffer): Honor above setting.
44 (hfy-begin-span, hfy-end-span): New routines factored out form
45 `hfy-fontify-buffer'.
46 (hfy-begin-span-handler, hfy-end-span-handler): New variables
47 that permit insertion of custom tags.
48 (hfy-fontify-buffer): Use above handlers.
49 (hfy-face-to-css-default): Same as the earlier `hfy-face-to-css'.
50 (hfy-face-to-css): Re-defined to be a variable.
51 (hfy-compile-stylesheet): Modified. Allow stylesheet to be built
52 over multiple runs. This is made possible by having the caller let
53 bind a special variable `hfy-user-sheet-assoc'.
54 (htmlfontify-string): New defun.
55 (hfy-compile-face-map): Make sure that the last char in the
56 buffer is correctly fontified.
57 (hfy-face-resolve-face): Whitespace only change.
58
592012-03-17 Eli Zaretskii <eliz@gnu.org>
60
61 * textmodes/ispell.el (ispell-get-decoded-string): Make the error
62 message more clear.
63
642012-03-16 Leo Liu <sdl.web@gmail.com>
65
66 * emacs-lisp/copyright.el (copyright-year-ranges): Fix typo.
67
682012-03-16 Alan Mackenzie <acm@muc.de>
69
70 Further optimise the handling of large macros.
71
72 * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Use a
73 limit to a call of `c-literal-limits'.
74 (c-determine-+ve-limit): New function.
75 (c-at-macro-vsemi-p): Move `c-in-literal' to the bottom of an
76 `and'.
77 (c-guess-basic-syntax): In macros, restrict a search limit to
78 2000.
79 In CASE 5B, restrict a search limit to 500.
80 (c-just-after-func-arglist-p): Obviouly wrong `or' -> `and'.
81
82 * progmodes/cc-mode.el (c-neutralize-syntax-in-and-mark-CPP):
83 Restrict macro bounds to +-500 from after-change's BEG END.
84
852012-03-16 Leo Liu <sdl.web@gmail.com>
86
87 * font-lock.el (lisp-font-lock-keywords-2): Add letrec.
88
892012-03-16 Aaron S. Hawley <Aaron.S.Hawley@gmail.com>
90
91 * tar-mode.el (tar-mode): Fix saving by conditionally undoing
92 `special-mode' setting of `buffer-read-only'. (Bug#11010)
93
942012-03-16 Glenn Morris <rgm@gnu.org>
95
96 * view.el (view-buffer, view-buffer-other-window)
97 (view-buffer-other-frame): Doc fixes re special mode-class.
98
99 * subr.el (eval-after-load): If named feature is provided not from
100 a file, run after-load forms. (Bug#10946)
101
102 * calendar/calendar.el (calendar-insert-at-column):
103 Handle non-unit-width characters a bit better. (Bug#10978)
104
1052012-03-15 Chong Yidong <cyd@gnu.org>
106
107 * emacs-lisp/ring.el (ring-extend): New function.
108 (ring-insert+extend): Extend the ring correctly (Bug#11019).
109
110 * comint.el (comint-read-input-ring)
111 (comint-add-to-input-history): Grow comint-input-ring lazily.
112
1132012-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
114
115 * progmodes/perl-mode.el (perl-syntax-propertize-special-constructs):
116 Fix up parsing of multiline twoarg non-paired elements (bug#11014).
117
118 * imenu.el: Fix multiple inheritance breakage (bug#9199).
119 (imenu-add-to-menubar): Don't add a redundant index.
120 (imenu-update-menubar): Handle a dynamically composed keymap.
121
1222012-03-13 Katsumi Yamaoka <yamaoka@jpl.org>
123
124 * mail/sendmail.el (mail-encode-header):
125 Bind rfc2047-encode-encoded-words to nil.
126
1272012-03-13 Glenn Morris <rgm@gnu.org>
128
129 * calendar/calendar.el (calendar-string-spread):
130 Handle non-unit-width characters a bit better. (Bug#10978)
131
1322012-03-13 Leo Liu <sdl.web@gmail.com>
133
134 * vc/vc-hg.el (vc-hg-working-revision): Rework to work with both
135 directory and file as argument (Bug#10822).
136
12012-03-13 Kaushik Srenevasan <ksrenevasan@gmail.com> (tiny change) 1372012-03-13 Kaushik Srenevasan <ksrenevasan@gmail.com> (tiny change)
2 138
3 * progmodes/gdb-mi.el (gdb-invalidate-disassembly): 139 * progmodes/gdb-mi.el (gdb-invalidate-disassembly):
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 0c351c6072f..d9ec27b4f88 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1424,16 +1424,24 @@ Optional integers MON and YR are used instead of today's date."
1424 "Move to column INDENT, adding spaces as needed. 1424 "Move to column INDENT, adding spaces as needed.
1425Inserts STRING so that it ends at INDENT. STRING is either a 1425Inserts STRING so that it ends at INDENT. STRING is either a
1426literal string, or a sexp to evaluate to return such. Truncates 1426literal string, or a sexp to evaluate to return such. Truncates
1427STRING to length TRUNCATE, ensure a trailing space." 1427STRING to length TRUNCATE, and ensures a trailing space."
1428 (if (not (ignore-errors (stringp (setq string (eval string))))) 1428 (if (not (ignore-errors (stringp (setq string (eval string)))))
1429 (calendar-move-to-column indent) 1429 (calendar-move-to-column indent)
1430 (if (> (length string) truncate) 1430 (if (> (string-width string) truncate)
1431 (setq string (substring string 0 truncate))) 1431 (setq string (truncate-string-to-width string truncate)))
1432 (or (string-match " $" string) 1432 (or (string-match " $" string)
1433 (if (= (length string) truncate) 1433 (setq string (concat (if (= (string-width string) truncate)
1434 (aset string (1- truncate) ?\s) 1434 (substring string 0 -1)
1435 (setq string (concat string " ")))) 1435 string)
1436 (calendar-move-to-column (- indent (length string))) 1436 ;; Avoid inserting text properties unless
1437 ;; we have to (ie, non-unit-width chars).
1438 ;; This is by no means essential.
1439 (if (= (string-width string) (length string))
1440 " "
1441 ;; Cribbed from buff-menu.el.
1442 (propertize
1443 " " 'display `(space :align-to ,indent))))))
1444 (calendar-move-to-column (- indent (string-width string)))
1437 (insert string))) 1445 (insert string)))
1438 1446
1439(defun calendar-generate-month (month year indent) 1447(defun calendar-generate-month (month year indent)
@@ -1756,8 +1764,8 @@ the STRINGS are just concatenated and the result truncated."
1756 (if (< (length strings) 2) 1764 (if (< (length strings) 2)
1757 (append (list "") strings (list "")) 1765 (append (list "") strings (list ""))
1758 strings))) 1766 strings)))
1759 (n (- length (length (apply 'concat strings)))) 1767 (n (- length (string-width (apply 'concat strings))))
1760 (m (1- (length strings))) 1768 (m (* (1- (length strings)) (char-width char)))
1761 (s (car strings)) 1769 (s (car strings))
1762 (strings (cdr strings)) 1770 (strings (cdr strings))
1763 (i 0)) 1771 (i 0))
@@ -1766,7 +1774,7 @@ the STRINGS are just concatenated and the result truncated."
1766 (make-string (max 0 (/ (+ n i) m)) char) 1774 (make-string (max 0 (/ (+ n i) m)) char)
1767 string) 1775 string)
1768 i (1+ i))) 1776 i (1+ i)))
1769 (substring s 0 length))) 1777 (truncate-string-to-width s length)))
1770 1778
1771(defun calendar-update-mode-line () 1779(defun calendar-update-mode-line ()
1772 "Update the calendar mode line with the current date and date style." 1780 "Update the calendar mode line with the current date and date style."
diff --git a/lisp/comint.el b/lisp/comint.el
index 4c2229f2f83..9306bf8dbb2 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -922,15 +922,18 @@ See also `comint-input-ignoredups' and `comint-write-input-ring'."
922 (t 922 (t
923 (let* ((file comint-input-ring-file-name) 923 (let* ((file comint-input-ring-file-name)
924 (count 0) 924 (count 0)
925 (size comint-input-ring-size) 925 ;; Some users set HISTSIZE or `comint-input-ring-size'
926 (ring (make-ring size))) 926 ;; to huge numbers. Don't allocate a huge ring right
927 ;; away; there might not be that much history.
928 (ring-size (min 1500 comint-input-ring-size))
929 (ring (make-ring ring-size)))
927 (with-temp-buffer 930 (with-temp-buffer
928 (insert-file-contents file) 931 (insert-file-contents file)
929 ;; Save restriction in case file is already visited... 932 ;; Save restriction in case file is already visited...
930 ;; Watch for those date stamps in history files! 933 ;; Watch for those date stamps in history files!
931 (goto-char (point-max)) 934 (goto-char (point-max))
932 (let (start end history) 935 (let (start end history)
933 (while (and (< count size) 936 (while (and (< count comint-input-ring-size)
934 (re-search-backward comint-input-ring-separator 937 (re-search-backward comint-input-ring-separator
935 nil t) 938 nil t)
936 (setq end (match-beginning 0))) 939 (setq end (match-beginning 0)))
@@ -941,15 +944,18 @@ See also `comint-input-ignoredups' and `comint-write-input-ring'."
941 (point-min))) 944 (point-min)))
942 (setq history (buffer-substring start end)) 945 (setq history (buffer-substring start end))
943 (goto-char start) 946 (goto-char start)
944 (if (and (not (string-match comint-input-history-ignore 947 (when (and (not (string-match comint-input-history-ignore
945 history)) 948 history))
946 (or (null comint-input-ignoredups) 949 (or (null comint-input-ignoredups)
947 (ring-empty-p ring) 950 (ring-empty-p ring)
948 (not (string-equal (ring-ref ring 0) 951 (not (string-equal (ring-ref ring 0)
949 history)))) 952 history))))
950 (progn 953 (when (= count ring-size)
951 (ring-insert-at-beginning ring history) 954 (ring-extend ring (min (- comint-input-ring-size ring-size)
952 (setq count (1+ count))))))) 955 ring-size))
956 (setq ring-size (ring-size ring)))
957 (ring-insert-at-beginning ring history)
958 (setq count (1+ count))))))
953 (setq comint-input-ring ring 959 (setq comint-input-ring ring
954 comint-input-ring-index nil))))) 960 comint-input-ring-index nil)))))
955 961
@@ -1691,13 +1697,18 @@ Argument 0 is the command name."
1691(defun comint-add-to-input-history (cmd) 1697(defun comint-add-to-input-history (cmd)
1692 "Add CMD to the input history. 1698 "Add CMD to the input history.
1693Ignore duplicates if `comint-input-ignoredups' is non-nil." 1699Ignore duplicates if `comint-input-ignoredups' is non-nil."
1694 (if (and (funcall comint-input-filter cmd) 1700 (when (and (funcall comint-input-filter cmd)
1695 (or (null comint-input-ignoredups) 1701 (or (null comint-input-ignoredups)
1696 (not (ring-p comint-input-ring)) 1702 (not (ring-p comint-input-ring))
1697 (ring-empty-p comint-input-ring) 1703 (ring-empty-p comint-input-ring)
1698 (not (string-equal (ring-ref comint-input-ring 0) 1704 (not (string-equal (ring-ref comint-input-ring 0) cmd))))
1699 cmd)))) 1705 ;; If `comint-input-ring' is full, maybe grow it.
1700 (ring-insert comint-input-ring cmd))) 1706 (let ((size (ring-size comint-input-ring)))
1707 (and (= size (ring-length comint-input-ring))
1708 (< size comint-input-ring-size)
1709 (ring-extend comint-input-ring
1710 (min size (- comint-input-ring-size size)))))
1711 (ring-insert comint-input-ring cmd)))
1701 1712
1702(defun comint-send-input (&optional no-newline artificial) 1713(defun comint-send-input (&optional no-newline artificial)
1703 "Send input to process. 1714 "Send input to process.
diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el
index a77998aa6d9..09b456b54ba 100644
--- a/lisp/emacs-lisp/copyright.el
+++ b/lisp/emacs-lisp/copyright.el
@@ -85,7 +85,7 @@ The second \\( \\) construct must match the years."
85 "Non-nil if individual consecutive years should be replaced with a range. 85 "Non-nil if individual consecutive years should be replaced with a range.
86For example: 2005, 2006, 2007, 2008 might be replaced with 2005-2008. 86For example: 2005, 2006, 2007, 2008 might be replaced with 2005-2008.
87If you use ranges, you should add an explanatory note in a README file. 87If you use ranges, you should add an explanatory note in a README file.
88The function `copyright-fix-year' respects this variable." 88The function `copyright-fix-years' respects this variable."
89 :group 'copyright 89 :group 'copyright
90 :type 'boolean 90 :type 'boolean
91 :version "24.1") 91 :version "24.1")
diff --git a/lisp/emacs-lisp/ring.el b/lisp/emacs-lisp/ring.el
index 4b07de523c3..cee6a43df86 100644
--- a/lisp/emacs-lisp/ring.el
+++ b/lisp/emacs-lisp/ring.el
@@ -185,26 +185,31 @@ Raise error if ITEM is not in the RING."
185 (unless curr-index (error "Item is not in the ring: `%s'" item)) 185 (unless curr-index (error "Item is not in the ring: `%s'" item))
186 (ring-ref ring (ring-minus1 curr-index (ring-length ring))))) 186 (ring-ref ring (ring-minus1 curr-index (ring-length ring)))))
187 187
188(defun ring-extend (ring x)
189 "Increase the size of RING by X."
190 (when (and (integerp x) (> x 0))
191 (let* ((hd (car ring))
192 (length (ring-length ring))
193 (size (ring-size ring))
194 (old-vec (cddr ring))
195 (new-vec (make-vector (+ size x) nil)))
196 (setcdr ring (cons length new-vec))
197 ;; If the ring is wrapped, the existing elements must be written
198 ;; out in the right order.
199 (dotimes (j length)
200 (aset new-vec j (aref old-vec (mod (+ hd j) size))))
201 (setcar ring 0))))
202
188(defun ring-insert+extend (ring item &optional grow-p) 203(defun ring-insert+extend (ring item &optional grow-p)
189 "Like `ring-insert', but if GROW-P is non-nil, then enlarge ring. 204 "Like `ring-insert', but if GROW-P is non-nil, then enlarge ring.
190Insert onto ring RING the item ITEM, as the newest (last) item. 205Insert onto ring RING the item ITEM, as the newest (last) item.
191If the ring is full, behavior depends on GROW-P: 206If the ring is full, behavior depends on GROW-P:
192 If GROW-P is non-nil, enlarge the ring to accommodate the new item. 207 If GROW-P is non-nil, enlarge the ring to accommodate the new item.
193 If GROW-P is nil, dump the oldest item to make room for the new." 208 If GROW-P is nil, dump the oldest item to make room for the new."
194 (let* ((vec (cddr ring)) 209 (and grow-p
195 (veclen (length vec)) 210 (= (ring-length ring) (ring-size ring))
196 (hd (car ring)) 211 (ring-extend ring 1))
197 (ringlen (ring-length ring))) 212 (ring-insert ring item))
198 (prog1
199 (cond ((and grow-p (= ringlen veclen)) ; Full ring. Enlarge it.
200 (setq veclen (1+ veclen))
201 (setcdr ring (cons (setq ringlen (1+ ringlen))
202 (setq vec (vconcat vec (vector item)))))
203 (setcar ring hd))
204 (t (aset vec (mod (+ hd ringlen) veclen) item)))
205 (if (= ringlen veclen)
206 (setcar ring (ring-plus1 hd veclen))
207 (setcar (cdr ring) (1+ ringlen))))))
208 213
209(defun ring-remove+insert+extend (ring item &optional grow-p) 214(defun ring-remove+insert+extend (ring item &optional grow-p)
210 "`ring-remove' ITEM from RING, then `ring-insert+extend' it. 215 "`ring-remove' ITEM from RING, then `ring-insert+extend' it.
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 8fe514ab551..f17b12da6a0 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -278,11 +278,10 @@ of column descriptors."
278 (width (nth 1 format)) 278 (width (nth 1 format))
279 (label (if (stringp desc) desc (car desc))) 279 (label (if (stringp desc) desc (car desc)))
280 (help-echo (concat (car format) ": " label))) 280 (help-echo (concat (car format) ": " label)))
281 ;; Truncate labels if necessary. 281 ;; Truncate labels if necessary (except last column).
282 (and (> width 6) 282 (and (< (1+ n) len)
283 (> (length label) width) 283 (> (string-width label) width)
284 (setq label (concat (substring label 0 (- width 3)) 284 (setq label (truncate-string-to-width label width nil nil t)))
285 "...")))
286 (setq label (bidi-string-mark-left-to-right label)) 285 (setq label (bidi-string-mark-left-to-right label))
287 (if (stringp desc) 286 (if (stringp desc)
288 (insert (propertize label 'help-echo help-echo)) 287 (insert (propertize label 'help-echo help-echo))
diff --git a/lisp/faces.el b/lisp/faces.el
index bdac3a1bb6a..34fad66ce27 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1521,7 +1521,10 @@ If SPEC is nil, return nil."
1521 (append 1521 (append
1522 '(:underline nil :overline nil :strike-through nil 1522 '(:underline nil :overline nil :strike-through nil
1523 :box nil :inverse-video nil :stipple nil :inherit nil) 1523 :box nil :inverse-video nil :stipple nil :inherit nil)
1524 (unless (display-graphic-p frame) 1524 ;; `display-graphic-p' is unavailable when running
1525 ;; temacs, prior to loading frame.el.
1526 (unless (and (fboundp 'display-graphic-p)
1527 (display-graphic-p frame))
1525 '(:family "default" :foundry "default" :width normal 1528 '(:family "default" :foundry "default" :width normal
1526 :height 1 :weight normal :slant normal 1529 :height 1 :weight normal :slant normal
1527 :foreground "unspecified-fg" 1530 :foreground "unspecified-fg"
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 4222791705b..b65828ca1d7 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -2284,7 +2284,7 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
2284 `(;; Control structures. Emacs Lisp forms. 2284 `(;; Control structures. Emacs Lisp forms.
2285 (,(concat 2285 (,(concat
2286 "(" (regexp-opt 2286 "(" (regexp-opt
2287 '("cond" "if" "while" "while-no-input" "let" "let*" 2287 '("cond" "if" "while" "while-no-input" "let" "let*" "letrec"
2288 "prog" "progn" "progv" "prog1" "prog2" "prog*" 2288 "prog" "progn" "progv" "prog1" "prog2" "prog*"
2289 "inline" "lambda" "save-restriction" "save-excursion" 2289 "inline" "lambda" "save-restriction" "save-excursion"
2290 "save-selected-window" "save-window-excursion" 2290 "save-selected-window" "save-window-excursion"
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 1e787642664..878b9b9eb6b 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,27 @@
12012-03-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * shr.el (shr-insert): Update the text state properly to avoid
4 inserting spurious paragraph starts.
5
62012-03-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7
8 * gnus-sum.el (gnus-update-marks): Don't propagate marks unless
9 requested (bug#10961).
10
11 * shr.el (shr-table-widths): Divide the extra width more fairly over
12 the TDs (bug#10973).
13 (shr-render-td): Don't delete too much padding.
14 (shr-natural-width): Compute the natural width more correctly.
15 (shr-insert): Allow the natural width to be computed for tables again.
16 (shr-tag-table-1): Rework how the natural widths are computed by
17 rendering the table a third time.
18 (shr-natural-width): Removed.
19 (shr-buffer-width): New function.
20 (shr-expand-newlines): Use it.
21
22 * gnus-msg.el (gnus-bug): Don't delete the other windows. We may be
23 using a `gnus-use-full-window' setup (bug#11013).
24
12012-03-12 Lars Magne Ingebrigtsen <larsi@gnus.org> 252012-03-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 26
3 * gnus-int.el (gnus-backend-trace): Flip default to nil before Emacs 27 * gnus-int.el (gnus-backend-trace): Flip default to nil before Emacs
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 7c8d194f26b..500ace9e8ff 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1453,7 +1453,6 @@ If YANK is non-nil, include the original article."
1453 (error "Gnus has been shut down")) 1453 (error "Gnus has been shut down"))
1454 (gnus-setup-message (if (message-mail-user-agent) 'message 'bug) 1454 (gnus-setup-message (if (message-mail-user-agent) 'message 'bug)
1455 (unless (message-mail-user-agent) 1455 (unless (message-mail-user-agent)
1456 (delete-other-windows)
1457 (when gnus-bug-create-help-buffer 1456 (when gnus-bug-create-help-buffer
1458 (switch-to-buffer "*Gnus Help Bug*") 1457 (switch-to-buffer "*Gnus Help Bug*")
1459 (erase-buffer) 1458 (erase-buffer)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 9770b8f9982..7f095e15496 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -6074,6 +6074,10 @@ If SELECT-ARTICLES, only select those articles from GROUP."
6074 6074
6075 (when (and (gnus-check-backend-function 6075 (when (and (gnus-check-backend-function
6076 'request-set-mark gnus-newsgroup-name) 6076 'request-set-mark gnus-newsgroup-name)
6077 (or gnus-propagate-marks
6078 (gnus-method-option-p
6079 (gnus-find-method-for-group gnus-newsgroup-name)
6080 'server-marks))
6077 (not (gnus-article-unpropagatable-p (cdr type)))) 6081 (not (gnus-article-unpropagatable-p (cdr type))))
6078 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info)))) 6082 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
6079 ;; Don't do anything about marks for articles we 6083 ;; Don't do anything about marks for articles we
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 41f12243971..c2040a9b8cf 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -332,6 +332,7 @@ the URL of the image to the kill buffer instead."
332 (unless shr-start 332 (unless shr-start
333 (setq shr-start (point))) 333 (setq shr-start (point)))
334 (insert elem) 334 (insert elem)
335 (setq shr-state nil)
335 (let (found) 336 (let (found)
336 (while (and (> (current-column) shr-width) 337 (while (and (> (current-column) shr-width)
337 (progn 338 (progn
@@ -341,7 +342,6 @@ the URL of the image to the kill buffer instead."
341 (delete-char -1)) 342 (delete-char -1))
342 (insert "\n") 343 (insert "\n")
343 (unless found 344 (unless found
344 (put-text-property (1- (point)) (point) 'shr-break t)
345 ;; No space is needed at the beginning of a line. 345 ;; No space is needed at the beginning of a line.
346 (when (eq (following-char) ? ) 346 (when (eq (following-char) ? )
347 (delete-char 1))) 347 (delete-char 1)))
@@ -711,7 +711,7 @@ ones, in case fg and bg are nil."
711 (forward-line 1) 711 (forward-line 1)
712 (setq end (point)) 712 (setq end (point))
713 (narrow-to-region start end) 713 (narrow-to-region start end)
714 (let ((width (shr-natural-width)) 714 (let ((width (shr-buffer-width))
715 column) 715 column)
716 (goto-char (point-min)) 716 (goto-char (point-min))
717 (while (not (eobp)) 717 (while (not (eobp))
@@ -1048,7 +1048,10 @@ ones, in case fg and bg are nil."
1048 ;; be smaller (if there's little text) or bigger (if there's 1048 ;; be smaller (if there's little text) or bigger (if there's
1049 ;; unbreakable text). 1049 ;; unbreakable text).
1050 (sketch (shr-make-table cont suggested-widths)) 1050 (sketch (shr-make-table cont suggested-widths))
1051 (sketch-widths (shr-table-widths sketch suggested-widths))) 1051 ;; Compute the "natural" width by setting each column to 500
1052 ;; characters and see how wide they really render.
1053 (natural (shr-make-table cont (make-vector (length columns) 500)))
1054 (sketch-widths (shr-table-widths sketch natural suggested-widths)))
1052 ;; This probably won't work very well. 1055 ;; This probably won't work very well.
1053 (when (> (+ (loop for width across sketch-widths 1056 (when (> (+ (loop for width across sketch-widths
1054 summing (1+ width)) 1057 summing (1+ width))
@@ -1186,31 +1189,35 @@ ones, in case fg and bg are nil."
1186 shr-table-corner)) 1189 shr-table-corner))
1187 (insert "\n")) 1190 (insert "\n"))
1188 1191
1189(defun shr-table-widths (table suggested-widths) 1192(defun shr-table-widths (table natural-table suggested-widths)
1190 (let* ((length (length suggested-widths)) 1193 (let* ((length (length suggested-widths))
1191 (widths (make-vector length 0)) 1194 (widths (make-vector length 0))
1192 (natural-widths (make-vector length 0))) 1195 (natural-widths (make-vector length 0)))
1193 (dolist (row table) 1196 (dolist (row table)
1194 (let ((i 0)) 1197 (let ((i 0))
1195 (dolist (column row) 1198 (dolist (column row)
1196 (aset widths i (max (aref widths i) 1199 (aset widths i (max (aref widths i) column))
1197 (car column))) 1200 (setq i (1+ i)))))
1198 (aset natural-widths i (max (aref natural-widths i) 1201 (dolist (row natural-table)
1199 (cadr column))) 1202 (let ((i 0))
1203 (dolist (column row)
1204 (aset natural-widths i (max (aref natural-widths i) column))
1200 (setq i (1+ i))))) 1205 (setq i (1+ i)))))
1201 (let ((extra (- (apply '+ (append suggested-widths nil)) 1206 (let ((extra (- (apply '+ (append suggested-widths nil))
1202 (apply '+ (append widths nil)))) 1207 (apply '+ (append widths nil))))
1203 (expanded-columns 0)) 1208 (expanded-columns 0))
1209 ;; We have extra, unused space, so divide this space amongst the
1210 ;; columns.
1204 (when (> extra 0) 1211 (when (> extra 0)
1212 ;; If the natural width is wider than the rendered width, we
1213 ;; want to allow the column to expand.
1205 (dotimes (i length) 1214 (dotimes (i length)
1206 ;; If the natural width is wider than the rendered width, we
1207 ;; want to allow the column to expand.
1208 (when (> (aref natural-widths i) (aref widths i)) 1215 (when (> (aref natural-widths i) (aref widths i))
1209 (setq expanded-columns (1+ expanded-columns)))) 1216 (setq expanded-columns (1+ expanded-columns))))
1210 (dotimes (i length) 1217 (dotimes (i length)
1211 (when (> (aref natural-widths i) (aref widths i)) 1218 (when (> (aref natural-widths i) (aref widths i))
1212 (aset widths i (min 1219 (aset widths i (min
1213 (1+ (aref natural-widths i)) 1220 (aref natural-widths i)
1214 (+ (/ extra expanded-columns) 1221 (+ (/ extra expanded-columns)
1215 (aref widths i)))))))) 1222 (aref widths i))))))))
1216 widths)) 1223 widths))
@@ -1265,10 +1272,13 @@ ones, in case fg and bg are nil."
1265 (let ((shr-width width) 1272 (let ((shr-width width)
1266 (shr-indentation 0)) 1273 (shr-indentation 0))
1267 (shr-descend (cons 'td cont))) 1274 (shr-descend (cons 'td cont)))
1275 ;; Delete padding at the bottom of the TDs.
1268 (delete-region 1276 (delete-region
1269 (point) 1277 (point)
1270 (+ (point) 1278 (progn
1271 (skip-chars-backward " \t\n"))) 1279 (skip-chars-backward " \t\n")
1280 (end-of-line)
1281 (point)))
1272 (push (list (cons width cont) (buffer-string) 1282 (push (list (cons width cont) (buffer-string)
1273 (shr-overlays-in-region (point-min) (point-max))) 1283 (shr-overlays-in-region (point-min) (point-max)))
1274 shr-content-cache))) 1284 shr-content-cache)))
@@ -1302,19 +1312,14 @@ ones, in case fg and bg are nil."
1302 (split-string (buffer-string) "\n") 1312 (split-string (buffer-string) "\n")
1303 (shr-collect-overlays) 1313 (shr-collect-overlays)
1304 (car actual-colors)) 1314 (car actual-colors))
1305 (list max 1315 max)))))
1306 (shr-natural-width)))))))
1307 1316
1308(defun shr-natural-width () 1317(defun shr-buffer-width ()
1309 (goto-char (point-min)) 1318 (goto-char (point-min))
1310 (let ((current 0) 1319 (let ((max 0))
1311 (max 0))
1312 (while (not (eobp)) 1320 (while (not (eobp))
1313 (end-of-line) 1321 (end-of-line)
1314 (setq current (+ current (current-column))) 1322 (setq max (max max (current-column)))
1315 (unless (get-text-property (point) 'shr-break)
1316 (setq max (max max current)
1317 current 0))
1318 (forward-line 1)) 1323 (forward-line 1))
1319 max)) 1324 max))
1320 1325
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index b94d4293fa7..fbf7a672ff6 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -450,6 +450,12 @@ and so on."
450 keep-overlays : More of a bell (or possibly whistle) than an 450 keep-overlays : More of a bell (or possibly whistle) than an
451 optimization - If on, preserve overlay highlighting 451 optimization - If on, preserve overlay highlighting
452 (cf ediff or goo-font-lock) as well as basic faces.\n 452 (cf ediff or goo-font-lock) as well as basic faces.\n
453 body-text-only : Emit only body-text. In concrete terms,
454 1. Suppress calls to `hfy-page-header'and
455 `hfy-page-footer'
456 2. Pretend that `div-wrapper' option above is
457 turned off
458 3. Don't enclose output in <pre> </pre> tags
453 And the following are planned but not yet available:\n 459 And the following are planned but not yet available:\n
454 kill-context-leak : Suppress hyperlinking between files highlighted by 460 kill-context-leak : Suppress hyperlinking between files highlighted by
455 different modes.\n 461 different modes.\n
@@ -463,7 +469,8 @@ which can never slow you down, but may result in incomplete fontification."
463 (const :tag "skip-refontification" skip-refontification) 469 (const :tag "skip-refontification" skip-refontification)
464 (const :tag "kill-context-leak" kill-context-leak ) 470 (const :tag "kill-context-leak" kill-context-leak )
465 (const :tag "div-wrapper" div-wrapper ) 471 (const :tag "div-wrapper" div-wrapper )
466 (const :tag "keep-overlays" keep-overlays )) 472 (const :tag "keep-overlays" keep-overlays )
473 (const :tag "body-text-only" body-text-only ))
467 :group 'htmlfontify 474 :group 'htmlfontify
468 :tag "optimizations") 475 :tag "optimizations")
469 476
@@ -1044,7 +1051,7 @@ haven't encountered them yet. Returns a `hfy-style-assoc'."
1044 ((facep fn) 1051 ((facep fn)
1045 (hfy-face-attr-for-class fn hfy-display-class)) 1052 (hfy-face-attr-for-class fn hfy-display-class))
1046 ((and (symbolp fn) 1053 ((and (symbolp fn)
1047 (facep (symbol-value fn))) 1054 (facep (symbol-value fn)))
1048 ;; Obsolete faces like `font-lock-reference-face' are defined as 1055 ;; Obsolete faces like `font-lock-reference-face' are defined as
1049 ;; aliases for another face. 1056 ;; aliases for another face.
1050 (hfy-face-attr-for-class (symbol-value fn) hfy-display-class)) 1057 (hfy-face-attr-for-class (symbol-value fn) hfy-display-class))
@@ -1108,10 +1115,9 @@ See also `hfy-face-to-style-i', `hfy-flatten-style'."
1108 1115
1109;; construct an assoc of (stripped-name . "{ css-stuff-here }") pairs 1116;; construct an assoc of (stripped-name . "{ css-stuff-here }") pairs
1110;; from a face: 1117;; from a face:
1111(defun hfy-face-to-css (fn) 1118(defun hfy-face-to-css-default (fn)
1112 "Take FN, a font or `defface' specification (cf `face-attr-construct') 1119 "Default handler for mapping faces to styles.
1113and return a CSS style specification.\n 1120See also `hfy-face-to-css'."
1114See also `hfy-face-to-style'."
1115 ;;(message "hfy-face-to-css");;DBUG 1121 ;;(message "hfy-face-to-css");;DBUG
1116 (let* ((css-list (hfy-face-to-style fn)) 1122 (let* ((css-list (hfy-face-to-style fn))
1117 (seen nil) 1123 (seen nil)
@@ -1125,6 +1131,17 @@ See also `hfy-face-to-style'."
1125 css-list))) 1131 css-list)))
1126 (cons (hfy-css-name fn) (format "{%s}" (apply 'concat css-text)))) ) 1132 (cons (hfy-css-name fn) (format "{%s}" (apply 'concat css-text)))) )
1127 1133
1134(defvar hfy-face-to-css 'hfy-face-to-css-default
1135 "Handler for mapping faces to styles.
1136The signature of the handler is of the form \(lambda (FN) ...\).
1137FN is a font or `defface' specification (cf
1138`face-attr-construct'). The handler should return a cons cell of
1139the form (STYLE-NAME . STYLE-SPEC).
1140
1141The default handler is `hfy-face-to-css-default'.
1142
1143See also `hfy-face-to-style'.")
1144
1128(defalias 'hfy-prop-invisible-p 1145(defalias 'hfy-prop-invisible-p
1129 (if (fboundp 'invisible-p) #'invisible-p 1146 (if (fboundp 'invisible-p) #'invisible-p
1130 (lambda (prop) 1147 (lambda (prop)
@@ -1311,20 +1328,27 @@ The plists are returned in descending priority order."
1311 1328
1312;; construct an assoc of (face-name . (css-name . "{ css-style }")) elements: 1329;; construct an assoc of (face-name . (css-name . "{ css-style }")) elements:
1313(defun hfy-compile-stylesheet () 1330(defun hfy-compile-stylesheet ()
1314 "Trawl the current buffer, construct and return a `hfy-sheet-assoc'." 1331 "Trawl the current buffer, construct and return a `hfy-sheet-assoc'.
1332If `hfy-user-sheet-assoc' is currently bound then use it to
1333collect new styles discovered during this run. Otherwise create
1334a new assoc."
1315 ;;(message "hfy-compile-stylesheet");;DBUG 1335 ;;(message "hfy-compile-stylesheet");;DBUG
1316 (let ((pt (point-min)) 1336 (let ((pt (point-min))
1317 ;; Make the font stack stay: 1337 ;; Make the font stack stay:
1318 ;;(hfy-tmpfont-stack nil) 1338 ;;(hfy-tmpfont-stack nil)
1319 (fn nil) 1339 (fn nil)
1320 (style nil)) 1340 (style (and (boundp 'hfy-user-sheet-assoc) hfy-user-sheet-assoc)))
1321 (save-excursion 1341 (save-excursion
1322 (goto-char pt) 1342 (goto-char pt)
1323 (while (< pt (point-max)) 1343 (while (< pt (point-max))
1324 (if (and (setq fn (hfy-face-at pt)) (not (assoc fn style))) 1344 (if (and (setq fn (hfy-face-at pt)) (not (assoc fn style)))
1325 (push (cons fn (hfy-face-to-css fn)) style)) 1345 (push (cons fn (funcall hfy-face-to-css fn)) style))
1326 (setq pt (next-char-property-change pt))) ) 1346 (setq pt (next-char-property-change pt))))
1327 (push (cons 'default (hfy-face-to-css 'default)) style))) 1347 (unless (assoc 'default style)
1348 (push (cons 'default (funcall hfy-face-to-css 'default)) style))
1349 (when (boundp 'hfy-user-sheet-assoc)
1350 (setq hfy-user-sheet-assoc style))
1351 style))
1328 1352
1329(defun hfy-fontified-p () 1353(defun hfy-fontified-p ()
1330 "`font-lock' doesn't like to say it's been fontified when in batch 1354 "`font-lock' doesn't like to say it's been fontified when in batch
@@ -1425,7 +1449,7 @@ Returns a modified copy of FACE-MAP."
1425 (setq pt (next-char-property-change pt)) 1449 (setq pt (next-char-property-change pt))
1426 (setq pt-narrow (+ offset pt))) 1450 (setq pt-narrow (+ offset pt)))
1427 (if (and map (not (eq 'end (cdar map)))) 1451 (if (and map (not (eq 'end (cdar map))))
1428 (push (cons (- (point-max) (point-min)) 'end) map))) 1452 (push (cons (1+ (- (point-max) (point-min))) 'end) map)))
1429 (if (hfy-opt 'merge-adjacent-tags) (hfy-merge-adjacent-spans map) map))) 1453 (if (hfy-opt 'merge-adjacent-tags) (hfy-merge-adjacent-spans map) map)))
1430 1454
1431(defun hfy-buffer () 1455(defun hfy-buffer ()
@@ -1547,6 +1571,61 @@ Do not record undo information during evaluation of BODY."
1547 (remove-text-properties (point-min) (point-max) 1571 (remove-text-properties (point-min) (point-max)
1548 '(hfy-show-trailing-whitespace))))) 1572 '(hfy-show-trailing-whitespace)))))
1549 1573
1574(defun hfy-begin-span (style text-block text-id text-begins-block-p)
1575 "Default handler to begin a span of text.
1576Insert \"<span class=\"STYLE\" ...>\". See
1577`hfy-begin-span-handler' for more information."
1578 (when text-begins-block-p
1579 (insert
1580 (format "<span onclick=\"toggle_invis('%s');\">…</span>" text-block)))
1581
1582 (insert
1583 (if text-block
1584 (format "<span class=\"%s\" id=\"%s-%d\">" style text-block text-id)
1585 (format "<span class=\"%s\">" style))))
1586
1587(defun hfy-end-span ()
1588 "Default handler to end a span of text.
1589Insert \"</span>\". See `hfy-end-span-handler' for more
1590information."
1591 (insert "</span>"))
1592
1593(defvar hfy-begin-span-handler 'hfy-begin-span
1594 "Handler to begin a span of text.
1595The signature of the handler is \(lambda (STYLE TEXT-BLOCK
1596TEXT-ID TEXT-BEGINS-BLOCK-P) ...\). The handler must insert
1597appropriate tags to begin a span of text.
1598
1599STYLE is the name of the style that begins at point. It is
1600derived from the face attributes as part of `hfy-face-to-css'
1601callback. The other arguments TEXT-BLOCK, TEXT-ID,
1602TEXT-BEGINS-BLOCK-P are non-nil only if the buffer contains
1603invisible text.
1604
1605TEXT-BLOCK is a string that identifies a single chunk of visible
1606or invisible text of which the current position is a part. For
1607visible portions, it's value is \"nil\". For invisible portions,
1608it's value is computed as part of `hfy-invisible-name'.
1609
1610TEXT-ID marks a unique position within a block. It is set to
1611value of `point' at the current buffer position.
1612
1613TEXT-BEGINS-BLOCK-P is a boolean and is non-nil if the current
1614span also begins a invisible portion of text.
1615
1616An implementation can use TEXT-BLOCK, TEXT-ID,
1617TEXT-BEGINS-BLOCK-P to implement fold/unfold-on-mouse-click like
1618behaviour.
1619
1620The default handler is `hfy-begin-span'.")
1621
1622(defvar hfy-end-span-handler 'hfy-end-span
1623 "Handler to end a span of text.
1624The signature of the handler is \(lambda () ...\). The handler
1625must insert appropriate tags to end a span of text.
1626
1627The default handler is `hfy-end-span'.")
1628
1550(defun hfy-fontify-buffer (&optional srcdir file) 1629(defun hfy-fontify-buffer (&optional srcdir file)
1551 "Implement the guts of `htmlfontify-buffer'. 1630 "Implement the guts of `htmlfontify-buffer'.
1552SRCDIR, if set, is the directory being htmlfontified. 1631SRCDIR, if set, is the directory being htmlfontified.
@@ -1634,23 +1713,19 @@ FILE, if set, is the file name."
1634 (or (get-text-property pt 'hfy-linkp) 1713 (or (get-text-property pt 'hfy-linkp)
1635 (get-text-property pt 'hfy-endl ))) 1714 (get-text-property pt 'hfy-endl )))
1636 (if (eq 'end fn) 1715 (if (eq 'end fn)
1637 (insert "</span>") 1716 (funcall hfy-end-span-handler)
1638 (if (not (and srcdir file)) 1717 (if (not (and srcdir file))
1639 nil 1718 nil
1640 (when move-link 1719 (when move-link
1641 (remove-text-properties (point) (1+ (point)) '(hfy-endl nil)) 1720 (remove-text-properties (point) (1+ (point)) '(hfy-endl nil))
1642 (put-text-property pt (1+ pt) 'hfy-endl t) )) 1721 (put-text-property pt (1+ pt) 'hfy-endl t) ))
1643 ;; if we have invisible blocks, we need to do some extra magic: 1722 ;; if we have invisible blocks, we need to do some extra magic:
1644 (if invis-ranges 1723 (funcall hfy-begin-span-handler
1645 (let ((iname (hfy-invisible-name pt invis-ranges)) 1724 (hfy-lookup fn css-sheet)
1646 (fname (hfy-lookup fn css-sheet ))) 1725 (and invis-ranges
1647 (when (assq pt invis-ranges) 1726 (format "%s" (hfy-invisible-name pt invis-ranges)))
1648 (insert 1727 (and invis-ranges pt)
1649 (format "<span onclick=\"toggle_invis('%s');\">" iname)) 1728 (and invis-ranges (assq pt invis-ranges)))
1650 (insert "…</span>"))
1651 (insert
1652 (format "<span class=\"%s\" id=\"%s-%d\">" fname iname pt)))
1653 (insert (format "<span class=\"%s\">" (hfy-lookup fn css-sheet))))
1654 (if (not move-link) nil 1729 (if (not move-link) nil
1655 ;;(message "removing prop2 @ %d" (point)) 1730 ;;(message "removing prop2 @ %d" (point))
1656 (if (remove-text-properties (point) (1+ (point)) '(hfy-endl nil)) 1731 (if (remove-text-properties (point) (1+ (point)) '(hfy-endl nil))
@@ -1698,23 +1773,39 @@ FILE, if set, is the file name."
1698 ;; so we have to do this after we use said properties: 1773 ;; so we have to do this after we use said properties:
1699 ;; (message "munging dangerous characters") 1774 ;; (message "munging dangerous characters")
1700 (hfy-html-dekludge-buffer) 1775 (hfy-html-dekludge-buffer)
1701 ;; insert the stylesheet at the top: 1776 (unless (hfy-opt 'body-text-only)
1702 (goto-char (point-min)) 1777 ;; insert the stylesheet at the top:
1703 ;;(message "inserting stylesheet") 1778 (goto-char (point-min))
1704 (insert (hfy-sprintf-stylesheet css-sheet file)) 1779
1705 (if (hfy-opt 'div-wrapper) (insert "<div class=\"default\">")) 1780 ;;(message "inserting stylesheet")
1706 (insert "\n<pre>") 1781 (insert (hfy-sprintf-stylesheet css-sheet file))
1707 (goto-char (point-max)) 1782
1708 (insert "</pre>\n") 1783 (if (hfy-opt 'div-wrapper) (insert "<div class=\"default\">"))
1709 (if (hfy-opt 'div-wrapper) (insert "</div>")) 1784 (insert "\n<pre>")
1710 ;;(message "inserting footer") 1785 (goto-char (point-max))
1711 (insert (funcall hfy-page-footer file)) 1786 (insert "</pre>\n")
1787 (if (hfy-opt 'div-wrapper) (insert "</div>"))
1788 ;;(message "inserting footer")
1789 (insert (funcall hfy-page-footer file)))
1712 ;; call any post html-generation hooks: 1790 ;; call any post html-generation hooks:
1713 (run-hooks 'hfy-post-html-hooks) 1791 (run-hooks 'hfy-post-html-hooks)
1714 ;; return the html buffer 1792 ;; return the html buffer
1715 (set-buffer-modified-p nil) 1793 (set-buffer-modified-p nil)
1716 html-buffer)) 1794 html-buffer))
1717 1795
1796(defun htmlfontify-string (string)
1797 "Take a STRING and return a fontified version of it.
1798It is assumed that STRING has text properties that allow it to be
1799fontified. This is a simple convenience wrapper around
1800`htmlfontify-buffer'."
1801 (let* ((hfy-optimisations-1 (copy-sequence hfy-optimisations))
1802 (hfy-optimisations (add-to-list 'hfy-optimisations-1
1803 'skip-refontification)))
1804 (with-temp-buffer
1805 (insert string)
1806 (htmlfontify-buffer)
1807 (buffer-string))))
1808
1718(defun hfy-force-fontification () 1809(defun hfy-force-fontification ()
1719 "Try to force font-locking even when it is optimized away." 1810 "Try to force font-locking even when it is optimized away."
1720 (run-hooks 'hfy-init-kludge-hook) 1811 (run-hooks 'hfy-init-kludge-hook)
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 9a847f32e89..8363956355b 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -963,13 +963,14 @@ See the command `imenu' for more information."
963 imenu-generic-expression 963 imenu-generic-expression
964 (not (eq imenu-create-index-function 964 (not (eq imenu-create-index-function
965 'imenu-default-create-index-function))) 965 'imenu-default-create-index-function)))
966 (let ((newmap (make-sparse-keymap))) 966 (unless (keymapp (lookup-key (current-local-map) [menu-bar index]))
967 (set-keymap-parent newmap (current-local-map)) 967 (let ((newmap (make-sparse-keymap)))
968 (setq imenu--last-menubar-index-alist nil) 968 (set-keymap-parent newmap (current-local-map))
969 (define-key newmap [menu-bar index] 969 (setq imenu--last-menubar-index-alist nil)
970 `(menu-item ,name ,(make-sparse-keymap "Imenu"))) 970 (define-key newmap [menu-bar index]
971 (use-local-map newmap) 971 `(menu-item ,name ,(make-sparse-keymap "Imenu")))
972 (add-hook 'menu-bar-update-hook 'imenu-update-menubar)) 972 (use-local-map newmap)
973 (add-hook 'menu-bar-update-hook 'imenu-update-menubar)))
973 (error "The mode `%s' does not support Imenu" 974 (error "The mode `%s' does not support Imenu"
974 (format-mode-line mode-name)))) 975 (format-mode-line mode-name))))
975 976
@@ -1008,6 +1009,9 @@ to `imenu-update-menubar'.")
1008 (car (cdr menu)))) 1009 (car (cdr menu))))
1009 'imenu--menubar-select)) 1010 'imenu--menubar-select))
1010 (setq old (lookup-key (current-local-map) [menu-bar index])) 1011 (setq old (lookup-key (current-local-map) [menu-bar index]))
1012 ;; This should never happen, but in some odd cases, potentially,
1013 ;; lookup-key may return a dynamically composed keymap.
1014 (if (keymapp (cadr old)) (setq old (cadr old)))
1011 (setcdr old (cdr menu1))))))) 1015 (setcdr old (cdr menu1)))))))
1012 1016
1013(defun imenu--menubar-select (item) 1017(defun imenu--menubar-select (item)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index f4dfcfcf647..4e2d827fc29 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1085,9 +1085,10 @@ Return non-nil if and only if some part of the header is encoded."
1085 (cons selected mm-coding-system-priorities) 1085 (cons selected mm-coding-system-priorities)
1086 mm-coding-system-priorities)) 1086 mm-coding-system-priorities))
1087 (tick (buffer-chars-modified-tick)) 1087 (tick (buffer-chars-modified-tick))
1088 ;; rms: this proved necessary, but I don't recall why. 1088 ;; Many mailers, including Gnus, passes a message of which
1089 ;; Can anyone determine why, and state it here? 1089 ;; the header is already encoded, so this is necessary to
1090 (rfc2047-encode-encoded-words t)) 1090 ;; prevent it from being encoded again.
1091 (rfc2047-encode-encoded-words nil))
1091 (rfc2047-encode-message-header) 1092 (rfc2047-encode-message-header)
1092 (= tick (buffer-chars-modified-tick))))) 1093 (= tick (buffer-chars-modified-tick)))))
1093 1094
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 1c74e6190dc..d09b6aa831f 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -2165,13 +2165,17 @@ CHANNELS is a comma- or space-separated string of channel names."
2165 (let ((channel (if (> (length channel) 0) channel target))) 2165 (let ((channel (if (> (length channel) 0) channel target)))
2166 (rcirc-send-string process (concat "PART " channel " :" rcirc-id-string)))) 2166 (rcirc-send-string process (concat "PART " channel " :" rcirc-id-string))))
2167 2167
2168(defun-rcirc-command quit (reason) 2168(defun-rcirc-command quit (reason all)
2169 "Send a quit message to server with REASON." 2169 "Send a quit message to server with REASON.
2170 (interactive "sQuit reason: ") 2170When called with prefix, quit all servers."
2171 (rcirc-send-string process (concat "QUIT :" 2171 (interactive "sQuit reason: \nP")
2172 (if (not (zerop (length reason))) 2172 (dolist (p (if all
2173 reason 2173 (rcirc-process-list)
2174 rcirc-id-string)))) 2174 (list process)))
2175 (rcirc-send-string p (concat "QUIT :"
2176 (if (not (zerop (length reason)))
2177 reason
2178 rcirc-id-string)))))
2175 2179
2176(defun-rcirc-command nick (nick) 2180(defun-rcirc-command nick (nick)
2177 "Change nick to NICK." 2181 "Change nick to NICK."
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index f392971e7d1..cf38001c123 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -1246,7 +1246,7 @@ comment at the start of cc-engine.el for more info."
1246 (c-at-vsemi-p)))) 1246 (c-at-vsemi-p))))
1247 (throw 'done vsemi-pos)) 1247 (throw 'done vsemi-pos))
1248 ;; In a string/comment? 1248 ;; In a string/comment?
1249 ((setq lit-range (c-literal-limits)) 1249 ((setq lit-range (c-literal-limits from))
1250 (goto-char (cdr lit-range))) 1250 (goto-char (cdr lit-range)))
1251 ((eq (char-after) ?:) 1251 ((eq (char-after) ?:)
1252 (forward-char) 1252 (forward-char)
@@ -3250,8 +3250,7 @@ comment at the start of cc-engine.el for more info."
3250 (if scan-forward-p 3250 (if scan-forward-p
3251 (progn (narrow-to-region (point-min) here) 3251 (progn (narrow-to-region (point-min) here)
3252 (c-append-to-state-cache good-pos)) 3252 (c-append-to-state-cache good-pos))
3253 3253 good-pos)))
3254 (c-get-cache-scan-pos good-pos))))
3255 3254
3256 (t ; (eq strategy 'IN-LIT) 3255 (t ; (eq strategy 'IN-LIT)
3257 (setq c-state-cache nil 3256 (setq c-state-cache nil
@@ -4563,6 +4562,38 @@ comment at the start of cc-engine.el for more info."
4563 (point-min)) 4562 (point-min))
4564 (t 4563 (t
4565 (c-determine-limit (- how-far-back count) base try-size)))))) 4564 (c-determine-limit (- how-far-back count) base try-size))))))
4565
4566(defun c-determine-+ve-limit (how-far &optional start-pos)
4567 ;; Return a buffer position about HOW-FAR non-literal characters forward
4568 ;; from START-POS (default point), which must not be inside a literal.
4569 (save-excursion
4570 (let ((pos (or start-pos (point)))
4571 (count how-far)
4572 (s (parse-partial-sexp (point) (point)))) ; null state
4573 (while (and (not (eobp))
4574 (> count 0))
4575 ;; Scan over counted characters.
4576 (setq s (parse-partial-sexp
4577 pos
4578 (min (+ pos count) (point-max))
4579 nil ; target-depth
4580 nil ; stop-before
4581 s ; state
4582 'syntax-table)) ; stop-comment
4583 (setq count (- count (- (point) pos) 1)
4584 pos (point))
4585 ;; Scan over literal characters.
4586 (if (nth 8 s)
4587 (setq s (parse-partial-sexp
4588 pos
4589 (point-max)
4590 nil ; target-depth
4591 nil ; stop-before
4592 s ; state
4593 'syntax-table) ; stop-comment
4594 pos (point))))
4595 (point))))
4596
4566 4597
4567;; `c-find-decl-spots' and accompanying stuff. 4598;; `c-find-decl-spots' and accompanying stuff.
4568 4599
@@ -7670,8 +7701,8 @@ comment at the start of cc-engine.el for more info."
7670 (and 7701 (and
7671 (eq (c-beginning-of-statement-1 lim) 'same) 7702 (eq (c-beginning-of-statement-1 lim) 'same)
7672 7703
7673 (not (or (c-major-mode-is 'objc-mode) 7704 (not (and (c-major-mode-is 'objc-mode)
7674 (c-forward-objc-directive))) 7705 (c-forward-objc-directive)))
7675 7706
7676 (setq id-start 7707 (setq id-start
7677 (car-safe (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))) 7708 (car-safe (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil)))
@@ -8635,7 +8666,6 @@ comment at the start of cc-engine.el for more info."
8635 (setq pos (point))) 8666 (setq pos (point)))
8636 (and 8667 (and
8637 c-macro-with-semi-re 8668 c-macro-with-semi-re
8638 (not (c-in-literal))
8639 (eq (skip-chars-backward " \t") 0) 8669 (eq (skip-chars-backward " \t") 0)
8640 8670
8641 ;; Check we've got nothing after this except comments and empty lines 8671 ;; Check we've got nothing after this except comments and empty lines
@@ -8666,7 +8696,9 @@ comment at the start of cc-engine.el for more info."
8666 (c-backward-syntactic-ws) 8696 (c-backward-syntactic-ws)
8667 t)) 8697 t))
8668 (c-simple-skip-symbol-backward) 8698 (c-simple-skip-symbol-backward)
8669 (looking-at c-macro-with-semi-re))))) 8699 (looking-at c-macro-with-semi-re)
8700 (goto-char pos)
8701 (not (c-in-literal)))))) ; The most expensive check last.
8670 8702
8671(defun c-macro-vsemi-status-unknown-p () t) ; See cc-defs.el. 8703(defun c-macro-vsemi-status-unknown-p () t) ; See cc-defs.el.
8672 8704
@@ -9207,6 +9239,10 @@ comment at the start of cc-engine.el for more info."
9207 containing-sexp nil))) 9239 containing-sexp nil)))
9208 (setq lim (1+ containing-sexp)))) 9240 (setq lim (1+ containing-sexp))))
9209 (setq lim (point-min))) 9241 (setq lim (point-min)))
9242 (when (c-beginning-of-macro)
9243 (goto-char indent-point)
9244 (let ((lim1 (c-determine-limit 2000)))
9245 (setq lim (max lim lim1))))
9210 9246
9211 ;; If we're in a parenthesis list then ',' delimits the 9247 ;; If we're in a parenthesis list then ',' delimits the
9212 ;; "statements" rather than being an operator (with the 9248 ;; "statements" rather than being an operator (with the
@@ -9571,7 +9607,8 @@ comment at the start of cc-engine.el for more info."
9571 ;; CASE 5B: After a function header but before the body (or 9607 ;; CASE 5B: After a function header but before the body (or
9572 ;; the ending semicolon if there's no body). 9608 ;; the ending semicolon if there's no body).
9573 ((save-excursion 9609 ((save-excursion
9574 (when (setq placeholder (c-just-after-func-arglist-p lim)) 9610 (when (setq placeholder (c-just-after-func-arglist-p
9611 (max lim (c-determine-limit 500))))
9575 (setq tmp-pos (point)))) 9612 (setq tmp-pos (point))))
9576 (cond 9613 (cond
9577 9614
@@ -9779,7 +9816,7 @@ comment at the start of cc-engine.el for more info."
9779 ;; top level construct. Or, perhaps, an unrecognized construct. 9816 ;; top level construct. Or, perhaps, an unrecognized construct.
9780 (t 9817 (t
9781 (while (and (setq placeholder (point)) 9818 (while (and (setq placeholder (point))
9782 (eq (car (c-beginning-of-decl-1 containing-sexp)) 9819 (eq (car (c-beginning-of-decl-1 containing-sexp)) ; Can't use `lim' here.
9783 'same) 9820 'same)
9784 (save-excursion 9821 (save-excursion
9785 (c-backward-syntactic-ws) 9822 (c-backward-syntactic-ws)
@@ -9882,7 +9919,7 @@ comment at the start of cc-engine.el for more info."
9882 (eq (cdar c-state-cache) (point))) 9919 (eq (cdar c-state-cache) (point)))
9883 ;; Speed up the backward search a bit. 9920 ;; Speed up the backward search a bit.
9884 (goto-char (caar c-state-cache))) 9921 (goto-char (caar c-state-cache)))
9885 (c-beginning-of-decl-1 containing-sexp) 9922 (c-beginning-of-decl-1 containing-sexp) ; Can't use `lim' here.
9886 (setq placeholder (point)) 9923 (setq placeholder (point))
9887 (if (= start (point)) 9924 (if (= start (point))
9888 ;; The '}' is unbalanced. 9925 ;; The '}' is unbalanced.
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 985214db1dc..7c018feefbb 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -925,8 +925,8 @@ Note that the style variables are always made local to the buffer."
925 ;; inside a string, comment, or macro. 925 ;; inside a string, comment, or macro.
926 (setq new-bounds (c-extend-font-lock-region-for-macros 926 (setq new-bounds (c-extend-font-lock-region-for-macros
927 c-new-BEG c-new-END old-len)) 927 c-new-BEG c-new-END old-len))
928 (setq c-new-BEG (car new-bounds) 928 (setq c-new-BEG (max (car new-bounds) (c-determine-limit 500 begg))
929 c-new-END (cdr new-bounds)) 929 c-new-END (min (cdr new-bounds) (c-determine-+ve-limit 500 endd)))
930 ;; Clear all old relevant properties. 930 ;; Clear all old relevant properties.
931 (c-clear-char-property-with-value c-new-BEG c-new-END 'syntax-table '(1)) 931 (c-clear-char-property-with-value c-new-BEG c-new-END 'syntax-table '(1))
932 (c-clear-char-property-with-value c-new-BEG c-new-END 'category 'c-cpp-delimiter) 932 (c-clear-char-property-with-value c-new-BEG c-new-END 'category 'c-cpp-delimiter)
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index e7afd0e0e67..de728da236d 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -388,7 +388,11 @@ The expansion is entirely correct because it uses the C preprocessor."
388 ;; In case of error, make sure we don't move backward. 388 ;; In case of error, make sure we don't move backward.
389 (scan-error (goto-char startpos) nil)) 389 (scan-error (goto-char startpos) nil))
390 (not (or (nth 8 (parse-partial-sexp 390 (not (or (nth 8 (parse-partial-sexp
391 (point) limit nil nil state 'syntax-table)) 391 ;; Since we don't know if point is within
392 ;; the first or the scond arg, we have to
393 ;; start from the beginning.
394 (if twoargs (1+ (nth 8 state)) (point))
395 limit nil nil state 'syntax-table))
392 ;; If we have a self-paired opener and a twoargs 396 ;; If we have a self-paired opener and a twoargs
393 ;; command, the form is s/../../ so we have to skip 397 ;; command, the form is s/../../ so we have to skip
394 ;; a second time. 398 ;; a second time.
diff --git a/lisp/subr.el b/lisp/subr.el
index e0b099dd16b..514827f9615 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1785,6 +1785,8 @@ this name matching.
1785 1785
1786Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM 1786Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM
1787is evaluated at the end of any file that `provide's this feature. 1787is evaluated at the end of any file that `provide's this feature.
1788If the feature is provided when evaluating code not associated with a
1789file, FORM is evaluated immediately after the provide statement.
1788 1790
1789Usually FILE is just a library name like \"font-lock\" or a feature name 1791Usually FILE is just a library name like \"font-lock\" or a feature name
1790like 'font-lock. 1792like 'font-lock.
@@ -1814,14 +1816,16 @@ This function makes or adds to an entry on `after-load-alist'."
1814 ;; make sure that `form' is really run "after-load" in case the provide 1816 ;; make sure that `form' is really run "after-load" in case the provide
1815 ;; call happens early. 1817 ;; call happens early.
1816 (setq form 1818 (setq form
1817 `(when load-file-name 1819 `(if load-file-name
1818 (let ((fun (make-symbol "eval-after-load-helper"))) 1820 (let ((fun (make-symbol "eval-after-load-helper")))
1819 (fset fun `(lambda (file) 1821 (fset fun `(lambda (file)
1820 (if (not (equal file ',load-file-name)) 1822 (if (not (equal file ',load-file-name))
1821 nil 1823 nil
1822 (remove-hook 'after-load-functions ',fun) 1824 (remove-hook 'after-load-functions ',fun)
1823 ,',form))) 1825 ,',form)))
1824 (add-hook 'after-load-functions fun))))) 1826 (add-hook 'after-load-functions fun))
1827 ;; Not being provided from a file, run form right now.
1828 ,form)))
1825 ;; Add FORM to the element unless it's already there. 1829 ;; Add FORM to the element unless it's already there.
1826 (unless (member form (cdr elt)) 1830 (unless (member form (cdr elt))
1827 (nconc elt (purecopy (list form))))))) 1831 (nconc elt (purecopy (list form)))))))
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 949ac4c0889..3eb2be15698 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -634,6 +634,9 @@ inside of a tar archive without extracting it and re-archiving it.
634 634
635See also: variables `tar-update-datestamp' and `tar-anal-blocksize'. 635See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
636\\{tar-mode-map}" 636\\{tar-mode-map}"
637 (and buffer-file-name
638 (file-writable-p buffer-file-name)
639 (setq buffer-read-only nil)) ; undo what `special-mode' did
637 (make-local-variable 'tar-parse-info) 640 (make-local-variable 'tar-parse-info)
638 (set (make-local-variable 'require-final-newline) nil) ; binary data, dude... 641 (set (make-local-variable 'require-final-newline) nil) ; binary data, dude...
639 (set (make-local-variable 'local-enable-local-variables) nil) 642 (set (make-local-variable 'local-enable-local-variables) nil)
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index fdfb1a51ba0..72ae44bb60d 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -535,7 +535,8 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.")
535 ("Text" artist-select-op-text-overwrite text-ovwrt) 535 ("Text" artist-select-op-text-overwrite text-ovwrt)
536 ("Ellipse" artist-select-op-circle circle) 536 ("Ellipse" artist-select-op-circle circle)
537 ("Poly-line" artist-select-op-straight-poly-line spolyline) 537 ("Poly-line" artist-select-op-straight-poly-line spolyline)
538 ("Rectangle" artist-select-op-square square) 538 ("Square" artist-select-op-square square)
539 ("Rectangle" artist-select-op-rectangle rectangle)
539 ("Line" artist-select-op-straight-line s-line) 540 ("Line" artist-select-op-straight-line s-line)
540 ("Pen" artist-select-op-pen-line pen-line))) 541 ("Pen" artist-select-op-pen-line pen-line)))
541 (define-key map (vector (nth 2 op)) 542 (define-key map (vector (nth 2 op))
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index c1fcb6013b2..bbd433ec9fc 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -324,9 +324,9 @@ Uses `query-replace' (\\[query-replace]) for corrections."
324Skips any text between strings matching regular expressions 324Skips any text between strings matching regular expressions
325`ispell-tib-ref-beginning' and `ispell-tib-ref-end'. 325`ispell-tib-ref-beginning' and `ispell-tib-ref-end'.
326 326
327TeX users beware: Any field starting with [. will skip until a .] -- even 327TeX users beware: Any text between [. and .] will be skipped -- even if
328your whole buffer -- unless you set `ispell-skip-tib' to nil. That includes 328that's your whole buffer -- unless you set `ispell-skip-tib' to nil.
329a [.5mm] type of number...." 329That includes the [.5mm] type of number..."
330 :type 'boolean 330 :type 'boolean
331 :group 'ispell) 331 :group 'ispell)
332 332
@@ -337,13 +337,13 @@ a [.5mm] type of number...."
337 "Regexp matching the end of a Tib reference.") 337 "Regexp matching the end of a Tib reference.")
338 338
339(defcustom ispell-keep-choices-win t 339(defcustom ispell-keep-choices-win t
340 "*When non-nil, the `*Choices*' window remains for spelling session. 340 "*If non-nil, keep the `*Choices*' window for the entire spelling session.
341This minimizes redisplay thrashing." 341This minimizes redisplay thrashing."
342 :type 'boolean 342 :type 'boolean
343 :group 'ispell) 343 :group 'ispell)
344 344
345(defcustom ispell-choices-win-default-height 2 345(defcustom ispell-choices-win-default-height 2
346 "*The default size of the `*Choices*' window, including mode line. 346 "*The default size of the `*Choices*' window, including the mode line.
347Must be greater than 1." 347Must be greater than 1."
348 :type 'integer 348 :type 'integer
349 :group 'ispell) 349 :group 'ispell)
@@ -493,7 +493,7 @@ default dictionary and LANG the two letter language code."
493 :group 'ispell) 493 :group 'ispell)
494 494
495(defcustom ispell-silently-savep nil 495(defcustom ispell-silently-savep nil
496 "*When non-nil, save the personal dictionary without confirmation." 496 "*When non-nil, save personal dictionary without asking for confirmation."
497 :type 'boolean 497 :type 'boolean
498 :group 'ispell) 498 :group 'ispell)
499 499
@@ -714,7 +714,7 @@ Hint: regexp syntax requires the hyphen to be declared first here.
714 714
715CASECHARS, NOT-CASECHARS, and OTHERCHARS must be unibyte strings 715CASECHARS, NOT-CASECHARS, and OTHERCHARS must be unibyte strings
716containing bytes of CHARACTER-SET. In addition, if they contain 716containing bytes of CHARACTER-SET. In addition, if they contain
717a non-ASCII byte, the regular expression must be a single 717non-ASCII bytes, the regular expression must be a single
718`character set' construct that doesn't specify a character range 718`character set' construct that doesn't specify a character range
719for non-ASCII bytes. 719for non-ASCII bytes.
720 720
@@ -734,27 +734,31 @@ but the dictionary can control the extended character mode.
734Both defaults can be overruled in a buffer-local fashion. See 734Both defaults can be overruled in a buffer-local fashion. See
735`ispell-parsing-keyword' for details on this. 735`ispell-parsing-keyword' for details on this.
736 736
737CHARACTER-SET used for languages with multibyte characters. 737CHARACTER-SET used to encode text sent to the ispell subprocess
738when the language uses non-ASCII characters.
738 739
739Note that the CASECHARS and OTHERCHARS slots of the alist should 740Note that with \"ispell\" as the speller, the CASECHARS and
740contain the same character set as casechars and otherchars in the 741OTHERCHARS slots of the alist should contain the same character
741LANGUAGE.aff file \(e.g., english.aff\).") 742set as casechars and otherchars in the LANGUAGE.aff file \(e.g.,
743english.aff\). apsell and hunspell don't have this limitation.")
742 744
743(defvar ispell-really-aspell nil) ; Non-nil if we can use aspell extensions. 745(defvar ispell-really-aspell nil) ; Non-nil if we can use aspell extensions.
744(defvar ispell-really-hunspell nil) ; Non-nil if we can use hunspell extensions. 746(defvar ispell-really-hunspell nil) ; Non-nil if we can use hunspell extensions.
745(defvar ispell-encoding8-command nil 747(defvar ispell-encoding8-command nil
746 "Command line option prefix to select UTF-8 if supported, nil otherwise. 748 "Command line option prefix to select encoding if supported, nil otherwise.
747If UTF-8 if supported by spellchecker and is selectable from the command line 749If setting the encoding is supported by spellchecker and is selectable from
748this variable will contain \"--encoding=\" for aspell and \"-i \" for hunspell, 750the command line, this variable will contain \"--encoding=\" for aspell
749so UTF-8 or other mime charsets can be selected. That will be set for hunspell 751and \"-i \" for hunspell, so the appropriate mime charset can be selected.
750>=1.1.6 or aspell >= 0.60 in `ispell-check-version'. 752That will be set in `ispell-check-version' for hunspell >= 1.1.6 and
751 753aspell >= 0.60.
752For aspell non-nil means to try to automatically find aspell dictionaries. 754
753Earlier aspell versions do not consistently support UTF-8. Handling 755For aspell, non-nil also means to try to automatically find its dictionaries.
756
757Earlier aspell versions do not consistently support charset encoding. Handling
754this would require some extra guessing in `ispell-aspell-find-dictionary'.") 758this would require some extra guessing in `ispell-aspell-find-dictionary'.")
755 759
756(defvar ispell-aspell-supports-utf8 nil 760(defvar ispell-aspell-supports-utf8 nil
757 "Non nil if aspell has consistent command line UTF-8 support. Obsolete. 761 "Non-nil if aspell has consistent command line UTF-8 support. Obsolete.
758ispell.el and flyspell.el will use for this purpose the more generic 762ispell.el and flyspell.el will use for this purpose the more generic
759variable `ispell-encoding8-command' for both aspell and hunspell. Is left 763variable `ispell-encoding8-command' for both aspell and hunspell. Is left
760here just for backwards compatibility.") 764here just for backwards compatibility.")
@@ -780,7 +784,7 @@ here just for backwards compatibility.")
780 784
781 785
782(defun ispell-check-version (&optional interactivep) 786(defun ispell-check-version (&optional interactivep)
783 "Ensure that `ispell-program-name' is valid and the correct version. 787 "Ensure that `ispell-program-name' is valid and has the correct version.
784Returns version number if called interactively. 788Returns version number if called interactively.
785Otherwise returns the library directory name, if that is defined." 789Otherwise returns the library directory name, if that is defined."
786 ;; This is a little wasteful as we actually launch ispell twice: once 790 ;; This is a little wasteful as we actually launch ispell twice: once
@@ -983,8 +987,8 @@ Assumes that value contains no whitespace."
983 987
984(defun ispell-aspell-find-dictionary (dict-name) 988(defun ispell-aspell-find-dictionary (dict-name)
985 "For aspell dictionary DICT-NAME, return a list of parameters if an 989 "For aspell dictionary DICT-NAME, return a list of parameters if an
986 associated data file is found or nil otherwise. List format is 990associated data file is found or nil otherwise. List format is that
987 that of `ispell-dictionary-base-alist' elements." 991of `ispell-dictionary-base-alist' elements."
988 ;; Make sure `ispell-aspell-data-dir' is defined 992 ;; Make sure `ispell-aspell-data-dir' is defined
989 (or ispell-aspell-data-dir 993 (or ispell-aspell-data-dir
990 (setq ispell-aspell-data-dir 994 (setq ispell-aspell-data-dir
@@ -1117,7 +1121,7 @@ aspell is used along with Emacs).")
1117 1121
1118(defun ispell-valid-dictionary-list () 1122(defun ispell-valid-dictionary-list ()
1119 "Return a list of valid dictionaries. 1123 "Return a list of valid dictionaries.
1120The variable `ispell-library-directory' defines the library location." 1124The variable `ispell-library-directory' defines their location."
1121 ;; Initialize variables and dictionaries alists for desired spellchecker. 1125 ;; Initialize variables and dictionaries alists for desired spellchecker.
1122 ;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs 1126 ;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs
1123 ;; (and may be others) 1127 ;; (and may be others)
@@ -1307,7 +1311,8 @@ Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
1307 (let* ((slot (or 1311 (let* ((slot (or
1308 (assoc ispell-current-dictionary ispell-local-dictionary-alist) 1312 (assoc ispell-current-dictionary ispell-local-dictionary-alist)
1309 (assoc ispell-current-dictionary ispell-dictionary-alist) 1313 (assoc ispell-current-dictionary ispell-dictionary-alist)
1310 (error "No match for the current dictionary"))) 1314 (error "No data for dictionary \"%s\", neither in `ispell-local-dictionary-alist' nor in `ispell-dictionary-alist'"
1315 ispell-current-dictionary)))
1311 (str (nth n slot))) 1316 (str (nth n slot)))
1312 (when (and (> (length str) 0) 1317 (when (and (> (length str) 0)
1313 (not (multibyte-string-p str))) 1318 (not (multibyte-string-p str)))
@@ -1381,7 +1386,7 @@ Set to the MIME boundary locations when checking messages.")
1381(defconst ispell-words-keyword "LocalWords: " 1386(defconst ispell-words-keyword "LocalWords: "
1382 "The keyword for local oddly-spelled words to accept. 1387 "The keyword for local oddly-spelled words to accept.
1383The keyword will be followed by any number of local word spellings. 1388The keyword will be followed by any number of local word spellings.
1384There can be multiple of these keywords in the file.") 1389There can be multiple instances of this keyword in the file.")
1385 1390
1386(defconst ispell-dictionary-keyword "Local IspellDict: " 1391(defconst ispell-dictionary-keyword "Local IspellDict: "
1387 "The keyword for a local dictionary to use. 1392 "The keyword for a local dictionary to use.
@@ -1786,7 +1791,8 @@ If optional argument FOLLOWING is non-nil or if `ispell-following-word'
1786is non-nil when called interactively, then the following word 1791is non-nil when called interactively, then the following word
1787\(rather than preceding\) is checked when the cursor is not over a word. 1792\(rather than preceding\) is checked when the cursor is not over a word.
1788Optional second argument contains otherchars that can be included in word 1793Optional second argument contains otherchars that can be included in word
1789many times. 1794many times (see the doc string of `ispell-dictionary-alist' for details
1795about otherchars).
1790 1796
1791Word syntax is controlled by the definition of the chosen dictionary, 1797Word syntax is controlled by the definition of the chosen dictionary,
1792which is in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'." 1798which is in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'."
@@ -2817,8 +2823,8 @@ By just answering RET you can find out what the current dictionary is."
2817 2823
2818(defun ispell-internal-change-dictionary () 2824(defun ispell-internal-change-dictionary ()
2819 "Update the dictionary and the personal dictionary used by Ispell. 2825 "Update the dictionary and the personal dictionary used by Ispell.
2820This may kill the Ispell process; if so, 2826This may kill the Ispell process; if so, a new one will be started
2821a new one will be started when needed." 2827when needed."
2822 (let ((dict (or ispell-local-dictionary ispell-dictionary)) 2828 (let ((dict (or ispell-local-dictionary ispell-dictionary))
2823 (pdict (or ispell-local-pdict ispell-personal-dictionary))) 2829 (pdict (or ispell-local-pdict ispell-personal-dictionary)))
2824 (unless (and (equal ispell-current-dictionary dict) 2830 (unless (and (equal ispell-current-dictionary dict)
@@ -2836,8 +2842,8 @@ a new one will be started when needed."
2836;;;###autoload 2842;;;###autoload
2837(defun ispell-region (reg-start reg-end &optional recheckp shift) 2843(defun ispell-region (reg-start reg-end &optional recheckp shift)
2838 "Interactively check a region for spelling errors. 2844 "Interactively check a region for spelling errors.
2839Return nil if spell session is quit, 2845Return nil if spell session was terminated, otherwise returns shift offset
2840 otherwise returns shift offset amount for last line processed." 2846amount for last line processed."
2841 (interactive "r") ; Don't flag errors on read-only bufs. 2847 (interactive "r") ; Don't flag errors on read-only bufs.
2842 (ispell-set-spellchecker-params) ; Initialize variables and dicts alists 2848 (ispell-set-spellchecker-params) ; Initialize variables and dicts alists
2843 (if (not recheckp) 2849 (if (not recheckp)
@@ -2956,7 +2962,7 @@ Return nil if spell session is quit,
2956(defun ispell-begin-skip-region-regexp () 2962(defun ispell-begin-skip-region-regexp ()
2957 "Return a regexp of the search keys for region skipping. 2963 "Return a regexp of the search keys for region skipping.
2958Includes `ispell-skip-region-alist' plus tex, tib, html, and comment keys. 2964Includes `ispell-skip-region-alist' plus tex, tib, html, and comment keys.
2959Must call after `ispell-buffer-local-parsing' due to dependence on mode." 2965Must be called after `ispell-buffer-local-parsing' due to dependence on mode."
2960 (mapconcat 2966 (mapconcat
2961 'identity 2967 'identity
2962 (delq nil 2968 (delq nil
@@ -3016,7 +3022,7 @@ Includes regions defined by `ispell-skip-region-alist', tex mode,
3016`ispell-html-skip-alists', and `ispell-checking-message'. 3022`ispell-html-skip-alists', and `ispell-checking-message'.
3017Manual checking must include comments and tib references. 3023Manual checking must include comments and tib references.
3018The list is of the form described by variable `ispell-skip-region-alist'. 3024The list is of the form described by variable `ispell-skip-region-alist'.
3019Must call after `ispell-buffer-local-parsing' due to dependence on mode." 3025Must be called after `ispell-buffer-local-parsing' due to dependence on mode."
3020 (let ((skip-alist ispell-skip-region-alist)) 3026 (let ((skip-alist ispell-skip-region-alist))
3021 ;; only additional explicit region definition is tex. 3027 ;; only additional explicit region definition is tex.
3022 (if (eq ispell-parser 'tex) 3028 (if (eq ispell-parser 'tex)
@@ -3046,7 +3052,7 @@ Must call after `ispell-buffer-local-parsing' due to dependence on mode."
3046 3052
3047(defun ispell-ignore-fcc (start end) 3053(defun ispell-ignore-fcc (start end)
3048 "Delete the Fcc: message header when large attachments are included. 3054 "Delete the Fcc: message header when large attachments are included.
3049Return value `nil' if file with large attachments are saved. 3055Return value `nil' if file with large attachments is saved.
3050This can be used to avoid multiple questions for multiple large attachments. 3056This can be used to avoid multiple questions for multiple large attachments.
3051Returns point to starting location afterwards." 3057Returns point to starting location afterwards."
3052 (let ((result t)) 3058 (let ((result t))
@@ -3153,7 +3159,7 @@ Returns a string with the line data."
3153 coding))))) 3159 coding)))))
3154 3160
3155(defun ispell-process-line (string shift) 3161(defun ispell-process-line (string shift)
3156 "Send STRING, a line of text, to ispell and processes the result. 3162 "Send STRING, a line of text, to ispell and process the result.
3157This will modify the buffer for spelling errors. 3163This will modify the buffer for spelling errors.
3158Requires variables ISPELL-START and ISPELL-END to be defined in its 3164Requires variables ISPELL-START and ISPELL-END to be defined in its
3159dynamic scope. 3165dynamic scope.
@@ -3468,7 +3474,7 @@ With a prefix argument ARG, enable Ispell minor mode if ARG is
3468positive, and disable it otherwise. If called from Lisp, enable 3474positive, and disable it otherwise. If called from Lisp, enable
3469the mode if ARG is omitted or nil. 3475the mode if ARG is omitted or nil.
3470 3476
3471Ispell minor mode is a buffer-local mior mode. When enabled, 3477Ispell minor mode is a buffer-local minor mode. When enabled,
3472typing SPC or RET warns you if the previous word is incorrectly 3478typing SPC or RET warns you if the previous word is incorrectly
3473spelled. 3479spelled.
3474 3480
@@ -3481,7 +3487,7 @@ RET, use `flyspell-mode'."
3481 nil " Spell" ispell-minor-keymap) 3487 nil " Spell" ispell-minor-keymap)
3482 3488
3483(defun ispell-minor-check () 3489(defun ispell-minor-check ()
3484 "Check previous word then continue with the normal binding of this key. 3490 "Check previous word, then continue with the normal binding of this key.
3485Don't check previous word when character before point is a space or newline. 3491Don't check previous word when character before point is a space or newline.
3486Don't read buffer-local settings or word lists." 3492Don't read buffer-local settings or word lists."
3487 (interactive "*") 3493 (interactive "*")
@@ -3519,8 +3525,8 @@ Don't read buffer-local settings or word lists."
3519 ;; Matches commonly used "cut" boundaries 3525 ;; Matches commonly used "cut" boundaries
3520 "^\\(- \\)?[-=_]+\\s ?\\(cut here\\|Environment Follows\\)") 3526 "^\\(- \\)?[-=_]+\\s ?\\(cut here\\|Environment Follows\\)")
3521 "\\|") 3527 "\\|")
3522 "*End of text which will be checked in `ispell-message'. 3528 "*Text beyond which `ispell-message' will not spell-check.
3523If it is a string, limit at first occurrence of that regular expression. 3529If it is a string, limit is the first occurrence of that regular expression.
3524Otherwise, it must be a function which is called to get the limit.") 3530Otherwise, it must be a function which is called to get the limit.")
3525(put 'ispell-message-text-end 'risky-local-variable t) 3531(put 'ispell-message-text-end 'risky-local-variable t)
3526 3532
@@ -3625,7 +3631,7 @@ Don't check included messages.
3625 3631
3626To abort spell checking of a message region and send the message anyway, 3632To abort spell checking of a message region and send the message anyway,
3627use the `x' command. (Any subsequent regions will be checked.) 3633use the `x' command. (Any subsequent regions will be checked.)
3628The `X' command aborts the message send so that you can edit the buffer. 3634The `X' command aborts sending the message so that you can edit the buffer.
3629 3635
3630To spell-check whenever a message is sent, include the appropriate lines 3636To spell-check whenever a message is sent, include the appropriate lines
3631in your .emacs file: 3637in your .emacs file:
@@ -3788,7 +3794,7 @@ You can bind this to the key C-c i in GNUS or mail by adding to
3788(defun ispell-buffer-local-parsing () 3794(defun ispell-buffer-local-parsing ()
3789 "Place Ispell into parsing mode for this buffer. 3795 "Place Ispell into parsing mode for this buffer.
3790Overrides the default parsing mode. 3796Overrides the default parsing mode.
3791Includes Latex/Nroff modes and extended character mode." 3797Includes LaTeX/Nroff modes and extended character mode."
3792 ;; (ispell-init-process) must already be called. 3798 ;; (ispell-init-process) must already be called.
3793 (ispell-send-string "!\n") ; Put process in terse mode. 3799 (ispell-send-string "!\n") ; Put process in terse mode.
3794 ;; We assume all major modes with "tex-mode" in them should use latex parsing 3800 ;; We assume all major modes with "tex-mode" in them should use latex parsing
@@ -3838,7 +3844,7 @@ Includes Latex/Nroff modes and extended character mode."
3838 3844
3839(defun ispell-buffer-local-dict (&optional no-reload) 3845(defun ispell-buffer-local-dict (&optional no-reload)
3840 "Initializes local dictionary and local personal dictionary. 3846 "Initializes local dictionary and local personal dictionary.
3841If optional NO-RELOAD is non-nil, do not make any dictionary reloading. 3847If optional NO-RELOAD is non-nil, do not reload any dictionary.
3842When a dictionary is defined in the buffer (see variable 3848When a dictionary is defined in the buffer (see variable
3843`ispell-dictionary-keyword'), it will override the local setting 3849`ispell-dictionary-keyword'), it will override the local setting
3844from \\[ispell-change-dictionary]. 3850from \\[ispell-change-dictionary].
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 960649bdbc9..ff6a6e6f805 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,8 @@
12012-03-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * url-queue.el (url-queue-kill-job): Make sure that the callback
4 is always called, even if we have a timeout.
5
12012-03-11 Chong Yidong <cyd@gnu.org> 62012-03-11 Chong Yidong <cyd@gnu.org>
2 7
3 * url-http.el (url-http-end-of-document-sentinel): Handle 8 * url-http.el (url-http-end-of-document-sentinel): Handle
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index 6e4cedddaf3..46124717fed 100644
--- a/lisp/url/url-queue.el
+++ b/lisp/url/url-queue.el
@@ -156,9 +156,20 @@ The variable `url-queue-timeout' sets a timeout."
156 (while (setq process (get-buffer-process (url-queue-buffer job))) 156 (while (setq process (get-buffer-process (url-queue-buffer job)))
157 (set-process-sentinel process 'ignore) 157 (set-process-sentinel process 'ignore)
158 (ignore-errors 158 (ignore-errors
159 (delete-process process)))) 159 (delete-process process)))))
160 (ignore-errors 160 ;; Call the callback with an error message to ensure that the caller
161 (kill-buffer (url-queue-buffer job))))) 161 ;; is notified that the job has failed.
162 (with-current-buffer
163 (if (bufferp (url-queue-buffer job))
164 ;; Use the (partially filled) process buffer it it exists.
165 (url-queue-buffer job)
166 ;; If not, just create a new buffer, which will probably be
167 ;; killed again by the caller.
168 (generate-new-buffer " *temp*"))
169 (apply (url-queue-callback job)
170 (cons (list :error (list 'error 'url-queue-timeout
171 "Queue timeout exceeded"))
172 (url-queue-cbargs job)))))
162 173
163(provide 'url-queue) 174(provide 'url-queue)
164 175
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index f3ba009b8c2..52e8051342d 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -226,45 +226,14 @@ highlighting the Log View buffer."
226 226
227(defun vc-hg-working-revision (file) 227(defun vc-hg-working-revision (file)
228 "Hg-specific version of `vc-working-revision'." 228 "Hg-specific version of `vc-working-revision'."
229 (let* 229 (let ((default-directory (if (file-directory-p file)
230 ((status nil) 230 (file-name-as-directory file)
231 (default-directory (file-name-directory file)) 231 (file-name-directory file))))
232 ;; Avoid localization of messages so we can parse the output. 232 (ignore-errors
233 (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C") 233 (with-output-to-string
234 process-environment)) 234 (process-file vc-hg-program nil standard-output nil
235 (out 235 "log" "-l" "1" "--template" "{rev}"
236 (with-output-to-string 236 (file-relative-name file))))))
237 (with-current-buffer
238 standard-output
239 (setq status
240 (condition-case nil
241 (let ((process-environment avoid-local-env))
242 ;; Ignore all errors.
243 (process-file
244 vc-hg-program nil t nil
245 "--config" "alias.parents=parents"
246 "--config" "defaults.parents="
247 "parents" "--template" "{rev}" (file-relative-name file)))
248 ;; Some problem happened. E.g. We can't find an `hg'
249 ;; executable.
250 (error nil)))))))
251 (if (eq 0 status)
252 out
253 ;; Check if the file is in the 'added state, the above hg
254 ;; command does not distinguish between 'added and 'unregistered.
255 (setq status
256 (condition-case nil
257 (let ((process-environment avoid-local-env))
258 (process-file
259 vc-hg-program nil nil nil
260 ;; We use "log" here, if there's a faster command
261 ;; that returns true for an 'added file and false
262 ;; for an 'unregistered one, we could use that.
263 "log" "-l1" (file-relative-name file)))
264 ;; Some problem happened. E.g. We can't find an `hg'
265 ;; executable.
266 (error nil)))
267 (when (eq 0 status) "0"))))
268 237
269;;; History functions 238;;; History functions
270 239
diff --git a/lisp/view.el b/lisp/view.el
index 4a219971097..41cb9752288 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -309,7 +309,11 @@ this argument instead of explicitly setting `view-exit-action'.
309Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a 309Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a
310file: Users may suspend viewing in order to modify the buffer. 310file: Users may suspend viewing in order to modify the buffer.
311Exiting View mode will then discard the user's edits. Setting 311Exiting View mode will then discard the user's edits. Setting
312EXIT-ACTION to `kill-buffer-if-not-modified' avoids this." 312EXIT-ACTION to `kill-buffer-if-not-modified' avoids this.
313
314This function does not enable View mode if the buffer's major-mode
315has a `special' mode-class, because such modes usually have their
316own View-like bindings."
313 (interactive "bView buffer: ") 317 (interactive "bView buffer: ")
314 (switch-to-buffer buffer) 318 (switch-to-buffer buffer)
315 (if (eq (get major-mode 'mode-class) 'special) 319 (if (eq (get major-mode 'mode-class) 'special)
@@ -331,7 +335,11 @@ Optional argument NOT-RETURN is ignored.
331 335
332Optional argument EXIT-ACTION is either nil or a function with buffer as 336Optional argument EXIT-ACTION is either nil or a function with buffer as
333argument. This function is called when finished viewing buffer. Use 337argument. This function is called when finished viewing buffer. Use
334this argument instead of explicitly setting `view-exit-action'." 338this argument instead of explicitly setting `view-exit-action'.
339
340This function does not enable View mode if the buffer's major-mode
341has a `special' mode-class, because such modes usually have their
342own View-like bindings."
335 (interactive "bIn other window view buffer:\nP") 343 (interactive "bIn other window view buffer:\nP")
336 (let ((pop-up-windows t)) 344 (let ((pop-up-windows t))
337 (pop-to-buffer buffer t)) 345 (pop-to-buffer buffer t))
@@ -354,7 +362,11 @@ Optional argument NOT-RETURN is ignored.
354 362
355Optional argument EXIT-ACTION is either nil or a function with buffer as 363Optional argument EXIT-ACTION is either nil or a function with buffer as
356argument. This function is called when finished viewing buffer. Use 364argument. This function is called when finished viewing buffer. Use
357this argument instead of explicitly setting `view-exit-action'." 365this argument instead of explicitly setting `view-exit-action'.
366
367This function does not enable View mode if the buffer's major-mode
368has a `special' mode-class, because such modes usually have their
369own View-like bindings."
358 (interactive "bView buffer in other frame: \nP") 370 (interactive "bView buffer in other frame: \nP")
359 (let ((pop-up-frames t)) 371 (let ((pop-up-frames t))
360 (pop-to-buffer buffer t)) 372 (pop-to-buffer buffer t))
diff --git a/src/ChangeLog b/src/ChangeLog
index 1ec148b30c8..ae8835478a5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,21 @@
12012-03-20 Chong Yidong <cyd@gnu.org>
2
3 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4 to reflect default non-nil value of redisplay-dont-pause.
5
62012-03-19 Kenichi Handa <handa@m17n.org>
7
8 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9 it fit in a valid range (Bug#11003).
10
112012-03-18 Eli Zaretskii <eliz@gnu.org>
12
13 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14 that is not from display property, accept the row as a "cursor
15 row" if one of the string's character has a non-nil `cursor'
16 property. Fixes cursor positioning when there are newlines in
17 overlay strings, e.g. in icomplete.el. (Bug#11035)
18
12012-03-12 Paul Eggert <eggert@cs.ucla.edu> 192012-03-12 Paul Eggert <eggert@cs.ucla.edu>
2 20
3 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830). 21 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
diff --git a/src/dispnew.c b/src/dispnew.c
index d2c2668864e..1f494b5685b 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6081,10 +6081,14 @@ sit_for (Lisp_Object timeout, int reading, int do_display)
6081 6081
6082 6082
6083DEFUN ("redisplay", Fredisplay, Sredisplay, 0, 1, 0, 6083DEFUN ("redisplay", Fredisplay, Sredisplay, 0, 1, 0,
6084 doc: /* Perform redisplay if no input is available. 6084 doc: /* Perform redisplay.
6085If optional arg FORCE is non-nil or `redisplay-dont-pause' is non-nil, 6085Optional arg FORCE, if non-nil, prevents redisplay from being
6086perform a full redisplay even if input is available. 6086preempted by arriving input, even if `redisplay-dont-pause' is nil.
6087Return t if redisplay was performed, nil otherwise. */) 6087If `redisplay-dont-pause' is non-nil (the default), redisplay is never
6088preempted by arriving input, so FORCE does nothing.
6089
6090Return t if redisplay was performed, nil if redisplay was preempted
6091immediately by pending input. */)
6088 (Lisp_Object force) 6092 (Lisp_Object force)
6089{ 6093{
6090 int count; 6094 int count;
@@ -6534,21 +6538,21 @@ syms_of_display (void)
6534 DEFSYM (Qredisplay_dont_pause, "redisplay-dont-pause"); 6538 DEFSYM (Qredisplay_dont_pause, "redisplay-dont-pause");
6535 6539
6536 DEFVAR_INT ("baud-rate", baud_rate, 6540 DEFVAR_INT ("baud-rate", baud_rate,
6537 doc: /* *The output baud rate of the terminal. 6541 doc: /* The output baud rate of the terminal.
6538On most systems, changing this value will affect the amount of padding 6542On most systems, changing this value will affect the amount of padding
6539and the other strategic decisions made during redisplay. */); 6543and the other strategic decisions made during redisplay. */);
6540 6544
6541 DEFVAR_BOOL ("inverse-video", inverse_video, 6545 DEFVAR_BOOL ("inverse-video", inverse_video,
6542 doc: /* *Non-nil means invert the entire frame display. 6546 doc: /* Non-nil means invert the entire frame display.
6543This means everything is in inverse video which otherwise would not be. */); 6547This means everything is in inverse video which otherwise would not be. */);
6544 6548
6545 DEFVAR_BOOL ("visible-bell", visible_bell, 6549 DEFVAR_BOOL ("visible-bell", visible_bell,
6546 doc: /* *Non-nil means try to flash the frame to represent a bell. 6550 doc: /* Non-nil means try to flash the frame to represent a bell.
6547 6551
6548See also `ring-bell-function'. */); 6552See also `ring-bell-function'. */);
6549 6553
6550 DEFVAR_BOOL ("no-redraw-on-reenter", no_redraw_on_reenter, 6554 DEFVAR_BOOL ("no-redraw-on-reenter", no_redraw_on_reenter,
6551 doc: /* *Non-nil means no need to redraw entire frame after suspending. 6555 doc: /* Non-nil means no need to redraw entire frame after suspending.
6552A non-nil value is useful if the terminal can automatically preserve 6556A non-nil value is useful if the terminal can automatically preserve
6553Emacs's frame display when you reenter Emacs. 6557Emacs's frame display when you reenter Emacs.
6554It is up to you to set this variable if your terminal can do that. */); 6558It is up to you to set this variable if your terminal can do that. */);
@@ -6603,14 +6607,15 @@ See `buffer-display-table' for more information. */);
6603 Vstandard_display_table = Qnil; 6607 Vstandard_display_table = Qnil;
6604 6608
6605 DEFVAR_BOOL ("redisplay-dont-pause", redisplay_dont_pause, 6609 DEFVAR_BOOL ("redisplay-dont-pause", redisplay_dont_pause,
6606 doc: /* *Non-nil means display update isn't paused when input is detected. */); 6610 doc: /* Non-nil means display update isn't paused when input is detected. */);
6607 redisplay_dont_pause = 1; 6611 redisplay_dont_pause = 1;
6608 6612
6609#if PERIODIC_PREEMPTION_CHECKING 6613#if PERIODIC_PREEMPTION_CHECKING
6610 DEFVAR_LISP ("redisplay-preemption-period", Vredisplay_preemption_period, 6614 DEFVAR_LISP ("redisplay-preemption-period", Vredisplay_preemption_period,
6611 doc: /* *The period in seconds between checking for input during redisplay. 6615 doc: /* Period in seconds between checking for input during redisplay.
6612If input is detected, redisplay is pre-empted, and the input is processed. 6616This has an effect only if `redisplay-dont-pause' is nil; in that
6613If nil, never pre-empt redisplay. */); 6617case, arriving input preempts redisplay until the input is processed.
6618If the value is nil, redisplay is never preempted. */);
6614 Vredisplay_preemption_period = make_float (0.10); 6619 Vredisplay_preemption_period = make_float (0.10);
6615#endif 6620#endif
6616 6621
diff --git a/src/ftfont.c b/src/ftfont.c
index 3c45eb2f72f..131465b4f85 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -1856,7 +1856,7 @@ ftfont_drive_otf (MFLTFont *font,
1856 setup_otf_gstring (len); 1856 setup_otf_gstring (len);
1857 for (i = 0; i < len; i++) 1857 for (i = 0; i < len; i++)
1858 { 1858 {
1859 otf_gstring.glyphs[i].c = in->glyphs[from + i].c; 1859 otf_gstring.glyphs[i].c = in->glyphs[from + i].c & 0x11FFFF;
1860 otf_gstring.glyphs[i].glyph_id = in->glyphs[from + i].code; 1860 otf_gstring.glyphs[i].glyph_id = in->glyphs[from + i].code;
1861 } 1861 }
1862 1862
diff --git a/src/xdisp.c b/src/xdisp.c
index 47eb75221e9..da2b78f67e3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18561,9 +18561,11 @@ cursor_row_p (struct glyph_row *row)
18561 /* Suppose the row ends on a string. 18561 /* Suppose the row ends on a string.
18562 Unless the row is continued, that means it ends on a newline 18562 Unless the row is continued, that means it ends on a newline
18563 in the string. If it's anything other than a display string 18563 in the string. If it's anything other than a display string
18564 (e.g. a before-string from an overlay), we don't want the 18564 (e.g., a before-string from an overlay), we don't want the
18565 cursor there. (This heuristic seems to give the optimal 18565 cursor there. (This heuristic seems to give the optimal
18566 behavior for the various types of multi-line strings.) */ 18566 behavior for the various types of multi-line strings.)
18567 One exception: if the string has `cursor' property on one of
18568 its characters, we _do_ want the cursor there. */
18567 if (CHARPOS (row->end.string_pos) >= 0) 18569 if (CHARPOS (row->end.string_pos) >= 0)
18568 { 18570 {
18569 if (row->continued_p) 18571 if (row->continued_p)
@@ -18585,6 +18587,25 @@ cursor_row_p (struct glyph_row *row)
18585 result = 18587 result =
18586 (!NILP (prop) 18588 (!NILP (prop)
18587 && display_prop_string_p (prop, glyph->object)); 18589 && display_prop_string_p (prop, glyph->object));
18590 /* If there's a `cursor' property on one of the
18591 string's characters, this row is a cursor row,
18592 even though this is not a display string. */
18593 if (!result)
18594 {
18595 Lisp_Object s = glyph->object;
18596
18597 for ( ; glyph >= beg && EQ (glyph->object, s); --glyph)
18598 {
18599 EMACS_INT gpos = glyph->charpos;
18600
18601 if (!NILP (Fget_char_property (make_number (gpos),
18602 Qcursor, s)))
18603 {
18604 result = 1;
18605 break;
18606 }
18607 }
18608 }
18588 break; 18609 break;
18589 } 18610 }
18590 } 18611 }