diff options
| author | Grégoire Jadi | 2013-06-15 11:24:47 +0200 |
|---|---|---|
| committer | Grégoire Jadi | 2013-06-15 11:24:47 +0200 |
| commit | 1a0f9e5e80586e4f2157fdfecae250c5619edf15 (patch) | |
| tree | dbf9c38ab630787db0e41667efc19715f7d571b4 | |
| parent | c75684e7603cfea0ec91c63fca0187a5544245c8 (diff) | |
| parent | 2a342ba649407875a265b8d56c9f7c3d87c4b43c (diff) | |
| download | emacs-1a0f9e5e80586e4f2157fdfecae250c5619edf15.tar.gz emacs-1a0f9e5e80586e4f2157fdfecae250c5619edf15.zip | |
Merge branch 'jave-xwidget' into xwidget
42 files changed, 993 insertions, 569 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index ac6031fa205..8fdfe3965b1 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,9 +1,12 @@ | |||
| 1 | 2013-06-13 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * admin.el (manual-style-string): Use new file manual.css. | ||
| 4 | |||
| 1 | 2013-06-02 Eric Ludlam <zappo@gnu.org> | 5 | 2013-06-02 Eric Ludlam <zappo@gnu.org> |
| 2 | 6 | ||
| 3 | * grammars/srecode-template.wy (variable): Accept a single number | 7 | * grammars/srecode-template.wy (variable): Accept a single number |
| 4 | as a variable value. Allows the 'priority' to be set to a number. | 8 | as a variable value. Allows the 'priority' to be set to a number. |
| 5 | (wisent-srecode-template-lexer): Move number up so it can be | 9 | (wisent-srecode-template-lexer): Move number up so it can be created. |
| 6 | created. | ||
| 7 | 10 | ||
| 8 | 2013-05-16 Glenn Morris <rgm@gnu.org> | 11 | 2013-05-16 Glenn Morris <rgm@gnu.org> |
| 9 | 12 | ||
diff --git a/admin/admin.el b/admin/admin.el index cb7eaead27f..8366207f5b0 100644 --- a/admin/admin.el +++ b/admin/admin.el | |||
| @@ -271,7 +271,7 @@ Root must be the root of an Emacs source tree." | |||
| 271 | <meta name=\"DC.title\" content=\"gnu.org\">\n\n") | 271 | <meta name=\"DC.title\" content=\"gnu.org\">\n\n") |
| 272 | 272 | ||
| 273 | (defconst manual-style-string "<style type=\"text/css\"> | 273 | (defconst manual-style-string "<style type=\"text/css\"> |
| 274 | @import url('/style.css');\n</style>\n") | 274 | @import url('/s/emacs/manual.css');\n</style>\n") |
| 275 | 275 | ||
| 276 | (defun manual-misc-html (name root html-node-dir html-mono-dir) | 276 | (defun manual-misc-html (name root html-node-dir html-mono-dir) |
| 277 | (let ((texi (expand-file-name (format "doc/misc/%s.texi" name) root))) | 277 | (let ((texi (expand-file-name (format "doc/misc/%s.texi" name) root))) |
diff --git a/configure.ac b/configure.ac index 4a676ba6b6f..f9a5e2df6f6 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -86,7 +86,7 @@ AC_DEFUN([OPTION_DEFAULT_OFF], [dnl | |||
| 86 | ])dnl | 86 | ])dnl |
| 87 | 87 | ||
| 88 | dnl OPTION_DEFAULT_ON(NAME, HELP-STRING) | 88 | dnl OPTION_DEFAULT_ON(NAME, HELP-STRING) |
| 89 | dnl Create a new --with option that defaults to $enable_features. | 89 | dnl Create a new --with option that defaults to $with_features. |
| 90 | dnl NAME is the base name of the option. The shell variable with_NAME | 90 | dnl NAME is the base name of the option. The shell variable with_NAME |
| 91 | dnl will be set either to 'no' (for a plain --without-NAME) or to | 91 | dnl will be set either to 'no' (for a plain --without-NAME) or to |
| 92 | dnl 'yes' (if the option is not specified). Note that the shell | 92 | dnl 'yes' (if the option is not specified). Note that the shell |
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index f56f2f51e07..c3a7343aa8f 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | 2013-06-12 Xue Fuqiao <xfq.free@gmail.com> | ||
| 2 | |||
| 3 | * vc1-xtra.texi (Revision Tags): Add a cross reference. | ||
| 4 | (CVS Options): Fix the default value of `vc-cvs-stay-local'. | ||
| 5 | |||
| 1 | 2013-06-11 Glenn Morris <rgm@gnu.org> | 6 | 2013-06-11 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * maintaining.texi (VC Directory Commands): Copyedit. | 8 | * maintaining.texi (VC Directory Commands): Copyedit. |
| 4 | (Branches): Put back milder version of pre 2013-06-07 text. | 9 | (Branches): Put back milder version of pre 2013-06-07 text. |
| 5 | 10 | ||
| 6 | 2013-06-09 Xue Fuqiao <xfq.free@gmail.com> | ||
| 7 | |||
| 8 | * vc1-xtra.texi (Revision Tags): Add a cross reference. | ||
| 9 | (CVS Options): Fix the default value of `vc-cvs-stay-local'. | ||
| 10 | |||
| 11 | 2013-06-07 Xue Fuqiao <xfq.free@gmail.com> | 11 | 2013-06-07 Xue Fuqiao <xfq.free@gmail.com> |
| 12 | 12 | ||
| 13 | * maintaining.texi (Branches): Remove text copied from other sources. | 13 | * maintaining.texi (Branches): Remove text copied from other sources. |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 259bf9a78a6..e14f7543443 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-06-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * loading.texi (Hooks for Loading): Don't document after-load-alist. | ||
| 4 | Document with-eval-after-load instead of eval-after-load. | ||
| 5 | |||
| 1 | 2013-06-11 Xue Fuqiao <xfq.free@gmail.com> | 6 | 2013-06-11 Xue Fuqiao <xfq.free@gmail.com> |
| 2 | 7 | ||
| 3 | * files.texi (File Name Expansion): Make the example more | 8 | * files.texi (File Name Expansion): Make the example more |
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 5c92307f7d5..4c0f0d73e41 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi | |||
| @@ -990,19 +990,18 @@ file that was just loaded. | |||
| 990 | @end defvar | 990 | @end defvar |
| 991 | 991 | ||
| 992 | If you want code to be executed when a @emph{particular} library is | 992 | If you want code to be executed when a @emph{particular} library is |
| 993 | loaded, use the function @code{eval-after-load}: | 993 | loaded, use the macro @code{with-eval-after-load}: |
| 994 | 994 | ||
| 995 | @defun eval-after-load library form | 995 | @defmac with-eval-after-load library body@dots{} |
| 996 | This function arranges to evaluate @var{form} at the end of loading | 996 | This macro arranges to evaluate @var{body} at the end of loading |
| 997 | the file @var{library}, each time @var{library} is loaded. If | 997 | the file @var{library}, each time @var{library} is loaded. If |
| 998 | @var{library} is already loaded, it evaluates @var{form} right away. | 998 | @var{library} is already loaded, it evaluates @var{body} right away. |
| 999 | Don't forget to quote @var{form}! | ||
| 1000 | 999 | ||
| 1001 | You don't need to give a directory or extension in the file name | 1000 | You don't need to give a directory or extension in the file name |
| 1002 | @var{library}. Normally, you just give a bare file name, like this: | 1001 | @var{library}. Normally, you just give a bare file name, like this: |
| 1003 | 1002 | ||
| 1004 | @example | 1003 | @example |
| 1005 | (eval-after-load "edebug" '(def-edebug-spec c-point t)) | 1004 | (with-eval-after-load "edebug" (def-edebug-spec c-point t)) |
| 1006 | @end example | 1005 | @end example |
| 1007 | 1006 | ||
| 1008 | To restrict which files can trigger the evaluation, include a | 1007 | To restrict which files can trigger the evaluation, include a |
| @@ -1014,16 +1013,16 @@ example, @file{my_inst.elc} or @file{my_inst.elc.gz} in some directory | |||
| 1014 | @file{my_inst.el}: | 1013 | @file{my_inst.el}: |
| 1015 | 1014 | ||
| 1016 | @example | 1015 | @example |
| 1017 | (eval-after-load "foo/bar/my_inst.elc" @dots{}) | 1016 | (with-eval-after-load "foo/bar/my_inst.elc" @dots{}) |
| 1018 | @end example | 1017 | @end example |
| 1019 | 1018 | ||
| 1020 | @var{library} can also be a feature (i.e., a symbol), in which case | 1019 | @var{library} can also be a feature (i.e., a symbol), in which case |
| 1021 | @var{form} is evaluated at the end of any file where | 1020 | @var{body} is evaluated at the end of any file where |
| 1022 | @code{(provide @var{library})} is called. | 1021 | @code{(provide @var{library})} is called. |
| 1023 | 1022 | ||
| 1024 | An error in @var{form} does not undo the load, but does prevent | 1023 | An error in @var{body} does not undo the load, but does prevent |
| 1025 | execution of the rest of @var{form}. | 1024 | execution of the rest of @var{body}. |
| 1026 | @end defun | 1025 | @end defmac |
| 1027 | 1026 | ||
| 1028 | Normally, well-designed Lisp programs should not use | 1027 | Normally, well-designed Lisp programs should not use |
| 1029 | @code{eval-after-load}. If you need to examine and set the variables | 1028 | @code{eval-after-load}. If you need to examine and set the variables |
| @@ -1031,18 +1030,3 @@ defined in another library (those meant for outside use), you can do | |||
| 1031 | it immediately---there is no need to wait until the library is loaded. | 1030 | it immediately---there is no need to wait until the library is loaded. |
| 1032 | If you need to call functions defined by that library, you should load | 1031 | If you need to call functions defined by that library, you should load |
| 1033 | the library, preferably with @code{require} (@pxref{Named Features}). | 1032 | the library, preferably with @code{require} (@pxref{Named Features}). |
| 1034 | |||
| 1035 | @defvar after-load-alist | ||
| 1036 | This variable stores an alist built by @code{eval-after-load}, | ||
| 1037 | containing the expressions to evaluate when certain libraries are | ||
| 1038 | loaded. Each element looks like this: | ||
| 1039 | |||
| 1040 | @example | ||
| 1041 | (@var{regexp-or-feature} @var{forms}@dots{}) | ||
| 1042 | @end example | ||
| 1043 | |||
| 1044 | The key @var{regexp-or-feature} is either a regular expression or a | ||
| 1045 | symbol, and the value is a list of forms. The forms are evaluated | ||
| 1046 | when the key matches the absolute true name or feature name of the | ||
| 1047 | library being loaded. | ||
| 1048 | @end defvar | ||
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 4cae3d0a478..0837c8e06f2 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-06-13 Albert Krewinkel <tarleb@moltkeplatz.de> | ||
| 2 | |||
| 3 | * sieve.texi: (Managing Sieve): Fix port in example, fix documentation | ||
| 4 | for keys q and Q. | ||
| 5 | (Standards): Reference RFC5804 as the defining document of the | ||
| 6 | managesieve protocol. | ||
| 7 | |||
| 1 | 2013-06-10 Aidan Gauland <aidalgol@amuri.net> | 8 | 2013-06-10 Aidan Gauland <aidalgol@amuri.net> |
| 2 | 9 | ||
| 3 | * eshell.texi (Input/Output): Expand to cover new visual-command | 10 | * eshell.texi (Input/Output): Expand to cover new visual-command |
diff --git a/doc/misc/sieve.texi b/doc/misc/sieve.texi index b84c3047ec1..f69e2b9b948 100644 --- a/doc/misc/sieve.texi +++ b/doc/misc/sieve.texi | |||
| @@ -149,7 +149,7 @@ When a server has been successfully contacted, the Manage Sieve buffer | |||
| 149 | looks something like: | 149 | looks something like: |
| 150 | 150 | ||
| 151 | @example | 151 | @example |
| 152 | Server : mailserver:2000 | 152 | Server : mailserver:sieve |
| 153 | 153 | ||
| 154 | 2 scripts on server, press RET on a script name edits it, or | 154 | 2 scripts on server, press RET on a script name edits it, or |
| 155 | press RET on <new script> to create a new script. | 155 | press RET on <new script> to create a new script. |
| @@ -214,6 +214,11 @@ Bury the Manage Sieve buffer without closing the connection. | |||
| 214 | @findex sieve-help | 214 | @findex sieve-help |
| 215 | Displays help in the minibuffer. | 215 | Displays help in the minibuffer. |
| 216 | 216 | ||
| 217 | @item Q | ||
| 218 | @kindex Q | ||
| 219 | @findex sieve-manage-quit | ||
| 220 | Quit Manage Sieve and close the connection. | ||
| 221 | |||
| 217 | @end table | 222 | @end table |
| 218 | 223 | ||
| 219 | @node Examples | 224 | @node Examples |
| @@ -342,7 +347,7 @@ lists the relevant ones. They can all be fetched from | |||
| 342 | @item RFC3028 | 347 | @item RFC3028 |
| 343 | Sieve: A Mail Filtering Language. | 348 | Sieve: A Mail Filtering Language. |
| 344 | 349 | ||
| 345 | @item draft-martin-managesieve-03 | 350 | @item RFC5804 |
| 346 | A Protocol for Remotely Managing Sieve Scripts | 351 | A Protocol for Remotely Managing Sieve Scripts |
| 347 | 352 | ||
| 348 | @end table | 353 | @end table |
diff --git a/etc/ChangeLog b/etc/ChangeLog index f80c1b6973c..1892d5fbb58 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2013-06-14 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * NEWS (utf-8 for el): Move to the incompatible section. | ||
| 4 | |||
| 5 | 2013-06-13 Paul Eggert <eggert@cs.ucla.edu> | ||
| 6 | |||
| 7 | * DEBUG: Document -Og and -fno-omit-frame-pointer. | ||
| 8 | |||
| 1 | 2013-06-05 Teodor Zlatanov <tzz@lifelogs.com> | 9 | 2013-06-05 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 10 | ||
| 3 | * NEWS: Document new prog-mode symbol prettify support. | 11 | * NEWS: Document new prog-mode symbol prettify support. |
| @@ -24,12 +24,14 @@ There are several ways to overcome that difficulty, they are all | |||
| 24 | described in the node "Auto-loading safe path" in the GDB user manual. | 24 | described in the node "Auto-loading safe path" in the GDB user manual. |
| 25 | 25 | ||
| 26 | ** When you are trying to analyze failed assertions or backtraces, it | 26 | ** When you are trying to analyze failed assertions or backtraces, it |
| 27 | will be essential to compile Emacs either completely without | 27 | is essential to compile Emacs with flags suitable for debugging. |
| 28 | optimizations (set CFLAGS to "-O0 -g3") or at least (when using GCC) | 28 | With GCC 4.8 or later, you can invoke 'make' with CFLAGS="-Og -g3". |
| 29 | with the -fno-crossjumping option in CFLAGS. Failure to do so may | 29 | With older GCC or non-GCC commpilers, you can use CFLAGS="-O0 -g3". |
| 30 | make the compiler recycle the same abort call for all assertions in a | 30 | With GCC and higher optimization levels such as -O2, the |
| 31 | given function, rendering the stack backtrace useless for identifying | 31 | -fno-omit-frame-pointer and -fno-crossjumping options are often |
| 32 | the specific failed assertion. | 32 | essential. The latter prevents GCC from using the same abort call for |
| 33 | all assertions in a given function, rendering the stack backtrace | ||
| 34 | useless for identifying the specific failed assertion. | ||
| 33 | 35 | ||
| 34 | ** It is a good idea to run Emacs under GDB (or some other suitable | 36 | ** It is a good idea to run Emacs under GDB (or some other suitable |
| 35 | debugger) *all the time*. Then, when Emacs crashes, you will be able | 37 | debugger) *all the time*. Then, when Emacs crashes, you will be able |
| @@ -769,4 +771,3 @@ Local variables: | |||
| 769 | mode: outline | 771 | mode: outline |
| 770 | paragraph-separate: "[ ]*$" | 772 | paragraph-separate: "[ ]*$" |
| 771 | end: | 773 | end: |
| 772 | |||
| @@ -296,6 +296,18 @@ and opens overlays with hidden text when `search-invisible' is `open'. | |||
| 296 | *** By default, prefix arguments do not now terminate Isearch mode. | 296 | *** By default, prefix arguments do not now terminate Isearch mode. |
| 297 | Set `isearch-allow-prefix' to nil to restore old behavior. | 297 | Set `isearch-allow-prefix' to nil to restore old behavior. |
| 298 | 298 | ||
| 299 | *** More Isearch commands accept prefix arguments, namely | ||
| 300 | `isearch-printing-char', `isearch-quote-char', `isearch-yank-word', | ||
| 301 | `isearch-yank-line'. | ||
| 302 | |||
| 303 | *** Word search now matches whitespace at the beginning/end | ||
| 304 | of the search string if it contains leading/trailing whitespace. | ||
| 305 | In an incremental word search or when using a non-nil LAX argument | ||
| 306 | of `word-search-regexp', the lax matching can also match part of | ||
| 307 | the first word (in addition to the lax matching of the last word). | ||
| 308 | The same rules are now applied to the symbol search with the difference | ||
| 309 | that it matches symbols, and non-symbol characters between symbols. | ||
| 310 | |||
| 299 | ** MH-E has been updated to MH-E version 8.5. | 311 | ** MH-E has been updated to MH-E version 8.5. |
| 300 | See MH-E-NEWS for details. | 312 | See MH-E-NEWS for details. |
| 301 | 313 | ||
| @@ -365,6 +377,8 @@ External su and sudo commands are now the default; the internal, | |||
| 365 | TRAMP-using variants can still be used by enabling the eshell-tramp | 377 | TRAMP-using variants can still be used by enabling the eshell-tramp |
| 366 | module. | 378 | module. |
| 367 | 379 | ||
| 380 | ** New term.el option `term-suppress-hard-newline'. | ||
| 381 | |||
| 368 | ** Obsolete packages: | 382 | ** Obsolete packages: |
| 369 | 383 | ||
| 370 | *** longlines.el is obsolete; use visual-line-mode instead. | 384 | *** longlines.el is obsolete; use visual-line-mode instead. |
| @@ -400,6 +414,12 @@ It is layered as: | |||
| 400 | 414 | ||
| 401 | * Incompatible Lisp Changes in Emacs 24.4 | 415 | * Incompatible Lisp Changes in Emacs 24.4 |
| 402 | 416 | ||
| 417 | ** The default file coding for Emacs Lisp files is now utf-8. | ||
| 418 | (See file-coding-system-alist.) In most cases, this change is transparent, but | ||
| 419 | files that contain unusual characters without specifying an explicit coding | ||
| 420 | system may fail to load with obscure errors. | ||
| 421 | You should either convert them to utf-8 or add an explicit coding: cookie. | ||
| 422 | |||
| 403 | ** overriding-terminal-local-map does not replace the local keymaps any more. | 423 | ** overriding-terminal-local-map does not replace the local keymaps any more. |
| 404 | It used to disable the minor mode, major mode, and text-property keymaps, | 424 | It used to disable the minor mode, major mode, and text-property keymaps, |
| 405 | whereas now it simply has higher precedence. | 425 | whereas now it simply has higher precedence. |
| @@ -438,6 +458,9 @@ file using `set-file-extended-attributes'. | |||
| 438 | 458 | ||
| 439 | * Lisp Changes in Emacs 24.4 | 459 | * Lisp Changes in Emacs 24.4 |
| 440 | 460 | ||
| 461 | +++ | ||
| 462 | ** New macro with-eval-after-load. Like eval-after-load, but better behaved. | ||
| 463 | |||
| 441 | ** Obsoleted functions: | 464 | ** Obsoleted functions: |
| 442 | *** `dont-compile' | 465 | *** `dont-compile' |
| 443 | *** `lisp-complete-symbol' | 466 | *** `lisp-complete-symbol' |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 48124b85fe4..2605247244a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,145 @@ | |||
| 1 | 2013-06-14 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * term/xterm.el (xterm--query): | ||
| 4 | Stop after first matching handler. (Bug#14615) | ||
| 5 | |||
| 6 | 2013-06-14 Ivan Kanis <ivan@kanis.fr> | ||
| 7 | |||
| 8 | Add support for dired in saveplace. | ||
| 9 | * dired.el (dired-initial-position-hook): New variable. | ||
| 10 | (dired-initial-position): Call hook to place cursor position. | ||
| 11 | * saveplace.el (save-place-to-alist): Add dired position. | ||
| 12 | (save-place-dired-hook): New function. | ||
| 13 | |||
| 14 | 2013-06-14 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 15 | |||
| 16 | * subr.el (eval-after-load, set-temporary-overlay-map): Use indirection | ||
| 17 | through a symbol rather than letrec. | ||
| 18 | |||
| 19 | * emacs-lisp/package.el: Don't recompute dir. Use pkg-descs more. | ||
| 20 | (package-desc): Add `dir' field. | ||
| 21 | (package-desc-full-name): New function. | ||
| 22 | (package-load-descriptor): Combine the two arguments. Don't use `load'. | ||
| 23 | (package-maybe-load-descriptor): Remove. | ||
| 24 | (package-load-all-descriptors): Just call package-load-descriptor. | ||
| 25 | (package--disabled-p): New function. | ||
| 26 | (package-desc-vers, package-desc-doc): Remove aliases. | ||
| 27 | (package--dir): Remove function. | ||
| 28 | (package-activate): Check if a package is disabled. | ||
| 29 | (package-process-define-package): New function, extracted from | ||
| 30 | define-package. | ||
| 31 | (define-package): Turn into a place holder. | ||
| 32 | (package-unpack-single, package-tar-file-info): | ||
| 33 | Use package--description-file. | ||
| 34 | (package-compute-transaction): Use package--disabled-p. | ||
| 35 | (package-download-transaction): Don't call | ||
| 36 | package-maybe-load-descriptor since they're all loaded anyway. | ||
| 37 | (package-install): Change argument to be a pkg-desc. | ||
| 38 | (package-delete): Use a single pkg-desc argument. | ||
| 39 | (describe-package-1): Use package-desc-dir instead of package--dir. | ||
| 40 | Use package-desc property instead of package-symbol. | ||
| 41 | (package-install-button-action): Adjust accordingly. | ||
| 42 | (package--push): Rewrite. | ||
| 43 | (package-menu--print-info): Adjust accordingly. Change the ID format | ||
| 44 | to be a pkg-desc. | ||
| 45 | (package-menu-describe-package, package-menu-get-status) | ||
| 46 | (package-menu--find-upgrades, package-menu-mark-upgrades) | ||
| 47 | (package-menu-execute, package-menu--name-predicate): | ||
| 48 | Adjust accordingly. | ||
| 49 | * startup.el (package--description-file): New function. | ||
| 50 | (command-line): Use it. | ||
| 51 | * emacs-lisp/package-x.el (package-upload-buffer-internal): | ||
| 52 | Use package-desc-version. | ||
| 53 | |||
| 54 | * emacs-lisp/bytecomp.el (byte-compile-force-lexical-warnings): New var. | ||
| 55 | (byte-compile-preprocess): Use it. | ||
| 56 | (byte-compile-file-form-defalias): Try a bit harder to use macros we | ||
| 57 | can't quite recognize. | ||
| 58 | (byte-compile-add-to-list): Remove. | ||
| 59 | * emacs-lisp/cconv.el (cconv-warnings-only): New function. | ||
| 60 | (cconv-closure-convert): Add assertion. | ||
| 61 | |||
| 62 | * emacs-lisp/map-ynp.el: Use lexical-binding. | ||
| 63 | (map-y-or-n-p): Remove unused vars `tail' and `object'. | ||
| 64 | Factor out some repeated code. | ||
| 65 | |||
| 66 | 2013-06-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 67 | |||
| 68 | * subr.el (with-eval-after-load): New macro. | ||
| 69 | (eval-after-load): Allow form to be a function. | ||
| 70 | take advantage of lexical-binding. | ||
| 71 | (do-after-load-evaluation): Use dolist and adjust to new format. | ||
| 72 | * simple.el (bad-packages-alist): Use dolist and with-eval-after-load. | ||
| 73 | |||
| 74 | 2013-06-13 Juri Linkov <juri@jurta.org> | ||
| 75 | |||
| 76 | * replace.el (perform-replace): Display "symbol " and other search | ||
| 77 | modes from `isearch-message-prefix' in the *Help* buffer. | ||
| 78 | |||
| 79 | * isearch.el (isearch-query-replace): Add " symbol" and other | ||
| 80 | possible search modes from `isearch-message-prefix' to the prompt. | ||
| 81 | (isearch-occur): Use `with-isearch-suspended' to not exit Isearch | ||
| 82 | when reading a regexp to collect. | ||
| 83 | |||
| 84 | 2013-06-13 Juri Linkov <juri@jurta.org> | ||
| 85 | |||
| 86 | * isearch.el (word-search-regexp): Match whitespace if the search | ||
| 87 | string begins or ends in whitespace. The LAX arg is applied to | ||
| 88 | both ends of the search string. Use `regexp-quote' and explicit | ||
| 89 | \< and \> instead of \b. Use \` and \' instead of ^ and $. | ||
| 90 | (isearch-symbol-regexp): Sync with `word-search-regexp' where word | ||
| 91 | boundaries are replaced with symbol boundaries, and characters | ||
| 92 | between symbols match non-word non-symbol syntax. (Bug#14602) | ||
| 93 | |||
| 94 | 2013-06-13 Juri Linkov <juri@jurta.org> | ||
| 95 | |||
| 96 | * isearch.el (isearch-del-char): Don't exceed the length of | ||
| 97 | `isearch-string' by the prefix arg. (Bug#14563) | ||
| 98 | |||
| 99 | 2013-06-13 Juri Linkov <juri@jurta.org> | ||
| 100 | |||
| 101 | * isearch.el (isearch-yank-word, isearch-yank-line) | ||
| 102 | (isearch-char-by-name, isearch-quote-char) | ||
| 103 | (isearch-printing-char, isearch-process-search-char): | ||
| 104 | Add optional count prefix arg. (Bug#14563) | ||
| 105 | |||
| 106 | * international/isearch-x.el | ||
| 107 | (isearch-process-search-multibyte-characters): | ||
| 108 | Add optional count prefix arg. | ||
| 109 | |||
| 110 | 2013-06-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 111 | |||
| 112 | * subr.el (internal-push-keymap, internal-pop-keymap): New functions. | ||
| 113 | (set-temporary-overlay-map): Use them (bug#14095); and take advantage of | ||
| 114 | lexical-binding. | ||
| 115 | |||
| 116 | 2013-06-13 Vitalie Spinu <spinuvit@gmail.com> | ||
| 117 | |||
| 118 | * subr.el (set-temporary-overlay-map): Add on-exit argument. | ||
| 119 | |||
| 120 | 2013-06-13 Glenn Morris <rgm@gnu.org> | ||
| 121 | |||
| 122 | * startup.el (tty-handle-args): | ||
| 123 | Don't just discard "--" and anything after. (Bug#14608) | ||
| 124 | |||
| 125 | * emacs-lisp/lisp.el (forward-sexp, backward-sexp): Doc fixes. | ||
| 126 | |||
| 127 | 2013-06-13 Michael Albinus <michael.albinus@gmx.de> | ||
| 128 | |||
| 129 | Implement changes in Secret Service API. Make it backward compatible. | ||
| 130 | * net/secrets.el (secrets-struct-secret-content-type): New defonst. | ||
| 131 | (secrets-create-item): Use it. Prefix properties with interface. | ||
| 132 | |||
| 133 | 2013-06-13 Michael Hoffman <9qobl2n02@sneakemail.com> (tiny change) | ||
| 134 | |||
| 135 | * term.el (term-suppress-hard-newline): New option. (Bug#12017) | ||
| 136 | (term-emulate-terminal): Respect term-suppress-hard-newline. | ||
| 137 | |||
| 138 | 2013-06-13 E Sabof <esabof@gmail.com> (tiny change) | ||
| 139 | |||
| 140 | * image-dired.el (image-dired-dired-toggle-marked-thumbs): | ||
| 141 | Only remove a `thumb-file' overlay. (Bug#14548) | ||
| 142 | |||
| 1 | 2013-06-12 Grégoire Jadi <daimrod@gmail.com> | 143 | 2013-06-12 Grégoire Jadi <daimrod@gmail.com> |
| 2 | 144 | ||
| 3 | * mail/reporter.el (reporter-submit-bug-report): | 145 | * mail/reporter.el (reporter-submit-bug-report): |
| @@ -74,6 +216,11 @@ | |||
| 74 | (cl-define-compiler-macro): Use eval-and-compile. Give a name to the | 216 | (cl-define-compiler-macro): Use eval-and-compile. Give a name to the |
| 75 | compiler-macro function instead of setting `compiler-macro-file'. | 217 | compiler-macro function instead of setting `compiler-macro-file'. |
| 76 | 218 | ||
| 219 | 2013-06-12 Xue Fuqiao <xfq.free@gmail.com> | ||
| 220 | |||
| 221 | * vc/vc-cvs.el (vc-cvs-stay-local): Doc fix. | ||
| 222 | * vc/vc-hooks.el (vc-stay-local): Doc fix. | ||
| 223 | |||
| 77 | 2013-06-12 Stefan Monnier <monnier@iro.umontreal.ca> | 224 | 2013-06-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 78 | Daniel Hackney <dan@haxney.org> | 225 | Daniel Hackney <dan@haxney.org> |
| 79 | 226 | ||
| @@ -164,11 +311,6 @@ | |||
| 164 | * epa.el (epa-read-file-name): New function. (Bug#14510) | 311 | * epa.el (epa-read-file-name): New function. (Bug#14510) |
| 165 | (epa-decrypt-file): Make plain-file optional. Use epa-read-file-name. | 312 | (epa-decrypt-file): Make plain-file optional. Use epa-read-file-name. |
| 166 | 313 | ||
| 167 | 2013-06-09 Xue Fuqiao <xfq.free@gmail.com> | ||
| 168 | |||
| 169 | * vc/vc-cvs.el (vc-cvs-stay-local): Doc fix. | ||
| 170 | * vc/vc-hooks.el (vc-stay-local): Doc fix. | ||
| 171 | |||
| 172 | 2013-06-09 Aidan Gauland <aidalgol@amuri.net> | 314 | 2013-06-09 Aidan Gauland <aidalgol@amuri.net> |
| 173 | 315 | ||
| 174 | * eshell/em-term.el (eshell-visual-command-p): Fix bug that caused | 316 | * eshell/em-term.el (eshell-visual-command-p): Fix bug that caused |
| @@ -4634,7 +4776,7 @@ | |||
| 4634 | * progmodes/grep.el (grep-regexp-alist): Use variable grep-match-face | 4776 | * progmodes/grep.el (grep-regexp-alist): Use variable grep-match-face |
| 4635 | instead of hard-coded default face `match'. (Bug#9438) | 4777 | instead of hard-coded default face `match'. (Bug#9438) |
| 4636 | 4778 | ||
| 4637 | 2012-02-01 Christopher Schmidt <christopher@ch.ristopher.com> | 4779 | 2013-02-01 Christopher Schmidt <christopher@ch.ristopher.com> |
| 4638 | 4780 | ||
| 4639 | * vc/vc-arch.el (vc-arch-registered): | 4781 | * vc/vc-arch.el (vc-arch-registered): |
| 4640 | * vc/vc-bzr.el (vc-bzr-registered): | 4782 | * vc/vc-bzr.el (vc-bzr-registered): |
diff --git a/lisp/dired.el b/lisp/dired.el index 5b6a78759db..0f2b0973986 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -217,6 +217,13 @@ with the buffer narrowed to the listing." | |||
| 217 | ;; Note this can't simply be run inside function `dired-ls' as the hook | 217 | ;; Note this can't simply be run inside function `dired-ls' as the hook |
| 218 | ;; functions probably depend on the dired-subdir-alist to be OK. | 218 | ;; functions probably depend on the dired-subdir-alist to be OK. |
| 219 | 219 | ||
| 220 | (defcustom dired-initial-point-hook nil | ||
| 221 | "This hook is used to position the point. | ||
| 222 | It is run the function `dired-initial-position'." | ||
| 223 | :group 'dired | ||
| 224 | :type 'hook | ||
| 225 | :version "24.4") | ||
| 226 | |||
| 220 | (defcustom dired-dnd-protocol-alist | 227 | (defcustom dired-dnd-protocol-alist |
| 221 | '(("^file:///" . dired-dnd-handle-local-file) | 228 | '(("^file:///" . dired-dnd-handle-local-file) |
| 222 | ("^file://" . dired-dnd-handle-file) | 229 | ("^file://" . dired-dnd-handle-file) |
| @@ -2758,11 +2765,13 @@ as returned by `dired-get-filename'. LIMIT is the search limit." | |||
| 2758 | ;; FIXME document whatever dired-x is doing. | 2765 | ;; FIXME document whatever dired-x is doing. |
| 2759 | (defun dired-initial-position (dirname) | 2766 | (defun dired-initial-position (dirname) |
| 2760 | "Where point should go in a new listing of DIRNAME. | 2767 | "Where point should go in a new listing of DIRNAME. |
| 2761 | Point assumed at beginning of new subdir line." | 2768 | Point assumed at beginning of new subdir line. |
| 2769 | It runs the hook `dired-initial-position-hook'." | ||
| 2762 | (end-of-line) | 2770 | (end-of-line) |
| 2763 | (and (featurep 'dired-x) dired-find-subdir | 2771 | (and (featurep 'dired-x) dired-find-subdir |
| 2764 | (dired-goto-subdir dirname)) | 2772 | (dired-goto-subdir dirname)) |
| 2765 | (if dired-trivial-filenames (dired-goto-next-nontrivial-file))) | 2773 | (if dired-trivial-filenames (dired-goto-next-nontrivial-file)) |
| 2774 | (run-hooks 'dired-initial-point-hook)) | ||
| 2766 | 2775 | ||
| 2767 | ;; These are hooks which make tree dired work. | 2776 | ;; These are hooks which make tree dired work. |
| 2768 | ;; They are in this file because other parts of dired need to call them. | 2777 | ;; They are in this file because other parts of dired need to call them. |
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 7375c2176ba..7214501362d 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el | |||
| @@ -287,6 +287,7 @@ | |||
| 287 | (byte-compile--reify-function fn))))) | 287 | (byte-compile--reify-function fn))))) |
| 288 | (if (eq (car-safe newfn) 'function) | 288 | (if (eq (car-safe newfn) 'function) |
| 289 | (byte-compile-unfold-lambda `(,(cadr newfn) ,@(cdr form))) | 289 | (byte-compile-unfold-lambda `(,(cadr newfn) ,@(cdr form))) |
| 290 | ;; This can happen because of macroexp-warn-and-return &co. | ||
| 290 | (byte-compile-log-warning | 291 | (byte-compile-log-warning |
| 291 | (format "Inlining closure %S failed" name)) | 292 | (format "Inlining closure %S failed" name)) |
| 292 | form)))) | 293 | form)))) |
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index e603f76f41d..391401ae5d6 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -2174,6 +2174,8 @@ list that represents a doc string reference. | |||
| 2174 | byte-compile-maxdepth 0 | 2174 | byte-compile-maxdepth 0 |
| 2175 | byte-compile-output nil)))) | 2175 | byte-compile-output nil)))) |
| 2176 | 2176 | ||
| 2177 | (defvar byte-compile-force-lexical-warnings nil) | ||
| 2178 | |||
| 2177 | (defun byte-compile-preprocess (form &optional _for-effect) | 2179 | (defun byte-compile-preprocess (form &optional _for-effect) |
| 2178 | (setq form (macroexpand-all form byte-compile-macro-environment)) | 2180 | (setq form (macroexpand-all form byte-compile-macro-environment)) |
| 2179 | ;; FIXME: We should run byte-optimize-form here, but it currently does not | 2181 | ;; FIXME: We should run byte-optimize-form here, but it currently does not |
| @@ -2182,9 +2184,10 @@ list that represents a doc string reference. | |||
| 2182 | ;; macroexpand-all. | 2184 | ;; macroexpand-all. |
| 2183 | ;; (if (memq byte-optimize '(t source)) | 2185 | ;; (if (memq byte-optimize '(t source)) |
| 2184 | ;; (setq form (byte-optimize-form form for-effect))) | 2186 | ;; (setq form (byte-optimize-form form for-effect))) |
| 2185 | (if lexical-binding | 2187 | (cond |
| 2186 | (cconv-closure-convert form) | 2188 | (lexical-binding (cconv-closure-convert form)) |
| 2187 | form)) | 2189 | (byte-compile-force-lexical-warnings (cconv-warnings-only form)) |
| 2190 | (t form))) | ||
| 2188 | 2191 | ||
| 2189 | ;; byte-hunk-handlers cannot call this! | 2192 | ;; byte-hunk-handlers cannot call this! |
| 2190 | (defun byte-compile-toplevel-file-form (form) | 2193 | (defun byte-compile-toplevel-file-form (form) |
| @@ -4240,6 +4243,12 @@ binding slots have been popped." | |||
| 4240 | lam)) | 4243 | lam)) |
| 4241 | (unless (byte-compile-file-form-defmumble | 4244 | (unless (byte-compile-file-form-defmumble |
| 4242 | name macro arglist body rest) | 4245 | name macro arglist body rest) |
| 4246 | (when macro | ||
| 4247 | (if (null fun) | ||
| 4248 | (message "Macro %s unrecognized, won't work in file" name) | ||
| 4249 | (message "Macro %s partly recognized, trying our luck" name) | ||
| 4250 | (push (cons name (eval fun)) | ||
| 4251 | byte-compile-macro-environment))) | ||
| 4243 | (byte-compile-keep-pending form)))) | 4252 | (byte-compile-keep-pending form)))) |
| 4244 | 4253 | ||
| 4245 | ;; We used to just do: (byte-compile-normal-call form) | 4254 | ;; We used to just do: (byte-compile-normal-call form) |
| @@ -4268,26 +4277,6 @@ binding slots have been popped." | |||
| 4268 | 'byte-hunk-handler 'byte-compile-form-make-variable-buffer-local) | 4277 | 'byte-hunk-handler 'byte-compile-form-make-variable-buffer-local) |
| 4269 | (defun byte-compile-form-make-variable-buffer-local (form) | 4278 | (defun byte-compile-form-make-variable-buffer-local (form) |
| 4270 | (byte-compile-keep-pending form 'byte-compile-normal-call)) | 4279 | (byte-compile-keep-pending form 'byte-compile-normal-call)) |
| 4271 | |||
| 4272 | (byte-defop-compiler-1 add-to-list byte-compile-add-to-list) | ||
| 4273 | (defun byte-compile-add-to-list (form) | ||
| 4274 | ;; FIXME: This could be used for `set' as well, except that it's got | ||
| 4275 | ;; its own opcode, so the final `byte-compile-normal-call' needs to | ||
| 4276 | ;; be replaced with something else. | ||
| 4277 | (pcase form | ||
| 4278 | (`(,fun ',var . ,_) | ||
| 4279 | (byte-compile-check-variable var 'assign) | ||
| 4280 | (if (assq var byte-compile--lexical-environment) | ||
| 4281 | (byte-compile-log-warning | ||
| 4282 | (format "%s cannot use lexical var `%s'" fun var) | ||
| 4283 | nil :error) | ||
| 4284 | (unless (or (not (byte-compile-warning-enabled-p 'free-vars)) | ||
| 4285 | (boundp var) | ||
| 4286 | (memq var byte-compile-bound-variables) | ||
| 4287 | (memq var byte-compile-free-references)) | ||
| 4288 | (byte-compile-warn "assignment to free variable `%S'" var) | ||
| 4289 | (push var byte-compile-free-references))))) | ||
| 4290 | (byte-compile-normal-call form)) | ||
| 4291 | 4280 | ||
| 4292 | ;;; tags | 4281 | ;;; tags |
| 4293 | 4282 | ||
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index 761e33c059d..70fa71a0da4 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el | |||
| @@ -143,7 +143,19 @@ Returns a form where all lambdas don't have any free variables." | |||
| 143 | ;; Analyze form - fill these variables with new information. | 143 | ;; Analyze form - fill these variables with new information. |
| 144 | (cconv-analyse-form form '()) | 144 | (cconv-analyse-form form '()) |
| 145 | (setq cconv-freevars-alist (nreverse cconv-freevars-alist)) | 145 | (setq cconv-freevars-alist (nreverse cconv-freevars-alist)) |
| 146 | (cconv-convert form nil nil))) ; Env initially empty. | 146 | (prog1 (cconv-convert form nil nil) ; Env initially empty. |
| 147 | (cl-assert (null cconv-freevars-alist))))) | ||
| 148 | |||
| 149 | ;;;###autoload | ||
| 150 | (defun cconv-warnings-only (form) | ||
| 151 | "Add the warnings that closure conversion would encounter." | ||
| 152 | (let ((cconv-freevars-alist '()) | ||
| 153 | (cconv-lambda-candidates '()) | ||
| 154 | (cconv-captured+mutated '())) | ||
| 155 | ;; Analyze form - fill these variables with new information. | ||
| 156 | (cconv-analyse-form form '()) | ||
| 157 | ;; But don't perform the closure conversion. | ||
| 158 | form)) | ||
| 147 | 159 | ||
| 148 | (defconst cconv--dummy-var (make-symbol "ignored")) | 160 | (defconst cconv--dummy-var (make-symbol "ignored")) |
| 149 | 161 | ||
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index a31bef2391d..b37a811b8d5 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el | |||
| @@ -59,7 +59,8 @@ Should take the same arguments and behave similarly to `forward-sexp'.") | |||
| 59 | "Move forward across one balanced expression (sexp). | 59 | "Move forward across one balanced expression (sexp). |
| 60 | With ARG, do it that many times. Negative arg -N means | 60 | With ARG, do it that many times. Negative arg -N means |
| 61 | move backward across N balanced expressions. | 61 | move backward across N balanced expressions. |
| 62 | This command assumes point is not in a string or comment." | 62 | This command assumes point is not in a string or comment. |
| 63 | Calls `forward-sexp-function' to do the work, if that is non-nil." | ||
| 63 | (interactive "^p") | 64 | (interactive "^p") |
| 64 | (or arg (setq arg 1)) | 65 | (or arg (setq arg 1)) |
| 65 | (if forward-sexp-function | 66 | (if forward-sexp-function |
| @@ -71,7 +72,8 @@ This command assumes point is not in a string or comment." | |||
| 71 | "Move backward across one balanced expression (sexp). | 72 | "Move backward across one balanced expression (sexp). |
| 72 | With ARG, do it that many times. Negative arg -N means | 73 | With ARG, do it that many times. Negative arg -N means |
| 73 | move forward across N balanced expressions. | 74 | move forward across N balanced expressions. |
| 74 | This command assumes point is not in a string or comment." | 75 | This command assumes point is not in a string or comment. |
| 76 | Uses `forward-sexp' to do the work." | ||
| 75 | (interactive "^p") | 77 | (interactive "^p") |
| 76 | (or arg (setq arg 1)) | 78 | (or arg (setq arg 1)) |
| 77 | (forward-sexp (- arg))) | 79 | (forward-sexp (- arg))) |
diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el index 13202a9ce4d..1919d47687b 100644 --- a/lisp/emacs-lisp/map-ynp.el +++ b/lisp/emacs-lisp/map-ynp.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; map-ynp.el --- general-purpose boolean question-asker | 1 | ;;; map-ynp.el --- general-purpose boolean question-asker -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1991-1995, 2000-2013 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1991-1995, 2000-2013 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -79,7 +79,7 @@ are meaningful here. | |||
| 79 | 79 | ||
| 80 | Returns the number of actions taken." | 80 | Returns the number of actions taken." |
| 81 | (let* ((actions 0) | 81 | (let* ((actions 0) |
| 82 | user-keys mouse-event map prompt char elt tail def | 82 | user-keys mouse-event map prompt char elt def |
| 83 | ;; Non-nil means we should use mouse menus to ask. | 83 | ;; Non-nil means we should use mouse menus to ask. |
| 84 | use-menus | 84 | use-menus |
| 85 | delayed-switch-frame | 85 | delayed-switch-frame |
| @@ -89,13 +89,15 @@ Returns the number of actions taken." | |||
| 89 | (next (if (functionp list) | 89 | (next (if (functionp list) |
| 90 | (lambda () (setq elt (funcall list))) | 90 | (lambda () (setq elt (funcall list))) |
| 91 | (lambda () (when list | 91 | (lambda () (when list |
| 92 | (setq elt (pop list)) | 92 | (setq elt (pop list)) |
| 93 | t))))) | 93 | t)))) |
| 94 | (try-again (lambda () | ||
| 95 | (let ((x next)) | ||
| 96 | (setq next (lambda () (setq next x) elt)))))) | ||
| 94 | (if (and (listp last-nonmenu-event) | 97 | (if (and (listp last-nonmenu-event) |
| 95 | use-dialog-box) | 98 | use-dialog-box) |
| 96 | ;; Make a list describing a dialog box. | 99 | ;; Make a list describing a dialog box. |
| 97 | (let ((object (if help (capitalize (nth 0 help)))) | 100 | (let ((objects (if help (capitalize (nth 1 help)))) |
| 98 | (objects (if help (capitalize (nth 1 help)))) | ||
| 99 | (action (if help (capitalize (nth 2 help))))) | 101 | (action (if help (capitalize (nth 2 help))))) |
| 100 | (setq map `(("Yes" . act) ("No" . skip) | 102 | (setq map `(("Yes" . act) ("No" . skip) |
| 101 | ,@(mapcar (lambda (elt) | 103 | ,@(mapcar (lambda (elt) |
| @@ -129,8 +131,8 @@ Returns the number of actions taken." | |||
| 129 | (unwind-protect | 131 | (unwind-protect |
| 130 | (progn | 132 | (progn |
| 131 | (if (stringp prompter) | 133 | (if (stringp prompter) |
| 132 | (setq prompter `(lambda (object) | 134 | (setq prompter (lambda (object) |
| 133 | (format ,prompter object)))) | 135 | (format prompter object)))) |
| 134 | (while (funcall next) | 136 | (while (funcall next) |
| 135 | (setq prompt (funcall prompter elt)) | 137 | (setq prompt (funcall prompter elt)) |
| 136 | (cond ((stringp prompt) | 138 | (cond ((stringp prompt) |
| @@ -176,9 +178,7 @@ Returns the number of actions taken." | |||
| 176 | next (lambda () nil))) | 178 | next (lambda () nil))) |
| 177 | ((eq def 'quit) | 179 | ((eq def 'quit) |
| 178 | (setq quit-flag t) | 180 | (setq quit-flag t) |
| 179 | (setq next `(lambda () | 181 | (funcall try-again)) |
| 180 | (setq next ',next) | ||
| 181 | ',elt))) | ||
| 182 | ((eq def 'automatic) | 182 | ((eq def 'automatic) |
| 183 | ;; Act on this and all following objects. | 183 | ;; Act on this and all following objects. |
| 184 | (if (funcall prompter elt) | 184 | (if (funcall prompter elt) |
| @@ -219,40 +219,30 @@ the current %s and exit." | |||
| 219 | (with-current-buffer standard-output | 219 | (with-current-buffer standard-output |
| 220 | (help-mode))) | 220 | (help-mode))) |
| 221 | 221 | ||
| 222 | (setq next `(lambda () | 222 | (funcall try-again)) |
| 223 | (setq next ',next) | 223 | ((and (symbolp def) (commandp def)) |
| 224 | ',elt))) | 224 | (call-interactively def) |
| 225 | ((and (symbolp def) (commandp def)) | 225 | ;; Regurgitated; try again. |
| 226 | (call-interactively def) | 226 | (funcall try-again)) |
| 227 | ;; Regurgitated; try again. | ||
| 228 | (setq next `(lambda () | ||
| 229 | (setq next ',next) | ||
| 230 | ',elt))) | ||
| 231 | ((vectorp def) | 227 | ((vectorp def) |
| 232 | ;; A user-defined key. | 228 | ;; A user-defined key. |
| 233 | (if (funcall (aref def 0) elt) ;Call its function. | 229 | (if (funcall (aref def 0) elt) ;Call its function. |
| 234 | ;; The function has eaten this object. | 230 | ;; The function has eaten this object. |
| 235 | (setq actions (1+ actions)) | 231 | (setq actions (1+ actions)) |
| 236 | ;; Regurgitated; try again. | 232 | ;; Regurgitated; try again. |
| 237 | (setq next `(lambda () | 233 | (funcall try-again))) |
| 238 | (setq next ',next) | ||
| 239 | ',elt)))) | ||
| 240 | ((and (consp char) | 234 | ((and (consp char) |
| 241 | (eq (car char) 'switch-frame)) | 235 | (eq (car char) 'switch-frame)) |
| 242 | ;; switch-frame event. Put it off until we're done. | 236 | ;; switch-frame event. Put it off until we're done. |
| 243 | (setq delayed-switch-frame char) | 237 | (setq delayed-switch-frame char) |
| 244 | (setq next `(lambda () | 238 | (funcall try-again)) |
| 245 | (setq next ',next) | ||
| 246 | ',elt))) | ||
| 247 | (t | 239 | (t |
| 248 | ;; Random char. | 240 | ;; Random char. |
| 249 | (message "Type %s for help." | 241 | (message "Type %s for help." |
| 250 | (key-description (vector help-char))) | 242 | (key-description (vector help-char))) |
| 251 | (beep) | 243 | (beep) |
| 252 | (sit-for 1) | 244 | (sit-for 1) |
| 253 | (setq next `(lambda () | 245 | (funcall try-again)))) |
| 254 | (setq next ',next) | ||
| 255 | ',elt))))) | ||
| 256 | (prompt | 246 | (prompt |
| 257 | (funcall actor elt) | 247 | (funcall actor elt) |
| 258 | (setq actions (1+ actions)))))) | 248 | (setq actions (1+ actions)))))) |
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el index 17919d9bbeb..3300e89ec1e 100644 --- a/lisp/emacs-lisp/package-x.el +++ b/lisp/emacs-lisp/package-x.el | |||
| @@ -224,7 +224,7 @@ if it exists." | |||
| 224 | (let ((elt (assq pkg-name (cdr contents)))) | 224 | (let ((elt (assq pkg-name (cdr contents)))) |
| 225 | (if elt | 225 | (if elt |
| 226 | (if (version-list-<= split-version | 226 | (if (version-list-<= split-version |
| 227 | (package-desc-vers (cdr elt))) | 227 | (package-desc-version (cdr elt))) |
| 228 | (error "New package has smaller version: %s" pkg-version) | 228 | (error "New package has smaller version: %s" pkg-version) |
| 229 | (setcdr elt new-desc)) | 229 | (setcdr elt new-desc)) |
| 230 | (setq contents (cons (car contents) | 230 | (setq contents (cons (car contents) |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index d5176abded0..6d34c229733 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -336,13 +336,22 @@ required version. | |||
| 336 | either `single' or `tar'. | 336 | either `single' or `tar'. |
| 337 | 337 | ||
| 338 | `archive' The name of the archive (as a string) whence this | 338 | `archive' The name of the archive (as a string) whence this |
| 339 | package came." | 339 | package came. |
| 340 | |||
| 341 | `dir' The directory where the package is installed (if installed)." | ||
| 340 | name | 342 | name |
| 341 | version | 343 | version |
| 342 | (summary package--default-summary) | 344 | (summary package--default-summary) |
| 343 | reqs | 345 | reqs |
| 344 | kind | 346 | kind |
| 345 | archive) | 347 | archive |
| 348 | dir) | ||
| 349 | |||
| 350 | ;; Pseudo fields. | ||
| 351 | (defsubst package-desc-full-name (pkg-desc) | ||
| 352 | (format "%s-%s" | ||
| 353 | (package-desc-name pkg-desc) | ||
| 354 | (package-version-join (package-desc-version pkg-desc)))) | ||
| 346 | 355 | ||
| 347 | ;; Package descriptor format used in finder-inf.el and package--builtins. | 356 | ;; Package descriptor format used in finder-inf.el and package--builtins. |
| 348 | (cl-defstruct (package--bi-desc | 357 | (cl-defstruct (package--bi-desc |
| @@ -422,17 +431,18 @@ E.g., if given \"quux-23.0\", will return \"quux\"" | |||
| 422 | (if (string-match (concat "\\`" package-subdirectory-regexp "\\'") dirname) | 431 | (if (string-match (concat "\\`" package-subdirectory-regexp "\\'") dirname) |
| 423 | (match-string 1 dirname))) | 432 | (match-string 1 dirname))) |
| 424 | 433 | ||
| 425 | (defun package-load-descriptor (dir package) | 434 | (defun package-load-descriptor (pkg-dir) |
| 426 | "Load the description file in directory DIR for package PACKAGE. | 435 | "Load the description file in directory PKG-DIR." |
| 427 | Here, PACKAGE is a string of the form NAME-VERSION, where NAME is | 436 | (let ((pkg-file (expand-file-name (package--description-file pkg-dir) |
| 428 | the package name and VERSION is its version." | 437 | pkg-dir))) |
| 429 | (let* ((pkg-dir (expand-file-name package dir)) | 438 | (when (file-exists-p pkg-file) |
| 430 | (pkg-file (expand-file-name | 439 | (with-temp-buffer |
| 431 | (concat (package-strip-version package) "-pkg") | 440 | (insert-file-contents pkg-file) |
| 432 | pkg-dir))) | 441 | (emacs-lisp-mode) |
| 433 | (when (and (file-directory-p pkg-dir) | 442 | (goto-char (point-min)) |
| 434 | (file-exists-p (concat pkg-file ".el"))) | 443 | (let ((pkg-desc (package-process-define-package |
| 435 | (load pkg-file nil t)))) | 444 | (read (current-buffer)) pkg-file))) |
| 445 | (setf (package-desc-dir pkg-desc) pkg-dir)))))) | ||
| 436 | 446 | ||
| 437 | (defun package-load-all-descriptors () | 447 | (defun package-load-all-descriptors () |
| 438 | "Load descriptors for installed Emacs Lisp packages. | 448 | "Load descriptors for installed Emacs Lisp packages. |
| @@ -443,65 +453,34 @@ controls which package subdirectories may be loaded. | |||
| 443 | In each valid package subdirectory, this function loads the | 453 | In each valid package subdirectory, this function loads the |
| 444 | description file containing a call to `define-package', which | 454 | description file containing a call to `define-package', which |
| 445 | updates `package-alist' and `package-obsolete-alist'." | 455 | updates `package-alist' and `package-obsolete-alist'." |
| 446 | (let ((regexp (concat "\\`" package-subdirectory-regexp "\\'"))) | 456 | (dolist (dir (cons package-user-dir package-directory-list)) |
| 447 | (dolist (dir (cons package-user-dir package-directory-list)) | 457 | (when (file-directory-p dir) |
| 448 | (when (file-directory-p dir) | 458 | (dolist (subdir (directory-files dir)) |
| 449 | (dolist (subdir (directory-files dir)) | 459 | (let ((pkg-dir (expand-file-name subdir dir))) |
| 450 | (when (string-match regexp subdir) | 460 | (when (file-directory-p pkg-dir) |
| 451 | (package-maybe-load-descriptor (match-string 1 subdir) | 461 | (package-load-descriptor pkg-dir))))))) |
| 452 | (match-string 2 subdir) | 462 | |
| 453 | dir))))))) | 463 | (defun package-disabled-p (pkg-name version) |
| 454 | 464 | "Return whether PKG-NAME at VERSION can be activated. | |
| 455 | (defun package-maybe-load-descriptor (name version dir) | 465 | The decision is made according to `package-load-list'. |
| 456 | "Maybe load a specific package from directory DIR. | 466 | Return nil if the package can be activated. |
| 457 | NAME and VERSION are the package's name and version strings. | 467 | Return t if the package is completely disabled. |
| 458 | This function checks `package-load-list', before actually loading | 468 | Return the max version (as a string) if the package is held at a lower version." |
| 459 | the package by calling `package-load-descriptor'." | 469 | (let ((force (assq pkg-name package-load-list))) |
| 460 | (let ((force (assq (intern name) package-load-list)) | 470 | (cond ((null force) (not (memq 'all package-load-list))) |
| 461 | (subdir (concat name "-" version))) | 471 | ((null (setq force (cadr force))) t) ; disabled |
| 462 | (and (file-directory-p (expand-file-name subdir dir)) | 472 | ((eq force t) nil) |
| 463 | ;; Check `package-load-list': | 473 | ((stringp force) ; held |
| 464 | (cond ((null force) | 474 | (unless (version-list-= version (version-to-list force)) |
| 465 | (memq 'all package-load-list)) | 475 | force)) |
| 466 | ((null (setq force (cadr force))) | 476 | (t (error "Invalid element in `package-load-list'"))))) |
| 467 | nil) ; disabled | ||
| 468 | ((eq force t) | ||
| 469 | t) | ||
| 470 | ((stringp force) ; held | ||
| 471 | (version-list-= (version-to-list version) | ||
| 472 | (version-to-list force))) | ||
| 473 | (t | ||
| 474 | (error "Invalid element in `package-load-list'"))) | ||
| 475 | ;; Actually load the descriptor: | ||
| 476 | (package-load-descriptor dir subdir)))) | ||
| 477 | |||
| 478 | (define-obsolete-function-alias 'package-desc-vers 'package-desc-version "24.4") | ||
| 479 | |||
| 480 | (define-obsolete-function-alias 'package-desc-doc 'package-desc-summary "24.4") | ||
| 481 | |||
| 482 | |||
| 483 | (defun package--dir (name version) | ||
| 484 | ;; FIXME: Keep this as a field in the package-desc. | ||
| 485 | "Return the directory where a package is installed, or nil if none. | ||
| 486 | NAME is a symbol and VERSION is a string." | ||
| 487 | (let* ((subdir (format "%s-%s" name version)) | ||
| 488 | (dir-list (cons package-user-dir package-directory-list)) | ||
| 489 | pkg-dir) | ||
| 490 | (while dir-list | ||
| 491 | (let ((subdir-full (expand-file-name subdir (car dir-list)))) | ||
| 492 | (if (file-directory-p subdir-full) | ||
| 493 | (setq pkg-dir subdir-full | ||
| 494 | dir-list nil) | ||
| 495 | (setq dir-list (cdr dir-list))))) | ||
| 496 | pkg-dir)) | ||
| 497 | 477 | ||
| 498 | (defun package-activate-1 (pkg-desc) | 478 | (defun package-activate-1 (pkg-desc) |
| 499 | (let* ((name (package-desc-name pkg-desc)) | 479 | (let* ((name (package-desc-name pkg-desc)) |
| 500 | (version-str (package-version-join (package-desc-version pkg-desc))) | 480 | (pkg-dir (package-desc-dir pkg-desc))) |
| 501 | (pkg-dir (package--dir name version-str))) | ||
| 502 | (unless pkg-dir | 481 | (unless pkg-dir |
| 503 | (error "Internal error: unable to find directory for `%s-%s'" | 482 | (error "Internal error: unable to find directory for `%s'" |
| 504 | name version-str)) | 483 | (package-desc-full-name pkg-desc))) |
| 505 | ;; Add info node. | 484 | ;; Add info node. |
| 506 | (when (file-exists-p (expand-file-name "dir" pkg-dir)) | 485 | (when (file-exists-p (expand-file-name "dir" pkg-dir)) |
| 507 | ;; FIXME: not the friendliest, but simple. | 486 | ;; FIXME: not the friendliest, but simple. |
| @@ -553,6 +532,8 @@ Return nil if the package could not be activated." | |||
| 553 | ;; If the package is already activated, just return t. | 532 | ;; If the package is already activated, just return t. |
| 554 | ((memq package package-activated-list) | 533 | ((memq package package-activated-list) |
| 555 | t) | 534 | t) |
| 535 | ;; If it's disabled, then just skip it. | ||
| 536 | ((package-disabled-p package available-version) nil) | ||
| 556 | ;; Otherwise, proceed with activation. | 537 | ;; Otherwise, proceed with activation. |
| 557 | (t | 538 | (t |
| 558 | (let ((fail (catch 'dep-failure | 539 | (let ((fail (catch 'dep-failure |
| @@ -593,29 +574,32 @@ REQUIREMENTS is a list of dependencies on other packages. | |||
| 593 | where OTHER-VERSION is a string. | 574 | where OTHER-VERSION is a string. |
| 594 | 575 | ||
| 595 | EXTRA-PROPERTIES is currently unused." | 576 | EXTRA-PROPERTIES is currently unused." |
| 596 | (let* ((name (intern name-string)) | 577 | ;; FIXME: Placeholder! Should we keep it? |
| 597 | (version (version-to-list version-string)) | 578 | (error "Don't call me!")) |
| 598 | (new-pkg-desc (cons name | 579 | |
| 599 | (package-desc-from-define name-string | 580 | (defun package-process-define-package (exp origin) |
| 600 | version-string | 581 | (unless (eq (car-safe exp) 'define-package) |
| 601 | docstring | 582 | (error "Can't find define-package in %s" origin)) |
| 602 | requirements))) | 583 | (let* ((new-pkg-desc (apply #'package-desc-from-define (cdr exp))) |
| 603 | (old-pkg (assq name package-alist))) | 584 | (name (package-desc-name new-pkg-desc)) |
| 585 | (version (package-desc-version new-pkg-desc)) | ||
| 586 | (old-pkg (assq name package-alist))) | ||
| 604 | (cond | 587 | (cond |
| 605 | ;; If there's no old package, just add this to `package-alist'. | 588 | ;; If there's no old package, just add this to `package-alist'. |
| 606 | ((null old-pkg) | 589 | ((null old-pkg) |
| 607 | (push new-pkg-desc package-alist)) | 590 | (push (cons name new-pkg-desc) package-alist)) |
| 608 | ((version-list-< (package-desc-version (cdr old-pkg)) version) | 591 | ((version-list-< (package-desc-version (cdr old-pkg)) version) |
| 609 | ;; Remove the old package and declare it obsolete. | 592 | ;; Remove the old package and declare it obsolete. |
| 610 | (package-mark-obsolete name (cdr old-pkg)) | 593 | (package-mark-obsolete name (cdr old-pkg)) |
| 611 | (setq package-alist (cons new-pkg-desc | 594 | (setq package-alist (cons (cons name new-pkg-desc) |
| 612 | (delq old-pkg package-alist)))) | 595 | (delq old-pkg package-alist)))) |
| 613 | ;; You can have two packages with the same version, e.g. one in | 596 | ;; You can have two packages with the same version, e.g. one in |
| 614 | ;; the system package directory and one in your private | 597 | ;; the system package directory and one in your private |
| 615 | ;; directory. We just let the first one win. | 598 | ;; directory. We just let the first one win. |
| 616 | ((not (version-list-= (package-desc-version (cdr old-pkg)) version)) | 599 | ((not (version-list-= (package-desc-version (cdr old-pkg)) version)) |
| 617 | ;; The package is born obsolete. | 600 | ;; The package is born obsolete. |
| 618 | (package-mark-obsolete name (cdr new-pkg-desc)))))) | 601 | (package-mark-obsolete name new-pkg-desc))) |
| 602 | new-pkg-desc)) | ||
| 619 | 603 | ||
| 620 | ;; From Emacs 22. | 604 | ;; From Emacs 22. |
| 621 | (defun package-autoload-ensure-default-file (file) | 605 | (defun package-autoload-ensure-default-file (file) |
| @@ -711,7 +695,8 @@ PKG-DIR is the name of the package directory." | |||
| 711 | (version-to-list version))) | 695 | (version-to-list version))) |
| 712 | package-user-dir)) | 696 | package-user-dir)) |
| 713 | (el-file (expand-file-name (format "%s.el" name) pkg-dir)) | 697 | (el-file (expand-file-name (format "%s.el" name) pkg-dir)) |
| 714 | (pkg-file (expand-file-name (format "%s-pkg.el" name) pkg-dir))) | 698 | (pkg-file (expand-file-name (package--description-file pkg-dir) |
| 699 | pkg-dir))) | ||
| 715 | (make-directory pkg-dir t) | 700 | (make-directory pkg-dir t) |
| 716 | (package--write-file-no-coding el-file) | 701 | (package--write-file-no-coding el-file) |
| 717 | (let ((print-level nil) | 702 | (let ((print-level nil) |
| @@ -828,20 +813,15 @@ not included in this list." | |||
| 828 | ;; A package is required, but not installed. It might also be | 813 | ;; A package is required, but not installed. It might also be |
| 829 | ;; blocked via `package-load-list'. | 814 | ;; blocked via `package-load-list'. |
| 830 | (let ((pkg-desc (cdr (assq next-pkg package-archive-contents))) | 815 | (let ((pkg-desc (cdr (assq next-pkg package-archive-contents))) |
| 831 | hold) | 816 | (disabled (package-disabled-p next-pkg next-version))) |
| 832 | (when (setq hold (assq next-pkg package-load-list)) | 817 | (when disabled |
| 833 | (setq hold (cadr hold)) | 818 | (if (stringp disabled) |
| 834 | (cond ((eq hold t)) | 819 | (error "Package `%s' held at version %s, \ |
| 835 | ((eq hold nil) | ||
| 836 | (error "Required package '%s' is disabled" | ||
| 837 | (symbol-name next-pkg))) | ||
| 838 | ((null (stringp hold)) | ||
| 839 | (error "Invalid element in `package-load-list'")) | ||
| 840 | ((version-list-< (version-to-list hold) next-version) | ||
| 841 | (error "Package `%s' held at version %s, \ | ||
| 842 | but version %s required" | 820 | but version %s required" |
| 843 | (symbol-name next-pkg) hold | 821 | (symbol-name next-pkg) disabled |
| 844 | (package-version-join next-version))))) | 822 | (package-version-join next-version)) |
| 823 | (error "Required package '%s' is disabled" | ||
| 824 | (symbol-name next-pkg)))) | ||
| 845 | (unless pkg-desc | 825 | (unless pkg-desc |
| 846 | (error "Package `%s-%s' is unavailable" | 826 | (error "Package `%s-%s' is unavailable" |
| 847 | (symbol-name next-pkg) | 827 | (symbol-name next-pkg) |
| @@ -954,6 +934,7 @@ PACKAGE-LIST should be a list of package names (symbols). | |||
| 954 | This function assumes that all package requirements in | 934 | This function assumes that all package requirements in |
| 955 | PACKAGE-LIST are satisfied, i.e. that PACKAGE-LIST is computed | 935 | PACKAGE-LIST are satisfied, i.e. that PACKAGE-LIST is computed |
| 956 | using `package-compute-transaction'." | 936 | using `package-compute-transaction'." |
| 937 | ;; FIXME: make package-list a list of pkg-desc. | ||
| 957 | (dolist (elt package-list) | 938 | (dolist (elt package-list) |
| 958 | (let* ((desc (cdr (assq elt package-archive-contents))) | 939 | (let* ((desc (cdr (assq elt package-archive-contents))) |
| 959 | ;; As an exception, if package is "held" in | 940 | ;; As an exception, if package is "held" in |
| @@ -974,15 +955,13 @@ using `package-compute-transaction'." | |||
| 974 | ;; If package A depends on package B, then A may `require' B | 955 | ;; If package A depends on package B, then A may `require' B |
| 975 | ;; during byte compilation. So we need to activate B before | 956 | ;; during byte compilation. So we need to activate B before |
| 976 | ;; unpacking A. | 957 | ;; unpacking A. |
| 977 | (package-maybe-load-descriptor (symbol-name elt) v-string | ||
| 978 | package-user-dir) | ||
| 979 | (package-activate elt (version-to-list v-string))))) | 958 | (package-activate elt (version-to-list v-string))))) |
| 980 | 959 | ||
| 981 | ;;;###autoload | 960 | ;;;###autoload |
| 982 | (defun package-install (name) | 961 | (defun package-install (pkg-desc) |
| 983 | "Install the package named NAME. | 962 | "Install the package PKG-DESC. |
| 984 | NAME should be the name of one of the available packages in an | 963 | PKG-DESC should be one of the available packages in an |
| 985 | archive in `package-archives'. Interactively, prompt for NAME." | 964 | archive in `package-archives'. Interactively, prompt for its name." |
| 986 | (interactive | 965 | (interactive |
| 987 | (progn | 966 | (progn |
| 988 | ;; Initialize the package system to get the list of package | 967 | ;; Initialize the package system to get the list of package |
| @@ -991,20 +970,22 @@ archive in `package-archives'. Interactively, prompt for NAME." | |||
| 991 | (package-initialize t)) | 970 | (package-initialize t)) |
| 992 | (unless package-archive-contents | 971 | (unless package-archive-contents |
| 993 | (package-refresh-contents)) | 972 | (package-refresh-contents)) |
| 994 | (list (intern (completing-read | 973 | (let* ((name (intern (completing-read |
| 995 | "Install package: " | 974 | "Install package: " |
| 996 | (mapcar (lambda (elt) | 975 | (mapcar (lambda (elt) |
| 997 | (cons (symbol-name (car elt)) | 976 | (cons (symbol-name (car elt)) |
| 998 | nil)) | 977 | nil)) |
| 999 | package-archive-contents) | 978 | package-archive-contents) |
| 1000 | nil t))))) | 979 | nil t))) |
| 1001 | (let ((pkg-desc (assq name package-archive-contents))) | 980 | (pkg-desc (cdr (assq name package-archive-contents)))) |
| 1002 | (unless pkg-desc | 981 | (unless pkg-desc |
| 1003 | (error "Package `%s' is not available for installation" | 982 | (error "Package `%s' is not available for installation" |
| 1004 | (symbol-name name))) | 983 | name)) |
| 1005 | (package-download-transaction | 984 | (list pkg-desc)))) |
| 1006 | (package-compute-transaction (list name) | 985 | (package-download-transaction |
| 1007 | (package-desc-reqs (cdr pkg-desc)))))) | 986 | ;; FIXME: Use (list pkg-desc) instead of just the name. |
| 987 | (package-compute-transaction (list (package-desc-name pkg-desc)) | ||
| 988 | (package-desc-reqs pkg-desc)))) | ||
| 1008 | 989 | ||
| 1009 | (defun package-strip-rcs-id (str) | 990 | (defun package-strip-rcs-id (str) |
| 1010 | "Strip RCS version ID from the version string STR. | 991 | "Strip RCS version ID from the version string STR. |
| @@ -1055,31 +1036,28 @@ boundaries." | |||
| 1055 | "Find package information for a tar file. | 1036 | "Find package information for a tar file. |
| 1056 | FILE is the name of the tar file to examine. | 1037 | FILE is the name of the tar file to examine. |
| 1057 | The return result is a vector like `package-buffer-info'." | 1038 | The return result is a vector like `package-buffer-info'." |
| 1058 | (let ((default-directory (file-name-directory file)) | 1039 | (let* ((default-directory (file-name-directory file)) |
| 1059 | (file (file-name-nondirectory file))) | 1040 | (file (file-name-nondirectory file)) |
| 1060 | (unless (string-match (concat "\\`" package-subdirectory-regexp "\\.tar\\'") | 1041 | (dir-name |
| 1061 | file) | 1042 | (if (string-match "\\.tar\\'" file) |
| 1062 | (error "Invalid package name `%s'" file)) | 1043 | (substring file 0 (match-beginning 0)) |
| 1063 | (let* ((pkg-name (match-string-no-properties 1 file)) | 1044 | (error "Invalid package name `%s'" file))) |
| 1064 | (pkg-version (match-string-no-properties 2 file)) | 1045 | (desc-file (package--description-file dir-name)) |
| 1065 | ;; Extract the package descriptor. | 1046 | ;; Extract the package descriptor. |
| 1066 | (pkg-def-contents (shell-command-to-string | 1047 | (pkg-def-contents (shell-command-to-string |
| 1067 | ;; Requires GNU tar. | 1048 | ;; Requires GNU tar. |
| 1068 | (concat "tar -xOf " file " " | 1049 | (concat "tar -xOf " file " " |
| 1069 | pkg-name "-" pkg-version "/" | 1050 | dir-name "/" desc-file))) |
| 1070 | pkg-name "-pkg.el"))) | 1051 | (pkg-def-parsed (package-read-from-string pkg-def-contents))) |
| 1071 | (pkg-def-parsed (package-read-from-string pkg-def-contents))) | 1052 | (unless (eq (car pkg-def-parsed) 'define-package) |
| 1072 | (unless (eq (car pkg-def-parsed) 'define-package) | 1053 | (error "Can't find define-package in %s" desc-file)) |
| 1073 | (error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name)) | 1054 | (let ((pkg-desc |
| 1074 | (let ((pkg-desc | 1055 | (apply #'package-desc-from-define (append (cdr pkg-def-parsed) |
| 1075 | (apply #'package-desc-from-define (append (cdr pkg-def-parsed) | 1056 | '(:kind tar))))) |
| 1076 | '(:kind tar))))) | 1057 | (unless (equal dir-name (package-desc-full-name pkg-desc)) |
| 1077 | (unless (equal pkg-version | 1058 | ;; FIXME: Shouldn't this just be a message/warning? |
| 1078 | (package-version-join (package-desc-version pkg-desc))) | 1059 | (error "Package has inconsistent name")) |
| 1079 | (error "Package has inconsistent versions")) | 1060 | pkg-desc))) |
| 1080 | (unless (equal pkg-name (symbol-name (package-desc-name pkg-desc))) | ||
| 1081 | (error "Package has inconsistent names")) | ||
| 1082 | pkg-desc)))) | ||
| 1083 | 1061 | ||
| 1084 | 1062 | ||
| 1085 | ;;;###autoload | 1063 | ;;;###autoload |
| @@ -1123,17 +1101,17 @@ The file can either be a tar file or an Emacs Lisp file." | |||
| 1123 | (package-install-from-buffer (package-tar-file-info file))) | 1101 | (package-install-from-buffer (package-tar-file-info file))) |
| 1124 | (t (error "Unrecognized extension `%s'" (file-name-extension file)))))) | 1102 | (t (error "Unrecognized extension `%s'" (file-name-extension file)))))) |
| 1125 | 1103 | ||
| 1126 | (defun package-delete (name version) | 1104 | (defun package-delete (pkg-desc) |
| 1127 | (let ((dir (package--dir name version))) | 1105 | (let ((dir (package-desc-dir pkg-desc))) |
| 1128 | (if (string-equal (file-name-directory dir) | 1106 | (if (string-equal (file-name-directory dir) |
| 1129 | (file-name-as-directory | 1107 | (file-name-as-directory |
| 1130 | (expand-file-name package-user-dir))) | 1108 | (expand-file-name package-user-dir))) |
| 1131 | (progn | 1109 | (progn |
| 1132 | (delete-directory dir t t) | 1110 | (delete-directory dir t t) |
| 1133 | (message "Package `%s-%s' deleted." name version)) | 1111 | (message "Package `%s' deleted." (package-desc-full-name pkg-desc))) |
| 1134 | ;; Don't delete "system" packages | 1112 | ;; Don't delete "system" packages |
| 1135 | (error "Package `%s-%s' is a system package, not deleting" | 1113 | (error "Package `%s' is a system package, not deleting" |
| 1136 | name version)))) | 1114 | (package-desc-full-name pkg-desc))))) |
| 1137 | 1115 | ||
| 1138 | (defun package-archive-base (name) | 1116 | (defun package-archive-base (name) |
| 1139 | "Return the archive containing the package NAME." | 1117 | "Return the archive containing the package NAME." |
| @@ -1212,7 +1190,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages." | |||
| 1212 | "Describe package: ") | 1190 | "Describe package: ") |
| 1213 | packages nil t nil nil guess)) | 1191 | packages nil t nil nil guess)) |
| 1214 | (list (if (equal val "") guess (intern val))))) | 1192 | (list (if (equal val "") guess (intern val))))) |
| 1215 | (if (or (null package) (not (symbolp package))) | 1193 | (if (not (and package (symbolp package))) |
| 1216 | (message "No package specified") | 1194 | (message "No package specified") |
| 1217 | (help-setup-xref (list #'describe-package package) | 1195 | (help-setup-xref (list #'describe-package package) |
| 1218 | (called-interactively-p 'interactive)) | 1196 | (called-interactively-p 'interactive)) |
| @@ -1231,7 +1209,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages." | |||
| 1231 | ;; Loaded packages are in `package-alist'. | 1209 | ;; Loaded packages are in `package-alist'. |
| 1232 | ((setq desc (cdr (assq package package-alist))) | 1210 | ((setq desc (cdr (assq package package-alist))) |
| 1233 | (setq version (package-version-join (package-desc-version desc))) | 1211 | (setq version (package-version-join (package-desc-version desc))) |
| 1234 | (if (setq pkg-dir (package--dir package-name version)) | 1212 | (if (setq pkg-dir (package-desc-dir desc)) |
| 1235 | (insert "an installed package.\n\n") | 1213 | (insert "an installed package.\n\n") |
| 1236 | ;; This normally does not happen. | 1214 | ;; This normally does not happen. |
| 1237 | (insert "a deleted package.\n\n"))) | 1215 | (insert "a deleted package.\n\n"))) |
| @@ -1279,7 +1257,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages." | |||
| 1279 | :foreground "black") | 1257 | :foreground "black") |
| 1280 | 'link))) | 1258 | 'link))) |
| 1281 | (insert-text-button button-text 'face button-face 'follow-link t | 1259 | (insert-text-button button-text 'face button-face 'follow-link t |
| 1282 | 'package-symbol package | 1260 | 'package-desc desc |
| 1283 | 'action 'package-install-button-action))) | 1261 | 'action 'package-install-button-action))) |
| 1284 | (built-in | 1262 | (built-in |
| 1285 | (insert (propertize "Built-in." | 1263 | (insert (propertize "Built-in." |
| @@ -1343,9 +1321,10 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages." | |||
| 1343 | (goto-char (point-max)))))))) | 1321 | (goto-char (point-max)))))))) |
| 1344 | 1322 | ||
| 1345 | (defun package-install-button-action (button) | 1323 | (defun package-install-button-action (button) |
| 1346 | (let ((package (button-get button 'package-symbol))) | 1324 | (let ((pkg-desc (button-get button 'package-desc))) |
| 1347 | (when (y-or-n-p (format "Install package `%s'? " package)) | 1325 | (when (y-or-n-p (format "Install package `%s'? " |
| 1348 | (package-install package) | 1326 | (package-desc-full-name pkg-desc))) |
| 1327 | (package-install pkg-desc) | ||
| 1349 | (revert-buffer nil t) | 1328 | (revert-buffer nil t) |
| 1350 | (goto-char (point-min))))) | 1329 | (goto-char (point-min))))) |
| 1351 | 1330 | ||
| @@ -1434,29 +1413,26 @@ Letters do not insert themselves; instead, they are commands. | |||
| 1434 | (setq tabulated-list-sort-key (cons "Status" nil)) | 1413 | (setq tabulated-list-sort-key (cons "Status" nil)) |
| 1435 | (tabulated-list-init-header)) | 1414 | (tabulated-list-init-header)) |
| 1436 | 1415 | ||
| 1437 | (defmacro package--push (package desc status listname) | 1416 | (defmacro package--push (pkg-desc status listname) |
| 1438 | "Convenience macro for `package-menu--generate'. | 1417 | "Convenience macro for `package-menu--generate'. |
| 1439 | If the alist stored in the symbol LISTNAME lacks an entry for a | 1418 | If the alist stored in the symbol LISTNAME lacks an entry for a |
| 1440 | package PACKAGE with descriptor DESC, add one. The alist is | 1419 | package PKG-DESC, add one. The alist is keyed with PKG-DESC." |
| 1441 | keyed with cons cells (PACKAGE . VERSION-LIST), where PACKAGE is | 1420 | `(unless (assoc ,pkg-desc ,listname) |
| 1442 | a symbol and VERSION-LIST is a version list." | 1421 | ;; FIXME: Should we move status into pkg-desc? |
| 1443 | `(let* ((version (package-desc-version ,desc)) | 1422 | (push (cons ,pkg-desc ,status) ,listname))) |
| 1444 | (key (cons ,package version))) | ||
| 1445 | (unless (assoc key ,listname) | ||
| 1446 | (push (list key ,status (package-desc-summary ,desc)) ,listname)))) | ||
| 1447 | 1423 | ||
| 1448 | (defun package-menu--generate (remember-pos packages) | 1424 | (defun package-menu--generate (remember-pos packages) |
| 1449 | "Populate the Package Menu. | 1425 | "Populate the Package Menu. |
| 1450 | If REMEMBER-POS is non-nil, keep point on the same entry. | 1426 | If REMEMBER-POS is non-nil, keep point on the same entry. |
| 1451 | PACKAGES should be t, which means to display all known packages, | 1427 | PACKAGES should be t, which means to display all known packages, |
| 1452 | or a list of package names (symbols) to display." | 1428 | or a list of package names (symbols) to display." |
| 1453 | ;; Construct list of ((PACKAGE . VERSION) STATUS DESCRIPTION). | 1429 | ;; Construct list of (PKG-DESC . STATUS). |
| 1454 | (let (info-list name) | 1430 | (let (info-list name) |
| 1455 | ;; Installed packages: | 1431 | ;; Installed packages: |
| 1456 | (dolist (elt package-alist) | 1432 | (dolist (elt package-alist) |
| 1457 | (setq name (car elt)) | 1433 | (setq name (car elt)) |
| 1458 | (when (or (eq packages t) (memq name packages)) | 1434 | (when (or (eq packages t) (memq name packages)) |
| 1459 | (package--push name (cdr elt) | 1435 | (package--push (cdr elt) |
| 1460 | (if (stringp (cadr (assq name package-load-list))) | 1436 | (if (stringp (cadr (assq name package-load-list))) |
| 1461 | "held" "installed") | 1437 | "held" "installed") |
| 1462 | info-list))) | 1438 | info-list))) |
| @@ -1466,14 +1442,14 @@ or a list of package names (symbols) to display." | |||
| 1466 | (setq name (car elt)) | 1442 | (setq name (car elt)) |
| 1467 | (when (and (not (eq name 'emacs)) ; Hide the `emacs' package. | 1443 | (when (and (not (eq name 'emacs)) ; Hide the `emacs' package. |
| 1468 | (or (eq packages t) (memq name packages))) | 1444 | (or (eq packages t) (memq name packages))) |
| 1469 | (package--push name (package--from-builtin elt) "built-in" info-list))) | 1445 | (package--push (package--from-builtin elt) "built-in" info-list))) |
| 1470 | 1446 | ||
| 1471 | ;; Available and disabled packages: | 1447 | ;; Available and disabled packages: |
| 1472 | (dolist (elt package-archive-contents) | 1448 | (dolist (elt package-archive-contents) |
| 1473 | (setq name (car elt)) | 1449 | (setq name (car elt)) |
| 1474 | (when (or (eq packages t) (memq name packages)) | 1450 | (when (or (eq packages t) (memq name packages)) |
| 1475 | (let ((hold (assq name package-load-list))) | 1451 | (let ((hold (assq name package-load-list))) |
| 1476 | (package--push name (cdr elt) | 1452 | (package--push (cdr elt) |
| 1477 | (cond | 1453 | (cond |
| 1478 | ((and hold (null (cadr hold))) "disabled") | 1454 | ((and hold (null (cadr hold))) "disabled") |
| 1479 | ((memq name package-menu--new-package-list) "new") | 1455 | ((memq name package-menu--new-package-list) "new") |
| @@ -1484,7 +1460,7 @@ or a list of package names (symbols) to display." | |||
| 1484 | (dolist (elt package-obsolete-alist) | 1460 | (dolist (elt package-obsolete-alist) |
| 1485 | (dolist (inner-elt (cdr elt)) | 1461 | (dolist (inner-elt (cdr elt)) |
| 1486 | (when (or (eq packages t) (memq (car elt) packages)) | 1462 | (when (or (eq packages t) (memq (car elt) packages)) |
| 1487 | (package--push (car elt) (cdr inner-elt) "obsolete" info-list)))) | 1463 | (package--push (cdr inner-elt) "obsolete" info-list)))) |
| 1488 | 1464 | ||
| 1489 | ;; Print the result. | 1465 | ;; Print the result. |
| 1490 | (setq tabulated-list-entries (mapcar 'package-menu--print-info info-list)) | 1466 | (setq tabulated-list-entries (mapcar 'package-menu--print-info info-list)) |
| @@ -1492,31 +1468,30 @@ or a list of package names (symbols) to display." | |||
| 1492 | 1468 | ||
| 1493 | (defun package-menu--print-info (pkg) | 1469 | (defun package-menu--print-info (pkg) |
| 1494 | "Return a package entry suitable for `tabulated-list-entries'. | 1470 | "Return a package entry suitable for `tabulated-list-entries'. |
| 1495 | PKG has the form ((PACKAGE . VERSION) STATUS DOC). | 1471 | PKG has the form (PKG-DESC . STATUS). |
| 1496 | Return (KEY [NAME VERSION STATUS DOC]), where KEY is the | 1472 | Return (PKG-DESC [NAME VERSION STATUS DOC])." |
| 1497 | identifier (NAME . VERSION-LIST)." | 1473 | (let* ((pkg-desc (car pkg)) |
| 1498 | (let* ((package (caar pkg)) | 1474 | (status (cdr pkg)) |
| 1499 | (version (cdr (car pkg))) | 1475 | (face (pcase status |
| 1500 | (status (nth 1 pkg)) | 1476 | (`"built-in" 'font-lock-builtin-face) |
| 1501 | (doc (or (nth 2 pkg) "")) | 1477 | (`"available" 'default) |
| 1502 | (face (cond | 1478 | (`"new" 'bold) |
| 1503 | ((string= status "built-in") 'font-lock-builtin-face) | 1479 | (`"held" 'font-lock-constant-face) |
| 1504 | ((string= status "available") 'default) | 1480 | (`"disabled" 'font-lock-warning-face) |
| 1505 | ((string= status "new") 'bold) | 1481 | (`"installed" 'font-lock-comment-face) |
| 1506 | ((string= status "held") 'font-lock-constant-face) | 1482 | (_ 'font-lock-warning-face)))) ; obsolete. |
| 1507 | ((string= status "disabled") 'font-lock-warning-face) | 1483 | (list pkg-desc |
| 1508 | ((string= status "installed") 'font-lock-comment-face) | 1484 | (vector (list (symbol-name (package-desc-name pkg-desc)) |
| 1509 | (t 'font-lock-warning-face)))) ; obsolete. | ||
| 1510 | (list (cons package version) | ||
| 1511 | (vector (list (symbol-name package) | ||
| 1512 | 'face 'link | 1485 | 'face 'link |
| 1513 | 'follow-link t | 1486 | 'follow-link t |
| 1514 | 'package-symbol package | 1487 | 'package-desc pkg-desc |
| 1515 | 'action 'package-menu-describe-package) | 1488 | 'action 'package-menu-describe-package) |
| 1516 | (propertize (package-version-join version) | 1489 | (propertize (package-version-join |
| 1490 | (package-desc-version pkg-desc)) | ||
| 1517 | 'font-lock-face face) | 1491 | 'font-lock-face face) |
| 1518 | (propertize status 'font-lock-face face) | 1492 | (propertize status 'font-lock-face face) |
| 1519 | (propertize doc 'font-lock-face face))))) | 1493 | (propertize (package-desc-summary pkg-desc) |
| 1494 | 'font-lock-face face))))) | ||
| 1520 | 1495 | ||
| 1521 | (defun package-menu-refresh () | 1496 | (defun package-menu-refresh () |
| 1522 | "Download the Emacs Lisp package archive. | 1497 | "Download the Emacs Lisp package archive. |
| @@ -1532,10 +1507,11 @@ This fetches the contents of each archive specified in | |||
| 1532 | "Describe the current package. | 1507 | "Describe the current package. |
| 1533 | If optional arg BUTTON is non-nil, describe its associated package." | 1508 | If optional arg BUTTON is non-nil, describe its associated package." |
| 1534 | (interactive) | 1509 | (interactive) |
| 1535 | (let ((package (if button (button-get button 'package-symbol) | 1510 | (let ((pkg-desc (if button (button-get button 'package-desc) |
| 1536 | (car (tabulated-list-get-id))))) | 1511 | (car (tabulated-list-get-id))))) |
| 1537 | (if package | 1512 | (if pkg-desc |
| 1538 | (describe-package package)))) | 1513 | ;; FIXME: We could actually describe this particular pkg-desc. |
| 1514 | (describe-package (package-desc-name pkg-desc))))) | ||
| 1539 | 1515 | ||
| 1540 | ;; fixme numeric argument | 1516 | ;; fixme numeric argument |
| 1541 | (defun package-menu-mark-delete (&optional _num) | 1517 | (defun package-menu-mark-delete (&optional _num) |
| @@ -1582,8 +1558,8 @@ If optional arg BUTTON is non-nil, describe its associated package." | |||
| 1582 | 'package-menu-view-commentary 'package-menu-describe-package "24.1") | 1558 | 'package-menu-view-commentary 'package-menu-describe-package "24.1") |
| 1583 | 1559 | ||
| 1584 | (defun package-menu-get-status () | 1560 | (defun package-menu-get-status () |
| 1585 | (let* ((pkg (tabulated-list-get-id)) | 1561 | (let* ((id (tabulated-list-get-id)) |
| 1586 | (entry (and pkg (assq pkg tabulated-list-entries)))) | 1562 | (entry (and id (assq id tabulated-list-entries)))) |
| 1587 | (if entry | 1563 | (if entry |
| 1588 | (aref (cadr entry) 2) | 1564 | (aref (cadr entry) 2) |
| 1589 | ""))) | 1565 | ""))) |
| @@ -1592,18 +1568,20 @@ If optional arg BUTTON is non-nil, describe its associated package." | |||
| 1592 | (let (installed available upgrades) | 1568 | (let (installed available upgrades) |
| 1593 | ;; Build list of installed/available packages in this buffer. | 1569 | ;; Build list of installed/available packages in this buffer. |
| 1594 | (dolist (entry tabulated-list-entries) | 1570 | (dolist (entry tabulated-list-entries) |
| 1595 | ;; ENTRY is ((NAME . VERSION) [NAME VERSION STATUS DOC]) | 1571 | ;; ENTRY is (PKG-DESC [NAME VERSION STATUS DOC]) |
| 1596 | (let ((pkg (car entry)) | 1572 | (let ((pkg-desc (car entry)) |
| 1597 | (status (aref (cadr entry) 2))) | 1573 | (status (aref (cadr entry) 2))) |
| 1598 | (cond ((equal status "installed") | 1574 | (cond ((equal status "installed") |
| 1599 | (push pkg installed)) | 1575 | (push pkg-desc installed)) |
| 1600 | ((member status '("available" "new")) | 1576 | ((member status '("available" "new")) |
| 1601 | (push pkg available))))) | 1577 | (push (cons (package-desc-name pkg-desc) pkg-desc) |
| 1602 | ;; Loop through list of installed packages, finding upgrades | 1578 | available))))) |
| 1603 | (dolist (pkg installed) | 1579 | ;; Loop through list of installed packages, finding upgrades. |
| 1604 | (let ((avail-pkg (assq (car pkg) available))) | 1580 | (dolist (pkg-desc installed) |
| 1581 | (let ((avail-pkg (assq (package-desc-name pkg-desc) available))) | ||
| 1605 | (and avail-pkg | 1582 | (and avail-pkg |
| 1606 | (version-list-< (cdr pkg) (cdr avail-pkg)) | 1583 | (version-list-< (package-desc-version pkg-desc) |
| 1584 | (package-desc-version (cdr avail-pkg))) | ||
| 1607 | (push avail-pkg upgrades)))) | 1585 | (push avail-pkg upgrades)))) |
| 1608 | upgrades)) | 1586 | upgrades)) |
| 1609 | 1587 | ||
| @@ -1623,11 +1601,11 @@ call will upgrade the package." | |||
| 1623 | (save-excursion | 1601 | (save-excursion |
| 1624 | (goto-char (point-min)) | 1602 | (goto-char (point-min)) |
| 1625 | (while (not (eobp)) | 1603 | (while (not (eobp)) |
| 1626 | (let* ((pkg (tabulated-list-get-id)) | 1604 | (let* ((pkg-desc (tabulated-list-get-id)) |
| 1627 | (upgrade (assq (car pkg) upgrades))) | 1605 | (upgrade (cdr (assq (package-desc-name pkg-desc) upgrades)))) |
| 1628 | (cond ((null upgrade) | 1606 | (cond ((null upgrade) |
| 1629 | (forward-line 1)) | 1607 | (forward-line 1)) |
| 1630 | ((equal pkg upgrade) | 1608 | ((equal pkg-desc upgrade) |
| 1631 | (package-menu-mark-install)) | 1609 | (package-menu-mark-install)) |
| 1632 | (t | 1610 | (t |
| 1633 | (package-menu-mark-delete)))))) | 1611 | (package-menu-mark-delete)))))) |
| @@ -1643,30 +1621,30 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm." | |||
| 1643 | (interactive) | 1621 | (interactive) |
| 1644 | (unless (derived-mode-p 'package-menu-mode) | 1622 | (unless (derived-mode-p 'package-menu-mode) |
| 1645 | (error "The current buffer is not in Package Menu mode")) | 1623 | (error "The current buffer is not in Package Menu mode")) |
| 1646 | (let (install-list delete-list cmd id) | 1624 | (let (install-list delete-list cmd pkg-desc) |
| 1647 | (save-excursion | 1625 | (save-excursion |
| 1648 | (goto-char (point-min)) | 1626 | (goto-char (point-min)) |
| 1649 | (while (not (eobp)) | 1627 | (while (not (eobp)) |
| 1650 | (setq cmd (char-after)) | 1628 | (setq cmd (char-after)) |
| 1651 | (unless (eq cmd ?\s) | 1629 | (unless (eq cmd ?\s) |
| 1652 | ;; This is the key (PACKAGE . VERSION-LIST). | 1630 | ;; This is the key PKG-DESC. |
| 1653 | (setq id (tabulated-list-get-id)) | 1631 | (setq pkg-desc (tabulated-list-get-id)) |
| 1654 | (cond ((eq cmd ?D) | 1632 | (cond ((eq cmd ?D) |
| 1655 | (push (cons (symbol-name (car id)) | 1633 | (push pkg-desc delete-list)) |
| 1656 | (package-version-join (cdr id))) | ||
| 1657 | delete-list)) | ||
| 1658 | ((eq cmd ?I) | 1634 | ((eq cmd ?I) |
| 1659 | (push (car id) install-list)))) | 1635 | (push pkg-desc install-list)))) |
| 1660 | (forward-line))) | 1636 | (forward-line))) |
| 1661 | (when install-list | 1637 | (when install-list |
| 1662 | (if (or | 1638 | (if (or |
| 1663 | noquery | 1639 | noquery |
| 1664 | (yes-or-no-p | 1640 | (yes-or-no-p |
| 1665 | (if (= (length install-list) 1) | 1641 | (if (= (length install-list) 1) |
| 1666 | (format "Install package `%s'? " (car install-list)) | 1642 | (format "Install package `%s'? " |
| 1667 | (format "Install these %d packages (%s)? " | 1643 | (package-desc-full-name (car install-list))) |
| 1668 | (length install-list) | 1644 | (format "Install these %d packages (%s)? " |
| 1669 | (mapconcat 'symbol-name install-list ", "))))) | 1645 | (length install-list) |
| 1646 | (mapconcat #'package-desc-full-name | ||
| 1647 | install-list ", "))))) | ||
| 1670 | (mapc 'package-install install-list))) | 1648 | (mapc 'package-install install-list))) |
| 1671 | ;; Delete packages, prompting if necessary. | 1649 | ;; Delete packages, prompting if necessary. |
| 1672 | (when delete-list | 1650 | (when delete-list |
| @@ -1674,18 +1652,15 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm." | |||
| 1674 | noquery | 1652 | noquery |
| 1675 | (yes-or-no-p | 1653 | (yes-or-no-p |
| 1676 | (if (= (length delete-list) 1) | 1654 | (if (= (length delete-list) 1) |
| 1677 | (format "Delete package `%s-%s'? " | 1655 | (format "Delete package `%s'? " |
| 1678 | (caar delete-list) | 1656 | (package-desc-full-name (car delete-list))) |
| 1679 | (cdr (car delete-list))) | ||
| 1680 | (format "Delete these %d packages (%s)? " | 1657 | (format "Delete these %d packages (%s)? " |
| 1681 | (length delete-list) | 1658 | (length delete-list) |
| 1682 | (mapconcat (lambda (elt) | 1659 | (mapconcat #'package-desc-full-name |
| 1683 | (concat (car elt) "-" (cdr elt))) | 1660 | delete-list ", "))))) |
| 1684 | delete-list | ||
| 1685 | ", "))))) | ||
| 1686 | (dolist (elt delete-list) | 1661 | (dolist (elt delete-list) |
| 1687 | (condition-case-unless-debug err | 1662 | (condition-case-unless-debug err |
| 1688 | (package-delete (car elt) (cdr elt)) | 1663 | (package-delete elt) |
| 1689 | (error (message (cadr err))))) | 1664 | (error (message (cadr err))))) |
| 1690 | (error "Aborted"))) | 1665 | (error "Aborted"))) |
| 1691 | ;; If we deleted anything, regenerate `package-alist'. This is done | 1666 | ;; If we deleted anything, regenerate `package-alist'. This is done |
| @@ -1730,8 +1705,8 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm." | |||
| 1730 | (string< dA dB)))) | 1705 | (string< dA dB)))) |
| 1731 | 1706 | ||
| 1732 | (defun package-menu--name-predicate (A B) | 1707 | (defun package-menu--name-predicate (A B) |
| 1733 | (string< (symbol-name (caar A)) | 1708 | (string< (symbol-name (package-desc-name (car A))) |
| 1734 | (symbol-name (caar B)))) | 1709 | (symbol-name (package-desc-name (car B))))) |
| 1735 | 1710 | ||
| 1736 | ;;;###autoload | 1711 | ;;;###autoload |
| 1737 | (defun list-packages (&optional no-fetch) | 1712 | (defun list-packages (&optional no-fetch) |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index ac5cdfafca2..4524dd76504 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,58 @@ | |||
| 1 | 2013-06-14 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * eww.el (eww-submit): Get submit button logic right when hitting RET | ||
| 4 | on non-submit buttons. | ||
| 5 | |||
| 6 | * shr.el: Remove shr-preliminary-table-render, since that can't really | ||
| 7 | be used for anything in practice. | ||
| 8 | |||
| 9 | 2013-06-13 Albert Krewinkel <tarleb@moltkeplatz.de> | ||
| 10 | |||
| 11 | * sieve.el: Rebind q to (sieve-bury-buffer), bind Q to | ||
| 12 | (sieve-manage-quit). | ||
| 13 | |||
| 14 | 2013-06-14 David Edmondson <dme@dme.org> (tiny change) | ||
| 15 | |||
| 16 | * mml2015.el (mml2015-maximum-key-image-dimension): New user option to | ||
| 17 | control the maximum size of photo ID image. | ||
| 18 | (mml2015-epg-key-image-to-string): Respect it. | ||
| 19 | |||
| 20 | 2013-06-13 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 21 | |||
| 22 | * shr.el (shr-tag-table-1): Mark the preliminary table renderings | ||
| 23 | instead of the final one so that we can more easily distinguish them. | ||
| 24 | |||
| 25 | * eww.el (eww-submit): Compute the submission URL correctly. | ||
| 26 | |||
| 27 | 2013-06-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 28 | |||
| 29 | * sieve-manage.el (sieve-manage-open-server): Don't quote lambda. | ||
| 30 | Use plist-get rather than CL's getf. | ||
| 31 | (sieve-manage-parse-capability): Avoid CL's remove-if. | ||
| 32 | |||
| 33 | 2013-06-13 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 34 | |||
| 35 | * shr.el (shr-expand-url): Expansion should chop off the bits after the | ||
| 36 | last slash. | ||
| 37 | |||
| 38 | * eww.el (eww-tag-select): Use the first value as the default value. | ||
| 39 | |||
| 40 | 2013-06-13 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> | ||
| 41 | |||
| 42 | * eww.el (eww): Prepend urls with http:// if scheme is missing. | ||
| 43 | (eww-mode): Use `define-derived-mode'. | ||
| 44 | (eww-parse-headers): Parse headers from beginning of buffer so that | ||
| 45 | file:// links work. | ||
| 46 | |||
| 47 | 2013-06-13 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 48 | |||
| 49 | * eww.el (eww-detect-charset): Detect charset from the <meta> tag. | ||
| 50 | |||
| 51 | 2013-06-12 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 52 | |||
| 53 | * shr.el (shr-tag-svg): Ignore SVG elements, because we don't know how | ||
| 54 | to handle them at all. | ||
| 55 | |||
| 1 | 2013-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org> | 56 | 2013-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 57 | ||
| 3 | * eww.el (eww-convert-widgets): Make widgets from non-tabular layouts | 58 | * eww.el (eww-convert-widgets): Make widgets from non-tabular layouts |
| @@ -6,7 +61,7 @@ | |||
| 6 | 61 | ||
| 7 | 2013-06-10 Albert Krewinkel <krewinkel@moltkeplatz.de> | 62 | 2013-06-10 Albert Krewinkel <krewinkel@moltkeplatz.de> |
| 8 | 63 | ||
| 9 | * sieve-manage.el (sieve-manage-open): work with STARTTLS: shorten | 64 | * sieve-manage.el (sieve-manage-open): Work with STARTTLS: shorten |
| 10 | stream managing functions by using open-protocol-stream to do most of | 65 | stream managing functions by using open-protocol-stream to do most of |
| 11 | the work. Has the nice benefit of enabling STARTTLS. | 66 | the work. Has the nice benefit of enabling STARTTLS. |
| 12 | Wait for capabilities after STARTTLS: following RFC5804, the server | 67 | Wait for capabilities after STARTTLS: following RFC5804, the server |
diff --git a/lisp/gnus/eww.el b/lisp/gnus/eww.el index 3e799732ecb..270c3ee3ed2 100644 --- a/lisp/gnus/eww.el +++ b/lisp/gnus/eww.el | |||
| @@ -36,8 +36,22 @@ | |||
| 36 | (defun eww (url) | 36 | (defun eww (url) |
| 37 | "Fetch URL and render the page." | 37 | "Fetch URL and render the page." |
| 38 | (interactive "sUrl: ") | 38 | (interactive "sUrl: ") |
| 39 | (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) | ||
| 40 | (setq url (concat "http://" url))) | ||
| 39 | (url-retrieve url 'eww-render (list url))) | 41 | (url-retrieve url 'eww-render (list url))) |
| 40 | 42 | ||
| 43 | (defun eww-detect-charset (html-p) | ||
| 44 | (let ((case-fold-search t) | ||
| 45 | (pt (point))) | ||
| 46 | (or (and html-p | ||
| 47 | (re-search-forward | ||
| 48 | "<meta[\t\n\r ]+[^>]*charset=\\([^\t\n\r \"/>]+\\)" nil t) | ||
| 49 | (goto-char pt) | ||
| 50 | (match-string 1)) | ||
| 51 | (and (looking-at | ||
| 52 | "[\t\n\r ]*<\\?xml[\t\n\r ]+[^>]*encoding=\"\\([^\"]+\\)") | ||
| 53 | (match-string 1))))) | ||
| 54 | |||
| 41 | (defun eww-render (status url &optional point) | 55 | (defun eww-render (status url &optional point) |
| 42 | (let* ((headers (eww-parse-headers)) | 56 | (let* ((headers (eww-parse-headers)) |
| 43 | (content-type | 57 | (content-type |
| @@ -47,6 +61,8 @@ | |||
| 47 | (charset (intern | 61 | (charset (intern |
| 48 | (downcase | 62 | (downcase |
| 49 | (or (cdr (assq 'charset (cdr content-type))) | 63 | (or (cdr (assq 'charset (cdr content-type))) |
| 64 | (eww-detect-charset (equal (car content-type) | ||
| 65 | "text/html")) | ||
| 50 | "utf8")))) | 66 | "utf8")))) |
| 51 | (data-buffer (current-buffer))) | 67 | (data-buffer (current-buffer))) |
| 52 | (unwind-protect | 68 | (unwind-protect |
| @@ -64,6 +80,7 @@ | |||
| 64 | 80 | ||
| 65 | (defun eww-parse-headers () | 81 | (defun eww-parse-headers () |
| 66 | (let ((headers nil)) | 82 | (let ((headers nil)) |
| 83 | (goto-char (point-min)) | ||
| 67 | (while (and (not (eobp)) | 84 | (while (and (not (eobp)) |
| 68 | (not (eolp))) | 85 | (not (eolp))) |
| 69 | (when (looking-at "\\([^:]+\\): *\\(.*\\)") | 86 | (when (looking-at "\\([^:]+\\): *\\(.*\\)") |
| @@ -129,22 +146,20 @@ | |||
| 129 | ;;(define-key map "n" 'eww-next-url) | 146 | ;;(define-key map "n" 'eww-next-url) |
| 130 | map)) | 147 | map)) |
| 131 | 148 | ||
| 132 | (defun eww-mode () | 149 | (define-derived-mode eww-mode nil "eww" |
| 133 | "Mode for browsing the web. | 150 | "Mode for browsing the web. |
| 134 | 151 | ||
| 135 | \\{eww-mode-map}" | 152 | \\{eww-mode-map}" |
| 136 | (interactive) | ||
| 137 | (setq major-mode 'eww-mode | ||
| 138 | mode-name "eww") | ||
| 139 | (set (make-local-variable 'eww-current-url) 'author) | 153 | (set (make-local-variable 'eww-current-url) 'author) |
| 140 | (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url) | 154 | (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url)) |
| 141 | ;;(setq buffer-read-only t) | ||
| 142 | (use-local-map eww-mode-map)) | ||
| 143 | 155 | ||
| 144 | (defun eww-browse-url (url &optional new-window) | 156 | (defun eww-browse-url (url &optional new-window) |
| 145 | (push (list eww-current-url (point)) | 157 | (let ((url-request-extra-headers |
| 146 | eww-history) | 158 | (append '(("User-Agent" . "eww/1.0")) |
| 147 | (eww url)) | 159 | url-request-extra-headers))) |
| 160 | (push (list eww-current-url (point)) | ||
| 161 | eww-history) | ||
| 162 | (eww url))) | ||
| 148 | 163 | ||
| 149 | (defun eww-quit () | 164 | (defun eww-quit () |
| 150 | "Exit the Emacs Web Wowser." | 165 | "Exit the Emacs Web Wowser." |
| @@ -177,7 +192,9 @@ | |||
| 177 | (start (point))) | 192 | (start (point))) |
| 178 | (shr-ensure-paragraph) | 193 | (shr-ensure-paragraph) |
| 179 | (shr-generic cont) | 194 | (shr-generic cont) |
| 180 | (shr-ensure-paragraph) | 195 | (unless (bolp) |
| 196 | (insert "\n")) | ||
| 197 | (insert "\n") | ||
| 181 | (when (> (point) start) | 198 | (when (> (point) start) |
| 182 | (put-text-property start (1+ start) | 199 | (put-text-property start (1+ start) |
| 183 | 'eww-form eww-form)))) | 200 | 'eww-form eww-form)))) |
| @@ -189,12 +206,12 @@ | |||
| 189 | (widget | 206 | (widget |
| 190 | (cond | 207 | (cond |
| 191 | ((equal type "submit") | 208 | ((equal type "submit") |
| 192 | (list | 209 | (list 'push-button |
| 193 | 'push-button | 210 | :notify 'eww-submit |
| 194 | :notify 'eww-submit | 211 | :name (cdr (assq :name cont)) |
| 195 | :name (cdr (assq :name cont)) | 212 | :value (cdr (assq :value cont)) |
| 196 | :eww-form eww-form | 213 | :eww-form eww-form |
| 197 | (or (cdr (assq :value cont)) "Submit"))) | 214 | (or (cdr (assq :value cont)) "Submit"))) |
| 198 | ((or (equal type "radio") | 215 | ((or (equal type "radio") |
| 199 | (equal type "checkbox")) | 216 | (equal type "checkbox")) |
| 200 | (list 'checkbox | 217 | (list 'checkbox |
| @@ -209,22 +226,19 @@ | |||
| 209 | :name (cdr (assq :name cont)) | 226 | :name (cdr (assq :name cont)) |
| 210 | :value (cdr (assq :value cont)))) | 227 | :value (cdr (assq :value cont)))) |
| 211 | (t | 228 | (t |
| 212 | (list | 229 | (list 'editable-field |
| 213 | 'editable-field | 230 | :size (string-to-number |
| 214 | :size (string-to-number | 231 | (or (cdr (assq :size cont)) |
| 215 | (or (cdr (assq :size cont)) | 232 | "40")) |
| 216 | "40")) | 233 | :value (or (cdr (assq :value cont)) "") |
| 217 | :value (or (cdr (assq :value cont)) "") | 234 | :secret (and (equal type "password") ?*) |
| 218 | :secret (and (equal type "password") ?*) | 235 | :action 'eww-submit |
| 219 | :action 'eww-submit | 236 | :name (cdr (assq :name cont)) |
| 220 | :name (cdr (assq :name cont)) | 237 | :eww-form eww-form))))) |
| 221 | :eww-form eww-form))))) | 238 | (nconc eww-form (list widget)) |
| 222 | (if (eq (car widget) 'hidden) | 239 | (unless (eq (car widget) 'hidden) |
| 223 | (when shr-final-table-render | 240 | (apply 'widget-create widget) |
| 224 | (nconc eww-form (list widget))) | 241 | (put-text-property start (point) 'eww-widget widget)))) |
| 225 | (apply 'widget-create widget)) | ||
| 226 | (put-text-property start (point) 'eww-widget widget) | ||
| 227 | (insert " "))) | ||
| 228 | 242 | ||
| 229 | (defun eww-tag-select (cont) | 243 | (defun eww-tag-select (cont) |
| 230 | (shr-ensure-paragraph) | 244 | (shr-ensure-paragraph) |
| @@ -242,6 +256,9 @@ | |||
| 242 | :value (cdr (assq :value (cdr elem))) | 256 | :value (cdr (assq :value (cdr elem))) |
| 243 | :tag (cdr (assq 'text (cdr elem)))) | 257 | :tag (cdr (assq 'text (cdr elem)))) |
| 244 | options))) | 258 | options))) |
| 259 | ;; If we have no selected values, default to the first value. | ||
| 260 | (unless (plist-get (cdr menu) :value) | ||
| 261 | (nconc menu (list :value (nth 2 (car options))))) | ||
| 245 | (nconc menu options) | 262 | (nconc menu options) |
| 246 | (apply 'widget-create menu) | 263 | (apply 'widget-create menu) |
| 247 | (put-text-property start (point) 'eww-widget menu) | 264 | (put-text-property start (point) 'eww-widget menu) |
| @@ -264,14 +281,12 @@ | |||
| 264 | 281 | ||
| 265 | (defun eww-submit (widget &rest ignore) | 282 | (defun eww-submit (widget &rest ignore) |
| 266 | (let ((form (plist-get (cdr widget) :eww-form)) | 283 | (let ((form (plist-get (cdr widget) :eww-form)) |
| 267 | (first-button t) | ||
| 268 | values) | 284 | values) |
| 269 | (dolist (overlay (sort (overlays-in (point-min) (point-max)) | 285 | (dolist (overlay (sort (overlays-in (point-min) (point-max)) |
| 270 | (lambda (o1 o2) | 286 | (lambda (o1 o2) |
| 271 | (< (overlay-start o1) (overlay-start o2))))) | 287 | (< (overlay-start o1) (overlay-start o2))))) |
| 272 | (let ((field (or (plist-get (overlay-properties overlay) 'field) | 288 | (let ((field (or (plist-get (overlay-properties overlay) 'field) |
| 273 | (plist-get (overlay-properties overlay) 'button) | 289 | (plist-get (overlay-properties overlay) 'button)))) |
| 274 | (plist-get (overlay-properties overlay) 'eww-hidden)))) | ||
| 275 | (when (eq (plist-get (cdr field) :eww-form) form) | 290 | (when (eq (plist-get (cdr field) :eww-form) form) |
| 276 | (let ((name (plist-get (cdr field) :name))) | 291 | (let ((name (plist-get (cdr field) :name))) |
| 277 | (when name | 292 | (when name |
| @@ -280,19 +295,12 @@ | |||
| 280 | (when (widget-value field) | 295 | (when (widget-value field) |
| 281 | (push (cons name (plist-get (cdr field) :checkbox-value)) | 296 | (push (cons name (plist-get (cdr field) :checkbox-value)) |
| 282 | values))) | 297 | values))) |
| 283 | ((eq (car field) 'eww-hidden) | ||
| 284 | (push (cons name (plist-get (cdr field) :value)) | ||
| 285 | values)) | ||
| 286 | ((eq (car field) 'push-button) | 298 | ((eq (car field) 'push-button) |
| 287 | ;; We want the values from buttons if we hit a button, | 299 | ;; We want the values from buttons if we hit a button, |
| 288 | ;; or we're submitting something and this is the first | 300 | ;; if it's the first button in the DOM after the field |
| 289 | ;; button displayed. | 301 | ;; hit ENTER on. |
| 290 | (when (or (and (eq (car widget) 'push-button) | 302 | (when (and (eq (car widget) 'push-button) |
| 291 | (eq widget field)) | 303 | (eq widget field)) |
| 292 | (and (not (eq (car widget) 'push-button)) | ||
| 293 | (eq (car field) 'push-button) | ||
| 294 | first-button)) | ||
| 295 | (setq first-button nil) | ||
| 296 | (push (cons name (widget-value field)) | 304 | (push (cons name (widget-value field)) |
| 297 | values))) | 305 | values))) |
| 298 | (t | 306 | (t |
| @@ -304,6 +312,25 @@ | |||
| 304 | (push (cons (plist-get (cdr elem) :name) | 312 | (push (cons (plist-get (cdr elem) :name) |
| 305 | (plist-get (cdr elem) :value)) | 313 | (plist-get (cdr elem) :value)) |
| 306 | values))) | 314 | values))) |
| 315 | ;; If we hit ENTER in a non-button field, include the value of the | ||
| 316 | ;; first submit button after it. | ||
| 317 | (unless (eq (car widget) 'push-button) | ||
| 318 | (let ((rest form) | ||
| 319 | (name (plist-get (cdr widget) :name))) | ||
| 320 | (when rest | ||
| 321 | (while (and rest | ||
| 322 | (or (not (consp (car rest))) | ||
| 323 | (not (equal name (plist-get (cdar rest) :name))))) | ||
| 324 | (pop rest))) | ||
| 325 | (while rest | ||
| 326 | (let ((elem (pop rest))) | ||
| 327 | (when (and (consp (car rest)) | ||
| 328 | (eq (car elem) 'push-button)) | ||
| 329 | (push (cons (plist-get (cdr elem) :name) | ||
| 330 | (plist-get (cdr elem) :value)) | ||
| 331 | values) | ||
| 332 | (setq rest nil)))))) | ||
| 333 | (debug values) | ||
| 307 | (let ((shr-base eww-current-url)) | 334 | (let ((shr-base eww-current-url)) |
| 308 | (if (and (stringp (cdr (assq :method form))) | 335 | (if (and (stringp (cdr (assq :method form))) |
| 309 | (equal (downcase (cdr (assq :method form))) "post")) | 336 | (equal (downcase (cdr (assq :method form))) "post")) |
| @@ -313,11 +340,12 @@ | |||
| 313 | (url-request-data (mm-url-encode-www-form-urlencoded values))) | 340 | (url-request-data (mm-url-encode-www-form-urlencoded values))) |
| 314 | (eww-browse-url (shr-expand-url (cdr (assq :action form))))) | 341 | (eww-browse-url (shr-expand-url (cdr (assq :action form))))) |
| 315 | (eww-browse-url | 342 | (eww-browse-url |
| 316 | (shr-expand-url | 343 | (concat |
| 317 | (concat | 344 | (if (cdr (assq :action form)) |
| 318 | (cdr (assq :action form)) | 345 | (shr-expand-url (cdr (assq :action form))) |
| 319 | "?" | 346 | eww-current-url) |
| 320 | (mm-url-encode-www-form-urlencoded values)))))))) | 347 | "?" |
| 348 | (mm-url-encode-www-form-urlencoded values))))))) | ||
| 321 | 349 | ||
| 322 | (defun eww-convert-widgets () | 350 | (defun eww-convert-widgets () |
| 323 | (let ((start (point-min)) | 351 | (let ((start (point-min)) |
| @@ -335,7 +363,9 @@ | |||
| 335 | (plist-get (overlay-properties overlay) 'field)) | 363 | (plist-get (overlay-properties overlay) 'field)) |
| 336 | (delete-overlay overlay))) | 364 | (delete-overlay overlay))) |
| 337 | (delete-region start end)) | 365 | (delete-region start end)) |
| 338 | (apply 'widget-create widget)) | 366 | (when (and widget |
| 367 | (not (eq (car widget) 'hidden))) | ||
| 368 | (apply 'widget-create widget))) | ||
| 339 | (widget-setup) | 369 | (widget-setup) |
| 340 | (eww-fix-widget-keymap))) | 370 | (eww-fix-widget-keymap))) |
| 341 | 371 | ||
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 5d122dfbe40..389b522aec8 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el | |||
| @@ -146,6 +146,12 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." | |||
| 146 | :group 'mime-security | 146 | :group 'mime-security |
| 147 | :type 'boolean) | 147 | :type 'boolean) |
| 148 | 148 | ||
| 149 | (defcustom mml2015-maximum-key-image-dimension 64 | ||
| 150 | "The maximum dimension (width or height) of any key images." | ||
| 151 | :version "24.4" | ||
| 152 | :group 'mime-security | ||
| 153 | :type 'integer) | ||
| 154 | |||
| 149 | ;; Extract plaintext from cleartext signature. IMO, this kind of task | 155 | ;; Extract plaintext from cleartext signature. IMO, this kind of task |
| 150 | ;; should be done by GnuPG rather than Elisp, but older PGP backends | 156 | ;; should be done by GnuPG rather than Elisp, but older PGP backends |
| 151 | ;; (such as Mailcrypt, and PGG) discard the output from GnuPG. | 157 | ;; (such as Mailcrypt, and PGG) discard the output from GnuPG. |
| @@ -873,13 +879,20 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." | |||
| 873 | (insert (substring data 16)) | 879 | (insert (substring data 16)) |
| 874 | (create-image (buffer-string) nil t))))) | 880 | (create-image (buffer-string) nil t))))) |
| 875 | 881 | ||
| 882 | (autoload 'gnus-rescale-image "gnus-util") | ||
| 883 | |||
| 876 | (defun mml2015-epg-key-image-to-string (key-id) | 884 | (defun mml2015-epg-key-image-to-string (key-id) |
| 877 | "Return a string with the image of a key, if any" | 885 | "Return a string with the image of a key, if any" |
| 878 | (let* ((result "") | 886 | (let* ((result "") |
| 879 | (key-image (mml2015-epg-key-image key-id))) | 887 | (key-image (mml2015-epg-key-image key-id))) |
| 880 | (when key-image | 888 | (when key-image |
| 881 | (setq result " ") | 889 | (setq result " ") |
| 882 | (put-text-property 1 2 'display key-image result)) | 890 | (put-text-property |
| 891 | 1 2 'display | ||
| 892 | (gnus-rescale-image key-image | ||
| 893 | (cons mml2015-maximum-key-image-dimension | ||
| 894 | mml2015-maximum-key-image-dimension)) | ||
| 895 | result)) | ||
| 883 | result)) | 896 | result)) |
| 884 | 897 | ||
| 885 | (defun mml2015-epg-signature-to-string (signature) | 898 | (defun mml2015-epg-signature-to-string (signature) |
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index d9e267e5288..c93357efd25 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el | |||
| @@ -115,7 +115,6 @@ cid: URL as the argument.") | |||
| 115 | (defvar shr-base nil) | 115 | (defvar shr-base nil) |
| 116 | (defvar shr-ignore-cache nil) | 116 | (defvar shr-ignore-cache nil) |
| 117 | (defvar shr-external-rendering-functions nil) | 117 | (defvar shr-external-rendering-functions nil) |
| 118 | (defvar shr-final-table-render nil) | ||
| 119 | 118 | ||
| 120 | (defvar shr-map | 119 | (defvar shr-map |
| 121 | (let ((map (make-sparse-keymap))) | 120 | (let ((map (make-sparse-keymap))) |
| @@ -158,6 +157,7 @@ DOM should be a parse tree as generated by | |||
| 158 | (shr-state nil) | 157 | (shr-state nil) |
| 159 | (shr-start nil) | 158 | (shr-start nil) |
| 160 | (shr-base nil) | 159 | (shr-base nil) |
| 160 | (shr-preliminary-table-render 0) | ||
| 161 | (shr-width (or shr-width (window-width)))) | 161 | (shr-width (or shr-width (window-width)))) |
| 162 | (shr-descend (shr-transform-dom dom)) | 162 | (shr-descend (shr-transform-dom dom)) |
| 163 | (shr-remove-trailing-whitespace start (point)))) | 163 | (shr-remove-trailing-whitespace start (point)))) |
| @@ -492,7 +492,10 @@ size, and full-buffer size." | |||
| 492 | url | 492 | url |
| 493 | (let ((base shr-base)) | 493 | (let ((base shr-base)) |
| 494 | ;; Chop off query string. | 494 | ;; Chop off query string. |
| 495 | (when (string-match "^\\([^?]+\\)[?]" base) | 495 | (when (string-match "\\`\\([^?]+\\)[?]" base) |
| 496 | (setq base (match-string 1 base))) | ||
| 497 | ;; Chop off the bit after the last slash. | ||
| 498 | (when (string-match "\\`\\(.*\\)[/][^/]+" base) | ||
| 496 | (setq base (match-string 1 base))) | 499 | (setq base (match-string 1 base))) |
| 497 | (cond | 500 | (cond |
| 498 | ((and (string-match "\\`//" url) | 501 | ((and (string-match "\\`//" url) |
| @@ -891,6 +894,9 @@ ones, in case fg and bg are nil." | |||
| 891 | (defun shr-tag-comment (cont) | 894 | (defun shr-tag-comment (cont) |
| 892 | ) | 895 | ) |
| 893 | 896 | ||
| 897 | (defun shr-tag-svg (cont) | ||
| 898 | ) | ||
| 899 | |||
| 894 | (defun shr-tag-sup (cont) | 900 | (defun shr-tag-sup (cont) |
| 895 | (let ((start (point))) | 901 | (let ((start (point))) |
| 896 | (shr-generic cont) | 902 | (shr-generic cont) |
| @@ -1182,8 +1188,7 @@ ones, in case fg and bg are nil." | |||
| 1182 | (frame-width)) | 1188 | (frame-width)) |
| 1183 | (setq truncate-lines t)) | 1189 | (setq truncate-lines t)) |
| 1184 | ;; Then render the table again with these new "hard" widths. | 1190 | ;; Then render the table again with these new "hard" widths. |
| 1185 | (let ((shr-final-table-render t)) | 1191 | (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths)) |
| 1186 | (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths))) | ||
| 1187 | ;; Finally, insert all the images after the table. The Emacs buffer | 1192 | ;; Finally, insert all the images after the table. The Emacs buffer |
| 1188 | ;; model isn't strong enough to allow us to put the images actually | 1193 | ;; model isn't strong enough to allow us to put the images actually |
| 1189 | ;; into the tables. | 1194 | ;; into the tables. |
diff --git a/lisp/gnus/sieve-manage.el b/lisp/gnus/sieve-manage.el index 23ab24152d9..6588f717bcb 100644 --- a/lisp/gnus/sieve-manage.el +++ b/lisp/gnus/sieve-manage.el | |||
| @@ -206,15 +206,15 @@ Return the buffer associated with the connection." | |||
| 206 | :success "^OK.*\n" | 206 | :success "^OK.*\n" |
| 207 | :return-list t | 207 | :return-list t |
| 208 | :starttls-function | 208 | :starttls-function |
| 209 | '(lambda (capabilities) | 209 | (lambda (capabilities) |
| 210 | (when (string-match "\\bSTARTTLS\\b" capabilities) | 210 | (when (string-match "\\bSTARTTLS\\b" capabilities) |
| 211 | "STARTTLS\r\n"))) | 211 | "STARTTLS\r\n"))) |
| 212 | (setq sieve-manage-process proc) | 212 | (setq sieve-manage-process proc) |
| 213 | (setq sieve-manage-capability | 213 | (setq sieve-manage-capability |
| 214 | (sieve-manage-parse-capability (getf props :capabilities))) | 214 | (sieve-manage-parse-capability (plist-get props :capabilities))) |
| 215 | ;; Ignore new capabilities issues after successful STARTTLS | 215 | ;; Ignore new capabilities issues after successful STARTTLS |
| 216 | (when (and (memq stream '(nil network starttls)) | 216 | (when (and (memq stream '(nil network starttls)) |
| 217 | (eq (getf props :type) 'tls)) | 217 | (eq (plist-get props :type) 'tls)) |
| 218 | (sieve-manage-drop-next-answer)) | 218 | (sieve-manage-drop-next-answer)) |
| 219 | (current-buffer)))) | 219 | (current-buffer)))) |
| 220 | 220 | ||
| @@ -502,9 +502,9 @@ If NAME is nil, return the full server list of capabilities." | |||
| 502 | (defun sieve-manage-parse-capability (str) | 502 | (defun sieve-manage-parse-capability (str) |
| 503 | "Parse managesieve capability string `STR'. | 503 | "Parse managesieve capability string `STR'. |
| 504 | Set variable `sieve-manage-capability' to " | 504 | Set variable `sieve-manage-capability' to " |
| 505 | (let ((capas (remove-if #'null | 505 | (let ((capas (delq nil |
| 506 | (mapcar #'split-string-and-unquote | 506 | (mapcar #'split-string-and-unquote |
| 507 | (split-string str "\n"))))) | 507 | (split-string str "\n"))))) |
| 508 | (when (string= "OK" (caar (last capas))) | 508 | (when (string= "OK" (caar (last capas))) |
| 509 | (setq sieve-manage-state 'nonauth)) | 509 | (setq sieve-manage-state 'nonauth)) |
| 510 | capas)) | 510 | capas)) |
diff --git a/lisp/gnus/sieve.el b/lisp/gnus/sieve.el index 2c11c039d56..b3539c5857f 100644 --- a/lisp/gnus/sieve.el +++ b/lisp/gnus/sieve.el | |||
| @@ -125,7 +125,8 @@ require \"fileinto\"; | |||
| 125 | (define-key map "f" 'sieve-edit-script) | 125 | (define-key map "f" 'sieve-edit-script) |
| 126 | (define-key map "o" 'sieve-edit-script-other-window) | 126 | (define-key map "o" 'sieve-edit-script-other-window) |
| 127 | (define-key map "r" 'sieve-remove) | 127 | (define-key map "r" 'sieve-remove) |
| 128 | (define-key map "q" 'sieve-manage-quit) | 128 | (define-key map "q" 'sieve-bury-buffer) |
| 129 | (define-key map "Q" 'sieve-manage-quit) | ||
| 129 | (define-key map [(down-mouse-2)] 'sieve-edit-script) | 130 | (define-key map [(down-mouse-2)] 'sieve-edit-script) |
| 130 | (define-key map [(down-mouse-3)] 'sieve-manage-mode-menu) | 131 | (define-key map [(down-mouse-3)] 'sieve-manage-mode-menu) |
| 131 | map) | 132 | map) |
| @@ -149,12 +150,17 @@ require \"fileinto\"; | |||
| 149 | ;; Commands used in sieve-manage mode: | 150 | ;; Commands used in sieve-manage mode: |
| 150 | 151 | ||
| 151 | (defun sieve-manage-quit () | 152 | (defun sieve-manage-quit () |
| 152 | "Quit." | 153 | "Quit Manage Sieve and close the connection." |
| 153 | (interactive) | 154 | (interactive) |
| 154 | (sieve-manage-close sieve-manage-buffer) | 155 | (sieve-manage-close sieve-manage-buffer) |
| 155 | (kill-buffer sieve-manage-buffer) | 156 | (kill-buffer sieve-manage-buffer) |
| 156 | (kill-buffer (current-buffer))) | 157 | (kill-buffer (current-buffer))) |
| 157 | 158 | ||
| 159 | (defun sieve-bury-buffer () | ||
| 160 | "Bury the Manage Sieve buffer without closing the connection." | ||
| 161 | (interactive) | ||
| 162 | (bury-buffer)) | ||
| 163 | |||
| 158 | (defun sieve-activate (&optional pos) | 164 | (defun sieve-activate (&optional pos) |
| 159 | (interactive "d") | 165 | (interactive "d") |
| 160 | (let ((name (sieve-script-at-point)) err) | 166 | (let ((name (sieve-script-at-point)) err) |
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 586c8306a36..8f7d584d00b 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -2652,7 +2652,7 @@ will be inserted before the group at point." | |||
| 2652 | ;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group | 2652 | ;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group |
| 2653 | ;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group | 2653 | ;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group |
| 2654 | ;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode | 2654 | ;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode |
| 2655 | ;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "9950bdf995e4b5e962a17d754a35f2c6") | 2655 | ;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "2c628e6cde385119c5f7b43cc1efe1a1") |
| 2656 | ;;; Generated autoloads from ibuf-ext.el | 2656 | ;;; Generated autoloads from ibuf-ext.el |
| 2657 | 2657 | ||
| 2658 | (autoload 'ibuffer-auto-mode "ibuf-ext" "\ | 2658 | (autoload 'ibuffer-auto-mode "ibuf-ext" "\ |
| @@ -2984,7 +2984,7 @@ Mark all buffers whose associated file does not exist. | |||
| 2984 | \(fn)" t nil) | 2984 | \(fn)" t nil) |
| 2985 | 2985 | ||
| 2986 | (autoload 'ibuffer-mark-help-buffers "ibuf-ext" "\ | 2986 | (autoload 'ibuffer-mark-help-buffers "ibuf-ext" "\ |
| 2987 | Mark buffers like *Help*, *Apropos*, *Info*. | 2987 | Mark buffers whose major mode is in variable `ibuffer-help-buffer-modes'. |
| 2988 | 2988 | ||
| 2989 | \(fn)" t nil) | 2989 | \(fn)" t nil) |
| 2990 | 2990 | ||
diff --git a/lisp/image-dired.el b/lisp/image-dired.el index bbb41d49a1d..afb940fe337 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el | |||
| @@ -156,8 +156,9 @@ | |||
| 156 | (require 'format-spec) | 156 | (require 'format-spec) |
| 157 | (require 'widget) | 157 | (require 'widget) |
| 158 | 158 | ||
| 159 | (require 'cl-lib) | ||
| 160 | |||
| 159 | (eval-when-compile | 161 | (eval-when-compile |
| 160 | (require 'cl-lib) | ||
| 161 | (require 'wid-edit)) | 162 | (require 'wid-edit)) |
| 162 | 163 | ||
| 163 | (defgroup image-dired nil | 164 | (defgroup image-dired nil |
| @@ -657,9 +658,12 @@ previous -ARG, if ARG<0) files." | |||
| 657 | (string-match-p (image-file-name-regexp) image-file)) | 658 | (string-match-p (image-file-name-regexp) image-file)) |
| 658 | (setq thumb-file (image-dired-get-thumbnail-image image-file)) | 659 | (setq thumb-file (image-dired-get-thumbnail-image image-file)) |
| 659 | ;; If image is not already added, then add it. | 660 | ;; If image is not already added, then add it. |
| 660 | (let ((cur-ov (overlays-in (point) (1+ (point))))) | 661 | (let* ((cur-ovs (overlays-in (point) (1+ (point)))) |
| 661 | (if cur-ov | 662 | (thumb-ov (car (cl-remove-if-not |
| 662 | (delete-overlay (car cur-ov)) | 663 | (lambda (ov) (overlay-get ov 'thumb-file)) |
| 664 | cur-ovs)))) | ||
| 665 | (if thumb-ov | ||
| 666 | (delete-overlay thumb-ov) | ||
| 663 | (put-image thumb-file image-pos) | 667 | (put-image thumb-file image-pos) |
| 664 | (setq overlay | 668 | (setq overlay |
| 665 | (cl-loop for o in (overlays-in (point) (1+ (point))) | 669 | (cl-loop for o in (overlays-in (point) (1+ (point))) |
diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el index 992236ce1ad..37213b95d3e 100644 --- a/lisp/international/isearch-x.el +++ b/lisp/international/isearch-x.el | |||
| @@ -94,7 +94,7 @@ | |||
| 94 | (exit-minibuffer))) | 94 | (exit-minibuffer))) |
| 95 | 95 | ||
| 96 | ;;;###autoload | 96 | ;;;###autoload |
| 97 | (defun isearch-process-search-multibyte-characters (last-char) | 97 | (defun isearch-process-search-multibyte-characters (last-char &optional count) |
| 98 | (if (eq this-command 'isearch-printing-char) | 98 | (if (eq this-command 'isearch-printing-char) |
| 99 | (let ((overriding-terminal-local-map nil) | 99 | (let ((overriding-terminal-local-map nil) |
| 100 | (prompt (isearch-message-prefix)) | 100 | (prompt (isearch-message-prefix)) |
| @@ -136,8 +136,11 @@ | |||
| 136 | 136 | ||
| 137 | (if (and str (> (length str) 0)) | 137 | (if (and str (> (length str) 0)) |
| 138 | (let ((unread-command-events nil)) | 138 | (let ((unread-command-events nil)) |
| 139 | (isearch-process-search-string str str)) | 139 | (if (and (integerp count) (> count 1)) |
| 140 | (let ((strs (mapconcat 'identity (make-list count str) ""))) | ||
| 141 | (isearch-process-search-string strs strs)) | ||
| 142 | (isearch-process-search-string str str))) | ||
| 140 | (isearch-update))) | 143 | (isearch-update))) |
| 141 | (isearch-process-search-char last-char))) | 144 | (isearch-process-search-char last-char count))) |
| 142 | 145 | ||
| 143 | ;;; isearch-x.el ends here | 146 | ;;; isearch-x.el ends here |
diff --git a/lisp/isearch.el b/lisp/isearch.el index d9f8b0891e4..ec4f32aecca 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -1540,17 +1540,22 @@ nil and a non-nil value of the option `search-invisible' | |||
| 1540 | "Return a regexp which matches words, ignoring punctuation. | 1540 | "Return a regexp which matches words, ignoring punctuation. |
| 1541 | Given STRING, a string of words separated by word delimiters, | 1541 | Given STRING, a string of words separated by word delimiters, |
| 1542 | compute a regexp that matches those exact words separated by | 1542 | compute a regexp that matches those exact words separated by |
| 1543 | arbitrary punctuation. If LAX is non-nil, the end of the string | 1543 | arbitrary punctuation. If the string begins or ends in whitespace, |
| 1544 | need not match a word boundary unless it ends in whitespace. | 1544 | the beginning or the end of the string matches arbitrary whitespace. |
| 1545 | Otherwise if LAX is non-nil, the beginning or the end of the string | ||
| 1546 | need not match a word boundary. | ||
| 1545 | 1547 | ||
| 1546 | Used in `word-search-forward', `word-search-backward', | 1548 | Used in `word-search-forward', `word-search-backward', |
| 1547 | `word-search-forward-lax', `word-search-backward-lax'." | 1549 | `word-search-forward-lax', `word-search-backward-lax'." |
| 1548 | (if (string-match-p "^\\W*$" string) | 1550 | (cond |
| 1549 | "" | 1551 | ((equal string "") "") |
| 1550 | (concat | 1552 | ((string-match-p "\\`\\W+\\'" string) "\\W+") |
| 1551 | "\\b" | 1553 | (t (concat |
| 1552 | (mapconcat 'identity (split-string string "\\W+" t) "\\W+") | 1554 | (if (string-match-p "\\`\\W" string) "\\W+" |
| 1553 | (if (or (not lax) (string-match-p "\\W$" string)) "\\b")))) | 1555 | (unless lax "\\<")) |
| 1556 | (mapconcat 'regexp-quote (split-string string "\\W+" t) "\\W+") | ||
| 1557 | (if (string-match-p "\\W\\'" string) "\\W+" | ||
| 1558 | (unless lax "\\>")))))) | ||
| 1554 | 1559 | ||
| 1555 | (defun word-search-backward (string &optional bound noerror count) | 1560 | (defun word-search-backward (string &optional bound noerror count) |
| 1556 | "Search backward from point for STRING, ignoring differences in punctuation. | 1561 | "Search backward from point for STRING, ignoring differences in punctuation. |
| @@ -1625,8 +1630,24 @@ to punctuation." | |||
| 1625 | (defun isearch-symbol-regexp (string &optional lax) | 1630 | (defun isearch-symbol-regexp (string &optional lax) |
| 1626 | "Return a regexp which matches STRING as a symbol. | 1631 | "Return a regexp which matches STRING as a symbol. |
| 1627 | Creates a regexp where STRING is surrounded by symbol delimiters \\_< and \\_>. | 1632 | Creates a regexp where STRING is surrounded by symbol delimiters \\_< and \\_>. |
| 1628 | If LAX is non-nil, the end of the string need not match a symbol boundary." | 1633 | If there are more than one symbol, then compute a regexp that matches |
| 1629 | (concat "\\_<" (regexp-quote string) (unless lax "\\_>"))) | 1634 | those exact symbols separated by non-symbol characters. If the string |
| 1635 | begins or ends in whitespace, the beginning or the end of the string | ||
| 1636 | matches arbitrary non-symbol whitespace. Otherwise if LAX is non-nil, | ||
| 1637 | the beginning or the end of the string need not match a symbol boundary." | ||
| 1638 | (let ((not-word-symbol-re | ||
| 1639 | ;; This regexp matches all syntaxes except word and symbol syntax. | ||
| 1640 | ;; FIXME: Replace it with something shorter if possible (bug#14602). | ||
| 1641 | "\\(?:\\s-\\|\\s.\\|\\s(\\|\\s)\\|\\s\"\\|\\s\\\\|\\s/\\|\\s$\\|\\s'\\|\\s<\\|\\s>\\|\\s@\\|\\s!\\|\\s|\\)+")) | ||
| 1642 | (cond | ||
| 1643 | ((equal string "") "") | ||
| 1644 | ((string-match-p (format "\\`%s\\'" not-word-symbol-re) string) not-word-symbol-re) | ||
| 1645 | (t (concat | ||
| 1646 | (if (string-match-p (format "\\`%s" not-word-symbol-re) string) not-word-symbol-re | ||
| 1647 | (unless lax "\\_<")) | ||
| 1648 | (mapconcat 'regexp-quote (split-string string not-word-symbol-re t) not-word-symbol-re) | ||
| 1649 | (if (string-match-p (format "%s\\'" not-word-symbol-re) string) not-word-symbol-re | ||
| 1650 | (unless lax "\\_>"))))))) | ||
| 1630 | 1651 | ||
| 1631 | (put 'isearch-symbol-regexp 'isearch-message-prefix "symbol ") | 1652 | (put 'isearch-symbol-regexp 'isearch-message-prefix "symbol ") |
| 1632 | 1653 | ||
| @@ -1657,9 +1678,10 @@ If LAX is non-nil, the end of the string need not match a symbol boundary." | |||
| 1657 | "Start `query-replace' with string to replace from last search string. | 1678 | "Start `query-replace' with string to replace from last search string. |
| 1658 | The arg DELIMITED (prefix arg if interactive), if non-nil, means replace | 1679 | The arg DELIMITED (prefix arg if interactive), if non-nil, means replace |
| 1659 | only matches surrounded by word boundaries. Note that using the prefix arg | 1680 | only matches surrounded by word boundaries. Note that using the prefix arg |
| 1660 | is possible only when `isearch-allow-scroll' is non-nil, and it doesn't | 1681 | is possible only when `isearch-allow-scroll' is non-nil or |
| 1661 | always provide the correct matches for `query-replace', so the preferred | 1682 | `isearch-allow-prefix' is non-nil, and it doesn't always provide the |
| 1662 | way to run word replacements from Isearch is `M-s w ... M-%'." | 1683 | correct matches for `query-replace', so the preferred way to run word |
| 1684 | replacements from Isearch is `M-s w ... M-%'." | ||
| 1663 | (interactive | 1685 | (interactive |
| 1664 | (list current-prefix-arg)) | 1686 | (list current-prefix-arg)) |
| 1665 | (barf-if-buffer-read-only) | 1687 | (barf-if-buffer-read-only) |
| @@ -1693,7 +1715,15 @@ way to run word replacements from Isearch is `M-s w ... M-%'." | |||
| 1693 | (query-replace-read-to | 1715 | (query-replace-read-to |
| 1694 | isearch-string | 1716 | isearch-string |
| 1695 | (concat "Query replace" | 1717 | (concat "Query replace" |
| 1696 | (if (or delimited isearch-word) " word" "") | 1718 | (if (or delimited isearch-word) |
| 1719 | (let* ((symbol (or delimited isearch-word)) | ||
| 1720 | (string (and symbol (symbolp symbol) | ||
| 1721 | (get symbol 'isearch-message-prefix)))) | ||
| 1722 | (if (stringp string) | ||
| 1723 | ;; Move space from the end to the beginning. | ||
| 1724 | (replace-regexp-in-string "\\(.*\\) \\'" " \\1" string) | ||
| 1725 | " word")) | ||
| 1726 | "") | ||
| 1697 | (if isearch-regexp " regexp" "") | 1727 | (if isearch-regexp " regexp" "") |
| 1698 | (if (and transient-mark-mode mark-active) " in region" "")) | 1728 | (if (and transient-mark-mode mark-active) " in region" "")) |
| 1699 | isearch-regexp) | 1729 | isearch-regexp) |
| @@ -1735,12 +1765,14 @@ characters in that string." | |||
| 1735 | ;; No subexpression so collect the entire match. | 1765 | ;; No subexpression so collect the entire match. |
| 1736 | "\\&" | 1766 | "\\&" |
| 1737 | ;; Get the regexp for collection pattern. | 1767 | ;; Get the regexp for collection pattern. |
| 1738 | (isearch-done nil t) | 1768 | (let ((default (car occur-collect-regexp-history)) |
| 1739 | (isearch-clean-overlays) | 1769 | regexp-collect) |
| 1740 | (let ((default (car occur-collect-regexp-history))) | 1770 | (with-isearch-suspended |
| 1741 | (read-regexp | 1771 | (setq regexp-collect |
| 1742 | (format "Regexp to collect (default %s): " default) | 1772 | (read-regexp |
| 1743 | default 'occur-collect-regexp-history))) | 1773 | (format "Regexp to collect (default %s): " default) |
| 1774 | default 'occur-collect-regexp-history))) | ||
| 1775 | regexp-collect)) | ||
| 1744 | ;; Otherwise normal occur takes numerical prefix argument. | 1776 | ;; Otherwise normal occur takes numerical prefix argument. |
| 1745 | (when current-prefix-arg | 1777 | (when current-prefix-arg |
| 1746 | (prefix-numeric-value current-prefix-arg)))))) | 1778 | (prefix-numeric-value current-prefix-arg)))))) |
| @@ -1815,11 +1847,17 @@ If search string is empty, just beep." | |||
| 1815 | (interactive "p") | 1847 | (interactive "p") |
| 1816 | (if (= 0 (length isearch-string)) | 1848 | (if (= 0 (length isearch-string)) |
| 1817 | (ding) | 1849 | (ding) |
| 1818 | (setq isearch-string (substring isearch-string 0 (- (or arg 1))) | 1850 | (setq isearch-string (substring isearch-string 0 |
| 1851 | (- (min (or arg 1) | ||
| 1852 | (length isearch-string)))) | ||
| 1819 | isearch-message (mapconcat 'isearch-text-char-description | 1853 | isearch-message (mapconcat 'isearch-text-char-description |
| 1820 | isearch-string ""))) | 1854 | isearch-string ""))) |
| 1821 | ;; Use the isearch-other-end as new starting point to be able | 1855 | ;; Use the isearch-other-end as new starting point to be able |
| 1822 | ;; to find the remaining part of the search string again. | 1856 | ;; to find the remaining part of the search string again. |
| 1857 | ;; This is like what `isearch-search-and-update' does, | ||
| 1858 | ;; but currently it doesn't support deletion of characters | ||
| 1859 | ;; for the case where unsuccessful search may become successful | ||
| 1860 | ;; by deletion of characters. | ||
| 1823 | (if isearch-other-end (goto-char isearch-other-end)) | 1861 | (if isearch-other-end (goto-char isearch-other-end)) |
| 1824 | (isearch-search) | 1862 | (isearch-search) |
| 1825 | (isearch-push-state) | 1863 | (isearch-push-state) |
| @@ -1919,29 +1957,33 @@ Subword is used when `subword-mode' is activated. " | |||
| 1919 | (forward-word 1)) | 1957 | (forward-word 1)) |
| 1920 | (forward-char 1)) (point)))) | 1958 | (forward-char 1)) (point)))) |
| 1921 | 1959 | ||
| 1922 | (defun isearch-yank-word () | 1960 | (defun isearch-yank-word (&optional arg) |
| 1923 | "Pull next word from buffer into search string." | 1961 | "Pull next word from buffer into search string." |
| 1924 | (interactive) | 1962 | (interactive "p") |
| 1925 | (isearch-yank-internal (lambda () (forward-word 1) (point)))) | 1963 | (isearch-yank-internal (lambda () (forward-word arg) (point)))) |
| 1926 | 1964 | ||
| 1927 | (defun isearch-yank-line () | 1965 | (defun isearch-yank-line (&optional arg) |
| 1928 | "Pull rest of line from buffer into search string." | 1966 | "Pull rest of line from buffer into search string." |
| 1929 | (interactive) | 1967 | (interactive "p") |
| 1930 | (isearch-yank-internal | 1968 | (isearch-yank-internal |
| 1931 | (lambda () (let ((inhibit-field-text-motion t)) | 1969 | (lambda () (let ((inhibit-field-text-motion t)) |
| 1932 | (line-end-position (if (eolp) 2 1)))))) | 1970 | (line-end-position (if (eolp) (1+ arg) arg)))))) |
| 1933 | 1971 | ||
| 1934 | (defun isearch-char-by-name () | 1972 | (defun isearch-char-by-name (&optional count) |
| 1935 | "Read a character by its Unicode name and add it to the search string. | 1973 | "Read a character by its Unicode name and add it to the search string. |
| 1936 | Completion is available like in `read-char-by-name' used by `insert-char'." | 1974 | Completion is available like in `read-char-by-name' used by `insert-char'. |
| 1937 | (interactive) | 1975 | With argument, add COUNT copies of the character." |
| 1976 | (interactive "p") | ||
| 1938 | (with-isearch-suspended | 1977 | (with-isearch-suspended |
| 1939 | (let ((char (read-char-by-name "Add character to search (Unicode name or hex): "))) | 1978 | (let ((char (read-char-by-name "Add character to search (Unicode name or hex): "))) |
| 1940 | (when char | 1979 | (when char |
| 1941 | (setq isearch-new-string (concat isearch-string (string char)) | 1980 | (let ((string (if (and (integerp count) (> count 1)) |
| 1942 | isearch-new-message (concat isearch-message | 1981 | (make-string count char) |
| 1943 | (mapconcat 'isearch-text-char-description | 1982 | (char-to-string char)))) |
| 1944 | (string char) ""))))))) | 1983 | (setq isearch-new-string (concat isearch-string string) |
| 1984 | isearch-new-message (concat isearch-message | ||
| 1985 | (mapconcat 'isearch-text-char-description | ||
| 1986 | string "")))))))) | ||
| 1945 | 1987 | ||
| 1946 | (defun isearch-search-and-update () | 1988 | (defun isearch-search-and-update () |
| 1947 | ;; Do the search and update the display. | 1989 | ;; Do the search and update the display. |
| @@ -2382,9 +2424,10 @@ Isearch mode." | |||
| 2382 | (t;; otherwise nil | 2424 | (t;; otherwise nil |
| 2383 | (isearch-process-search-string key key))))) | 2425 | (isearch-process-search-string key key))))) |
| 2384 | 2426 | ||
| 2385 | (defun isearch-quote-char () | 2427 | (defun isearch-quote-char (&optional count) |
| 2386 | "Quote special characters for incremental search." | 2428 | "Quote special characters for incremental search. |
| 2387 | (interactive) | 2429 | With argument, add COUNT copies of the character." |
| 2430 | (interactive "p") | ||
| 2388 | (let ((char (read-quoted-char (isearch-message t)))) | 2431 | (let ((char (read-quoted-char (isearch-message t)))) |
| 2389 | ;; Assume character codes 0200 - 0377 stand for characters in some | 2432 | ;; Assume character codes 0200 - 0377 stand for characters in some |
| 2390 | ;; single-byte character set, and convert them to Emacs | 2433 | ;; single-byte character set, and convert them to Emacs |
| @@ -2392,24 +2435,26 @@ Isearch mode." | |||
| 2392 | (if (and isearch-regexp isearch-regexp-lax-whitespace (= char ?\s)) | 2435 | (if (and isearch-regexp isearch-regexp-lax-whitespace (= char ?\s)) |
| 2393 | (if (subregexp-context-p isearch-string (length isearch-string)) | 2436 | (if (subregexp-context-p isearch-string (length isearch-string)) |
| 2394 | (isearch-process-search-string "[ ]" " ") | 2437 | (isearch-process-search-string "[ ]" " ") |
| 2395 | (isearch-process-search-char char)) | 2438 | (isearch-process-search-char char count)) |
| 2396 | (and enable-multibyte-characters | 2439 | (and enable-multibyte-characters |
| 2397 | (>= char ?\200) | 2440 | (>= char ?\200) |
| 2398 | (<= char ?\377) | 2441 | (<= char ?\377) |
| 2399 | (setq char (unibyte-char-to-multibyte char))) | 2442 | (setq char (unibyte-char-to-multibyte char))) |
| 2400 | (isearch-process-search-char char)))) | 2443 | (isearch-process-search-char char count)))) |
| 2401 | 2444 | ||
| 2402 | (defun isearch-printing-char () | 2445 | (defun isearch-printing-char (&optional char count) |
| 2403 | "Add this ordinary printing character to the search string and search." | 2446 | "Add this ordinary printing CHAR to the search string and search. |
| 2404 | (interactive) | 2447 | With argument, add COUNT copies of the character." |
| 2405 | (let ((char last-command-event)) | 2448 | (interactive (list last-command-event |
| 2449 | (prefix-numeric-value current-prefix-arg))) | ||
| 2450 | (let ((char (or char last-command-event))) | ||
| 2406 | (if (= char ?\S-\ ) | 2451 | (if (= char ?\S-\ ) |
| 2407 | (setq char ?\s)) | 2452 | (setq char ?\s)) |
| 2408 | (if current-input-method | 2453 | (if current-input-method |
| 2409 | (isearch-process-search-multibyte-characters char) | 2454 | (isearch-process-search-multibyte-characters char count) |
| 2410 | (isearch-process-search-char char)))) | 2455 | (isearch-process-search-char char count)))) |
| 2411 | 2456 | ||
| 2412 | (defun isearch-process-search-char (char) | 2457 | (defun isearch-process-search-char (char &optional count) |
| 2413 | ;; * and ? are special in regexps when not preceded by \. | 2458 | ;; * and ? are special in regexps when not preceded by \. |
| 2414 | ;; } and | are special in regexps when preceded by \. | 2459 | ;; } and | are special in regexps when preceded by \. |
| 2415 | ;; Nothing special for + because it matches at least once. | 2460 | ;; Nothing special for + because it matches at least once. |
| @@ -2418,12 +2463,15 @@ Isearch mode." | |||
| 2418 | ((eq char ?\}) (isearch-fallback t t)) | 2463 | ((eq char ?\}) (isearch-fallback t t)) |
| 2419 | ((eq char ?|) (isearch-fallback t nil t))) | 2464 | ((eq char ?|) (isearch-fallback t nil t))) |
| 2420 | 2465 | ||
| 2421 | ;; Append the char to the search string, update the message and re-search. | 2466 | ;; Append the char(s) to the search string, |
| 2422 | (isearch-process-search-string | 2467 | ;; update the message and re-search. |
| 2423 | (char-to-string char) | 2468 | (let* ((string (if (and (integerp count) (> count 1)) |
| 2424 | (if (>= char ?\200) | 2469 | (make-string count char) |
| 2425 | (char-to-string char) | 2470 | (char-to-string char))) |
| 2426 | (isearch-text-char-description char)))) | 2471 | (message (if (>= char ?\200) |
| 2472 | string | ||
| 2473 | (mapconcat 'isearch-text-char-description string "")))) | ||
| 2474 | (isearch-process-search-string string message))) | ||
| 2427 | 2475 | ||
| 2428 | (defun isearch-process-search-string (string message) | 2476 | (defun isearch-process-search-string (string message) |
| 2429 | (setq isearch-string (concat isearch-string string) | 2477 | (setq isearch-string (concat isearch-string string) |
diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el index 9555cb41cfe..1951b195886 100644 --- a/lisp/net/secrets.el +++ b/lisp/net/secrets.el | |||
| @@ -208,9 +208,9 @@ It returns t if not." | |||
| 208 | ;; <arg name="Prompt" type="o" direction="out"/> | 208 | ;; <arg name="Prompt" type="o" direction="out"/> |
| 209 | ;; </method> | 209 | ;; </method> |
| 210 | ;; <method name="GetSecrets"> | 210 | ;; <method name="GetSecrets"> |
| 211 | ;; <arg name="items" type="ao" direction="in"/> | 211 | ;; <arg name="items" type="ao" direction="in"/> |
| 212 | ;; <arg name="session" type="o" direction="in"/> | 212 | ;; <arg name="session" type="o" direction="in"/> |
| 213 | ;; <arg name="secrets" type="a{o(oayay)}" direction="out"/> | 213 | ;; <arg name="secrets" type="a{o(oayays)}" direction="out"/> |
| 214 | ;; </method> | 214 | ;; </method> |
| 215 | ;; <method name="ReadAlias"> | 215 | ;; <method name="ReadAlias"> |
| 216 | ;; <arg name="name" type="s" direction="in"/> | 216 | ;; <arg name="name" type="s" direction="in"/> |
| @@ -234,7 +234,7 @@ It returns t if not." | |||
| 234 | ;; <interface name="org.freedesktop.Secret.Collection"> | 234 | ;; <interface name="org.freedesktop.Secret.Collection"> |
| 235 | ;; <property name="Items" type="ao" access="read"/> | 235 | ;; <property name="Items" type="ao" access="read"/> |
| 236 | ;; <property name="Label" type="s" access="readwrite"/> | 236 | ;; <property name="Label" type="s" access="readwrite"/> |
| 237 | ;; <property name="Locked" type="s" access="read"/> | 237 | ;; <property name="Locked" type="b" access="read"/> |
| 238 | ;; <property name="Created" type="t" access="read"/> | 238 | ;; <property name="Created" type="t" access="read"/> |
| 239 | ;; <property name="Modified" type="t" access="read"/> | 239 | ;; <property name="Modified" type="t" access="read"/> |
| 240 | ;; <method name="Delete"> | 240 | ;; <method name="Delete"> |
| @@ -245,11 +245,11 @@ It returns t if not." | |||
| 245 | ;; <arg name="results" type="ao" direction="out"/> | 245 | ;; <arg name="results" type="ao" direction="out"/> |
| 246 | ;; </method> | 246 | ;; </method> |
| 247 | ;; <method name="CreateItem"> | 247 | ;; <method name="CreateItem"> |
| 248 | ;; <arg name="props" type="a{sv}" direction="in"/> | 248 | ;; <arg name="props" type="a{sv}" direction="in"/> |
| 249 | ;; <arg name="secret" type="(oayay)" direction="in"/> | 249 | ;; <arg name="secret" type="(oayays)" direction="in"/> |
| 250 | ;; <arg name="replace" type="b" direction="in"/> | 250 | ;; <arg name="replace" type="b" direction="in"/> |
| 251 | ;; <arg name="item" type="o" direction="out"/> | 251 | ;; <arg name="item" type="o" direction="out"/> |
| 252 | ;; <arg name="prompt" type="o" direction="out"/> | 252 | ;; <arg name="prompt" type="o" direction="out"/> |
| 253 | ;; </method> | 253 | ;; </method> |
| 254 | ;; <signal name="ItemCreated"> | 254 | ;; <signal name="ItemCreated"> |
| 255 | ;; <arg name="item" type="o"/> | 255 | ;; <arg name="item" type="o"/> |
| @@ -293,11 +293,11 @@ It returns t if not." | |||
| 293 | ;; <arg name="prompt" type="o" direction="out"/> | 293 | ;; <arg name="prompt" type="o" direction="out"/> |
| 294 | ;; </method> | 294 | ;; </method> |
| 295 | ;; <method name="GetSecret"> | 295 | ;; <method name="GetSecret"> |
| 296 | ;; <arg name="session" type="o" direction="in"/> | 296 | ;; <arg name="session" type="o" direction="in"/> |
| 297 | ;; <arg name="secret" type="(oayay)" direction="out"/> | 297 | ;; <arg name="secret" type="(oayays)" direction="out"/> |
| 298 | ;; </method> | 298 | ;; </method> |
| 299 | ;; <method name="SetSecret"> | 299 | ;; <method name="SetSecret"> |
| 300 | ;; <arg name="secret" type="(oayay)" direction="in"/> | 300 | ;; <arg name="secret" type="(oayays)" direction="in"/> |
| 301 | ;; </method> | 301 | ;; </method> |
| 302 | ;; </interface> | 302 | ;; </interface> |
| 303 | ;; | 303 | ;; |
| @@ -305,10 +305,22 @@ It returns t if not." | |||
| 305 | ;; OBJECT PATH session | 305 | ;; OBJECT PATH session |
| 306 | ;; ARRAY BYTE parameters | 306 | ;; ARRAY BYTE parameters |
| 307 | ;; ARRAY BYTE value | 307 | ;; ARRAY BYTE value |
| 308 | ;; STRING content_type ;; Added 2011/2/9 | ||
| 308 | 309 | ||
| 309 | (defconst secrets-interface-item-type-generic "org.freedesktop.Secret.Generic" | 310 | (defconst secrets-interface-item-type-generic "org.freedesktop.Secret.Generic" |
| 310 | "The default item type we are using.") | 311 | "The default item type we are using.") |
| 311 | 312 | ||
| 313 | (defconst secrets-struct-secret-content-type | ||
| 314 | (when (string-equal | ||
| 315 | (dbus-introspect-get-signature | ||
| 316 | :session secrets-service secrets-path secrets-interface-service | ||
| 317 | "GetSecrets" "out") | ||
| 318 | "a{o(oayays)}") | ||
| 319 | '("text/plain")) | ||
| 320 | "The content_type of a secret struct. | ||
| 321 | It must be wrapped as list, because we add it via `append'. This | ||
| 322 | is an interface introduced in 2011.") | ||
| 323 | |||
| 312 | (defconst secrets-interface-session "org.freedesktop.Secret.Session" | 324 | (defconst secrets-interface-session "org.freedesktop.Secret.Session" |
| 313 | "A session tracks state between the service and a client application.") | 325 | "A session tracks state between the service and a client application.") |
| 314 | 326 | ||
| @@ -616,16 +628,21 @@ The object path of the created item is returned." | |||
| 616 | ;; Properties. | 628 | ;; Properties. |
| 617 | (append | 629 | (append |
| 618 | `(:array | 630 | `(:array |
| 619 | (:dict-entry "Label" (:variant ,item)) | 631 | (:dict-entry ,(concat secrets-interface-item ".Label") |
| 620 | (:dict-entry | 632 | (:variant ,item)) |
| 621 | "Type" (:variant ,secrets-interface-item-type-generic))) | 633 | (:dict-entry ,(concat secrets-interface-item ".Type") |
| 634 | (:variant ,secrets-interface-item-type-generic))) | ||
| 622 | (when props | 635 | (when props |
| 623 | `((:dict-entry | 636 | `((:dict-entry ,(concat secrets-interface-item ".Attributes") |
| 624 | "Attributes" (:variant ,(append '(:array) props)))))) | 637 | (:variant ,(append '(:array) props)))))) |
| 625 | ;; Secret. | 638 | ;; Secret. |
| 626 | `(:struct :object-path ,secrets-session-path | 639 | (append |
| 627 | (:array :signature "y") ;; no parameters. | 640 | `(:struct :object-path ,secrets-session-path |
| 628 | ,(dbus-string-to-byte-array password)) | 641 | (:array :signature "y") ;; No parameters. |
| 642 | ,(dbus-string-to-byte-array password)) | ||
| 643 | ;; We add the content_type. In backward compatibility | ||
| 644 | ;; mode, nil is appended, which means nothing. | ||
| 645 | secrets-struct-secret-content-type) | ||
| 629 | ;; Do not replace. Replace does not seem to work. | 646 | ;; Do not replace. Replace does not seem to work. |
| 630 | nil)) | 647 | nil)) |
| 631 | (secrets-prompt (cadr result)) | 648 | (secrets-prompt (cadr result)) |
diff --git a/lisp/replace.el b/lisp/replace.el index 24cfccf60fd..be0ecda20fa 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -2156,7 +2156,10 @@ make, or the user didn't cancel the call." | |||
| 2156 | (with-output-to-temp-buffer "*Help*" | 2156 | (with-output-to-temp-buffer "*Help*" |
| 2157 | (princ | 2157 | (princ |
| 2158 | (concat "Query replacing " | 2158 | (concat "Query replacing " |
| 2159 | (if delimited-flag "word " "") | 2159 | (if delimited-flag |
| 2160 | (or (and (symbolp delimited-flag) | ||
| 2161 | (get delimited-flag 'isearch-message-prefix)) | ||
| 2162 | "word ") "") | ||
| 2160 | (if regexp-flag "regexp " "") | 2163 | (if regexp-flag "regexp " "") |
| 2161 | from-string " with " | 2164 | from-string " with " |
| 2162 | next-replacement ".\n\n" | 2165 | next-replacement ".\n\n" |
diff --git a/lisp/saveplace.el b/lisp/saveplace.el index 1b7efcec1b9..2ddac6d6c43 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el | |||
| @@ -169,22 +169,24 @@ file: | |||
| 169 | ;; file. If not, do so, then feel free to modify the alist. It | 169 | ;; file. If not, do so, then feel free to modify the alist. It |
| 170 | ;; will be saved again when Emacs is killed. | 170 | ;; will be saved again when Emacs is killed. |
| 171 | (or save-place-loaded (load-save-place-alist-from-file)) | 171 | (or save-place-loaded (load-save-place-alist-from-file)) |
| 172 | (when (and buffer-file-name | 172 | (let ((item (or buffer-file-name |
| 173 | (or (not save-place-ignore-files-regexp) | 173 | (and dired-directory (expand-file-name dired-directory))))) |
| 174 | (not (string-match save-place-ignore-files-regexp | 174 | (when (and item |
| 175 | buffer-file-name)))) | 175 | (or (not save-place-ignore-files-regexp) |
| 176 | (let ((cell (assoc buffer-file-name save-place-alist)) | 176 | (not (string-match save-place-ignore-files-regexp |
| 177 | (position (if (not (eq major-mode 'hexl-mode)) | 177 | item)))) |
| 178 | (point) | 178 | (let ((cell (assoc item save-place-alist)) |
| 179 | (with-no-warnings | 179 | (position (if (not (eq major-mode 'hexl-mode)) |
| 180 | (1+ (hexl-current-address)))))) | 180 | (point) |
| 181 | (if cell | 181 | (with-no-warnings |
| 182 | (setq save-place-alist (delq cell save-place-alist))) | 182 | (1+ (hexl-current-address)))))) |
| 183 | (if (and save-place | 183 | (if cell |
| 184 | (not (= position 1))) ;; Optimize out the degenerate case. | 184 | (setq save-place-alist (delq cell save-place-alist))) |
| 185 | (setq save-place-alist | 185 | (if (and save-place |
| 186 | (cons (cons buffer-file-name position) | 186 | (not (= position 1))) ;; Optimize out the degenerate case. |
| 187 | save-place-alist)))))) | 187 | (setq save-place-alist |
| 188 | (cons (cons item position) | ||
| 189 | save-place-alist))))))) | ||
| 188 | 190 | ||
| 189 | (defun save-place-forget-unreadable-files () | 191 | (defun save-place-forget-unreadable-files () |
| 190 | "Remove unreadable files from `save-place-alist'. | 192 | "Remove unreadable files from `save-place-alist'. |
| @@ -300,6 +302,17 @@ may have changed\) back to `save-place-alist'." | |||
| 300 | ;; and make sure it will be saved again for later | 302 | ;; and make sure it will be saved again for later |
| 301 | (setq save-place t))))) | 303 | (setq save-place t))))) |
| 302 | 304 | ||
| 305 | (defun save-place-dired-hook () | ||
| 306 | "Position the point in a dired buffer." | ||
| 307 | (or save-place-loaded (load-save-place-alist-from-file)) | ||
| 308 | (let ((cell (assoc (expand-file-name dired-directory) save-place-alist))) | ||
| 309 | (if cell | ||
| 310 | (progn | ||
| 311 | (or revert-buffer-in-progress-p | ||
| 312 | (goto-char (cdr cell))) | ||
| 313 | ;; and make sure it will be saved again for later | ||
| 314 | (setq save-place t))))) | ||
| 315 | |||
| 303 | (defun save-place-kill-emacs-hook () | 316 | (defun save-place-kill-emacs-hook () |
| 304 | ;; First update the alist. This loads the old save-place-file if nec. | 317 | ;; First update the alist. This loads the old save-place-file if nec. |
| 305 | (save-places-to-alist) | 318 | (save-places-to-alist) |
| @@ -310,6 +323,7 @@ may have changed\) back to `save-place-alist'." | |||
| 310 | 323 | ||
| 311 | (add-hook 'find-file-hook 'save-place-find-file-hook t) | 324 | (add-hook 'find-file-hook 'save-place-find-file-hook t) |
| 312 | 325 | ||
| 326 | (add-hook 'dired-initial-point-hook 'save-place-dired-hook) | ||
| 313 | (unless noninteractive | 327 | (unless noninteractive |
| 314 | (add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook)) | 328 | (add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook)) |
| 315 | 329 | ||
diff --git a/lisp/simple.el b/lisp/simple.el index 15bf8779f56..3fd94e96d33 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -7295,8 +7295,7 @@ version and use the one distributed with Emacs.")) | |||
| 7295 | "Alist of packages known to cause problems in this version of Emacs. | 7295 | "Alist of packages known to cause problems in this version of Emacs. |
| 7296 | Each element has the form (PACKAGE SYMBOL REGEXP STRING). | 7296 | Each element has the form (PACKAGE SYMBOL REGEXP STRING). |
| 7297 | PACKAGE is either a regular expression to match file names, or a | 7297 | PACKAGE is either a regular expression to match file names, or a |
| 7298 | symbol (a feature name); see the documentation of | 7298 | symbol (a feature name), like for `with-eval-after-load'. |
| 7299 | `after-load-alist', to which this variable adds functions. | ||
| 7300 | SYMBOL is either the name of a string variable, or `t'. Upon | 7299 | SYMBOL is either the name of a string variable, or `t'. Upon |
| 7301 | loading PACKAGE, if SYMBOL is t or matches REGEXP, display a | 7300 | loading PACKAGE, if SYMBOL is t or matches REGEXP, display a |
| 7302 | warning using STRING as the message.") | 7301 | warning using STRING as the message.") |
| @@ -7314,10 +7313,10 @@ warning using STRING as the message.") | |||
| 7314 | (display-warning package (nth 3 list) :warning))) | 7313 | (display-warning package (nth 3 list) :warning))) |
| 7315 | (error nil))) | 7314 | (error nil))) |
| 7316 | 7315 | ||
| 7317 | (mapc (lambda (elem) | 7316 | (dolist (elem bad-packages-alist) |
| 7318 | (eval-after-load (car elem) `(bad-package-check ',(car elem)))) | 7317 | (let ((pkg (car elem))) |
| 7319 | bad-packages-alist) | 7318 | (with-eval-after-load pkg |
| 7320 | 7319 | (bad-package-check pkg)))) | |
| 7321 | 7320 | ||
| 7322 | (provide 'simple) | 7321 | (provide 'simple) |
| 7323 | 7322 | ||
diff --git a/lisp/startup.el b/lisp/startup.el index b7b4c156f02..bd1e0db03e6 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -422,6 +422,13 @@ The second subexpression is the version string. | |||
| 422 | The regexp should not contain a starting \"\\`\" or a trailing | 422 | The regexp should not contain a starting \"\\`\" or a trailing |
| 423 | \"\\'\"; those are added automatically by callers.") | 423 | \"\\'\"; those are added automatically by callers.") |
| 424 | 424 | ||
| 425 | (defun package--description-file (dir) | ||
| 426 | (concat (let ((subdir (file-name-nondirectory | ||
| 427 | (directory-file-name dir)))) | ||
| 428 | (if (string-match package-subdirectory-regexp subdir) | ||
| 429 | (match-string 1 subdir) subdir)) | ||
| 430 | "-pkg.el")) | ||
| 431 | |||
| 425 | (defun normal-top-level-add-subdirs-to-load-path () | 432 | (defun normal-top-level-add-subdirs-to-load-path () |
| 426 | "Add all subdirectories of `default-directory' to `load-path'. | 433 | "Add all subdirectories of `default-directory' to `load-path'. |
| 427 | More precisely, this uses only the subdirectories whose names | 434 | More precisely, this uses only the subdirectories whose names |
| @@ -715,7 +722,7 @@ opening the first frame (e.g. open a connection to an X server).") | |||
| 715 | default-frame-alist)) | 722 | default-frame-alist)) |
| 716 | (t | 723 | (t |
| 717 | (push argi rest))))) | 724 | (push argi rest))))) |
| 718 | (nreverse rest))) | 725 | (nconc (nreverse rest) args))) |
| 719 | 726 | ||
| 720 | (declare-function x-get-resource "frame.c" | 727 | (declare-function x-get-resource "frame.c" |
| 721 | (attribute class &optional component subclass)) | 728 | (attribute class &optional component subclass)) |
| @@ -1194,10 +1201,10 @@ the `--debug-init' option to view a complete error backtrace." | |||
| 1194 | (dolist (dir dirs) | 1201 | (dolist (dir dirs) |
| 1195 | (when (file-directory-p dir) | 1202 | (when (file-directory-p dir) |
| 1196 | (dolist (subdir (directory-files dir)) | 1203 | (dolist (subdir (directory-files dir)) |
| 1197 | (when (and (file-directory-p (expand-file-name subdir dir)) | 1204 | (when (let ((subdir (expand-file-name subdir dir))) |
| 1198 | (string-match | 1205 | (and (file-directory-p subdir) |
| 1199 | (concat "\\`" package-subdirectory-regexp "\\'") | 1206 | (file-exists-p |
| 1200 | subdir)) | 1207 | (package--description-file subdir)))) |
| 1201 | (throw 'package-dir-found t))))))) | 1208 | (throw 'package-dir-found t))))))) |
| 1202 | (package-initialize)) | 1209 | (package-initialize)) |
| 1203 | 1210 | ||
diff --git a/lisp/subr.el b/lisp/subr.el index 8f290f356da..eba99b839e6 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -3729,6 +3729,8 @@ Return nil if there isn't one." | |||
| 3729 | (defun eval-after-load (file form) | 3729 | (defun eval-after-load (file form) |
| 3730 | "Arrange that if FILE is loaded, FORM will be run immediately afterwards. | 3730 | "Arrange that if FILE is loaded, FORM will be run immediately afterwards. |
| 3731 | If FILE is already loaded, evaluate FORM right now. | 3731 | If FILE is already loaded, evaluate FORM right now. |
| 3732 | FORM can be an Elisp expression (in which case it's passed to `eval'), | ||
| 3733 | or a function (in which case it's passed to `funcall' with no argument). | ||
| 3732 | 3734 | ||
| 3733 | If a matching file is loaded again, FORM will be evaluated again. | 3735 | If a matching file is loaded again, FORM will be evaluated again. |
| 3734 | 3736 | ||
| @@ -3756,43 +3758,61 @@ Usually FILE is just a library name like \"font-lock\" or a feature name | |||
| 3756 | like 'font-lock. | 3758 | like 'font-lock. |
| 3757 | 3759 | ||
| 3758 | This function makes or adds to an entry on `after-load-alist'." | 3760 | This function makes or adds to an entry on `after-load-alist'." |
| 3761 | (declare (compiler-macro | ||
| 3762 | (lambda (whole) | ||
| 3763 | (if (eq 'quote (car-safe form)) | ||
| 3764 | ;; Quote with lambda so the compiler can look inside. | ||
| 3765 | `(eval-after-load ,file (lambda () ,(nth 1 form))) | ||
| 3766 | whole)))) | ||
| 3759 | ;; Add this FORM into after-load-alist (regardless of whether we'll be | 3767 | ;; Add this FORM into after-load-alist (regardless of whether we'll be |
| 3760 | ;; evaluating it now). | 3768 | ;; evaluating it now). |
| 3761 | (let* ((regexp-or-feature | 3769 | (let* ((regexp-or-feature |
| 3762 | (if (stringp file) | 3770 | (if (stringp file) |
| 3763 | (setq file (purecopy (load-history-regexp file))) | 3771 | (setq file (purecopy (load-history-regexp file))) |
| 3764 | file)) | 3772 | file)) |
| 3765 | (elt (assoc regexp-or-feature after-load-alist))) | 3773 | (elt (assoc regexp-or-feature after-load-alist)) |
| 3774 | (func | ||
| 3775 | (if (functionp form) form | ||
| 3776 | ;; Try to use the "current" lexical/dynamic mode for `form'. | ||
| 3777 | (eval `(lambda () ,form) lexical-binding)))) | ||
| 3766 | (unless elt | 3778 | (unless elt |
| 3767 | (setq elt (list regexp-or-feature)) | 3779 | (setq elt (list regexp-or-feature)) |
| 3768 | (push elt after-load-alist)) | 3780 | (push elt after-load-alist)) |
| 3769 | ;; Make sure `form' is evalled in the current lexical/dynamic code. | ||
| 3770 | (setq form `(funcall ',(eval `(lambda () ,form) lexical-binding))) | ||
| 3771 | ;; Is there an already loaded file whose name (or `provide' name) | 3781 | ;; Is there an already loaded file whose name (or `provide' name) |
| 3772 | ;; matches FILE? | 3782 | ;; matches FILE? |
| 3773 | (prog1 (if (if (stringp file) | 3783 | (prog1 (if (if (stringp file) |
| 3774 | (load-history-filename-element regexp-or-feature) | 3784 | (load-history-filename-element regexp-or-feature) |
| 3775 | (featurep file)) | 3785 | (featurep file)) |
| 3776 | (eval form)) | 3786 | (funcall func)) |
| 3777 | (when (symbolp regexp-or-feature) | 3787 | (let ((delayed-func |
| 3778 | ;; For features, the after-load-alist elements get run when `provide' is | 3788 | (if (not (symbolp regexp-or-feature)) func |
| 3779 | ;; called rather than at the end of the file. So add an indirection to | 3789 | ;; For features, the after-load-alist elements get run when |
| 3780 | ;; make sure that `form' is really run "after-load" in case the provide | 3790 | ;; `provide' is called rather than at the end of the file. |
| 3781 | ;; call happens early. | 3791 | ;; So add an indirection to make sure that `func' is really run |
| 3782 | (setq form | 3792 | ;; "after-load" in case the provide call happens early. |
| 3783 | `(if load-file-name | 3793 | (lambda () |
| 3784 | (let ((fun (make-symbol "eval-after-load-helper"))) | 3794 | (if (not load-file-name) |
| 3785 | (fset fun `(lambda (file) | 3795 | ;; Not being provided from a file, run func right now. |
| 3786 | (if (not (equal file ',load-file-name)) | 3796 | (funcall func) |
| 3787 | nil | 3797 | (let ((lfn load-file-name) |
| 3788 | (remove-hook 'after-load-functions ',fun) | 3798 | ;; Don't use letrec, because equal (in |
| 3789 | ,',form))) | 3799 | ;; add/remove-hook) would get trapped in a cycle. |
| 3790 | (add-hook 'after-load-functions fun)) | 3800 | (fun (make-symbol "eval-after-load-helper"))) |
| 3791 | ;; Not being provided from a file, run form right now. | 3801 | (fset fun (lambda (file) |
| 3792 | ,form))) | 3802 | (when (equal file lfn) |
| 3793 | ;; Add FORM to the element unless it's already there. | 3803 | (remove-hook 'after-load-functions fun) |
| 3794 | (unless (member form (cdr elt)) | 3804 | (funcall func)))) |
| 3795 | (nconc elt (list form)))))) | 3805 | (add-hook 'after-load-functions fun))))))) |
| 3806 | ;; Add FORM to the element unless it's already there. | ||
| 3807 | (unless (member delayed-func (cdr elt)) | ||
| 3808 | (nconc elt (list delayed-func))))))) | ||
| 3809 | |||
| 3810 | (defmacro with-eval-after-load (file &rest body) | ||
| 3811 | "Execute BODY after FILE is loaded. | ||
| 3812 | FILE is normally a feature name, but it can also be a file name, | ||
| 3813 | in case that file does not provide any feature." | ||
| 3814 | (declare (indent 1) (debug t)) | ||
| 3815 | `(eval-after-load ,file (lambda () ,@body))) | ||
| 3796 | 3816 | ||
| 3797 | (defvar after-load-functions nil | 3817 | (defvar after-load-functions nil |
| 3798 | "Special hook run after loading a file. | 3818 | "Special hook run after loading a file. |
| @@ -3804,12 +3824,11 @@ name of the file just loaded.") | |||
| 3804 | ABS-FILE, a string, should be the absolute true name of a file just loaded. | 3824 | ABS-FILE, a string, should be the absolute true name of a file just loaded. |
| 3805 | This function is called directly from the C code." | 3825 | This function is called directly from the C code." |
| 3806 | ;; Run the relevant eval-after-load forms. | 3826 | ;; Run the relevant eval-after-load forms. |
| 3807 | (mapc #'(lambda (a-l-element) | 3827 | (dolist (a-l-element after-load-alist) |
| 3808 | (when (and (stringp (car a-l-element)) | 3828 | (when (and (stringp (car a-l-element)) |
| 3809 | (string-match-p (car a-l-element) abs-file)) | 3829 | (string-match-p (car a-l-element) abs-file)) |
| 3810 | ;; discard the file name regexp | 3830 | ;; discard the file name regexp |
| 3811 | (mapc #'eval (cdr a-l-element)))) | 3831 | (mapc #'funcall (cdr a-l-element)))) |
| 3812 | after-load-alist) | ||
| 3813 | ;; Complain when the user uses obsolete files. | 3832 | ;; Complain when the user uses obsolete files. |
| 3814 | (when (string-match-p "/obsolete/[^/]*\\'" abs-file) | 3833 | (when (string-match-p "/obsolete/[^/]*\\'" abs-file) |
| 3815 | (run-with-timer 0 nil | 3834 | (run-with-timer 0 nil |
| @@ -4234,7 +4253,25 @@ use `called-interactively-p'." | |||
| 4234 | (declare (obsolete called-interactively-p "23.2")) | 4253 | (declare (obsolete called-interactively-p "23.2")) |
| 4235 | (called-interactively-p 'interactive)) | 4254 | (called-interactively-p 'interactive)) |
| 4236 | 4255 | ||
| 4237 | (defun set-temporary-overlay-map (map &optional keep-pred) | 4256 | (defun internal-push-keymap (keymap symbol) |
| 4257 | (let ((map (symbol-value symbol))) | ||
| 4258 | (unless (memq keymap map) | ||
| 4259 | (unless (memq 'add-keymap-witness (symbol-value symbol)) | ||
| 4260 | (setq map (make-composed-keymap nil (symbol-value symbol))) | ||
| 4261 | (push 'add-keymap-witness (cdr map)) | ||
| 4262 | (set symbol map)) | ||
| 4263 | (push keymap (cdr map))))) | ||
| 4264 | |||
| 4265 | (defun internal-pop-keymap (keymap symbol) | ||
| 4266 | (let ((map (symbol-value symbol))) | ||
| 4267 | (when (memq keymap map) | ||
| 4268 | (setf (cdr map) (delq keymap (cdr map)))) | ||
| 4269 | (let ((tail (cddr map))) | ||
| 4270 | (and (or (null tail) (keymapp tail)) | ||
| 4271 | (eq 'add-keymap-witness (nth 1 map)) | ||
| 4272 | (set symbol tail))))) | ||
| 4273 | |||
| 4274 | (defun set-temporary-overlay-map (map &optional keep-pred on-exit) | ||
| 4238 | "Set MAP as a temporary keymap taking precedence over most other keymaps. | 4275 | "Set MAP as a temporary keymap taking precedence over most other keymaps. |
| 4239 | Note that this does NOT take precedence over the \"overriding\" maps | 4276 | Note that this does NOT take precedence over the \"overriding\" maps |
| 4240 | `overriding-terminal-local-map' and `overriding-local-map' (or the | 4277 | `overriding-terminal-local-map' and `overriding-local-map' (or the |
| @@ -4244,29 +4281,32 @@ found in MAP, the normal key lookup sequence then continues. | |||
| 4244 | Normally, MAP is used only once. If the optional argument | 4281 | Normally, MAP is used only once. If the optional argument |
| 4245 | KEEP-PRED is t, MAP stays active if a key from MAP is used. | 4282 | KEEP-PRED is t, MAP stays active if a key from MAP is used. |
| 4246 | KEEP-PRED can also be a function of no arguments: if it returns | 4283 | KEEP-PRED can also be a function of no arguments: if it returns |
| 4247 | non-nil then MAP stays active." | 4284 | non-nil then MAP stays active. |
| 4248 | (let* ((clearfunsym (make-symbol "clear-temporary-overlay-map")) | 4285 | |
| 4249 | (overlaysym (make-symbol "t")) | 4286 | Optional ON-EXIT argument is a function that is called after the |
| 4250 | (alist (list (cons overlaysym map))) | 4287 | deactivation of MAP." |
| 4251 | (clearfun | 4288 | (let ((clearfun (make-symbol "clear-temporary-overlay-map"))) |
| 4252 | ;; FIXME: Use lexical-binding. | 4289 | ;; Don't use letrec, because equal (in add/remove-hook) would get trapped |
| 4253 | `(lambda () | 4290 | ;; in a cycle. |
| 4254 | (unless ,(cond ((null keep-pred) nil) | 4291 | (fset clearfun |
| 4255 | ((eq t keep-pred) | 4292 | (lambda () |
| 4256 | `(eq this-command | 4293 | ;; FIXME: Handle the case of multiple temporary-overlay-maps |
| 4257 | (lookup-key ',map | 4294 | ;; E.g. if isearch and C-u both use temporary-overlay-maps, Then |
| 4258 | (this-command-keys-vector)))) | 4295 | ;; the lifetime of the C-u should be nested within the isearch |
| 4259 | (t `(funcall ',keep-pred))) | 4296 | ;; overlay, so the pre-command-hook of isearch should be |
| 4260 | (set ',overlaysym nil) ;Just in case. | 4297 | ;; suspended during the C-u one so we don't exit isearch just |
| 4261 | (remove-hook 'pre-command-hook ',clearfunsym) | 4298 | ;; because we hit 1 after C-u and that 1 exits isearch whereas it |
| 4262 | (setq emulation-mode-map-alists | 4299 | ;; doesn't exit C-u. |
| 4263 | (delq ',alist emulation-mode-map-alists)))))) | 4300 | (unless (cond ((null keep-pred) nil) |
| 4264 | (set overlaysym overlaysym) | 4301 | ((eq t keep-pred) |
| 4265 | (fset clearfunsym clearfun) | 4302 | (eq this-command |
| 4266 | (add-hook 'pre-command-hook clearfunsym) | 4303 | (lookup-key map (this-command-keys-vector)))) |
| 4267 | ;; FIXME: That's the keymaps with highest precedence, except for | 4304 | (t (funcall keep-pred))) |
| 4268 | ;; the `keymap' text-property ;-( | 4305 | (remove-hook 'pre-command-hook clearfun) |
| 4269 | (push alist emulation-mode-map-alists))) | 4306 | (internal-pop-keymap map 'overriding-terminal-local-map) |
| 4307 | (when on-exit (funcall on-exit))))) | ||
| 4308 | (add-hook 'pre-command-hook clearfun) | ||
| 4309 | (internal-push-keymap map 'overriding-terminal-local-map))) | ||
| 4270 | 4310 | ||
| 4271 | ;;;; Progress reporters. | 4311 | ;;;; Progress reporters. |
| 4272 | 4312 | ||
diff --git a/lisp/term.el b/lisp/term.el index 1c67057d3a7..31889a78273 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -560,6 +560,13 @@ This variable is buffer-local." | |||
| 560 | :type 'boolean | 560 | :type 'boolean |
| 561 | :group 'term) | 561 | :group 'term) |
| 562 | 562 | ||
| 563 | (defcustom term-suppress-hard-newline nil | ||
| 564 | "Non-nil means interpreter should not break long lines with newlines. | ||
| 565 | This means text can automatically reflow if the window is resized." | ||
| 566 | :version "24.4" | ||
| 567 | :type 'boolean | ||
| 568 | :group 'term) | ||
| 569 | |||
| 563 | ;; Where gud-display-frame should put the debugging arrow. This is | 570 | ;; Where gud-display-frame should put the debugging arrow. This is |
| 564 | ;; set by the marker-filter, which scans the debugger's output for | 571 | ;; set by the marker-filter, which scans the debugger's output for |
| 565 | ;; indications of the current pc. | 572 | ;; indications of the current pc. |
| @@ -2828,8 +2835,9 @@ See `term-prompt-regexp'." | |||
| 2828 | (setq count (length decoded-substring)) | 2835 | (setq count (length decoded-substring)) |
| 2829 | (setq temp (- (+ (term-horizontal-column) count) | 2836 | (setq temp (- (+ (term-horizontal-column) count) |
| 2830 | term-width)) | 2837 | term-width)) |
| 2831 | (cond ((<= temp 0)) ;; All count chars fit in line. | 2838 | (cond ((or term-suppress-hard-newline (<= temp 0))) |
| 2832 | ((> count temp) ;; Some chars fit. | 2839 | ;; All count chars fit in line. |
| 2840 | ((> count temp) ;; Some chars fit. | ||
| 2833 | ;; This iteration, handle only what fits. | 2841 | ;; This iteration, handle only what fits. |
| 2834 | (setq count (- count temp)) | 2842 | (setq count (- count temp)) |
| 2835 | (setq count-bytes | 2843 | (setq count-bytes |
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 05a129225ee..86f4583b987 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el | |||
| @@ -516,6 +516,9 @@ The relevant features are: | |||
| 516 | (terminal-init-xterm-modify-other-keys)))))) | 516 | (terminal-init-xterm-modify-other-keys)))))) |
| 517 | 517 | ||
| 518 | (defun xterm--query (query handlers) | 518 | (defun xterm--query (query handlers) |
| 519 | "Send QUERY string to the terminal and watch for a response. | ||
| 520 | HANDLERS is an alist with elements of the form (STRING . FUNCTION). | ||
| 521 | We run the first FUNCTION whose STRING matches the input events." | ||
| 519 | ;; We used to query synchronously, but the need to use `discard-input' is | 522 | ;; We used to query synchronously, but the need to use `discard-input' is |
| 520 | ;; rather annoying (bug#6758). Maybe we could always use the asynchronous | 523 | ;; rather annoying (bug#6758). Maybe we could always use the asynchronous |
| 521 | ;; approach, but it's less tested. | 524 | ;; approach, but it's less tested. |
| @@ -544,7 +547,8 @@ The relevant features are: | |||
| 544 | nil)))) | 547 | nil)))) |
| 545 | (setq i (1+ i))) | 548 | (setq i (1+ i))) |
| 546 | (if (= i (length (car handler))) | 549 | (if (= i (length (car handler))) |
| 547 | (funcall (cdr handler)) | 550 | (progn (setq handlers nil) |
| 551 | (funcall (cdr handler))) | ||
| 548 | (while (> i 0) | 552 | (while (> i 0) |
| 549 | (push (aref (car handler) (setq i (1- i))) | 553 | (push (aref (car handler) (setq i (1- i))) |
| 550 | unread-command-events))))))) | 554 | unread-command-events))))))) |
diff --git a/src/ChangeLog b/src/ChangeLog index 38eb460359c..827092e7f8a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2013-06-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * lread.c (syms_of_lread): | ||
| 4 | * fns.c (Fprovide): Adjust to new format of after-load-alist. | ||
| 5 | |||
| 6 | 2013-06-13 Kelly Dean <kellydeanch@yahoo.com> (tiny change) | ||
| 7 | |||
| 8 | * fileio.c (Fdo_auto_save): Trap errors in auto-save-hook. (Bug#14479) | ||
| 9 | |||
| 1 | 2013-06-12 Xue Fuqiao <xfq.free@gmail.com> | 10 | 2013-06-12 Xue Fuqiao <xfq.free@gmail.com> |
| 2 | 11 | ||
| 3 | * fileio.c (expand_file_name): Doc fix. | 12 | * fileio.c (expand_file_name): Doc fix. |
diff --git a/src/fileio.c b/src/fileio.c index ce5d4854fee..6a60186a84f 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -5596,7 +5596,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5596 | point to non-strings reached from Vbuffer_alist. */ | 5596 | point to non-strings reached from Vbuffer_alist. */ |
| 5597 | 5597 | ||
| 5598 | hook = intern ("auto-save-hook"); | 5598 | hook = intern ("auto-save-hook"); |
| 5599 | Frun_hooks (1, &hook); | 5599 | safe_run_hooks (hook); |
| 5600 | 5600 | ||
| 5601 | if (STRINGP (Vauto_save_list_file_name)) | 5601 | if (STRINGP (Vauto_save_list_file_name)) |
| 5602 | { | 5602 | { |
| @@ -2545,6 +2545,8 @@ SUBFEATURE can be used to check a specific subfeature of FEATURE. */) | |||
| 2545 | return (NILP (tem)) ? Qnil : Qt; | 2545 | return (NILP (tem)) ? Qnil : Qt; |
| 2546 | } | 2546 | } |
| 2547 | 2547 | ||
| 2548 | static Lisp_Object Qfuncall; | ||
| 2549 | |||
| 2548 | DEFUN ("provide", Fprovide, Sprovide, 1, 2, 0, | 2550 | DEFUN ("provide", Fprovide, Sprovide, 1, 2, 0, |
| 2549 | doc: /* Announce that FEATURE is a feature of the current Emacs. | 2551 | doc: /* Announce that FEATURE is a feature of the current Emacs. |
| 2550 | The optional argument SUBFEATURES should be a list of symbols listing | 2552 | The optional argument SUBFEATURES should be a list of symbols listing |
| @@ -2567,7 +2569,7 @@ particular subfeatures supported in this version of FEATURE. */) | |||
| 2567 | /* Run any load-hooks for this file. */ | 2569 | /* Run any load-hooks for this file. */ |
| 2568 | tem = Fassq (feature, Vafter_load_alist); | 2570 | tem = Fassq (feature, Vafter_load_alist); |
| 2569 | if (CONSP (tem)) | 2571 | if (CONSP (tem)) |
| 2570 | Fprogn (XCDR (tem)); | 2572 | Fmapc (Qfuncall, XCDR (tem)); |
| 2571 | 2573 | ||
| 2572 | return feature; | 2574 | return feature; |
| 2573 | } | 2575 | } |
| @@ -4866,6 +4868,7 @@ syms_of_fns (void) | |||
| 4866 | Used by `featurep' and `require', and altered by `provide'. */); | 4868 | Used by `featurep' and `require', and altered by `provide'. */); |
| 4867 | Vfeatures = Fcons (intern_c_string ("emacs"), Qnil); | 4869 | Vfeatures = Fcons (intern_c_string ("emacs"), Qnil); |
| 4868 | DEFSYM (Qsubfeatures, "subfeatures"); | 4870 | DEFSYM (Qsubfeatures, "subfeatures"); |
| 4871 | DEFSYM (Qfuncall, "funcall"); | ||
| 4869 | 4872 | ||
| 4870 | #ifdef HAVE_LANGINFO_CODESET | 4873 | #ifdef HAVE_LANGINFO_CODESET |
| 4871 | DEFSYM (Qcodeset, "codeset"); | 4874 | DEFSYM (Qcodeset, "codeset"); |
diff --git a/src/lread.c b/src/lread.c index 3ca644bb45b..b57665e365c 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -4485,15 +4485,15 @@ customize `jka-compr-load-suffixes' rather than the present variable. */); | |||
| 4485 | DEFSYM (Qload_in_progress, "load-in-progress"); | 4485 | DEFSYM (Qload_in_progress, "load-in-progress"); |
| 4486 | 4486 | ||
| 4487 | DEFVAR_LISP ("after-load-alist", Vafter_load_alist, | 4487 | DEFVAR_LISP ("after-load-alist", Vafter_load_alist, |
| 4488 | doc: /* An alist of expressions to be evalled when particular files are loaded. | 4488 | doc: /* An alist of functions to be evalled when particular files are loaded. |
| 4489 | Each element looks like (REGEXP-OR-FEATURE FORMS...). | 4489 | Each element looks like (REGEXP-OR-FEATURE FUNCS...). |
| 4490 | 4490 | ||
| 4491 | REGEXP-OR-FEATURE is either a regular expression to match file names, or | 4491 | REGEXP-OR-FEATURE is either a regular expression to match file names, or |
| 4492 | a symbol \(a feature name). | 4492 | a symbol \(a feature name). |
| 4493 | 4493 | ||
| 4494 | When `load' is run and the file-name argument matches an element's | 4494 | When `load' is run and the file-name argument matches an element's |
| 4495 | REGEXP-OR-FEATURE, or when `provide' is run and provides the symbol | 4495 | REGEXP-OR-FEATURE, or when `provide' is run and provides the symbol |
| 4496 | REGEXP-OR-FEATURE, the FORMS in the element are executed. | 4496 | REGEXP-OR-FEATURE, the FUNCS in the element are called. |
| 4497 | 4497 | ||
| 4498 | An error in FORMS does not undo the load, but does prevent execution of | 4498 | An error in FORMS does not undo the load, but does prevent execution of |
| 4499 | the rest of the FORMS. */); | 4499 | the rest of the FORMS. */); |