diff options
| author | Kenichi Handa | 2012-03-19 13:17:50 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-03-19 13:17:50 +0900 |
| commit | 4ebb358f29e64094871ad6d35fb365d77c17047d (patch) | |
| tree | cfc5c5055207bd4e5995a12ca292d16939a9efdb | |
| parent | 4827f94e1725c34d4b19d79f4c74f16a0dc3b0cb (diff) | |
| parent | e50a24a249e1bfd69af7e48ea5076cac78bf7224 (diff) | |
| download | emacs-4ebb358f29e64094871ad6d35fb365d77c17047d.tar.gz emacs-4ebb358f29e64094871ad6d35fb365d77c17047d.zip | |
merge trunk
58 files changed, 1250 insertions, 648 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 | |||
| 203 | help.texi cyd | 203 | help.texi cyd |
| 204 | hooks.texi rgm | 204 | hooks.texi rgm |
| 205 | index.texi | 205 | index.texi |
| 206 | internals.texi rgm (I don't know much about this, so it would be | 206 | internals.texi rgm cyd |
| 207 | good if someone else could at least look at the FIXME? comments.) | ||
| 208 | intro.texi cyd | 207 | intro.texi cyd |
| 209 | keymaps.texi cyd | 208 | keymaps.texi cyd |
| 210 | lists.texi cyd | 209 | lists.texi cyd |
| @@ -217,7 +216,7 @@ modes.texi cyd | |||
| 217 | nonascii.texi cyd | 216 | nonascii.texi cyd |
| 218 | numbers.texi cyd | 217 | numbers.texi cyd |
| 219 | objects.texi cyd | 218 | objects.texi cyd |
| 220 | os.texi | 219 | os.texi cyd |
| 221 | package.texi rgm | 220 | package.texi rgm |
| 222 | positions.texi cyd | 221 | positions.texi cyd |
| 223 | processes.texi | 222 | processes.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 @@ | |||
| 1 | 2012-03-17 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * package.texi (Package Installation): Document use of | ||
| 4 | package-initialize in init file. | ||
| 5 | |||
| 6 | 2012-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 | |||
| 12 | 2012-03-15 Dani Moncayo <dmoncayo@gmail.com> (tiny change) | ||
| 13 | |||
| 14 | * dired.texi (Shell Commands in Dired): Fix typo. | ||
| 15 | |||
| 1 | 2012-03-04 Chong Yidong <cyd@gnu.org> | 16 | 2012-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 |
| 825 | If the command string contains neither @samp{*} nor @samp{?}, Emacs | 825 | If the command string contains neither @samp{*} nor @samp{?}, Emacs |
| 826 | runs the shell command once for each file, adding the file name is | 826 | runs the shell command once for each file, adding the file name at the |
| 827 | added at the end. For example, @kbd{! uudecode @key{RET}} runs | 827 | end. For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on |
| 828 | @code{uudecode} on each file. | 828 | each 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 | |||
| 464 | methods, as well as some sample text for that language environment. | 464 | methods, 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 |
| 468 | how 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 |
| 470 | input method---either a specified input method, or by default the | 471 | input 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 |
| 141 | This illustrates various scripts. If some characters can't be | 141 | how to say ``hello'' in many languages. If some characters can't be |
| 142 | displayed on your terminal, they appear as @samp{?} or as hollow boxes | 142 | displayed 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 | |||
| 157 | wish to use third party package archives---but do so at your own risk, | 157 | wish to use third party package archives---but do so at your own risk, |
| 158 | and use only third parties that you think you can trust! | 158 | and 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 |
| 161 | current Emacs session. What ``taking effect'' means depends on the | 161 | the current Emacs session. Loading a package is not quite the same as |
| 162 | package; most packages just make some new commands available, while | 162 | loading a Lisp library (@pxref{Lisp Libraries}); its effect varies |
| 163 | others have more wide-ranging effects on the Emacs session. For such | 163 | from package to package. Most packages just make some new commands |
| 164 | information, consult the package's help buffer. | 164 | available, while others have more wide-ranging effects on the Emacs |
| 165 | 165 | session. 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 |
| 168 | happens at startup, after processing the init file (@pxref{Init | 168 | subsequent Emacs sessions. This happens at startup, after processing |
| 169 | File}). As an exception, Emacs does not load packages at startup if | 169 | the init file (@pxref{Init File}). As an exception, Emacs does not |
| 170 | invoked with the @samp{-q} or @samp{--no-init-file} options | 170 | load 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}. |
| 177 | can use the command @kbd{M-x package-initialize} to load your | 176 | |
| 178 | packages. | 177 | @findex package-initialize |
| 178 | The reason automatic package loading occurs after loading the init | ||
| 179 | file is that user options only receive their customized values after | ||
| 180 | loading the init file, including user options which affect the | ||
| 181 | packaging system. In some circumstances, you may want to load | ||
| 182 | packages explicitly in your init file (usually because some other code | ||
| 183 | in your init file depends on a package). In that case, your init file | ||
| 184 | should call the function @code{package-initialize}. It is up to you | ||
| 185 | to ensure that relevant user options, such as @code{package-load-list} | ||
| 186 | (see below), are set up prior to the @code{package-initialize} call. | ||
| 187 | You should also set @code{package-enable-at-startup} to @code{nil}, to | ||
| 188 | avoid loading the packages again after processing the init file. | ||
| 189 | Alternatively, you may choose to completely inhibit package loading at | ||
| 190 | startup, and invoke the command @kbd{M-x package-initialize} to load | ||
| 191 | your 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..af0cb306245 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,41 @@ | |||
| 1 | 2012-03-18 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * internals.texi (Building Emacs, Garbage Collection): Copyedits. | ||
| 4 | (Writing Emacs Primitives): Re-organize discussion of functions | ||
| 5 | with variable Lisp arguments are handled. Delete an obsolete | ||
| 6 | remark, previously tagged as FIXME. | ||
| 7 | |||
| 8 | * os.texi (Idle Timers): Minor clarification. | ||
| 9 | (Idle Timers): Link to Time of Day for description of time list. | ||
| 10 | |||
| 11 | 2012-03-18 Glenn Morris <rgm@gnu.org> | ||
| 12 | |||
| 13 | * os.texi (System Interface): Flow control was removed. | ||
| 14 | (Startup Summary): General update. | ||
| 15 | (Init File): Don't mention compiling it. | ||
| 16 | |||
| 17 | 2012-03-17 Chong Yidong <cyd@gnu.org> | ||
| 18 | |||
| 19 | * os.texi (Startup Summary): Mention package loading. | ||
| 20 | (Init File): Don't refer to .emacs in section title. Copyedits. | ||
| 21 | (Terminal-Specific): Give a realistic example. | ||
| 22 | (Command-Line Arguments): Reference Entering Emacs instead of | ||
| 23 | repeating the spiel about not restarting Emacs. | ||
| 24 | (Time of Day): Discuss time representation at beginning of node. | ||
| 25 | (Sound Output): Copyedits. | ||
| 26 | |||
| 27 | * package.texi (Packaging Basics): Document package-initialize. | ||
| 28 | |||
| 29 | 2012-03-17 Eli Zaretskii <eliz@gnu.org> | ||
| 30 | |||
| 31 | * frames.texi (Initial Parameters): Add an index entry for | ||
| 32 | minibuffer-only frame. | ||
| 33 | |||
| 34 | 2012-03-16 Glenn Morris <rgm@gnu.org> | ||
| 35 | |||
| 36 | * modes.texi (Major Mode Conventions): Mention the strange | ||
| 37 | relationship between View mode and special modes. (Bug#10650) | ||
| 38 | |||
| 1 | 2012-03-11 Chong Yidong <cyd@gnu.org> | 39 | 2012-03-11 Chong Yidong <cyd@gnu.org> |
| 2 | 40 | ||
| 3 | * windows.texi (Window Configurations): save-window-excursion is | 41 | * windows.texi (Window Configurations): save-window-excursion is |
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 | ||
| 423 | If these parameters specify a separate minibuffer-only frame with | 423 | If 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 |
| 425 | one for you. | 425 | one for you. |
| 426 | 426 | ||
| 427 | @cindex minibuffer-only frame | ||
| 427 | @defopt minibuffer-frame-alist | 428 | @defopt minibuffer-frame-alist |
| 428 | This variable's value is an alist of parameter values used when | 429 | This variable's value is an alist of parameter values used when |
| 429 | creating an initial minibuffer-only frame. This is the | 430 | creating an initial minibuffer-only frame. This is the |
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 83bbc140b13..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 |
| 29 | executable. You don't have to know this material to build and install | 29 | executable. You don't have to know this material to build and install |
| 30 | Emacs, since the makefiles do all these things automatically. This | 30 | Emacs, since the makefiles do all these things automatically. This |
| 31 | information is pertinent to Emacs maintenance. | 31 | information 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 |
| 34 | produces an executable file called @file{temacs}, also called a | 34 | produces 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 |
| 36 | routines, but not the editing commands. | 36 | I/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} |
| 40 | the real runnable Emacs executable. These arguments direct | 40 | and direct it to load @file{loadup.el}. The @code{loadup} library |
| 41 | @file{temacs} to evaluate the Lisp files specified in the file | 41 | loads additional Lisp libraries, which set up the normal Emacs editing |
| 42 | @file{loadup.el}. These files set up the normal Emacs editing | 42 | environment. After this step, the Emacs executable is no longer |
| 43 | environment, resulting in an Emacs that is still impure but no longer | 43 | @dfn{bare}. |
| 44 | bare. | ||
| 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 |
| 48 | you 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. |
| 49 | dump out an executable program called @file{emacs} that has these files | 48 | Instead, as one of the last steps of building Emacs, the command |
| 50 | preloaded. @file{emacs} starts more quickly because it does not need to | 49 | @samp{temacs -batch -l loadup dump} is run. The special @samp{dump} |
| 51 | load the files. This is the Emacs executable that is normally | 50 | argument causes @command{temacs} to dump out an executable program, |
| 52 | installed. | 51 | called @file{emacs}, which has all the standard Lisp files preloaded. |
| 53 | 52 | (The @samp{-batch} argument prevents @file{temacs} from trying to | |
| 53 | initialize any of its data on the terminal, so that the tables of | ||
| 54 | terminal 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 | 59 | is the one which is installed. The variable |
| 57 | dump}. The purpose of @samp{-batch} here is to prevent @file{temacs} | 60 | @code{preloaded-file-list} stores a list of the Lisp files preloaded |
| 58 | from trying to initialize any of its data on the terminal; this ensures | 61 | into the dumped Emacs. If you port Emacs to a new operating system, |
| 59 | that the tables of terminal information are empty in the dumped Emacs. | 62 | and are not able to implement dumping, then Emacs must load |
| 60 | The argument @samp{dump} tells @file{loadup.el} to dump a new executable | 63 | @file{loadup.el} each time it starts. |
| 61 | named @file{emacs}. The variable @code{preloaded-file-list} stores a | ||
| 62 | list 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 | ||
| 65 | implement dumping, then Emacs must load @file{loadup.el} each time it | ||
| 66 | starts. | ||
| 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 |
| @@ -134,7 +131,7 @@ in a different location since it was dumped. | |||
| 134 | This function delays the initialization of @var{symbol} to the next | 131 | This function delays the initialization of @var{symbol} to the next |
| 135 | Emacs start. You normally use this function by specifying it as the | 132 | Emacs start. You normally use this function by specifying it as the |
| 136 | @code{:initialize} property of a customizable variable. (The argument | 133 | @code{:initialize} property of a customizable variable. (The argument |
| 137 | @var{value} is unused, and is provided only for compatiblity with the | 134 | @var{value} is unused, and is provided only for compatibility with the |
| 138 | form Custom expects.) | 135 | form Custom expects.) |
| 139 | @end defun | 136 | @end defun |
| 140 | 137 | ||
| @@ -163,7 +160,7 @@ all the new data created during an Emacs session are kept | |||
| 163 | in the preloaded standard Lisp files---data that should never change | 160 | in the preloaded standard Lisp files---data that should never change |
| 164 | during actual use of Emacs. | 161 | during 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 |
| 167 | standard preloaded Lisp libraries. In the file @file{emacs}, it is | 164 | standard preloaded Lisp libraries. In the file @file{emacs}, it is |
| 168 | marked as read-only (on operating systems that permit this), so that | 165 | marked as read-only (on operating systems that permit this), so that |
| 169 | the memory space can be shared by all the Emacs jobs running on the | 166 | the 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 |
| 221 | as 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. |
| 222 | normal storage runs low, then Emacs asks the operating system to | 218 | If normal storage runs low, then Emacs asks the operating system to |
| 223 | allocate more memory in blocks of 1k bytes. Each block is used for one | 219 | allocate more memory. Different types of Lisp objects, such as |
| 224 | type of Lisp object, so symbols, cons cells, markers, etc., are | 220 | symbols, cons cells, markers, etc., are segregated in distinct blocks |
| 225 | segregated in distinct blocks in memory. (Vectors, long strings, | 221 | in memory. (Vectors, long strings, buffers and certain other editing |
| 226 | buffers and certain other editing types, which are fairly large, are | 222 | types, which are fairly large, are allocated in individual blocks, one |
| 227 | allocated in individual blocks, one per object, while small strings are | 223 | per object, while small strings are packed into blocks of 8k bytes.) |
| 228 | packed 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 | ||
| 232 | object. Emacs provides a @dfn{garbage collector} to reclaim this | ||
| 233 | abandoned storage. (This name is traditional, but ``garbage recycler'' | ||
| 234 | might 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 |
| 237 | that 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 |
| 238 | all the symbols, their values and associated function definitions, and | 227 | by (for example) killing a buffer or deleting the last pointer to an |
| 239 | any data presently on the stack, are accessible. Any objects that can | 228 | object. Emacs provides a @dfn{garbage collector} to reclaim this |
| 240 | be reached indirectly through other accessible objects are also | 229 | abandoned storage. The garbage collector operates by finding and |
| 241 | accessible. | 230 | marking all Lisp objects that are still accessible to Lisp programs. |
| 231 | To begin with, it assumes all the symbols, their values and associated | ||
| 232 | function definitions, and any data presently on the stack, are | ||
| 233 | accessible. Any objects that can be reached indirectly through other | ||
| 234 | accessible 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 |
| 244 | matter what the Lisp program or the user does, it is impossible to refer | 237 | matter 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. | |||
| 336 | The total number of elements of existing vectors. | 329 | The total number of elements of existing vectors. |
| 337 | 330 | ||
| 338 | @item used-floats | 331 | @item used-floats |
| 339 | @c Emacs 19 feature | ||
| 340 | The number of floats in use. | 332 | The number of floats in use. |
| 341 | 333 | ||
| 342 | @item free-floats | 334 | @item free-floats |
| 343 | @c Emacs 19 feature | ||
| 344 | The number of floats for which space has been obtained from the | 335 | The number of floats for which space has been obtained from the |
| 345 | operating system, but that are not currently being used. | 336 | operating 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 | |||
| 417 | function @code{memory-limit} provides information on the total amount of | 408 | function @code{memory-limit} provides information on the total amount of |
| 418 | memory Emacs is currently using. | 409 | memory Emacs is currently using. |
| 419 | 410 | ||
| 420 | @c Emacs 19 feature | ||
| 421 | @defun memory-limit | 411 | @defun memory-limit |
| 422 | This function returns the address of the last byte Emacs has allocated, | 412 | This function returns the address of the last byte Emacs has allocated, |
| 423 | divided by 1024. We divide the value by 1024 to make sure it fits in a | 413 | divided 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 |
| 431 | This variable is @code{t} if Emacs is close to out of memory for Lisp | 421 | This variable is @code{t} if Emacs is nearly out of memory for Lisp |
| 432 | objects, and @code{nil} otherwise. | 422 | objects, 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 |
| 521 | DEFUN ("or", For, Sor, 0, UNEVALLED, 0, | 511 | DEFUN ("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 |
| 523 | value. The remaining args are not evalled at all. | 513 | that value. |
| 514 | The remaining args are not evalled at all. | ||
| 524 | If all args return nil, return nil. | 515 | If 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 | |||
| 566 | the example above, it is @code{or}. | 557 | the example above, it is @code{or}. |
| 567 | 558 | ||
| 568 | @item fname | 559 | @item fname |
| 569 | This is the C function name for this function. This is | 560 | This is the C function name for this function. This is the name that |
| 570 | the name that is used in C code for calling the function. The name is, | 561 | is used in C code for calling the function. The name is, by |
| 571 | by convention, @samp{F} prepended to the Lisp name, with all dashes | 562 | convention, @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 |
| 573 | function from C code, call @code{For}. Remember that the arguments must | 564 | this function from C code, call @code{For}. |
| 574 | be of type @code{Lisp_Object}; various macros and functions for creating | ||
| 575 | values of type @code{Lisp_Object} are declared in the file | ||
| 576 | @file{lisp.h}. | ||
| 577 | 565 | ||
| 578 | @item sname | 566 | @item sname |
| 579 | This is a C variable name to use for a structure that holds the data for | 567 | This 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 |
| 630 | argument list that every C function must have, including the types for | 618 | argument list for the C function, including the types for the |
| 631 | the arguments. For a function with a fixed maximum number of | 619 | arguments. If the primitive accepts a fixed maximum number of Lisp |
| 632 | arguments, declare a C argument for each Lisp argument, and give them | 620 | arguments, there must be one C argument for each Lisp argument, and |
| 633 | all type @code{Lisp_Object}. When a Lisp function has no upper limit | 621 | each argument must be of type @code{Lisp_Object}. (Various macros and |
| 634 | on the number of arguments, its implementation in C actually receives | 622 | functions for creating values of type @code{Lisp_Object} are declared |
| 635 | exactly two arguments: the first is the number of Lisp arguments, and | 623 | in the file @file{lisp.h}.) If the primitive has no upper limit on |
| 636 | the second is the address of a block containing their values. They | 624 | the number of Lisp arguments, it must have exactly two C arguments: |
| 637 | have types @code{int} and @w{@code{Lisp_Object *}}. | 625 | the first is the number of Lisp arguments, and the second is the |
| 626 | address 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 | 633 | sake of the few platforms which do not use Emacs' default |
| 644 | collector that it must look in that variable and regard its contents | 634 | stack-marking garbage collector. The @code{GCPRO1} macro ``protects'' |
| 645 | as an accessible object. GC protection is necessary whenever you call | 635 | a variable from garbage collection, explicitly informing the garbage |
| 646 | @code{eval_sub} (or @code{Feval}) either directly or indirectly. | 636 | collector that that variable and all its contents must be as |
| 647 | At such a time, any Lisp object that this function may refer to again | 637 | accessible. GC protection is necessary in any function which can |
| 648 | must be protected somehow. | 638 | perform Lisp evaluation by calling @code{eval_sub} or @code{Feval} as |
| 639 | a 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 |
| 651 | GC-protected; that way, the object cannot be recycled, so all pointers | 642 | GC-protected. Thus, a particular local variable can do without |
| 652 | to it remain valid. Thus, a particular local variable can do without | ||
| 653 | protection if it is certain that the object it points to will be | 643 | protection if it is certain that the object it points to will be |
| 654 | preserved by some other pointer (such as another local variable that | 644 | preserved by some other pointer (such as another local variable that |
| 655 | has a @code{GCPRO}). | 645 | has 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 | ||
| 658 | versions, every local variable that might point to a string needed a | ||
| 659 | @code{GCPRO}.}. | ||
| 660 | @end ignore | ||
| 661 | Otherwise, 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 |
| 664 | want to protect two variables, use @code{GCPRO2} instead; repeating | 649 | want to protect two variables, use @code{GCPRO2} instead; repeating |
| @@ -667,34 +652,17 @@ want to protect two variables, use @code{GCPRO2} instead; repeating | |||
| 667 | implicitly use local variables such as @code{gcpro1}; you must declare | 652 | implicitly use local variables such as @code{gcpro1}; you must declare |
| 668 | these explicitly, with type @code{struct gcpro}. Thus, if you use | 653 | these 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}. |
| 670 | Alas, 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 |
| 673 | protected in the current function. It is necessary to do this | 657 | protected in the current function. It is necessary to do this |
| 674 | explicitly. | 658 | explicitly. |
| 675 | 659 | ||
| 676 | Built-in functions that take a variable number of arguments actually | ||
| 677 | accept two arguments at the C level: the number of Lisp arguments, and | ||
| 678 | a @code{Lisp_Object *} pointer to a C vector containing those Lisp | ||
| 679 | arguments. This C vector may be part of a Lisp vector, but it need | ||
| 680 | not be. The responsibility for using @code{GCPRO} to protect the Lisp | ||
| 681 | arguments from GC if necessary rests with the caller in this case, | ||
| 682 | since 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 |
| 685 | the variables are never written once Emacs is dumped. These variables | 661 | the variables are never written once Emacs is dumped. These variables |
| 686 | with initializers are allocated in an area of memory that becomes | 662 | with initializers are allocated in an area of memory that becomes |
| 687 | read-only (on certain operating systems) as a result of dumping Emacs. | 663 | read-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 | ||
| 692 | variables at top level in the file. This is necessary because Emacs on | ||
| 693 | some operating systems defines the keyword @code{static} as a null | ||
| 694 | macro. (This definition is used because those systems put all variables | ||
| 695 | declared static in a place that becomes read-only after dumping, whether | ||
| 696 | they 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 |
| 700 | available; you must also create the Lisp symbol for the primitive and | 668 | available; 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 |
| 526 | Dired, Rmail, and Buffer List use this feature. | 526 | Dired, Rmail, and Buffer List use this feature. |
| 527 | 527 | ||
| 528 | The function @code{view-buffer} does not enable View mode in buffers | ||
| 529 | whose mode-class is special, because such modes usually provide their | ||
| 530 | own View-like bindings. | ||
| 531 | |||
| 528 | The @code{define-derived-mode} macro automatically marks the derived | 532 | The @code{define-derived-mode} macro automatically marks the derived |
| 529 | mode as special if the parent mode is special. Special mode is a | 533 | mode as special if the parent mode is special. Special mode is a |
| 530 | convenient parent for such modes to inherit from; @xref{Basic Major | 534 | convenient parent for such modes to inherit from; @xref{Basic Major |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index f7df5f4bf87..1021787a0f4 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 |
| 11 | values in the operating system environment, and terminal input, output, | 11 | values in the operating system environment, and terminal input, output. |
| 12 | and flow control. | ||
| 13 | 12 | ||
| 14 | @xref{Building Emacs}, for related information. @xref{Display}, for | 13 | @xref{Building Emacs}, for related information. @xref{Display}, for |
| 15 | additional operating system status information pertaining to the | 14 | additional 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 | |||
| 70 | in their turn. The files @file{subdirs.el} are normally generated | 69 | in their turn. The files @file{subdirs.el} are normally generated |
| 71 | automatically when Emacs is installed. | 70 | automatically when Emacs is installed. |
| 72 | 71 | ||
| 72 | @item | ||
| 73 | It registers input methods by loading any @file{leim-list.el} file | ||
| 74 | found 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 |
| 75 | It sets the variable @code{before-init-time} to the value of | 83 | It 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 |
| 78 | that Emacs is being initialized. | 86 | that Emacs is being initialized. |
| 79 | 87 | ||
| 88 | @c set-locale-environment | ||
| 89 | @item | ||
| 90 | It sets the language environment and the terminal coding system, | ||
| 91 | if requested by environment variables such as @code{LANG}. | ||
| 92 | |||
| 93 | @item | ||
| 94 | It 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 |
| 83 | It loads the initialization library for the window system specified by | 99 | If not running in batch mode, it initializes the window system that |
| 84 | the variable @code{initial-window-system} (@pxref{Window Systems, | 100 | the variable @code{initial-window-system} specifies (@pxref{Window |
| 85 | initial-window-system}). This library's name is | 101 | Systems, initial-window-system}). The initialization function for |
| 86 | @file{term/@var{windowsystem}-win.el}, where @var{windowsystem} is the | 102 | each supported window system is specified by |
| 87 | value of @code{initial-window-system}. From that library, it calls | 103 | @code{window-system-initialization-alist}. If the value |
| 88 | the appropriate initialization function. The initialization function | 104 | of @code{initial-window-system} is @var{windowsystem}, then the |
| 89 | for each supported window system is specified by | 105 | appropriate 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 |
| 107 | compiled into the Emacs executable when it was built. | ||
| 91 | 108 | ||
| 92 | @item | 109 | @item |
| 93 | It sets the language environment and the terminal coding system, | 110 | It runs the normal hook @code{before-init-hook}. |
| 94 | if requested by environment variables such as @code{LANG}. | ||
| 95 | 111 | ||
| 96 | @item | 112 | @item |
| 97 | It processes the initial options. (Some of them are handled | 113 | If appropriate (e.g., not in batch mode or started as a daemon), it |
| 98 | even earlier than this.) | 114 | creates a graphical frame. |
| 99 | 115 | ||
| 100 | @item | 116 | @item |
| 101 | It runs the normal hook @code{before-init-hook}. | 117 | It initializes the initial frame's faces, and sets up the menu bar |
| 118 | and tool bar if needed. If graphical frames are supported, it sets up | ||
| 119 | the tool bar even if the current frame is not a graphical one, since a | ||
| 120 | graphical frame may be created later on. | ||
| 102 | 121 | ||
| 103 | @item | 122 | @item |
| 104 | It initializes the initial frame's faces, and turns on the menu bar | 123 | It use @code{custom-reevaluate-setting} to re-initialize the members |
| 105 | and tool bar if needed. | 124 | of the list @code{custom-delayed-init-variables}. These are any |
| 125 | pre-loaded user options whose default value depends on the run-time, | ||
| 126 | rather 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 |
| 108 | It loads the library @file{site-start}, if it exists. This is not | 133 | It 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 |
| 128 | option @samp{--batch} was specified. | 153 | option @samp{--batch} was specified. |
| 129 | 154 | ||
| 155 | @item | ||
| 156 | If @code{package-enable-at-startup} is non-@code{nil}, it calls the | ||
| 157 | function @code{package-initialize} to activate any optional Emacs Lisp | ||
| 158 | package that has been installed. @xref{Packaging Basics}. | ||
| 159 | |||
| 130 | @vindex after-init-time | 160 | @vindex after-init-time |
| 131 | @item | 161 | @item |
| 132 | It sets the variable @code{after-init-time} to the value of | 162 | It 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 |
| 150 | in @code{--batch} mode, nor if @code{term-file-prefix} is @code{nil}. | 180 | in @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 |
| 153 | It displays the initial echo area message, unless you have suppressed | 185 | It displays the initial echo area message, unless you have suppressed |
| 154 | that with @code{inhibit-startup-echo-area-message}. | 186 | that with @code{inhibit-startup-echo-area-message}. |
| 155 | 187 | ||
| 156 | @item | 188 | @item |
| 157 | It processes the action arguments from the command line. | 189 | It 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 |
| 160 | It now exits if the option @code{--batch} was specified. | 194 | It 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 | |||
| 164 | that name. Furthermore, if the @samp{*scratch*} buffer exists and is | 198 | that name. Furthermore, if the @samp{*scratch*} buffer exists and is |
| 165 | empty, it inserts @code{initial-scratch-message} into that buffer. | 199 | empty, 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 |
| 168 | It runs @code{emacs-startup-hook} and then @code{term-setup-hook}. | 211 | It runs @code{emacs-startup-hook} and then @code{term-setup-hook}. |
| 169 | 212 | ||
| @@ -176,21 +219,33 @@ specify. | |||
| 176 | It runs @code{window-setup-hook}. @xref{Window Systems}. | 219 | It runs @code{window-setup-hook}. @xref{Window Systems}. |
| 177 | 220 | ||
| 178 | @item | 221 | @item |
| 179 | If 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 | ||
| 184 | It displays the @dfn{startup screen}, which is a special buffer that | 222 | It displays the @dfn{startup screen}, which is a special buffer that |
| 185 | contains information about copyleft and basic Emacs usage. This is | 223 | contains information about copyleft and basic Emacs usage. This is |
| 186 | not done if @code{initial-buffer-choice} or | 224 | not 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 | ||
| 236 | If 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 |
| 191 | If started by the X session manager, it calls | 241 | If 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 |
| 193 | previous session. @xref{Session Management}. | 243 | previous 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 | ||
| 196 | @defopt inhibit-startup-screen | 251 | @defopt inhibit-startup-screen |
| @@ -242,17 +297,20 @@ is @code{nil}, the @samp{*scratch*} buffer is empty. | |||
| 242 | @end defopt | 297 | @end defopt |
| 243 | 298 | ||
| 244 | @node Init File | 299 | @node Init File |
| 245 | @subsection The Init File, @file{.emacs} | 300 | @subsection The Init File |
| 246 | @cindex init file | 301 | @cindex init file |
| 247 | @cindex @file{.emacs} | 302 | @cindex @file{.emacs} |
| 303 | @cindex @file{init.el} | ||
| 248 | 304 | ||
| 249 | When you start Emacs, it normally attempts to load your @dfn{init | 305 | When you start Emacs, it normally attempts to load your @dfn{init |
| 250 | file}. This is either a file named @file{.emacs} or @file{.emacs.el} | 306 | file}. This is either a file named @file{.emacs} or @file{.emacs.el} |
| 251 | in your home directory, or a file named @file{init.el} in a | 307 | in your home directory, or a file named @file{init.el} in a |
| 252 | subdirectory named @file{.emacs.d} in your home directory. Whichever | 308 | subdirectory named @file{.emacs.d} in your home directory. |
| 253 | place you use, you can also compile the file (@pxref{Byte | 309 | @ignore |
| 310 | Whichever place you use, you can also compile the file (@pxref{Byte | ||
| 254 | Compilation}); then the actual file loaded will be @file{.emacs.elc} | 311 | Compilation}); then the actual file loaded will be @file{.emacs.elc} |
| 255 | or @file{init.elc}. | 312 | or @file{init.elc}. |
| 313 | @end ignore | ||
| 256 | 314 | ||
| 257 | The command-line switches @samp{-q}, @samp{-Q}, and @samp{-u} | 315 | The command-line switches @samp{-q}, @samp{-Q}, and @samp{-u} |
| 258 | control whether and where to find the init file; @samp{-q} (and the | 316 | control whether and where to find the init file; @samp{-q} (and the |
| @@ -267,13 +325,13 @@ file. If those environment variables are absent, though, Emacs uses | |||
| 267 | your user-id to find your home directory. | 325 | your user-id to find your home directory. |
| 268 | 326 | ||
| 269 | @cindex default init file | 327 | @cindex default init file |
| 270 | A site may have a @dfn{default init file}, which is the library | 328 | An Emacs installation may have a @dfn{default init file}, which is a |
| 271 | named @file{default.el}. Emacs finds the @file{default.el} file | 329 | Lisp library named @file{default.el}. Emacs finds this file through |
| 272 | through the standard search path for libraries (@pxref{How Programs Do | 330 | the standard search path for libraries (@pxref{How Programs Do |
| 273 | Loading}). The Emacs distribution does not come with this file; sites | 331 | Loading}). The Emacs distribution does not come with this file; it is |
| 274 | may provide one for local customizations. If the default init file | 332 | intended for local customizations. If the default init file exists, |
| 275 | exists, it is loaded whenever you start Emacs, except in batch mode or | 333 | it is loaded whenever you start Emacs, except in batch mode or if |
| 276 | if @samp{-q} (or @samp{-Q}) is specified. But your own personal init | 334 | @samp{-q} (or @samp{-Q}) is specified. But your own personal init |
| 277 | file, if any, is loaded first; if it sets @code{inhibit-default-init} | 335 | file, if any, is loaded first; if it sets @code{inhibit-default-init} |
| 278 | to a non-@code{nil} value, then Emacs does not subsequently load the | 336 | to a non-@code{nil} value, then Emacs does not subsequently load the |
| 279 | @file{default.el} file. | 337 | @file{default.el} file. |
| @@ -343,23 +401,22 @@ in the normal manner, by searching the @code{load-path} directories, and | |||
| 343 | trying the @samp{.elc} and @samp{.el} suffixes. | 401 | trying the @samp{.elc} and @samp{.el} suffixes. |
| 344 | 402 | ||
| 345 | @cindex Termcap | 403 | @cindex Termcap |
| 346 | The usual function of a terminal-specific library is to enable | 404 | The usual role of a terminal-specific library is to enable special |
| 347 | special keys to send sequences that Emacs can recognize. It may also | 405 | keys to send sequences that Emacs can recognize. It may also need to |
| 348 | need to set or add to @code{input-decode-map} if the Termcap or | 406 | set or add to @code{input-decode-map} if the Termcap or Terminfo entry |
| 349 | Terminfo entry does not specify all the terminal's function keys. | 407 | does not specify all the terminal's function keys. @xref{Terminal |
| 350 | @xref{Terminal Input}. | 408 | Input}. |
| 351 | 409 | ||
| 352 | When the name of the terminal type contains a hyphen, and no library | 410 | When the name of the terminal type contains a hyphen, and no library |
| 353 | is found whose name is identical to the terminal's name, Emacs strips | 411 | is found whose name is identical to the terminal's name, Emacs strips |
| 354 | from the terminal's name the last hyphen and everything that follows | 412 | from the terminal's name the last hyphen and everything that follows |
| 355 | it, and tries again. This process is repeated until Emacs finds a | 413 | it, and tries again. This process is repeated until Emacs finds a |
| 356 | matching library or until there are no more hyphens in the name (the | 414 | matching library, or until there are no more hyphens in the name |
| 357 | latter means the terminal doesn't have any library specific to it). | 415 | (i.g.@: there is no terminal-specific library). For example, if the |
| 358 | Thus, for example, if there are no @samp{aaa-48} and @samp{aaa-30} | 416 | terminal name is @samp{xterm-256color} and there is no |
| 359 | libraries, Emacs will try the same library @file{term/aaa.el} for | 417 | @file{term/xterm-256color.el} library, Emacs tries to load |
| 360 | terminal types @samp{aaa-48} and @samp{aaa-30-rv}. If necessary, the | 418 | @file{term/xterm.el}. If necessary, the terminal library can evaluate |
| 361 | library can evaluate @code{(getenv "TERM")} to find the full name of | 419 | @code{(getenv "TERM")} to find the full name of the terminal type. |
| 362 | the terminal type.@refill | ||
| 363 | 420 | ||
| 364 | Your init file can prevent the loading of the | 421 | Your init file can prevent the loading of the |
| 365 | terminal-specific library by setting the variable | 422 | terminal-specific library by setting the variable |
| @@ -376,8 +433,8 @@ have their own libraries. @xref{Hooks}. | |||
| 376 | 433 | ||
| 377 | @defvar term-file-prefix | 434 | @defvar term-file-prefix |
| 378 | @cindex @code{TERM} environment variable | 435 | @cindex @code{TERM} environment variable |
| 379 | If the @code{term-file-prefix} variable is non-@code{nil}, Emacs loads | 436 | If the value of this variable is non-@code{nil}, Emacs loads a |
| 380 | a terminal-specific initialization file as follows: | 437 | terminal-specific initialization file as follows: |
| 381 | 438 | ||
| 382 | @example | 439 | @example |
| 383 | (load (concat term-file-prefix (getenv "TERM"))) | 440 | (load (concat term-file-prefix (getenv "TERM"))) |
| @@ -409,29 +466,14 @@ feature. | |||
| 409 | @subsection Command-Line Arguments | 466 | @subsection Command-Line Arguments |
| 410 | @cindex command-line arguments | 467 | @cindex command-line arguments |
| 411 | 468 | ||
| 412 | You can use command-line arguments to request various actions when you | 469 | You can use command-line arguments to request various actions when |
| 413 | start Emacs. Since you do not need to start Emacs more than once per | 470 | you start Emacs. Command-line arguments should not be commonly used, |
| 414 | day, and will often leave your Emacs session running longer than that, | 471 | since the recommended way of using Emacs is to start it just once, |
| 415 | command-line arguments are hardly ever used. As a practical matter, it | 472 | after logging in, and do all editing in the same Emacs session |
| 416 | is best to avoid making the habit of using them, since this habit would | 473 | (@pxref{Entering Emacs,,, emacs, The GNU Emacs Manual}); nonetheless, |
| 417 | encourage you to kill and restart Emacs unnecessarily often. These | 474 | they can be useful when invoking Emacs from session scripts or |
| 418 | options exist for two reasons: to be compatible with other editors (for | 475 | debugging Emacs itself. This section describes how Emacs processes |
| 419 | invocation by other programs) and to enable shell scripts to run | 476 | command-line arguments. |
| 420 | specific Lisp programs. | ||
| 421 | |||
| 422 | This section describes how Emacs processes command-line arguments, | ||
| 423 | and how you can customize them. | ||
| 424 | |||
| 425 | @ignore | ||
| 426 | (Note that some other editors require you to start afresh each time | ||
| 427 | you want to edit a file. With this kind of editor, you will probably | ||
| 428 | specify the file as a command-line argument. The recommended way to | ||
| 429 | use GNU Emacs is to start it only once, just after you log in, and do | ||
| 430 | all your editing in the same Emacs process. Each time you want to edit | ||
| 431 | a different file, you visit it with the existing Emacs, which eventually | ||
| 432 | comes to have many files in it ready for editing. Usually you do not | ||
| 433 | kill the Emacs until you are about to log out.) | ||
| 434 | @end ignore | ||
| 435 | 477 | ||
| 436 | @defun command-line | 478 | @defun command-line |
| 437 | This function parses the command line that Emacs was called with, | 479 | This function parses the command line that Emacs was called with, |
| @@ -525,9 +567,7 @@ as a file name to visit. | |||
| 525 | 567 | ||
| 526 | There are two ways to get out of Emacs: you can kill the Emacs job, | 568 | There are two ways to get out of Emacs: you can kill the Emacs job, |
| 527 | which exits permanently, or you can suspend it, which permits you to | 569 | which exits permanently, or you can suspend it, which permits you to |
| 528 | reenter the Emacs process later. As a practical matter, you seldom kill | 570 | reenter the Emacs process later. |
| 529 | Emacs---only when you are about to log out. Suspending is much more | ||
| 530 | common. | ||
| 531 | 571 | ||
| 532 | @menu | 572 | @menu |
| 533 | * Killing Emacs:: Exiting Emacs irreversibly. | 573 | * Killing Emacs:: Exiting Emacs irreversibly. |
| @@ -1105,24 +1145,47 @@ The value may be a floating point number. | |||
| 1105 | @node Time of Day | 1145 | @node Time of Day |
| 1106 | @section Time of Day | 1146 | @section Time of Day |
| 1107 | 1147 | ||
| 1108 | This section explains how to determine the current time and the time | 1148 | This section explains how to determine the current time and time |
| 1109 | zone. | 1149 | zone. |
| 1110 | 1150 | ||
| 1151 | @cindex epoch | ||
| 1152 | Most of these functions represent time as a list of either three | ||
| 1153 | integers, @code{(@var{sec-high} @var{sec-low} @var{microsec})}, or of | ||
| 1154 | two integers, @code{(@var{sec-high} @var{sec-low})}. The integers | ||
| 1155 | @var{sec-high} and @var{sec-low} give the high and low bits of an | ||
| 1156 | integer number of seconds. This integer number, | ||
| 1157 | @ifnottex | ||
| 1158 | @var{high} * 2**16 + @var{low}, | ||
| 1159 | @end ifnottex | ||
| 1160 | @tex | ||
| 1161 | $high*2^{16}+low$, | ||
| 1162 | @end tex | ||
| 1163 | is the number of seconds from the @dfn{epoch} (0:00 January 1, 1970 | ||
| 1164 | UTC) to the specified time. The third list element @var{microsec}, if | ||
| 1165 | present, gives the number of microseconds from the start of that | ||
| 1166 | second to the specified time. | ||
| 1167 | |||
| 1168 | The return value of @code{current-time} represents time using three | ||
| 1169 | integers, while the timestamps in the return value of | ||
| 1170 | @code{file-attributes} use two integers (@pxref{Definition of | ||
| 1171 | file-attributes}). In function arguments, e.g.@: the @var{time-value} | ||
| 1172 | argument to @code{current-time-string}, both two- and three-integer | ||
| 1173 | lists are accepted. You can convert times from the list | ||
| 1174 | representation into standard human-readable strings using | ||
| 1175 | @code{current-time}, or to other forms using the @code{decode-time} | ||
| 1176 | and @code{format-time-string} functions documented in the following | ||
| 1177 | sections. | ||
| 1178 | |||
| 1111 | @defun current-time-string &optional time-value | 1179 | @defun current-time-string &optional time-value |
| 1112 | This function returns the current time and date as a human-readable | 1180 | This function returns the current time and date as a human-readable |
| 1113 | string. The format of the string is unvarying; the number of characters | 1181 | string. The format of the string is unvarying; the number of |
| 1114 | used for each part is always the same, so you can reliably use | 1182 | characters 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 | 1183 | use @code{substring} to extract pieces of it. You should count |
| 1116 | characters from the beginning of the string rather than from the end, as | 1184 | characters from the beginning of the string rather than from the end, |
| 1117 | additional information may some day be added at the end. | 1185 | as additional information may some day be added at the end. |
| 1118 | 1186 | ||
| 1119 | The argument @var{time-value}, if given, specifies a time to format | 1187 | The argument @var{time-value}, if given, specifies a time to format |
| 1120 | instead of the current time. This argument should have the same form | 1188 | (represented as a list of integers), instead of the current time. |
| 1121 | as the times obtained from @code{current-time} (see below) and from | ||
| 1122 | @code{file-attributes} (@pxref{Definition of file-attributes}). It | ||
| 1123 | should be a list whose first two elements are integers; a third | ||
| 1124 | (microsecond) element, if present, is ignored. @var{time-value} can | ||
| 1125 | also be a cons of two integers, but this usage is obsolete. | ||
| 1126 | 1189 | ||
| 1127 | @example | 1190 | @example |
| 1128 | @group | 1191 | @group |
| @@ -1133,33 +1196,16 @@ also be a cons of two integers, but this usage is obsolete. | |||
| 1133 | @end defun | 1196 | @end defun |
| 1134 | 1197 | ||
| 1135 | @defun current-time | 1198 | @defun current-time |
| 1136 | This function returns the system's time value as a list of three | 1199 | This function returns the current time, represented as a list of three |
| 1137 | integers: @code{(@var{high} @var{low} @var{microsec})}. The integers | 1200 | integers @code{(@var{sec-high} @var{sec-low} @var{microsec})}. On |
| 1138 | @var{high} and @var{low} combine to give the number of seconds since | 1201 | systems with only one-second time resolutions, @var{microsec} is 0. |
| 1139 | 0: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 | |||
| 1147 | The third element, @var{microsec}, gives the microseconds since the | ||
| 1148 | start of the current second (or 0 for systems that return time with | ||
| 1149 | the resolution of only one second). | ||
| 1150 | |||
| 1151 | The first two elements can be compared with file time values such as you | ||
| 1152 | get with the function @code{file-attributes}. | ||
| 1153 | @xref{Definition of file-attributes}. | ||
| 1154 | @end defun | 1202 | @end defun |
| 1155 | 1203 | ||
| 1156 | @defun float-time &optional time-value | 1204 | @defun float-time &optional time-value |
| 1157 | This function returns the current time as a floating-point number of | 1205 | This function returns the current time as a floating-point number of |
| 1158 | seconds since the epoch. The argument @var{time-value}, if given, | 1206 | seconds since the epoch. The optional argument @var{time-value}, if |
| 1159 | specifies a time to convert instead of the current time. The argument | 1207 | given, specifies a time (represented as a list of integers) to convert |
| 1160 | should have the same form as for @code{current-time-string} (see | 1208 | instead of the current time. |
| 1161 | above). Thus, it accepts the output of @code{current-time} and | ||
| 1162 | @code{file-attributes} (@pxref{Definition of file-attributes}). | ||
| 1163 | 1209 | ||
| 1164 | @emph{Warning}: Since the result is floating point, it may not be | 1210 | @emph{Warning}: Since the result is floating point, it may not be |
| 1165 | exact. Do not use this function if precise time stamps are required. | 1211 | exact. Do not use this function if precise time stamps are required. |
| @@ -1180,11 +1226,8 @@ adjustment, then the value is constant through time. | |||
| 1180 | If the operating system doesn't supply all the information necessary to | 1226 | If the operating system doesn't supply all the information necessary to |
| 1181 | compute the value, the unknown elements of the list are @code{nil}. | 1227 | compute the value, the unknown elements of the list are @code{nil}. |
| 1182 | 1228 | ||
| 1183 | The argument @var{time-value}, if given, specifies a time to analyze | 1229 | The argument @var{time-value}, if given, specifies a time (represented |
| 1184 | instead of the current time. The argument should have the same form | 1230 | as a list of integers) to analyze instead of the current time. |
| 1185 | as for @code{current-time-string} (see above). Thus, you can use | ||
| 1186 | times obtained from @code{current-time} (see above) and from | ||
| 1187 | @code{file-attributes}. @xref{Definition of file-attributes}. | ||
| 1188 | @end defun | 1231 | @end defun |
| 1189 | 1232 | ||
| 1190 | The current time zone is determined by the @samp{TZ} environment | 1233 | The current time zone is determined by the @samp{TZ} environment |
| @@ -1196,16 +1239,15 @@ time zone. | |||
| 1196 | @node Time Conversion | 1239 | @node Time Conversion |
| 1197 | @section Time Conversion | 1240 | @section Time Conversion |
| 1198 | 1241 | ||
| 1199 | These functions convert time values (lists of two or three integers) | 1242 | These functions convert time values (lists of two or three integers, |
| 1200 | to calendrical information and vice versa. You can get time values | 1243 | as explained in the previous section) into calendrical information and |
| 1201 | from the functions @code{current-time} (@pxref{Time of Day}) and | 1244 | vice versa. |
| 1202 | @code{file-attributes} (@pxref{Definition of file-attributes}). | ||
| 1203 | 1245 | ||
| 1204 | Many 32-bit operating systems are limited to time values that contain 32 bits | 1246 | Many 32-bit operating systems are limited to time values containing |
| 1205 | of information; these systems typically handle only the times from | 1247 | 32 bits of information; these systems typically handle only the times |
| 1206 | 1901-12-13 20:45:52 UTC through 2038-01-19 03:14:07 UTC. However, 64-bit | 1248 | from 1901-12-13 20:45:52 UTC through 2038-01-19 03:14:07 UTC. |
| 1207 | and some 32-bit operating systems have larger time values, and can | 1249 | However, 64-bit and some 32-bit operating systems have larger time |
| 1208 | represent times far in the past or future. | 1250 | values, and can represent times far in the past or future. |
| 1209 | 1251 | ||
| 1210 | Time conversion functions always use the Gregorian calendar, even | 1252 | Time conversion functions always use the Gregorian calendar, even |
| 1211 | for dates before the Gregorian calendar was introduced. Year numbers | 1253 | for dates before the Gregorian calendar was introduced. Year numbers |
| @@ -1718,9 +1760,9 @@ certain length of time. Aside from how to set them up, idle timers | |||
| 1718 | work just like ordinary timers. | 1760 | work just like ordinary timers. |
| 1719 | 1761 | ||
| 1720 | @deffn Command run-with-idle-timer secs repeat function &rest args | 1762 | @deffn Command run-with-idle-timer secs repeat function &rest args |
| 1721 | Set up a timer which runs when Emacs has been idle for @var{secs} | 1763 | Set up a timer which runs the next time Emacs is idle for @var{secs} |
| 1722 | seconds. The value of @var{secs} may be an integer or a floating point | 1764 | seconds. The value of @var{secs} may be an integer or a floating |
| 1723 | number; a value of the type returned by @code{current-idle-time} | 1765 | point number; a value of the type returned by @code{current-idle-time} |
| 1724 | is also allowed. | 1766 | is also allowed. |
| 1725 | 1767 | ||
| 1726 | If @var{repeat} is @code{nil}, the timer runs just once, the first time | 1768 | If @var{repeat} is @code{nil}, the timer runs just once, the first time |
| @@ -1733,13 +1775,13 @@ can use in calling @code{cancel-timer} (@pxref{Timers}). | |||
| 1733 | @end deffn | 1775 | @end deffn |
| 1734 | 1776 | ||
| 1735 | @cindex idleness | 1777 | @cindex idleness |
| 1736 | Emacs becomes ``idle'' when it starts waiting for user input, and it | 1778 | Emacs becomes @dfn{idle} when it starts waiting for user input, and |
| 1737 | remains idle until the user provides some input. If a timer is set for | 1779 | it remains idle until the user provides some input. If a timer is set |
| 1738 | five seconds of idleness, it runs approximately five seconds after Emacs | 1780 | for five seconds of idleness, it runs approximately five seconds after |
| 1739 | first becomes idle. Even if @var{repeat} is non-@code{nil}, this timer | 1781 | Emacs first becomes idle. Even if @var{repeat} is non-@code{nil}, |
| 1740 | will not run again as long as Emacs remains idle, because the duration | 1782 | this timer will not run again as long as Emacs remains idle, because |
| 1741 | of idleness will continue to increase and will not go down to five | 1783 | the duration of idleness will continue to increase and will not go |
| 1742 | seconds again. | 1784 | down to five seconds again. |
| 1743 | 1785 | ||
| 1744 | Emacs can do various things while idle: garbage collect, autosave or | 1786 | Emacs can do various things while idle: garbage collect, autosave or |
| 1745 | handle data from a subprocess. But these interludes during idleness do | 1787 | handle data from a subprocess. But these interludes during idleness do |
| @@ -1753,22 +1795,12 @@ minutes, and even if there have been garbage collections and autosaves. | |||
| 1753 | input. Then it becomes idle again, and all the idle timers that are | 1795 | input. Then it becomes idle again, and all the idle timers that are |
| 1754 | set up to repeat will subsequently run another time, one by one. | 1796 | set up to repeat will subsequently run another time, one by one. |
| 1755 | 1797 | ||
| 1756 | @c Emacs 19 feature | ||
| 1757 | @defun current-idle-time | 1798 | @defun current-idle-time |
| 1758 | If Emacs is idle, this function returns the length of time Emacs has | 1799 | If Emacs is idle, this function returns the length of time Emacs has |
| 1759 | been idle, as a list of three integers: @code{(@var{high} @var{low} | 1800 | been idle, as a list of three integers: @code{(@var{sec-high} |
| 1760 | @var{microsec})}. The integers @var{high} and @var{low} combine to | 1801 | @var{sec-low} @var{microsec})}, where @var{high} and @var{low} are the |
| 1761 | give the number of seconds of idleness, which is | 1802 | high and low bits for the number of seconds and @var{microsec} is the |
| 1762 | @ifnottex | 1803 | additional 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 | |||
| 1769 | The third element, @var{microsec}, gives the microseconds since the | ||
| 1770 | start of the current second (or 0 for systems that return time with | ||
| 1771 | the resolution of only one second). | ||
| 1772 | 1804 | ||
| 1773 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. | 1805 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. |
| 1774 | This is a convenient way to test whether Emacs is idle. | 1806 | This is a convenient way to test whether Emacs is idle. |
| @@ -1801,9 +1833,9 @@ Here's an example: | |||
| 1801 | @end smallexample | 1833 | @end smallexample |
| 1802 | @end defun | 1834 | @end defun |
| 1803 | 1835 | ||
| 1804 | Some idle timer functions in user Lisp packages have a loop that | 1836 | Do not write an idle timer function containing a loop which does a |
| 1805 | does a certain amount of processing each time around, and exits when | 1837 | certain amount of processing each time around, and exits when |
| 1806 | @code{(input-pending-p)} is non-@code{nil}. That approach seems very | 1838 | @code{(input-pending-p)} is non-@code{nil}. This approach seems very |
| 1807 | natural but has two problems: | 1839 | natural but has two problems: |
| 1808 | 1840 | ||
| 1809 | @itemize | 1841 | @itemize |
| @@ -1816,9 +1848,9 @@ It blocks out any idle timers that ought to run during that time. | |||
| 1816 | @end itemize | 1848 | @end itemize |
| 1817 | 1849 | ||
| 1818 | @noindent | 1850 | @noindent |
| 1819 | To avoid these problems, don't use that technique. Instead, write | 1851 | The correct approach is for the idle timer to reschedule itself after |
| 1820 | such idle timers to reschedule themselves after a brief pause, using | 1852 | a brief pause, using the method in the @code{timer-function} example |
| 1821 | the method in the @code{timer-function} example above. | 1853 | above. |
| 1822 | 1854 | ||
| 1823 | @node Terminal Input | 1855 | @node Terminal Input |
| 1824 | @section Terminal Input | 1856 | @section Terminal Input |
| @@ -2014,9 +2046,8 @@ See also @code{open-dribble-file} in @ref{Recording Input}. | |||
| 2014 | @cindex sound | 2046 | @cindex sound |
| 2015 | 2047 | ||
| 2016 | To play sound using Emacs, use the function @code{play-sound}. Only | 2048 | To play sound using Emacs, use the function @code{play-sound}. Only |
| 2017 | certain systems are supported; if you call @code{play-sound} on a system | 2049 | certain systems are supported; if you call @code{play-sound} on a |
| 2018 | which cannot really do the job, it gives an error. Emacs version 20 and | 2050 | system which cannot really do the job, it gives an error. |
| 2019 | earlier did not support sound at all. | ||
| 2020 | 2051 | ||
| 2021 | The sound must be stored as a file in RIFF-WAVE format (@samp{.wav}) | 2052 | The sound must be stored as a file in RIFF-WAVE format (@samp{.wav}) |
| 2022 | or Sun Audio format (@samp{.au}). | 2053 | or 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 |
| 17 | put it in a @dfn{package archive} for others to download. | 17 | put it in a @dfn{package archive} for others to download. |
| 18 | @xref{Packages,,, emacs, The GNU Emacs Manual}, for a description of | ||
| 19 | user-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} | |||
| 91 | in the content directory. They are typically used to autoload the | 93 | in the content directory. They are typically used to autoload the |
| 92 | principal user commands defined in the package, but they can also | 94 | principal user commands defined in the package, but they can also |
| 93 | perform other tasks, such as adding an element to | 95 | perform 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 |
| 95 | Emacs will also byte-compile the Lisp files. | 97 | typically does @emph{not} autoload every function and variable defined |
| 96 | 98 | within it---only the handful of commands typically called to begin | |
| 97 | After installation, and (by default) each time Emacs is started, the | 99 | using the package. Emacs then byte-compiles every Lisp file in the |
| 98 | installed package is @dfn{activated}. During activation, Emacs adds | 100 | package. |
| 99 | the package's content directory to @code{load-path}, and evaluates the | 101 | |
| 100 | autoload definitions in @file{@var{name}-autoloads.el}. | 102 | After installation, the installed package is @dfn{loaded}: Emacs |
| 101 | 103 | adds the package's content directory to @code{load-path}, and | |
| 102 | Note that a package typically does @emph{not} autoload every | 104 | evaluates the autoload definitions in @file{@var{name}-autoloads.el}. |
| 103 | function and variable defined within it---only the handful of commands | 105 | |
| 104 | typically 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 | ||
| 108 | after loading the init file and abbrev file (if any) and before | ||
| 109 | running @code{after-init-hook} (@pxref{Startup Summary}). Automatic | ||
| 110 | package 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 | ||
| 114 | This function initializes Emacs' internal record of which packages are | ||
| 115 | installed, and loads them. The user option @code{package-load-list} | ||
| 116 | specifies which packages to load; by default, all installed packages | ||
| 117 | are loaded. @xref{Package Installation,,, emacs, The GNU Emacs | ||
| 118 | Manual}. | ||
| 119 | |||
| 120 | The optional argument @var{no-activate}, if non-@code{nil}, causes | ||
| 121 | Emacs to update its record of installed packages without actually | ||
| 122 | loading 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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-02-20 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2012-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'. |
| @@ -1,4 +1,6 @@ | |||
| 1 | This is a list of ways to say hello in various languages. | 1 | This is a list of ways to say hello in various languages. |
| 2 | It is not intended to be comprehensive, but to demonstrate | ||
| 3 | some of the character sets that Emacs supports. | ||
| 2 | 4 | ||
| 3 | Non-ASCII examples: | 5 | Non-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 | |||
| 46 | Malayalam ($,1@N@R@O@^@S@"(B) $,1@H@N@X@m@5@^@P@"(B | 48 | Malayalam ($,1@N@R@O@^@S@"(B) $,1@H@N@X@m@5@^@P@"(B |
| 47 | Maltese (il-Malti) Bon,Cu(Bu / Sa,C11(Ba | 49 | Maltese (il-Malti) Bon,Cu(Bu / Sa,C11(Ba |
| 48 | Mathematics $,1x (B p $,1x((B world $,1s"(B hello p $,2!a(B | 50 | Mathematics $,1x (B p $,1x((B world $,1s"(B hello p $,2!a(B |
| 49 | Nederlands, Vlaams Hallo / Dag | ||
| 50 | Norwegian (norsk) Hei / God dag | 51 | Norwegian (norsk) Hei / God dag |
| 51 | Oriya ($,1:s;\;?:f(B) $,1;6;A;#;?;,;G(B | 52 | Oriya ($,1:s;\;?:f(B) $,1;6;A;#;?;,;G(B |
| 52 | Polish (j,Bj(Bzyk polski) Dzie,Bq(B dobry! / Cze,B6f(B! | 53 | Polish (j,Bj(Bzyk polski) Dzie,Bq(B dobry! / Cze,B6f(B! |
| @@ -55,7 +56,7 @@ Sinhala ($,1B#B2ABB$A}(B) $,1AFAzB4AvB=B AqB*(B | |||
| 55 | Slovak (sloven,Bh(Bina) Dobr,A}(B de,Br(B | 56 | Slovak (sloven,Bh(Bina) Dobr,A}(B de,Br(B |
| 56 | Slovenian (sloven,B9h(Bina) Pozdravljeni! | 57 | Slovenian (sloven,B9h(Bina) Pozdravljeni! |
| 57 | Spanish (espa,Aq(Bol) ,A!(BHola! | 58 | Spanish (espa,Aq(Bol) ,A!(BHola! |
| 58 | Swedish (p,Ae(B svenska) Hej / Goddag / Hall,Ae(B | 59 | Swedish (svenska) Hej / Goddag / Hall,Ae(B |
| 59 | Tamil ($,1<D<N<_<T<m(B) $,1<U<C<5<m<5<N<m(B | 60 | Tamil ($,1<D<N<_<T<m(B) $,1<U<C<5<m<5<N<m(B |
| 60 | Telugu ($,1=d>&=r>!=W>!(B) $,1=h=n=x>-=U=~=p=B(B | 61 | Telugu ($,1=d>&=r>!=W>!(B) $,1=h=n=x>-=U=~=p=B(B |
| 61 | Thai (,T@RIRd7B(B) ,TJGQJ4U$CQ:(B / ,TJGQJ4U$hP(B | 62 | Thai (,T@RIRd7B(B) ,TJGQJ4U$CQ:(B / ,TJGQJ4U$hP(B |
| @@ -251,7 +251,8 @@ On character terminals, these methods are used for characters that | |||
| 251 | cannot be encoded by the `terminal-coding-system'. | 251 | cannot be encoded by the `terminal-coding-system'. |
| 252 | 252 | ||
| 253 | --- | 253 | --- |
| 254 | *** New input methods for Farsi: farsi and farsi-translit. | 254 | *** New input methods for Farsi: farsi and farsi-translit; |
| 255 | and for Bulgarian: bulgarian-alt-phonetic. | ||
| 255 | 256 | ||
| 256 | +++ | 257 | +++ |
| 257 | *** `nobreak-char-display' now also highlights Unicode hyphen chars | 258 | *** `nobreak-char-display' now also highlights Unicode hyphen chars |
| @@ -468,6 +469,11 @@ been shown in a specific window. | |||
| 468 | This is handy for minibuffer-only frames, and is also used for the feature | 469 | This is handy for minibuffer-only frames, and is also used for the feature |
| 469 | where mouse-1 pops up *Messages*"', which can now easily be changed. | 470 | where mouse-1 pops up *Messages*"', which can now easily be changed. |
| 470 | 471 | ||
| 472 | --- | ||
| 473 | ** Minibuffers set `truncate-lines' to nil. | ||
| 474 | If you want to change the value to something else, you could use | ||
| 475 | for example minibuffer-setup-hook. | ||
| 476 | |||
| 471 | 477 | ||
| 472 | * Editing Changes in Emacs 24.1 | 478 | * Editing Changes in Emacs 24.1 |
| 473 | 479 | ||
| @@ -1030,7 +1036,7 @@ for buffers with dead inferior processes has been generalized. | |||
| 1030 | ** The return value of `backup-buffer' has changed. | 1036 | ** The return value of `backup-buffer' has changed. |
| 1031 | It is now a list of three elements, where the second element is a list | 1037 | It is now a list of three elements, where the second element is a list |
| 1032 | describing the original file's SELinux context. If Emacs or the | 1038 | describing the original file's SELinux context. If Emacs or the |
| 1033 | system lacks SELinux cupport, the context list is (nil nil nil nil). | 1039 | system lacks SELinux support, the context list is (nil nil nil nil). |
| 1034 | See the "Basic SELinux support" entry under "Changes in Emacs 24.1", | 1040 | See the "Basic SELinux support" entry under "Changes in Emacs 24.1", |
| 1035 | above. | 1041 | above. |
| 1036 | 1042 | ||
| @@ -1370,7 +1376,7 @@ This can be useful when `inhibit-quit' is set. | |||
| 1370 | 1376 | ||
| 1371 | +++ | 1377 | +++ |
| 1372 | ** 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 |
| 1373 | named Emacs server instances, using TCP sockets. | 1379 | named Emacs server instances. |
| 1374 | 1380 | ||
| 1375 | +++ | 1381 | +++ |
| 1376 | ** `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/etc/PROBLEMS b/etc/PROBLEMS index 75627f084cd..ae3f49868b2 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS | |||
| @@ -302,6 +302,12 @@ Help mode due to setting `temp-buffer-show-hook' rather than using | |||
| 302 | 302 | ||
| 303 | ** Keyboard problems | 303 | ** Keyboard problems |
| 304 | 304 | ||
| 305 | *** Unable to enter the M-| key on some German keyboards. | ||
| 306 | Some users have reported that M-| suffers from "keyboard ghosting". | ||
| 307 | This can't be fixed by Emacs, as the keypress never gets passed to it | ||
| 308 | at all (as can be verified using "xev"). You can work around this by | ||
| 309 | typing `ESC |' instead. | ||
| 310 | |||
| 305 | *** "Compose Character" key does strange things when used as a Meta key. | 311 | *** "Compose Character" key does strange things when used as a Meta key. |
| 306 | 312 | ||
| 307 | If you define one key to serve as both Meta and Compose Character, you | 313 | If you define one key to serve as both Meta and Compose Character, you |
diff --git a/leim/ChangeLog b/leim/ChangeLog index a0ea53468e3..e5900eb7410 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog | |||
| @@ -1,7 +1,16 @@ | |||
| 1 | 2012-03-16 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * quail/indian.el (telugu-inscript): Fix typo. (Bug#10936) | ||
| 4 | |||
| 5 | 2012-03-13 Йордан Миладинов <jordanmiladinov@gmail.com> (tiny change) | ||
| 6 | |||
| 7 | * quail/cyrillic.el (bulgarian-alt-phonetic): | ||
| 8 | New input method. (Bug#10893) | ||
| 9 | |||
| 1 | 2012-03-09 Mohsen BANAN <libre@mohsen.1.banan.byname.net> | 10 | 2012-03-09 Mohsen BANAN <libre@mohsen.1.banan.byname.net> |
| 2 | 11 | ||
| 3 | * quail/persian.el: Update which includes: (1) full compliance to | 12 | * quail/persian.el: Update which includes: (1) full compliance to |
| 4 | ISIRI-6219, forbiden characters were eliminated and missing | 13 | ISIRI-6219, forbidden characters were eliminated and missing |
| 5 | characters were added; (2) layer 3 of ISIRI-9147 is now | 14 | characters were added; (2) layer 3 of ISIRI-9147 is now |
| 6 | implemented with a '\' prefix; (3) double entry of characters | 15 | implemented with a '\' prefix; (3) double entry of characters |
| 7 | which were postfixed with 'h' is now supported; (4) lots of | 16 | which were postfixed with 'h' is now supported; (4) lots of |
diff --git a/leim/quail/cyrillic.el b/leim/quail/cyrillic.el index 0c2f64e3d69..0e5fb0cdb83 100644 --- a/leim/quail/cyrillic.el +++ b/leim/quail/cyrillic.el | |||
| @@ -1236,6 +1236,79 @@ Unicode based." | |||
| 1236 | ("." ?$,1(n(B) | 1236 | ("." ?$,1(n(B) |
| 1237 | ("/" ?.)) | 1237 | ("/" ?.)) |
| 1238 | 1238 | ||
| 1239 | (quail-define-package | ||
| 1240 | "bulgarian-alt-phonetic" "Bulgarian" "$,1(1(=(D(B" | ||
| 1241 | nil | ||
| 1242 | "Bulgarian alternative Phonetic keyboard layout, producing Unicode. | ||
| 1243 | |||
| 1244 | This phonetic layout replaces all the Latin letters with Bulgarian | ||
| 1245 | \(Cyrillic\) letters based on similarities in their pronunciation or look. | ||
| 1246 | |||
| 1247 | Note that, since the letters ',Li(B', ',Ll(B', ',Ln(B' and ',Lo(B' are attached to the | ||
| 1248 | ']', '\', '`' and '[' keys respectively, Caps Lock does not affect them." | ||
| 1249 | nil t t t t nil nil nil nil nil t) | ||
| 1250 | |||
| 1251 | ;; $,1(N(B 1! 2@ 3$,1uV(B 4$ 5% 6$,1tL(B 7,A'(B 8* 9( 0) -$,1rs(B =+ $,1(l(}(B | ||
| 1252 | ;; $,1(G(B $,1(H(B $,1(5(B $,1(@(B $,1(B(B $,1(J(B $,1(C(B $,1(8(B $,1(>(B $,1(?(B $,1(O(B $,1(I(B | ||
| 1253 | ;; ,L0(B $,1(A(B $,1(4(B $,1(D(B $,1(3(B $,1(E(B $,1(9(B $,1(:(B $,1(;(B :; '" | ||
| 1254 | ;; $,1(7(B $,1(6(B $,1(F(B $,1(2(B $,1(1(B $,1(=(B $,1(<(B ,$,1r~(B .$,1r|(B /? | ||
| 1255 | |||
| 1256 | (quail-define-rules | ||
| 1257 | ("#" ?,Lp(B) | ||
| 1258 | ("&" ?,A'(B) | ||
| 1259 | ("/#" ?#) | ||
| 1260 | ("/&" ?&) | ||
| 1261 | ("/<" ?<) | ||
| 1262 | ("/>" ?>) | ||
| 1263 | ("/[" ?\[) | ||
| 1264 | ("/\\" ?\\) | ||
| 1265 | ("/]" ?\]) | ||
| 1266 | ("/^" ?^) | ||
| 1267 | ("/_" ?_) | ||
| 1268 | ("/`" ?`) | ||
| 1269 | ("/{" ?{) | ||
| 1270 | ("/|" ?|) | ||
| 1271 | ("/}" ?}) | ||
| 1272 | ("/~" ?~) | ||
| 1273 | ("<" ?$,1r~(B) | ||
| 1274 | (">" ?$,1r|(B) | ||
| 1275 | ("A" ?$,1(0(B) ("a" ?$,1(P(B) | ||
| 1276 | ("B" ?$,1(1(B) ("b" ?$,1(Q(B) | ||
| 1277 | ("C" ?$,1(F(B) ("c" ?$,1(f(B) | ||
| 1278 | ("D" ?$,1(4(B) ("d" ?$,1(T(B) | ||
| 1279 | ("E" ?$,1(5(B) ("e" ?$,1(U(B) | ||
| 1280 | ("F" ?$,1(D(B) ("f" ?$,1(d(B) | ||
| 1281 | ("G" ?$,1(3(B) ("g" ?$,1(S(B) | ||
| 1282 | ("H" ?$,1(E(B) ("h" ?$,1(e(B) | ||
| 1283 | ("I" ?$,1(8(B) ("i" ?$,1(X(B) | ||
| 1284 | ("J" ?$,1(9(B) ("j" ?$,1(Y(B) | ||
| 1285 | ("K" ?$,1(:(B) ("k" ?$,1(Z(B) | ||
| 1286 | ("L" ?$,1(;(B) ("l" ?$,1([(B) | ||
| 1287 | ("M" ?$,1(<(B) ("m" ?$,1(\(B) | ||
| 1288 | ("N" ?$,1(=(B) ("n" ?$,1(](B) | ||
| 1289 | ("O" ?$,1(>(B) ("o" ?$,1(^(B) | ||
| 1290 | ("P" ?$,1(?(B) ("p" ?$,1(_(B) | ||
| 1291 | ("Q" ?$,1(G(B) ("q" ?$,1(g(B) | ||
| 1292 | ("R" ?$,1(@(B) ("r" ?$,1(`(B) | ||
| 1293 | ("S" ?$,1(A(B) ("s" ?$,1(a(B) | ||
| 1294 | ("T" ?$,1(B(B) ("t" ?$,1(b(B) | ||
| 1295 | ("U" ?$,1(C(B) ("u" ?$,1(c(B) | ||
| 1296 | ("V" ?$,1(2(B) ("v" ?$,1(R(B) | ||
| 1297 | ("W" ?$,1(H(B) ("w" ?$,1(h(B) | ||
| 1298 | ("X" ?$,1(6(B) ("x" ?$,1(V(B) | ||
| 1299 | ("Y" ?$,1(J(B) ("y" ?$,1(j(B) | ||
| 1300 | ("Z" ?$,1(7(B) ("z" ?$,1(W(B) | ||
| 1301 | ("[" ?$,1(o(B) | ||
| 1302 | ("\\" ?$,1(l(B) | ||
| 1303 | ("]" ?$,1(i(B) | ||
| 1304 | ("^" ?$,1tL(B) | ||
| 1305 | ("_" ?$,1rs(B) | ||
| 1306 | ("`" ?$,1(n(B) | ||
| 1307 | ("{" ?$,1(O(B) | ||
| 1308 | ("|" ?$,1(}(B) | ||
| 1309 | ("}" ?$,1(I(B) | ||
| 1310 | ("~" ?$,1(N(B)) | ||
| 1311 | |||
| 1239 | ;; From `Bulgarian-PHO.kmap for Yudit', Alexander Shopov | 1312 | ;; From `Bulgarian-PHO.kmap for Yudit', Alexander Shopov |
| 1240 | ;; <al_shopov@web.bg>. | 1313 | ;; <al_shopov@web.bg>. |
| 1241 | 1314 | ||
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/leim/quail/persian.el b/leim/quail/persian.el index 8da42b75f31..70e2d380329 100644 --- a/leim/quail/persian.el +++ b/leim/quail/persian.el | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | ;; - (farsi-isiri-9149) Persian Keyboard based on Islamic Republic of Iran's ISIR-9147 | 34 | ;; - (farsi-isiri-9149) Persian Keyboard based on Islamic Republic of Iran's ISIR-9147 |
| 35 | ;; - (farsi-transliterate-banan) An intuitive transliteration keyboard for Farsi | 35 | ;; - (farsi-transliterate-banan) An intuitive transliteration keyboard for Farsi |
| 36 | ;; | 36 | ;; |
| 37 | ;; Additional documentaion for these inpput methods can be found at: | 37 | ;; Additional documentation for these input methods can be found at: |
| 38 | ;; http://www.persoarabic.org/PLPC/120036 | 38 | ;; http://www.persoarabic.org/PLPC/120036 |
| 39 | ;; | 39 | ;; |
| 40 | 40 | ||
| @@ -279,7 +279,7 @@ Based on ISIRI-9147 Layout of Persian Letters and Symbols on Computer Keyboards. | |||
| 279 | ;; ISIRI-9147 Persian keyboard is generally not well suited for Iranian-Expatriates | 279 | ;; ISIRI-9147 Persian keyboard is generally not well suited for Iranian-Expatriates |
| 280 | ;; working/living in the West. | 280 | ;; working/living in the West. |
| 281 | ;; | 281 | ;; |
| 282 | ;; The qwetry keyboard is usually second nature to Persian speaking expatriates and they | 282 | ;; The qwerty keyboard is usually second nature to Persian speaking expatriates and they |
| 283 | ;; don't want to learn/adapt to ISIRI-9147. They expect software to adapt to them. | 283 | ;; don't want to learn/adapt to ISIRI-9147. They expect software to adapt to them. |
| 284 | ;; | 284 | ;; |
| 285 | ;; That is what the ``Banan Multi-Character (Reverse) Transliteration Persian Input Method'' does. | 285 | ;; That is what the ``Banan Multi-Character (Reverse) Transliteration Persian Input Method'' does. |
| @@ -289,21 +289,21 @@ Based on ISIRI-9147 Layout of Persian Letters and Symbols on Computer Keyboards. | |||
| 289 | ;; - can write in farsi (not just speak it). | 289 | ;; - can write in farsi (not just speak it). |
| 290 | ;; - is fully comfortable with a qwerty latin keyboard. | 290 | ;; - is fully comfortable with a qwerty latin keyboard. |
| 291 | ;; - is not familiar with isir-9147 and does not wish to be trained. | 291 | ;; - is not familiar with isir-9147 and does not wish to be trained. |
| 292 | ;; - communicatates and writes in a mixed globish/persian -- not pure persian. | 292 | ;; - communicates and writes in a mixed globish/persian -- not pure persian. |
| 293 | ;; - is intuitively familiar with transliteration of farsi/persian into latin based on two letter | 293 | ;; - is intuitively familiar with transliteration of farsi/persian into latin based on two letter |
| 294 | ;; phonetic mapping to persian characters (e.g., gh ق -- kh خ -- sh ش -- ch چ -- zh ژ. | 294 | ;; phonetic mapping to persian characters (e.g., gh ق -- kh خ -- sh ش -- ch چ -- zh ژ. |
| 295 | ;; | 295 | ;; |
| 296 | ;; This transliteration keyboard is designed to be intuitive such that | 296 | ;; This transliteration keyboard is designed to be intuitive such that |
| 297 | ;; mapping are easy and natural to remember for a persian writer. | 297 | ;; mapping are easy and natural to remember for a persian writer. |
| 298 | ;; It is designed to be equivalent in capability to farsi-isiri-9147 | 298 | ;; It is designed to be equivalent in capability to farsi-isiri-9147 |
| 299 | ;; and provide for inputing all characters enumerated in ISIRI-6219. | 299 | ;; and provide for inputting all characters enumerated in ISIRI-6219. |
| 300 | ;; | 300 | ;; |
| 301 | ;; farsi-transliterate-banan is of course phonetic oriented. But it is very different from | 301 | ;; farsi-transliterate-banan is of course phonetic oriented. But it is very different from |
| 302 | ;; pinglish. Pinglish is word oriented where you sound out the word with latin letters -- | 302 | ;; pinglish. Pinglish is word oriented where you sound out the word with latin letters -- |
| 303 | ;; incuding the vowels. farsi-transliterate-banan is letter oriented where you enter the | 303 | ;; including the vowels. farsi-transliterate-banan is letter oriented where you enter the |
| 304 | ;; latin letter/letters closest to the persian letter. And usually omit vowels. | 304 | ;; latin letter/letters closest to the persian letter. And usually omit vowels. |
| 305 | ;; | 305 | ;; |
| 306 | ;; For some persian characters there are multiple ways of inputing | 306 | ;; For some persian characters there are multiple ways of inputting |
| 307 | ;; the same character. For example both ``i'' and ``y'' produce ی. | 307 | ;; the same character. For example both ``i'' and ``y'' produce ی. |
| 308 | ;; For یک ``yk'', ``y'' is more natural and for این ``ain'', ``i'' is more natural. | 308 | ;; For یک ``yk'', ``y'' is more natural and for این ``ain'', ``i'' is more natural. |
| 309 | ;; | 309 | ;; |
| @@ -317,7 +317,7 @@ Based on ISIRI-9147 Layout of Persian Letters and Symbols on Computer Keyboards. | |||
| 317 | ;; | 317 | ;; |
| 318 | ;; | 318 | ;; |
| 319 | ;; Prefix letter \ is used for two character inputs when an alternate form of a letter | 319 | ;; Prefix letter \ is used for two character inputs when an alternate form of a letter |
| 320 | ;; is desired for exampe \% is: ÷ when % is: ٪. | 320 | ;; is desired for example \% is: ÷ when % is: ٪. |
| 321 | ;; | 321 | ;; |
| 322 | ;; Prefix letter & is used for multi-character inputs when special characters are | 322 | ;; Prefix letter & is used for multi-character inputs when special characters are |
| 323 | ;; desired based on their abbreviate name. For example you can enter ‎ to enter the | 323 | ;; desired based on their abbreviate name. For example you can enter ‎ to enter the |
| @@ -485,7 +485,7 @@ Based on ISIRI-9147 Layout of Persian Letters and Symbols on Computer Keyboards. | |||
| 485 | ("$" ?\u0670) ;; (ucs-insert #x0670)ٰ named: الفِ مقصورهی فارسی | 485 | ("$" ?\u0670) ;; (ucs-insert #x0670)ٰ named: الفِ مقصورهی فارسی |
| 486 | 486 | ||
| 487 | 487 | ||
| 488 | ;;;;;;;;;;; isiri-6219 Table 8 - Forbiden Characters -- جدول ۸ - نویسههایِ ممنوع | 488 | ;;;;;;;;;;; isiri-6219 Table 8 - Forbidden Characters -- جدول ۸ - نویسههایِ ممنوع |
| 489 | ;; ;; he ye (ucs-insert 1728) kills emacs-24.0.90 | 489 | ;; ;; he ye (ucs-insert 1728) kills emacs-24.0.90 |
| 490 | ;; arabic digits 0-9 | 490 | ;; arabic digits 0-9 |
| 491 | 491 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f9e7eac9123..a6f5a5fd525 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,159 @@ | |||
| 1 | 2012-03-18 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * faces.el (face-spec-reset-face): Don't call display-graphic-p if | ||
| 4 | it is not yet defined (for temacs). | ||
| 5 | |||
| 6 | 2012-03-18 Leo Liu <sdl.web@gmail.com> | ||
| 7 | |||
| 8 | * net/rcirc.el (rcirc-cmd-quit): Allow quiting all servers with | ||
| 9 | prefix. | ||
| 10 | |||
| 11 | 2012-03-17 Eli Zaretskii <eliz@gnu.org> | ||
| 12 | |||
| 13 | * textmodes/ispell.el (ispell-skip-tib, ispell-keep-choices-win) | ||
| 14 | (ispell-choices-win-default-height, ispell-silently-savep) | ||
| 15 | (ispell-dictionary-alist, ispell-encoding8-command) | ||
| 16 | (ispell-check-version, ispell-aspell-find-dictionary) | ||
| 17 | (ispell-valid-dictionary-list, ispell-words-keyword) | ||
| 18 | (ispell-get-word, ispell-internal-change-dictionary) | ||
| 19 | (ispell-region, ispell-skip-region-list) | ||
| 20 | (ispell-begin-skip-region-regexp, ispell-ignore-fcc) | ||
| 21 | (ispell-process-line, ispell-minor-mode, ispell-minor-check) | ||
| 22 | (ispell-message-text-end, ispell-message) | ||
| 23 | (ispell-buffer-local-parsing): Doc fix. | ||
| 24 | |||
| 25 | 2012-03-13 Jambunathan K <kjambunathan@gmail.com> | ||
| 26 | |||
| 27 | * htmlfontify.el: Add support for code block fontification for ODT | ||
| 28 | export (Bug #9914). | ||
| 29 | (hfy-optimisations): Define new option | ||
| 30 | `body-text-only' | ||
| 31 | (hfy-fontify-buffer): Honor above setting. | ||
| 32 | (hfy-begin-span, hfy-end-span): New routines factored out form | ||
| 33 | `hfy-fontify-buffer'. | ||
| 34 | (hfy-begin-span-handler, hfy-end-span-handler): New variables | ||
| 35 | that permit insertion of custom tags. | ||
| 36 | (hfy-fontify-buffer): Use above handlers. | ||
| 37 | (hfy-face-to-css-default): Same as the earlier `hfy-face-to-css'. | ||
| 38 | (hfy-face-to-css): Re-defined to be a variable. | ||
| 39 | (hfy-compile-stylesheet): Modified. Allow stylesheet to be built | ||
| 40 | over multiple runs. This is made possible by having the caller let | ||
| 41 | bind a special variable `hfy-user-sheet-assoc'. | ||
| 42 | (htmlfontify-string): New defun. | ||
| 43 | (hfy-compile-face-map): Make sure that the last char in the | ||
| 44 | buffer is correctly fontified. | ||
| 45 | (hfy-face-resolve-face): Whitespace only change. | ||
| 46 | |||
| 47 | 2012-03-17 Eli Zaretskii <eliz@gnu.org> | ||
| 48 | |||
| 49 | * textmodes/ispell.el (ispell-get-decoded-string): Make the error | ||
| 50 | message more clear. | ||
| 51 | |||
| 52 | 2012-03-16 Leo Liu <sdl.web@gmail.com> | ||
| 53 | |||
| 54 | * emacs-lisp/copyright.el (copyright-year-ranges): Fix typo. | ||
| 55 | |||
| 56 | 2012-03-16 Alan Mackenzie <acm@muc.de> | ||
| 57 | |||
| 58 | Further optimise the handling of large macros. | ||
| 59 | |||
| 60 | * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Use a | ||
| 61 | limit to a call of `c-literal-limits'. | ||
| 62 | (c-determine-+ve-limit): New function. | ||
| 63 | (c-at-macro-vsemi-p): Move `c-in-literal' to the bottom of an | ||
| 64 | `and'. | ||
| 65 | (c-guess-basic-syntax): In macros, restrict a search limit to | ||
| 66 | 2000. | ||
| 67 | In CASE 5B, restrict a search limit to 500. | ||
| 68 | (c-just-after-func-arglist-p): Obviouly wrong `or' -> `and'. | ||
| 69 | |||
| 70 | * progmodes/cc-mode.el (c-neutralize-syntax-in-and-mark-CPP): | ||
| 71 | Restrict macro bounds to +-500 from after-change's BEG END. | ||
| 72 | |||
| 73 | 2012-03-16 Leo Liu <sdl.web@gmail.com> | ||
| 74 | |||
| 75 | * font-lock.el (lisp-font-lock-keywords-2): Add letrec. | ||
| 76 | |||
| 77 | 2012-03-16 Aaron S. Hawley <Aaron.S.Hawley@gmail.com> | ||
| 78 | |||
| 79 | * tar-mode.el (tar-mode): Fix saving by conditionally undoing | ||
| 80 | `special-mode' setting of `buffer-read-only'. (Bug#11010) | ||
| 81 | |||
| 82 | 2012-03-16 Glenn Morris <rgm@gnu.org> | ||
| 83 | |||
| 84 | * view.el (view-buffer, view-buffer-other-window) | ||
| 85 | (view-buffer-other-frame): Doc fixes re special mode-class. | ||
| 86 | |||
| 87 | * subr.el (eval-after-load): If named feature is provided not from | ||
| 88 | a file, run after-load forms. (Bug#10946) | ||
| 89 | |||
| 90 | * calendar/calendar.el (calendar-insert-at-column): | ||
| 91 | Handle non-unit-width characters a bit better. (Bug#10978) | ||
| 92 | |||
| 93 | 2012-03-15 Chong Yidong <cyd@gnu.org> | ||
| 94 | |||
| 95 | * emacs-lisp/ring.el (ring-extend): New function. | ||
| 96 | (ring-insert+extend): Extend the ring correctly (Bug#11019). | ||
| 97 | |||
| 98 | * comint.el (comint-read-input-ring) | ||
| 99 | (comint-add-to-input-history): Grow comint-input-ring lazily. | ||
| 100 | |||
| 101 | 2012-03-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 102 | |||
| 103 | * progmodes/perl-mode.el (perl-syntax-propertize-special-constructs): | ||
| 104 | Fix up parsing of multiline twoarg non-paired elements (bug#11014). | ||
| 105 | |||
| 106 | * imenu.el: Fix multiple inheritance breakage (bug#9199). | ||
| 107 | (imenu-add-to-menubar): Don't add a redundant index. | ||
| 108 | (imenu-update-menubar): Handle a dynamically composed keymap. | ||
| 109 | |||
| 110 | 2012-03-13 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 111 | |||
| 112 | * mail/sendmail.el (mail-encode-header): | ||
| 113 | Bind rfc2047-encode-encoded-words to nil. | ||
| 114 | |||
| 115 | 2012-03-13 Glenn Morris <rgm@gnu.org> | ||
| 116 | |||
| 117 | * calendar/calendar.el (calendar-string-spread): | ||
| 118 | Handle non-unit-width characters a bit better. (Bug#10978) | ||
| 119 | |||
| 120 | 2012-03-13 Leo Liu <sdl.web@gmail.com> | ||
| 121 | |||
| 122 | * vc/vc-hg.el (vc-hg-working-revision): Rework to work with both | ||
| 123 | directory and file as argument (Bug#10822). | ||
| 124 | |||
| 125 | 2012-03-13 Kaushik Srenevasan <ksrenevasan@gmail.com> (tiny change) | ||
| 126 | |||
| 127 | * progmodes/gdb-mi.el (gdb-invalidate-disassembly): | ||
| 128 | For dynamically generated code, follow $PC. | ||
| 129 | (gdb-disassembly-handler-custom): Handle no function name case. | ||
| 130 | |||
| 131 | 2012-03-13 Tim Landscheidt <tim@tim-landscheidt.de> (tiny change) | ||
| 132 | |||
| 133 | * calendar/icalendar.el (icalendar-export-file, icalendar-import-file): | ||
| 134 | * emulation/ws-mode.el (ws-query-replace): | ||
| 135 | * sort.el (sort-regexp-fields): | ||
| 136 | Fix missing trailing whitespace in interactive prompts. (Bug#11002) | ||
| 137 | |||
| 138 | 2012-03-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 139 | |||
| 140 | * dabbrev.el: Fix cycle completion order (bug#10963). | ||
| 141 | (dabbrev--last-obarray, dabbrev--last-completion-buffer): Remove. | ||
| 142 | (dabbrev-completion): Don't use an obarray; provide | ||
| 143 | a cycle-sort-function. | ||
| 144 | |||
| 145 | 2012-03-12 Leo Liu <sdl.web@gmail.com> | ||
| 146 | |||
| 147 | * simple.el (kill-new): Use equal-including-properties for | ||
| 148 | comparison. | ||
| 149 | (kill-do-not-save-duplicates): Doc fix. | ||
| 150 | |||
| 151 | 2012-03-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 152 | |||
| 153 | * dabbrev.el: Fix cycle completion (bug#10963). | ||
| 154 | Use lexical binding and wrap to 80 columns. | ||
| 155 | (dabbrev-completion): Delay computing the list of completions. | ||
| 156 | |||
| 1 | 2012-03-12 Kenichi Handa <handa@m17n.org> | 157 | 2012-03-12 Kenichi Handa <handa@m17n.org> |
| 2 | 158 | ||
| 3 | * international/quail.el (quail-insert-kbd-layout): Surround each | 159 | * international/quail.el (quail-insert-kbd-layout): Surround each |
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. |
| 1425 | Inserts STRING so that it ends at INDENT. STRING is either a | 1425 | Inserts STRING so that it ends at INDENT. STRING is either a |
| 1426 | literal string, or a sexp to evaluate to return such. Truncates | 1426 | literal string, or a sexp to evaluate to return such. Truncates |
| 1427 | STRING to length TRUNCATE, ensure a trailing space." | 1427 | STRING 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/calendar/icalendar.el b/lisp/calendar/icalendar.el index 83bda94fefe..f1549ec20b1 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el | |||
| @@ -915,7 +915,7 @@ would be \"pm\"." | |||
| 915 | "Export diary file to iCalendar format. | 915 | "Export diary file to iCalendar format. |
| 916 | All diary entries in the file DIARY-FILENAME are converted to iCalendar | 916 | All diary entries in the file DIARY-FILENAME are converted to iCalendar |
| 917 | format. The result is appended to the file ICAL-FILENAME." | 917 | format. The result is appended to the file ICAL-FILENAME." |
| 918 | (interactive "FExport diary data from file: | 918 | (interactive "FExport diary data from file: \n\ |
| 919 | Finto iCalendar file: ") | 919 | Finto iCalendar file: ") |
| 920 | (save-current-buffer | 920 | (save-current-buffer |
| 921 | (set-buffer (find-file diary-filename)) | 921 | (set-buffer (find-file diary-filename)) |
| @@ -1794,7 +1794,7 @@ Argument ICAL-FILENAME output iCalendar file. | |||
| 1794 | Argument DIARY-FILENAME input `diary-file'. | 1794 | Argument DIARY-FILENAME input `diary-file'. |
| 1795 | Optional argument NON-MARKING determines whether events are created as | 1795 | Optional argument NON-MARKING determines whether events are created as |
| 1796 | non-marking or not." | 1796 | non-marking or not." |
| 1797 | (interactive "fImport iCalendar data from file: | 1797 | (interactive "fImport iCalendar data from file: \n\ |
| 1798 | Finto diary file: | 1798 | Finto diary file: |
| 1799 | p") | 1799 | p") |
| 1800 | ;; clean up the diary file | 1800 | ;; clean up the diary file |
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index ec7fdcecca0..f185c457ee2 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-03-12 David Engster <deng@randomsample.de> | ||
| 2 | |||
| 3 | * semantic/db-find.el | ||
| 4 | (semanticdb-find-translate-path-brutish-default): If we don't yet | ||
| 5 | have a proper table for PATH, use `semanticdb-current-database' | ||
| 6 | instead (bug #10343). | ||
| 7 | |||
| 1 | 2012-03-11 David Engster <deng@randomsample.de> | 8 | 2012-03-11 David Engster <deng@randomsample.de> |
| 2 | 9 | ||
| 3 | * semantic/wisent/javascript.el (js-mode): Define `js-mode' as | 10 | * semantic/wisent/javascript.el (js-mode): Define `js-mode' as |
diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el index ca6a8fbf5ca..15ef3b09238 100644 --- a/lisp/cedet/semantic/db-find.el +++ b/lisp/cedet/semantic/db-find.el | |||
| @@ -325,8 +325,10 @@ Default action as described in `semanticdb-find-translate-path'." | |||
| 325 | (cond ((null path) semanticdb-current-database) | 325 | (cond ((null path) semanticdb-current-database) |
| 326 | ((semanticdb-table-p path) (oref path parent-db)) | 326 | ((semanticdb-table-p path) (oref path parent-db)) |
| 327 | (t (let ((tt (semantic-something-to-tag-table path))) | 327 | (t (let ((tt (semantic-something-to-tag-table path))) |
| 328 | ;; @todo - What does this DO ??!?! | 328 | (if tt |
| 329 | (with-current-buffer (semantic-tag-buffer (car tt)) | 329 | ;; @todo - What does this DO ??!?! |
| 330 | (with-current-buffer (semantic-tag-buffer (car tt)) | ||
| 331 | semanticdb-current-database) | ||
| 330 | semanticdb-current-database)))))) | 332 | semanticdb-current-database)))))) |
| 331 | (apply | 333 | (apply |
| 332 | #'nconc | 334 | #'nconc |
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. |
| 1693 | Ignore duplicates if `comint-input-ignoredups' is non-nil." | 1699 | Ignore 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/dabbrev.el b/lisp/dabbrev.el index aad3c83c32b..c5b370bfa61 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; dabbrev.el --- dynamic abbreviation package | 1 | ;;; dabbrev.el --- dynamic abbreviation package -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985-1986, 1992, 1994, 1996-1997, 2000-2012 | 3 | ;; Copyright (C) 1985-1986, 1992, 1994, 1996-1997, 2000-2012 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| @@ -291,9 +291,6 @@ this list." | |||
| 291 | ;; Internal variables | 291 | ;; Internal variables |
| 292 | ;;---------------------------------------------------------------- | 292 | ;;---------------------------------------------------------------- |
| 293 | 293 | ||
| 294 | ;; Last obarray of completions in `dabbrev-completion' | ||
| 295 | (defvar dabbrev--last-obarray nil) | ||
| 296 | |||
| 297 | ;; Table of expansions seen so far | 294 | ;; Table of expansions seen so far |
| 298 | (defvar dabbrev--last-table nil) | 295 | (defvar dabbrev--last-table nil) |
| 299 | 296 | ||
| @@ -321,9 +318,6 @@ this list." | |||
| 321 | ;; The buffer we found the expansion last time. | 318 | ;; The buffer we found the expansion last time. |
| 322 | (defvar dabbrev--last-buffer-found nil) | 319 | (defvar dabbrev--last-buffer-found nil) |
| 323 | 320 | ||
| 324 | ;; The buffer we last did a completion in. | ||
| 325 | (defvar dabbrev--last-completion-buffer nil) | ||
| 326 | |||
| 327 | ;; If non-nil, a function to use when copying successive words. | 321 | ;; If non-nil, a function to use when copying successive words. |
| 328 | ;; It should be `upcase' or `downcase'. | 322 | ;; It should be `upcase' or `downcase'. |
| 329 | (defvar dabbrev--last-case-pattern nil) | 323 | (defvar dabbrev--last-case-pattern nil) |
| @@ -387,49 +381,46 @@ then it searches *all* buffers." | |||
| 387 | (abbrev (dabbrev--abbrev-at-point)) | 381 | (abbrev (dabbrev--abbrev-at-point)) |
| 388 | (beg (progn (search-backward abbrev) (point))) | 382 | (beg (progn (search-backward abbrev) (point))) |
| 389 | (end (progn (search-forward abbrev) (point))) | 383 | (end (progn (search-forward abbrev) (point))) |
| 390 | (ignore-case-p (and (if (eq dabbrev-case-fold-search 'case-fold-search) | 384 | (ignore-case-p |
| 391 | case-fold-search | 385 | (and (if (eq dabbrev-case-fold-search 'case-fold-search) |
| 392 | dabbrev-case-fold-search) | 386 | case-fold-search |
| 393 | (or (not dabbrev-upcase-means-case-search) | 387 | dabbrev-case-fold-search) |
| 394 | (string= abbrev (downcase abbrev))))) | 388 | (or (not dabbrev-upcase-means-case-search) |
| 395 | (my-obarray dabbrev--last-obarray)) | 389 | (string= abbrev (downcase abbrev))))) |
| 396 | (save-excursion | 390 | (list 'uninitialized) |
| 397 | ;;-------------------------------- | 391 | (table |
| 398 | ;; New abbreviation to expand. | 392 | (lambda (s p a) |
| 399 | ;;-------------------------------- | 393 | (if (eq a 'metadata) |
| 400 | (setq dabbrev--last-abbreviation abbrev) | 394 | `(metadata (cycle-sort-function . ,#'identity) |
| 401 | ;; Find all expansion | 395 | (category . dabbrev)) |
| 402 | (let ((completion-list | 396 | (when (eq list 'uninitialized) |
| 403 | (dabbrev--find-all-expansions abbrev ignore-case-p)) | 397 | (save-excursion |
| 404 | (completion-ignore-case ignore-case-p)) | 398 | ;;-------------------------------- |
| 405 | ;; Make an obarray with all expansions | 399 | ;; New abbreviation to expand. |
| 406 | (setq my-obarray (make-vector (length completion-list) 0)) | 400 | ;;-------------------------------- |
| 407 | (or (> (length my-obarray) 0) | 401 | (setq dabbrev--last-abbreviation abbrev) |
| 408 | (error "No dynamic expansion for \"%s\" found%s" | 402 | ;; Find all expansion |
| 409 | abbrev | 403 | (let ((completion-list |
| 410 | (if dabbrev--check-other-buffers "" " in this-buffer"))) | 404 | (dabbrev--find-all-expansions abbrev ignore-case-p)) |
| 411 | (cond | 405 | (completion-ignore-case ignore-case-p)) |
| 412 | ((or (not ignore-case-p) | 406 | (or (consp completion-list) |
| 413 | (not dabbrev-case-replace)) | 407 | (error "No dynamic expansion for \"%s\" found%s" |
| 414 | (mapc (function (lambda (string) | 408 | abbrev |
| 415 | (intern string my-obarray))) | 409 | (if dabbrev--check-other-buffers |
| 416 | completion-list)) | 410 | "" " in this-buffer"))) |
| 417 | ((string= abbrev (upcase abbrev)) | 411 | (setq list |
| 418 | (mapc (function (lambda (string) | 412 | (cond |
| 419 | (intern (upcase string) my-obarray))) | 413 | ((not (and ignore-case-p dabbrev-case-replace)) |
| 420 | completion-list)) | 414 | completion-list) |
| 421 | ((string= (substring abbrev 0 1) | 415 | ((string= abbrev (upcase abbrev)) |
| 422 | (upcase (substring abbrev 0 1))) | 416 | (mapcar #'upcase completion-list)) |
| 423 | (mapc (function (lambda (string) | 417 | ((string= (substring abbrev 0 1) |
| 424 | (intern (capitalize string) my-obarray))) | 418 | (upcase (substring abbrev 0 1))) |
| 425 | completion-list)) | 419 | (mapcar #'capitalize completion-list)) |
| 426 | (t | 420 | (t |
| 427 | (mapc (function (lambda (string) | 421 | (mapcar #'downcase completion-list))))))) |
| 428 | (intern (downcase string) my-obarray))) | 422 | (complete-with-action a list s p))))) |
| 429 | completion-list))) | 423 | (completion-in-region beg end table))) |
| 430 | (setq dabbrev--last-obarray my-obarray) | ||
| 431 | (setq dabbrev--last-completion-buffer (current-buffer)))) | ||
| 432 | (completion-in-region beg end my-obarray))) | ||
| 433 | 424 | ||
| 434 | ;;;###autoload | 425 | ;;;###autoload |
| 435 | (defun dabbrev-expand (arg) | 426 | (defun dabbrev-expand (arg) |
| @@ -521,12 +512,13 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]." | |||
| 521 | ;;-------------------------------- | 512 | ;;-------------------------------- |
| 522 | (or expansion | 513 | (or expansion |
| 523 | (setq expansion | 514 | (setq expansion |
| 524 | (dabbrev--find-expansion abbrev direction | 515 | (dabbrev--find-expansion |
| 525 | (and (if (eq dabbrev-case-fold-search 'case-fold-search) | 516 | abbrev direction |
| 526 | case-fold-search | 517 | (and (if (eq dabbrev-case-fold-search 'case-fold-search) |
| 527 | dabbrev-case-fold-search) | 518 | case-fold-search |
| 528 | (or (not dabbrev-upcase-means-case-search) | 519 | dabbrev-case-fold-search) |
| 529 | (string= abbrev (downcase abbrev)))))))) | 520 | (or (not dabbrev-upcase-means-case-search) |
| 521 | (string= abbrev (downcase abbrev)))))))) | ||
| 530 | (cond | 522 | (cond |
| 531 | ((not expansion) | 523 | ((not expansion) |
| 532 | (dabbrev--reset-global-variables) | 524 | (dabbrev--reset-global-variables) |
| @@ -621,8 +613,6 @@ all skip characters." | |||
| 621 | 613 | ||
| 622 | (defun dabbrev--reset-global-variables () | 614 | (defun dabbrev--reset-global-variables () |
| 623 | "Initialize all global variables." | 615 | "Initialize all global variables." |
| 624 | ;; dabbrev--last-obarray and dabbrev--last-completion-buffer | ||
| 625 | ;; must not be reset here. | ||
| 626 | (setq dabbrev--last-table nil | 616 | (setq dabbrev--last-table nil |
| 627 | dabbrev--last-abbreviation nil | 617 | dabbrev--last-abbreviation nil |
| 628 | dabbrev--last-abbrev-location nil | 618 | dabbrev--last-abbrev-location nil |
| @@ -667,13 +657,13 @@ of the expansion in `dabbrev--last-expansion-location'." | |||
| 667 | (let ((case-fold-search ignore-case) | 657 | (let ((case-fold-search ignore-case) |
| 668 | (count n)) | 658 | (count n)) |
| 669 | (while (and (> count 0) | 659 | (while (and (> count 0) |
| 670 | (setq expansion (dabbrev--search abbrev | 660 | (setq expansion (dabbrev--search |
| 671 | reverse | 661 | abbrev reverse |
| 672 | (and ignore-case | 662 | (and ignore-case |
| 673 | (if (eq dabbrev-case-distinction 'case-replace) | 663 | (if (eq dabbrev-case-distinction |
| 674 | case-replace | 664 | 'case-replace) |
| 675 | dabbrev-case-distinction)) | 665 | case-replace |
| 676 | ))) | 666 | dabbrev-case-distinction))))) |
| 677 | (setq count (1- count)))) | 667 | (setq count (1- count)))) |
| 678 | (and expansion | 668 | (and expansion |
| 679 | (setq dabbrev--last-expansion-location (point))) | 669 | (setq dabbrev--last-expansion-location (point))) |
| @@ -829,14 +819,15 @@ EXPANSION is the expansion substring to be used this time. | |||
| 829 | RECORD-CASE-PATTERN, if non-nil, means set `dabbrev--last-case-pattern' | 819 | RECORD-CASE-PATTERN, if non-nil, means set `dabbrev--last-case-pattern' |
| 830 | to record whether we upcased the expansion, downcased it, or did neither." | 820 | to record whether we upcased the expansion, downcased it, or did neither." |
| 831 | ;;(undo-boundary) | 821 | ;;(undo-boundary) |
| 832 | (let ((use-case-replace (and (if (eq dabbrev-case-fold-search 'case-fold-search) | 822 | (let ((use-case-replace |
| 833 | case-fold-search | 823 | (and (if (eq dabbrev-case-fold-search 'case-fold-search) |
| 834 | dabbrev-case-fold-search) | 824 | case-fold-search |
| 835 | (or (not dabbrev-upcase-means-case-search) | 825 | dabbrev-case-fold-search) |
| 836 | (string= abbrev (downcase abbrev))) | 826 | (or (not dabbrev-upcase-means-case-search) |
| 837 | (if (eq dabbrev-case-replace 'case-replace) | 827 | (string= abbrev (downcase abbrev))) |
| 838 | case-replace | 828 | (if (eq dabbrev-case-replace 'case-replace) |
| 839 | dabbrev-case-replace)))) | 829 | case-replace |
| 830 | dabbrev-case-replace)))) | ||
| 840 | 831 | ||
| 841 | ;; If we upcased or downcased the original expansion, | 832 | ;; If we upcased or downcased the original expansion, |
| 842 | ;; do likewise for the subsequent words when we copy them. | 833 | ;; do likewise for the subsequent words when we copy them. |
| @@ -862,12 +853,13 @@ to record whether we upcased the expansion, downcased it, or did neither." | |||
| 862 | (let ((expansion-rest (substring expansion 1)) | 853 | (let ((expansion-rest (substring expansion 1)) |
| 863 | (first-letter-position (string-match "[[:alpha:]]" abbrev))) | 854 | (first-letter-position (string-match "[[:alpha:]]" abbrev))) |
| 864 | (if (or (null first-letter-position) | 855 | (if (or (null first-letter-position) |
| 865 | (and (not (and (or (string= expansion-rest (downcase expansion-rest)) | 856 | (and (not |
| 866 | (string= expansion-rest (upcase expansion-rest))) | 857 | (and (or (string= expansion-rest (downcase expansion-rest)) |
| 867 | (or (string= abbrev (downcase abbrev)) | 858 | (string= expansion-rest (upcase expansion-rest))) |
| 868 | (and (string= abbrev (upcase abbrev)) | 859 | (or (string= abbrev (downcase abbrev)) |
| 869 | (> (- (length abbrev) first-letter-position) | 860 | (and (string= abbrev (upcase abbrev)) |
| 870 | 1))))) | 861 | (> (- (length abbrev) first-letter-position) |
| 862 | 1))))) | ||
| 871 | (string= abbrev | 863 | (string= abbrev |
| 872 | (substring expansion 0 (length abbrev))))) | 864 | (substring expansion 0 (length abbrev))))) |
| 873 | (setq use-case-replace nil))) | 865 | (setq use-case-replace nil))) |
| @@ -951,9 +943,9 @@ Leaves point at the location of the start of the expansion." | |||
| 951 | ;; Limited search. | 943 | ;; Limited search. |
| 952 | (save-restriction | 944 | (save-restriction |
| 953 | (and dabbrev-limit | 945 | (and dabbrev-limit |
| 954 | (narrow-to-region dabbrev--last-expansion-location | 946 | (narrow-to-region |
| 955 | (+ (point) | 947 | dabbrev--last-expansion-location |
| 956 | (if reverse (- dabbrev-limit) dabbrev-limit)))) | 948 | (+ (point) (if reverse (- dabbrev-limit) dabbrev-limit)))) |
| 957 | ;;-------------------------------- | 949 | ;;-------------------------------- |
| 958 | ;; Look for a distinct expansion, using dabbrev--last-table. | 950 | ;; Look for a distinct expansion, using dabbrev--last-table. |
| 959 | ;;-------------------------------- | 951 | ;;-------------------------------- |
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. |
| 86 | For example: 2005, 2006, 2007, 2008 might be replaced with 2005-2008. | 86 | For example: 2005, 2006, 2007, 2008 might be replaced with 2005-2008. |
| 87 | If you use ranges, you should add an explanatory note in a README file. | 87 | If you use ranges, you should add an explanatory note in a README file. |
| 88 | The function `copyright-fix-year' respects this variable." | 88 | The 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. |
| 190 | Insert onto ring RING the item ITEM, as the newest (last) item. | 205 | Insert onto ring RING the item ITEM, as the newest (last) item. |
| 191 | If the ring is full, behavior depends on GROW-P: | 206 | If 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/emulation/ws-mode.el b/lisp/emulation/ws-mode.el index aa8d647ec11..0c7be145751 100644 --- a/lisp/emulation/ws-mode.el +++ b/lisp/emulation/ws-mode.el | |||
| @@ -716,7 +716,7 @@ This will only work for errors raised by WordStar mode functions." | |||
| 716 | 716 | ||
| 717 | (defun ws-query-replace (from to) | 717 | (defun ws-query-replace (from to) |
| 718 | "In WordStar mode: Search string, remember string for repetition." | 718 | "In WordStar mode: Search string, remember string for repetition." |
| 719 | (interactive "sReplace: | 719 | (interactive "sReplace: \n\ |
| 720 | sWith: " ) | 720 | sWith: " ) |
| 721 | (setq ws-search-string from) | 721 | (setq ws-search-string from) |
| 722 | (setq ws-search-direction t) | 722 | (setq ws-search-direction t) |
diff --git a/lisp/faces.el b/lisp/faces.el index 0011e0357a1..34fad66ce27 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1516,12 +1516,15 @@ If SPEC is nil, return nil." | |||
| 1516 | (apply 'set-face-attribute face frame | 1516 | (apply 'set-face-attribute face frame |
| 1517 | (if (eq face 'default) | 1517 | (if (eq face 'default) |
| 1518 | ;; For the default face, avoid making any attribute | 1518 | ;; For the default face, avoid making any attribute |
| 1519 | ;; unspecifed. Instead, set attributes to default values | 1519 | ;; unspecified. Instead, set attributes to default values |
| 1520 | ;; (see also realize_default_face in xfaces.c). | 1520 | ;; (see also realize_default_face in xfaces.c). |
| 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 092f42cd2ed..d0d35407367 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,27 @@ | |||
| 1 | 2012-03-14 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * gnus-sum.el (gnus-update-marks): Don't propagate marks unless | ||
| 4 | requested (bug#10961). | ||
| 5 | |||
| 6 | * shr.el (shr-table-widths): Divide the extra width more fairly over | ||
| 7 | the TDs (bug#10973). | ||
| 8 | (shr-render-td): Don't delete too much padding. | ||
| 9 | (shr-natural-width): Compute the natural width more correctly. | ||
| 10 | (shr-insert): Allow the natural width to be computed for tables again. | ||
| 11 | (shr-tag-table-1): Rework how the natural widths are computed by | ||
| 12 | rendering the table a third time. | ||
| 13 | (shr-natural-width): Removed. | ||
| 14 | (shr-buffer-width): New function. | ||
| 15 | (shr-expand-newlines): Use it. | ||
| 16 | |||
| 17 | * gnus-msg.el (gnus-bug): Don't delete the other windows. We may be | ||
| 18 | using a `gnus-use-full-window' setup (bug#11013). | ||
| 19 | |||
| 20 | 2012-03-12 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 21 | |||
| 22 | * gnus-int.el (gnus-backend-trace): Flip default to nil before Emacs | ||
| 23 | 24.1 release. | ||
| 24 | |||
| 1 | 2012-03-10 David Edmondson <dme@dme.org> | 25 | 2012-03-10 David Edmondson <dme@dme.org> |
| 2 | 26 | ||
| 3 | * mm-uu.el (mm-uu-forward-extract): Allow for blank lines between the | 27 | * mm-uu.el (mm-uu-forward-extract): Allow for blank lines between the |
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index 8dc691ffe42..1190d79f778 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el | |||
| @@ -247,7 +247,7 @@ If it is down, start it up (again)." | |||
| 247 | (eq (nth 1 (assoc method gnus-opened-servers)) | 247 | (eq (nth 1 (assoc method gnus-opened-servers)) |
| 248 | 'denied)) | 248 | 'denied)) |
| 249 | 249 | ||
| 250 | (defvar gnus-backend-trace t) | 250 | (defvar gnus-backend-trace nil) |
| 251 | 251 | ||
| 252 | (defun gnus-open-server (gnus-command-method) | 252 | (defun gnus-open-server (gnus-command-method) |
| 253 | "Open a connection to GNUS-COMMAND-METHOD." | 253 | "Open a connection to GNUS-COMMAND-METHOD." |
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..53c0063de2e 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el | |||
| @@ -341,7 +341,6 @@ the URL of the image to the kill buffer instead." | |||
| 341 | (delete-char -1)) | 341 | (delete-char -1)) |
| 342 | (insert "\n") | 342 | (insert "\n") |
| 343 | (unless found | 343 | (unless found |
| 344 | (put-text-property (1- (point)) (point) 'shr-break t) | ||
| 345 | ;; No space is needed at the beginning of a line. | 344 | ;; No space is needed at the beginning of a line. |
| 346 | (when (eq (following-char) ? ) | 345 | (when (eq (following-char) ? ) |
| 347 | (delete-char 1))) | 346 | (delete-char 1))) |
| @@ -711,7 +710,7 @@ ones, in case fg and bg are nil." | |||
| 711 | (forward-line 1) | 710 | (forward-line 1) |
| 712 | (setq end (point)) | 711 | (setq end (point)) |
| 713 | (narrow-to-region start end) | 712 | (narrow-to-region start end) |
| 714 | (let ((width (shr-natural-width)) | 713 | (let ((width (shr-buffer-width)) |
| 715 | column) | 714 | column) |
| 716 | (goto-char (point-min)) | 715 | (goto-char (point-min)) |
| 717 | (while (not (eobp)) | 716 | (while (not (eobp)) |
| @@ -1048,7 +1047,10 @@ ones, in case fg and bg are nil." | |||
| 1048 | ;; be smaller (if there's little text) or bigger (if there's | 1047 | ;; be smaller (if there's little text) or bigger (if there's |
| 1049 | ;; unbreakable text). | 1048 | ;; unbreakable text). |
| 1050 | (sketch (shr-make-table cont suggested-widths)) | 1049 | (sketch (shr-make-table cont suggested-widths)) |
| 1051 | (sketch-widths (shr-table-widths sketch suggested-widths))) | 1050 | ;; Compute the "natural" width by setting each column to 500 |
| 1051 | ;; characters and see how wide they really render. | ||
| 1052 | (natural (shr-make-table cont (make-vector (length columns) 500))) | ||
| 1053 | (sketch-widths (shr-table-widths sketch natural suggested-widths))) | ||
| 1052 | ;; This probably won't work very well. | 1054 | ;; This probably won't work very well. |
| 1053 | (when (> (+ (loop for width across sketch-widths | 1055 | (when (> (+ (loop for width across sketch-widths |
| 1054 | summing (1+ width)) | 1056 | summing (1+ width)) |
| @@ -1186,31 +1188,35 @@ ones, in case fg and bg are nil." | |||
| 1186 | shr-table-corner)) | 1188 | shr-table-corner)) |
| 1187 | (insert "\n")) | 1189 | (insert "\n")) |
| 1188 | 1190 | ||
| 1189 | (defun shr-table-widths (table suggested-widths) | 1191 | (defun shr-table-widths (table natural-table suggested-widths) |
| 1190 | (let* ((length (length suggested-widths)) | 1192 | (let* ((length (length suggested-widths)) |
| 1191 | (widths (make-vector length 0)) | 1193 | (widths (make-vector length 0)) |
| 1192 | (natural-widths (make-vector length 0))) | 1194 | (natural-widths (make-vector length 0))) |
| 1193 | (dolist (row table) | 1195 | (dolist (row table) |
| 1194 | (let ((i 0)) | 1196 | (let ((i 0)) |
| 1195 | (dolist (column row) | 1197 | (dolist (column row) |
| 1196 | (aset widths i (max (aref widths i) | 1198 | (aset widths i (max (aref widths i) column)) |
| 1197 | (car column))) | 1199 | (setq i (1+ i))))) |
| 1198 | (aset natural-widths i (max (aref natural-widths i) | 1200 | (dolist (row natural-table) |
| 1199 | (cadr column))) | 1201 | (let ((i 0)) |
| 1202 | (dolist (column row) | ||
| 1203 | (aset natural-widths i (max (aref natural-widths i) column)) | ||
| 1200 | (setq i (1+ i))))) | 1204 | (setq i (1+ i))))) |
| 1201 | (let ((extra (- (apply '+ (append suggested-widths nil)) | 1205 | (let ((extra (- (apply '+ (append suggested-widths nil)) |
| 1202 | (apply '+ (append widths nil)))) | 1206 | (apply '+ (append widths nil)))) |
| 1203 | (expanded-columns 0)) | 1207 | (expanded-columns 0)) |
| 1208 | ;; We have extra, unused space, so divide this space amongst the | ||
| 1209 | ;; columns. | ||
| 1204 | (when (> extra 0) | 1210 | (when (> extra 0) |
| 1211 | ;; If the natural width is wider than the rendered width, we | ||
| 1212 | ;; want to allow the column to expand. | ||
| 1205 | (dotimes (i length) | 1213 | (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)) | 1214 | (when (> (aref natural-widths i) (aref widths i)) |
| 1209 | (setq expanded-columns (1+ expanded-columns)))) | 1215 | (setq expanded-columns (1+ expanded-columns)))) |
| 1210 | (dotimes (i length) | 1216 | (dotimes (i length) |
| 1211 | (when (> (aref natural-widths i) (aref widths i)) | 1217 | (when (> (aref natural-widths i) (aref widths i)) |
| 1212 | (aset widths i (min | 1218 | (aset widths i (min |
| 1213 | (1+ (aref natural-widths i)) | 1219 | (aref natural-widths i) |
| 1214 | (+ (/ extra expanded-columns) | 1220 | (+ (/ extra expanded-columns) |
| 1215 | (aref widths i)))))))) | 1221 | (aref widths i)))))))) |
| 1216 | widths)) | 1222 | widths)) |
| @@ -1265,10 +1271,13 @@ ones, in case fg and bg are nil." | |||
| 1265 | (let ((shr-width width) | 1271 | (let ((shr-width width) |
| 1266 | (shr-indentation 0)) | 1272 | (shr-indentation 0)) |
| 1267 | (shr-descend (cons 'td cont))) | 1273 | (shr-descend (cons 'td cont))) |
| 1274 | ;; Delete padding at the bottom of the TDs. | ||
| 1268 | (delete-region | 1275 | (delete-region |
| 1269 | (point) | 1276 | (point) |
| 1270 | (+ (point) | 1277 | (progn |
| 1271 | (skip-chars-backward " \t\n"))) | 1278 | (skip-chars-backward " \t\n") |
| 1279 | (end-of-line) | ||
| 1280 | (point))) | ||
| 1272 | (push (list (cons width cont) (buffer-string) | 1281 | (push (list (cons width cont) (buffer-string) |
| 1273 | (shr-overlays-in-region (point-min) (point-max))) | 1282 | (shr-overlays-in-region (point-min) (point-max))) |
| 1274 | shr-content-cache))) | 1283 | shr-content-cache))) |
| @@ -1302,19 +1311,14 @@ ones, in case fg and bg are nil." | |||
| 1302 | (split-string (buffer-string) "\n") | 1311 | (split-string (buffer-string) "\n") |
| 1303 | (shr-collect-overlays) | 1312 | (shr-collect-overlays) |
| 1304 | (car actual-colors)) | 1313 | (car actual-colors)) |
| 1305 | (list max | 1314 | max))))) |
| 1306 | (shr-natural-width))))))) | ||
| 1307 | 1315 | ||
| 1308 | (defun shr-natural-width () | 1316 | (defun shr-buffer-width () |
| 1309 | (goto-char (point-min)) | 1317 | (goto-char (point-min)) |
| 1310 | (let ((current 0) | 1318 | (let ((max 0)) |
| 1311 | (max 0)) | ||
| 1312 | (while (not (eobp)) | 1319 | (while (not (eobp)) |
| 1313 | (end-of-line) | 1320 | (end-of-line) |
| 1314 | (setq current (+ current (current-column))) | 1321 | (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)) | 1322 | (forward-line 1)) |
| 1319 | max)) | 1323 | max)) |
| 1320 | 1324 | ||
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. |
| 1113 | and return a CSS style specification.\n | 1120 | See also `hfy-face-to-css'." |
| 1114 | See 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. | ||
| 1136 | The signature of the handler is of the form \(lambda (FN) ...\). | ||
| 1137 | FN is a font or `defface' specification (cf | ||
| 1138 | `face-attr-construct'). The handler should return a cons cell of | ||
| 1139 | the form (STYLE-NAME . STYLE-SPEC). | ||
| 1140 | |||
| 1141 | The default handler is `hfy-face-to-css-default'. | ||
| 1142 | |||
| 1143 | See 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'. |
| 1332 | If `hfy-user-sheet-assoc' is currently bound then use it to | ||
| 1333 | collect new styles discovered during this run. Otherwise create | ||
| 1334 | a 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. | ||
| 1576 | Insert \"<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. | ||
| 1589 | Insert \"</span>\". See `hfy-end-span-handler' for more | ||
| 1590 | information." | ||
| 1591 | (insert "</span>")) | ||
| 1592 | |||
| 1593 | (defvar hfy-begin-span-handler 'hfy-begin-span | ||
| 1594 | "Handler to begin a span of text. | ||
| 1595 | The signature of the handler is \(lambda (STYLE TEXT-BLOCK | ||
| 1596 | TEXT-ID TEXT-BEGINS-BLOCK-P) ...\). The handler must insert | ||
| 1597 | appropriate tags to begin a span of text. | ||
| 1598 | |||
| 1599 | STYLE is the name of the style that begins at point. It is | ||
| 1600 | derived from the face attributes as part of `hfy-face-to-css' | ||
| 1601 | callback. The other arguments TEXT-BLOCK, TEXT-ID, | ||
| 1602 | TEXT-BEGINS-BLOCK-P are non-nil only if the buffer contains | ||
| 1603 | invisible text. | ||
| 1604 | |||
| 1605 | TEXT-BLOCK is a string that identifies a single chunk of visible | ||
| 1606 | or invisible text of which the current position is a part. For | ||
| 1607 | visible portions, it's value is \"nil\". For invisible portions, | ||
| 1608 | it's value is computed as part of `hfy-invisible-name'. | ||
| 1609 | |||
| 1610 | TEXT-ID marks a unique position within a block. It is set to | ||
| 1611 | value of `point' at the current buffer position. | ||
| 1612 | |||
| 1613 | TEXT-BEGINS-BLOCK-P is a boolean and is non-nil if the current | ||
| 1614 | span also begins a invisible portion of text. | ||
| 1615 | |||
| 1616 | An implementation can use TEXT-BLOCK, TEXT-ID, | ||
| 1617 | TEXT-BEGINS-BLOCK-P to implement fold/unfold-on-mouse-click like | ||
| 1618 | behaviour. | ||
| 1619 | |||
| 1620 | The default handler is `hfy-begin-span'.") | ||
| 1621 | |||
| 1622 | (defvar hfy-end-span-handler 'hfy-end-span | ||
| 1623 | "Handler to end a span of text. | ||
| 1624 | The signature of the handler is \(lambda () ...\). The handler | ||
| 1625 | must insert appropriate tags to end a span of text. | ||
| 1626 | |||
| 1627 | The 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'. |
| 1552 | SRCDIR, if set, is the directory being htmlfontified. | 1631 | SRCDIR, 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. | ||
| 1798 | It is assumed that STRING has text properties that allow it to be | ||
| 1799 | fontified. 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/mairix.el b/lisp/net/mairix.el index 360b2286b7b..a8e969a18c5 100644 --- a/lisp/net/mairix.el +++ b/lisp/net/mairix.el | |||
| @@ -659,7 +659,7 @@ Fill in VALUES if based on an article." | |||
| 659 | " containing the word)\n" | 659 | " containing the word)\n" |
| 660 | " substring= to match words containing the substring\n" | 660 | " substring= to match words containing the substring\n" |
| 661 | " substring=N to match words containing the substring, allowing\n" | 661 | " substring=N to match words containing the substring, allowing\n" |
| 662 | " up to N errors(mising/extra/different letters)\n" | 662 | " up to N errors(missing/extra/different letters)\n" |
| 663 | " ^substring= to match the substring at the beginning of a word.\n")) | 663 | " ^substring= to match the substring at the beginning of a word.\n")) |
| 664 | (widget-insert | 664 | (widget-insert |
| 665 | "Whitespace will be converted to ',' (i.e. AND). Use '/' for OR.\n\n") | 665 | "Whitespace will be converted to ',' (i.e. AND). Use '/' for OR.\n\n") |
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: ") | 2170 | When 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 3b33ac894f2..cf38001c123 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -236,7 +236,7 @@ | |||
| 236 | 236 | ||
| 237 | (defun c-invalidate-macro-cache (beg end) | 237 | (defun c-invalidate-macro-cache (beg end) |
| 238 | ;; Called from a before-change function. If the change region is before or | 238 | ;; Called from a before-change function. If the change region is before or |
| 239 | ;; in the macro characterised by `c-macro-cache' etc., nullify it | 239 | ;; in the macro characterized by `c-macro-cache' etc., nullify it |
| 240 | ;; appropriately. BEG and END are the standard before-change-functions | 240 | ;; appropriately. BEG and END are the standard before-change-functions |
| 241 | ;; parameters. END isn't used. | 241 | ;; parameters. END isn't used. |
| 242 | (cond | 242 | (cond |
| @@ -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) |
| @@ -2163,7 +2163,7 @@ comment at the start of cc-engine.el for more info." | |||
| 2163 | (make-variable-buffer-local 'c-state-semi-nonlit-pos-cache-limit) | 2163 | (make-variable-buffer-local 'c-state-semi-nonlit-pos-cache-limit) |
| 2164 | ;; An upper limit on valid entries in `c-state-semi-nonlit-pos-cache'. This is | 2164 | ;; An upper limit on valid entries in `c-state-semi-nonlit-pos-cache'. This is |
| 2165 | ;; reduced by buffer changes, and increased by invocations of | 2165 | ;; reduced by buffer changes, and increased by invocations of |
| 2166 | ;; `c-state-literal-at'. FIMXE!!! | 2166 | ;; `c-state-literal-at'. FIXME!!! |
| 2167 | 2167 | ||
| 2168 | (defsubst c-state-pp-to-literal (from to) | 2168 | (defsubst c-state-pp-to-literal (from to) |
| 2169 | ;; Do a parse-partial-sexp from FROM to TO, returning either | 2169 | ;; Do a parse-partial-sexp from FROM to TO, returning either |
| @@ -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/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 8ea255e49dd..89450cd2276 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -3269,8 +3269,12 @@ DOC is an optional documentation string." | |||
| 3269 | (let* ((frame (gdb-current-buffer-frame)) | 3269 | (let* ((frame (gdb-current-buffer-frame)) |
| 3270 | (file (bindat-get-field frame 'fullname)) | 3270 | (file (bindat-get-field frame 'fullname)) |
| 3271 | (line (bindat-get-field frame 'line))) | 3271 | (line (bindat-get-field frame 'line))) |
| 3272 | (when file | 3272 | (if file |
| 3273 | (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line))) | 3273 | (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line) |
| 3274 | ;; If we're unable to get a file name / line for $PC, simply | ||
| 3275 | ;; follow $PC, disassembling the next 10 (x ~15 (on IA) == | ||
| 3276 | ;; 150 bytes) instructions. | ||
| 3277 | "-data-disassemble -s $pc -e \"$pc + 150\" -- 0")) | ||
| 3274 | gdb-disassembly-handler | 3278 | gdb-disassembly-handler |
| 3275 | ;; We update disassembly only after we have actual frame information | 3279 | ;; We update disassembly only after we have actual frame information |
| 3276 | ;; about all threads, so no there's `update' signal in this list | 3280 | ;; about all threads, so no there's `update' signal in this list |
| @@ -3329,8 +3333,12 @@ DOC is an optional documentation string." | |||
| 3329 | (gdb-table-add-row table | 3333 | (gdb-table-add-row table |
| 3330 | (list | 3334 | (list |
| 3331 | (bindat-get-field instr 'address) | 3335 | (bindat-get-field instr 'address) |
| 3332 | (apply #'format "<%s+%s>:" | 3336 | (let |
| 3333 | (gdb-get-many-fields instr 'func-name 'offset)) | 3337 | ((func-name (bindat-get-field instr 'func-name)) |
| 3338 | (offset (bindat-get-field instr 'offset))) | ||
| 3339 | (if func-name | ||
| 3340 | (format "<%s+%s>:" func-name offset) | ||
| 3341 | "")) | ||
| 3334 | (bindat-get-field instr 'inst))) | 3342 | (bindat-get-field instr 'inst))) |
| 3335 | (when (string-equal (bindat-get-field instr 'address) | 3343 | (when (string-equal (bindat-get-field instr 'address) |
| 3336 | address) | 3344 | address) |
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/simple.el b/lisp/simple.el index f42ea3e7a50..936037f5caa 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3069,7 +3069,8 @@ before the Emacs kill and one can still paste it using \\[yank] \\[yank-pop]." | |||
| 3069 | :version "23.2") | 3069 | :version "23.2") |
| 3070 | 3070 | ||
| 3071 | (defcustom kill-do-not-save-duplicates nil | 3071 | (defcustom kill-do-not-save-duplicates nil |
| 3072 | "Do not add a new string to `kill-ring' when it is the same as the last one." | 3072 | "Do not add a new string to `kill-ring' if it duplicates the last one. |
| 3073 | The comparison is done using `equal-including-properties'." | ||
| 3073 | :type 'boolean | 3074 | :type 'boolean |
| 3074 | :group 'killing | 3075 | :group 'killing |
| 3075 | :version "23.2") | 3076 | :version "23.2") |
| @@ -3097,7 +3098,10 @@ argument should still be a \"useful\" string for such uses." | |||
| 3097 | (signal 'args-out-of-range | 3098 | (signal 'args-out-of-range |
| 3098 | (list string "yank-handler specified for empty string")))) | 3099 | (list string "yank-handler specified for empty string")))) |
| 3099 | (unless (and kill-do-not-save-duplicates | 3100 | (unless (and kill-do-not-save-duplicates |
| 3100 | (equal string (car kill-ring))) | 3101 | ;; Due to text properties such as 'yank-handler that |
| 3102 | ;; can alter the contents to yank, comparison using | ||
| 3103 | ;; `equal' is unsafe. | ||
| 3104 | (equal-including-properties string (car kill-ring))) | ||
| 3101 | (if (fboundp 'menu-bar-update-yank-menu) | 3105 | (if (fboundp 'menu-bar-update-yank-menu) |
| 3102 | (menu-bar-update-yank-menu string (and replace (car kill-ring))))) | 3106 | (menu-bar-update-yank-menu string (and replace (car kill-ring))))) |
| 3103 | (when save-interprogram-paste-before-kill | 3107 | (when save-interprogram-paste-before-kill |
| @@ -3108,10 +3112,10 @@ argument should still be a \"useful\" string for such uses." | |||
| 3108 | (nreverse interprogram-paste) | 3112 | (nreverse interprogram-paste) |
| 3109 | (list interprogram-paste))) | 3113 | (list interprogram-paste))) |
| 3110 | (unless (and kill-do-not-save-duplicates | 3114 | (unless (and kill-do-not-save-duplicates |
| 3111 | (equal s (car kill-ring))) | 3115 | (equal-including-properties s (car kill-ring))) |
| 3112 | (push s kill-ring)))))) | 3116 | (push s kill-ring)))))) |
| 3113 | (unless (and kill-do-not-save-duplicates | 3117 | (unless (and kill-do-not-save-duplicates |
| 3114 | (equal string (car kill-ring))) | 3118 | (equal-including-properties string (car kill-ring))) |
| 3115 | (if (and replace kill-ring) | 3119 | (if (and replace kill-ring) |
| 3116 | (setcar kill-ring string) | 3120 | (setcar kill-ring string) |
| 3117 | (push string kill-ring) | 3121 | (push string kill-ring) |
diff --git a/lisp/sort.el b/lisp/sort.el index d38e475fd39..8cfe69f9458 100644 --- a/lisp/sort.el +++ b/lisp/sort.el | |||
| @@ -423,7 +423,7 @@ For example: to sort lines in the region by the first word on each line | |||
| 423 | ;; using negative prefix arg to mean "reverse" is now inconsistent with | 423 | ;; using negative prefix arg to mean "reverse" is now inconsistent with |
| 424 | ;; other sort-.*fields functions but then again this was before, since it | 424 | ;; other sort-.*fields functions but then again this was before, since it |
| 425 | ;; didn't use the magnitude of the arg to specify anything. | 425 | ;; didn't use the magnitude of the arg to specify anything. |
| 426 | (interactive "P\nsRegexp specifying records to sort: | 426 | (interactive "P\nsRegexp specifying records to sort: \n\ |
| 427 | sRegexp specifying key within record: \nr") | 427 | sRegexp specifying key within record: \nr") |
| 428 | (cond ((or (equal key-regexp "") (equal key-regexp "\\&")) | 428 | (cond ((or (equal key-regexp "") (equal key-regexp "\\&")) |
| 429 | (setq key-regexp 0)) | 429 | (setq key-regexp 0)) |
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 | ||
| 1786 | Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM | 1786 | Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM |
| 1787 | is evaluated at the end of any file that `provide's this feature. | 1787 | is evaluated at the end of any file that `provide's this feature. |
| 1788 | If the feature is provided when evaluating code not associated with a | ||
| 1789 | file, FORM is evaluated immediately after the provide statement. | ||
| 1788 | 1790 | ||
| 1789 | Usually FILE is just a library name like \"font-lock\" or a feature name | 1791 | Usually FILE is just a library name like \"font-lock\" or a feature name |
| 1790 | like 'font-lock. | 1792 | like '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 | ||
| 635 | See also: variables `tar-update-datestamp' and `tar-anal-blocksize'. | 635 | See 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/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." | |||
| 324 | Skips any text between strings matching regular expressions | 324 | Skips 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 | ||
| 327 | TeX users beware: Any field starting with [. will skip until a .] -- even | 327 | TeX users beware: Any text between [. and .] will be skipped -- even if |
| 328 | your whole buffer -- unless you set `ispell-skip-tib' to nil. That includes | 328 | that's your whole buffer -- unless you set `ispell-skip-tib' to nil. |
| 329 | a [.5mm] type of number...." | 329 | That 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. |
| 341 | This minimizes redisplay thrashing." | 341 | This 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. |
| 347 | Must be greater than 1." | 347 | Must 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 | ||
| 715 | CASECHARS, NOT-CASECHARS, and OTHERCHARS must be unibyte strings | 715 | CASECHARS, NOT-CASECHARS, and OTHERCHARS must be unibyte strings |
| 716 | containing bytes of CHARACTER-SET. In addition, if they contain | 716 | containing bytes of CHARACTER-SET. In addition, if they contain |
| 717 | a non-ASCII byte, the regular expression must be a single | 717 | non-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 |
| 719 | for non-ASCII bytes. | 719 | for non-ASCII bytes. |
| 720 | 720 | ||
| @@ -734,27 +734,31 @@ but the dictionary can control the extended character mode. | |||
| 734 | Both defaults can be overruled in a buffer-local fashion. See | 734 | Both 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 | ||
| 737 | CHARACTER-SET used for languages with multibyte characters. | 737 | CHARACTER-SET used to encode text sent to the ispell subprocess |
| 738 | when the language uses non-ASCII characters. | ||
| 738 | 739 | ||
| 739 | Note that the CASECHARS and OTHERCHARS slots of the alist should | 740 | Note that with \"ispell\" as the speller, the CASECHARS and |
| 740 | contain the same character set as casechars and otherchars in the | 741 | OTHERCHARS slots of the alist should contain the same character |
| 741 | LANGUAGE.aff file \(e.g., english.aff\).") | 742 | set as casechars and otherchars in the LANGUAGE.aff file \(e.g., |
| 743 | english.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. |
| 747 | If UTF-8 if supported by spellchecker and is selectable from the command line | 749 | If setting the encoding is supported by spellchecker and is selectable from |
| 748 | this variable will contain \"--encoding=\" for aspell and \"-i \" for hunspell, | 750 | the command line, this variable will contain \"--encoding=\" for aspell |
| 749 | so UTF-8 or other mime charsets can be selected. That will be set for hunspell | 751 | and \"-i \" for hunspell, so the appropriate mime charset can be selected. |
| 750 | >=1.1.6 or aspell >= 0.60 in `ispell-check-version'. | 752 | That will be set in `ispell-check-version' for hunspell >= 1.1.6 and |
| 751 | 753 | aspell >= 0.60. | |
| 752 | For aspell non-nil means to try to automatically find aspell dictionaries. | 754 | |
| 753 | Earlier aspell versions do not consistently support UTF-8. Handling | 755 | For aspell, non-nil also means to try to automatically find its dictionaries. |
| 756 | |||
| 757 | Earlier aspell versions do not consistently support charset encoding. Handling | ||
| 754 | this would require some extra guessing in `ispell-aspell-find-dictionary'.") | 758 | this 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. |
| 758 | ispell.el and flyspell.el will use for this purpose the more generic | 762 | ispell.el and flyspell.el will use for this purpose the more generic |
| 759 | variable `ispell-encoding8-command' for both aspell and hunspell. Is left | 763 | variable `ispell-encoding8-command' for both aspell and hunspell. Is left |
| 760 | here just for backwards compatibility.") | 764 | here 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. |
| 784 | Returns version number if called interactively. | 788 | Returns version number if called interactively. |
| 785 | Otherwise returns the library directory name, if that is defined." | 789 | Otherwise 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 | 990 | associated data file is found or nil otherwise. List format is that |
| 987 | that of `ispell-dictionary-base-alist' elements." | 991 | of `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. |
| 1120 | The variable `ispell-library-directory' defines the library location." | 1124 | The 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. |
| 1383 | The keyword will be followed by any number of local word spellings. | 1388 | The keyword will be followed by any number of local word spellings. |
| 1384 | There can be multiple of these keywords in the file.") | 1389 | There 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' | |||
| 1786 | is non-nil when called interactively, then the following word | 1791 | is 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. |
| 1788 | Optional second argument contains otherchars that can be included in word | 1793 | Optional second argument contains otherchars that can be included in word |
| 1789 | many times. | 1794 | many times (see the doc string of `ispell-dictionary-alist' for details |
| 1795 | about otherchars). | ||
| 1790 | 1796 | ||
| 1791 | Word syntax is controlled by the definition of the chosen dictionary, | 1797 | Word syntax is controlled by the definition of the chosen dictionary, |
| 1792 | which is in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'." | 1798 | which 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. |
| 2820 | This may kill the Ispell process; if so, | 2826 | This may kill the Ispell process; if so, a new one will be started |
| 2821 | a new one will be started when needed." | 2827 | when 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. |
| 2839 | Return nil if spell session is quit, | 2845 | Return nil if spell session was terminated, otherwise returns shift offset |
| 2840 | otherwise returns shift offset amount for last line processed." | 2846 | amount 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. |
| 2958 | Includes `ispell-skip-region-alist' plus tex, tib, html, and comment keys. | 2964 | Includes `ispell-skip-region-alist' plus tex, tib, html, and comment keys. |
| 2959 | Must call after `ispell-buffer-local-parsing' due to dependence on mode." | 2965 | Must 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'. |
| 3017 | Manual checking must include comments and tib references. | 3023 | Manual checking must include comments and tib references. |
| 3018 | The list is of the form described by variable `ispell-skip-region-alist'. | 3024 | The list is of the form described by variable `ispell-skip-region-alist'. |
| 3019 | Must call after `ispell-buffer-local-parsing' due to dependence on mode." | 3025 | Must 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. |
| 3049 | Return value `nil' if file with large attachments are saved. | 3055 | Return value `nil' if file with large attachments is saved. |
| 3050 | This can be used to avoid multiple questions for multiple large attachments. | 3056 | This can be used to avoid multiple questions for multiple large attachments. |
| 3051 | Returns point to starting location afterwards." | 3057 | Returns 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. |
| 3157 | This will modify the buffer for spelling errors. | 3163 | This will modify the buffer for spelling errors. |
| 3158 | Requires variables ISPELL-START and ISPELL-END to be defined in its | 3164 | Requires variables ISPELL-START and ISPELL-END to be defined in its |
| 3159 | dynamic scope. | 3165 | dynamic scope. |
| @@ -3468,7 +3474,7 @@ With a prefix argument ARG, enable Ispell minor mode if ARG is | |||
| 3468 | positive, and disable it otherwise. If called from Lisp, enable | 3474 | positive, and disable it otherwise. If called from Lisp, enable |
| 3469 | the mode if ARG is omitted or nil. | 3475 | the mode if ARG is omitted or nil. |
| 3470 | 3476 | ||
| 3471 | Ispell minor mode is a buffer-local mior mode. When enabled, | 3477 | Ispell minor mode is a buffer-local minor mode. When enabled, |
| 3472 | typing SPC or RET warns you if the previous word is incorrectly | 3478 | typing SPC or RET warns you if the previous word is incorrectly |
| 3473 | spelled. | 3479 | spelled. |
| 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. |
| 3485 | Don't check previous word when character before point is a space or newline. | 3491 | Don't check previous word when character before point is a space or newline. |
| 3486 | Don't read buffer-local settings or word lists." | 3492 | Don'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. |
| 3523 | If it is a string, limit at first occurrence of that regular expression. | 3529 | If it is a string, limit is the first occurrence of that regular expression. |
| 3524 | Otherwise, it must be a function which is called to get the limit.") | 3530 | Otherwise, 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 | ||
| 3626 | To abort spell checking of a message region and send the message anyway, | 3632 | To abort spell checking of a message region and send the message anyway, |
| 3627 | use the `x' command. (Any subsequent regions will be checked.) | 3633 | use the `x' command. (Any subsequent regions will be checked.) |
| 3628 | The `X' command aborts the message send so that you can edit the buffer. | 3634 | The `X' command aborts sending the message so that you can edit the buffer. |
| 3629 | 3635 | ||
| 3630 | To spell-check whenever a message is sent, include the appropriate lines | 3636 | To spell-check whenever a message is sent, include the appropriate lines |
| 3631 | in your .emacs file: | 3637 | in 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. |
| 3790 | Overrides the default parsing mode. | 3796 | Overrides the default parsing mode. |
| 3791 | Includes Latex/Nroff modes and extended character mode." | 3797 | Includes 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. |
| 3841 | If optional NO-RELOAD is non-nil, do not make any dictionary reloading. | 3847 | If optional NO-RELOAD is non-nil, do not reload any dictionary. |
| 3842 | When a dictionary is defined in the buffer (see variable | 3848 | When 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 |
| 3844 | from \\[ispell-change-dictionary]. | 3850 | from \\[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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-03-11 Chong Yidong <cyd@gnu.org> | 6 | 2012-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'. | |||
| 309 | Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a | 309 | Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a |
| 310 | file: Users may suspend viewing in order to modify the buffer. | 310 | file: Users may suspend viewing in order to modify the buffer. |
| 311 | Exiting View mode will then discard the user's edits. Setting | 311 | Exiting View mode will then discard the user's edits. Setting |
| 312 | EXIT-ACTION to `kill-buffer-if-not-modified' avoids this." | 312 | EXIT-ACTION to `kill-buffer-if-not-modified' avoids this. |
| 313 | |||
| 314 | This function does not enable View mode if the buffer's major-mode | ||
| 315 | has a `special' mode-class, because such modes usually have their | ||
| 316 | own 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 | ||
| 332 | Optional argument EXIT-ACTION is either nil or a function with buffer as | 336 | Optional argument EXIT-ACTION is either nil or a function with buffer as |
| 333 | argument. This function is called when finished viewing buffer. Use | 337 | argument. This function is called when finished viewing buffer. Use |
| 334 | this argument instead of explicitly setting `view-exit-action'." | 338 | this argument instead of explicitly setting `view-exit-action'. |
| 339 | |||
| 340 | This function does not enable View mode if the buffer's major-mode | ||
| 341 | has a `special' mode-class, because such modes usually have their | ||
| 342 | own 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 | ||
| 355 | Optional argument EXIT-ACTION is either nil or a function with buffer as | 363 | Optional argument EXIT-ACTION is either nil or a function with buffer as |
| 356 | argument. This function is called when finished viewing buffer. Use | 364 | argument. This function is called when finished viewing buffer. Use |
| 357 | this argument instead of explicitly setting `view-exit-action'." | 365 | this argument instead of explicitly setting `view-exit-action'. |
| 366 | |||
| 367 | This function does not enable View mode if the buffer's major-mode | ||
| 368 | has a `special' mode-class, because such modes usually have their | ||
| 369 | own 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 80bc42fa8c6..8b1221ab6d8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,18 @@ | |||
| 3 | * ftfont.c (ftfont_drive_otf): Mask bits of character code to make | 3 | * ftfont.c (ftfont_drive_otf): Mask bits of character code to make |
| 4 | it fit in a valid range (Bug#11003). | 4 | it fit in a valid range (Bug#11003). |
| 5 | 5 | ||
| 6 | 2012-03-18 Eli Zaretskii <eliz@gnu.org> | ||
| 7 | |||
| 8 | * xdisp.c (cursor_row_p): Even if the glyph row ends in a string | ||
| 9 | that is not from display property, accept the row as a "cursor | ||
| 10 | row" if one of the string's character has a non-nil `cursor' | ||
| 11 | property. Fixes cursor positioning when there are newlines in | ||
| 12 | overlay strings, e.g. in icomplete.el. (Bug#11035) | ||
| 13 | |||
| 14 | 2012-03-12 Paul Eggert <eggert@cs.ucla.edu> | ||
| 15 | |||
| 16 | * buffer.c (compare_overlays): Don't assume args differ (Bug#6830). | ||
| 17 | |||
| 6 | 2012-03-12 Chong Yidong <cyd@gnu.org> | 18 | 2012-03-12 Chong Yidong <cyd@gnu.org> |
| 7 | 19 | ||
| 8 | * eval.c (inhibit_lisp_code): Rename from | 20 | * eval.c (inhibit_lisp_code): Rename from |
diff --git a/src/buffer.c b/src/buffer.c index efb9a80f35d..1fea19b0d65 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -2868,7 +2868,9 @@ compare_overlays (const void *v1, const void *v2) | |||
| 2868 | between "equal" overlays. The result can still change between | 2868 | between "equal" overlays. The result can still change between |
| 2869 | invocations of Emacs, but it won't change in the middle of | 2869 | invocations of Emacs, but it won't change in the middle of |
| 2870 | `find_field' (bug#6830). */ | 2870 | `find_field' (bug#6830). */ |
| 2871 | return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1; | 2871 | if (XHASH (s1->overlay) != XHASH (s2->overlay)) |
| 2872 | return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1; | ||
| 2873 | return 0; | ||
| 2872 | } | 2874 | } |
| 2873 | 2875 | ||
| 2874 | /* Sort an array of overlays by priority. The array is modified in place. | 2876 | /* Sort an array of overlays by priority. The array is modified in place. |
diff --git a/src/xdisp.c b/src/xdisp.c index 62d0d187a19..71162960faa 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -18456,9 +18456,11 @@ cursor_row_p (struct glyph_row *row) | |||
| 18456 | /* Suppose the row ends on a string. | 18456 | /* Suppose the row ends on a string. |
| 18457 | Unless the row is continued, that means it ends on a newline | 18457 | Unless the row is continued, that means it ends on a newline |
| 18458 | in the string. If it's anything other than a display string | 18458 | in the string. If it's anything other than a display string |
| 18459 | (e.g. a before-string from an overlay), we don't want the | 18459 | (e.g., a before-string from an overlay), we don't want the |
| 18460 | cursor there. (This heuristic seems to give the optimal | 18460 | cursor there. (This heuristic seems to give the optimal |
| 18461 | behavior for the various types of multi-line strings.) */ | 18461 | behavior for the various types of multi-line strings.) |
| 18462 | One exception: if the string has `cursor' property on one of | ||
| 18463 | its characters, we _do_ want the cursor there. */ | ||
| 18462 | if (CHARPOS (row->end.string_pos) >= 0) | 18464 | if (CHARPOS (row->end.string_pos) >= 0) |
| 18463 | { | 18465 | { |
| 18464 | if (row->continued_p) | 18466 | if (row->continued_p) |
| @@ -18480,6 +18482,25 @@ cursor_row_p (struct glyph_row *row) | |||
| 18480 | result = | 18482 | result = |
| 18481 | (!NILP (prop) | 18483 | (!NILP (prop) |
| 18482 | && display_prop_string_p (prop, glyph->object)); | 18484 | && display_prop_string_p (prop, glyph->object)); |
| 18485 | /* If there's a `cursor' property on one of the | ||
| 18486 | string's characters, this row is a cursor row, | ||
| 18487 | even though this is not a display string. */ | ||
| 18488 | if (!result) | ||
| 18489 | { | ||
| 18490 | Lisp_Object s = glyph->object; | ||
| 18491 | |||
| 18492 | for ( ; glyph >= beg && EQ (glyph->object, s); --glyph) | ||
| 18493 | { | ||
| 18494 | EMACS_INT gpos = glyph->charpos; | ||
| 18495 | |||
| 18496 | if (!NILP (Fget_char_property (make_number (gpos), | ||
| 18497 | Qcursor, s))) | ||
| 18498 | { | ||
| 18499 | result = 1; | ||
| 18500 | break; | ||
| 18501 | } | ||
| 18502 | } | ||
| 18503 | } | ||
| 18483 | break; | 18504 | break; |
| 18484 | } | 18505 | } |
| 18485 | } | 18506 | } |