------------------------------------------------------------ revno: 115756 committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-12-26 00:57:28 -0800 message: Fix core dumps with gcc -fsanitize=address and GNU/Linux. On my Fedora 19 platform the core dumps were so big that my desktop became nearly catatonic. * configure.ac: Check whether addresses are sanitized. (CANNOT_DUMP): Warn if addresses are sanitized and not CANNOT_DUMP. (DOUG_LEA_MALLOC): Do not define if addresses are sanitized. (SYSTEM_MALLOC): Define if addresses are sanitized. * src/alloc.c (no_sanitize_memcpy) [MAX_SAVE_STACK > 0]: New function. (Fgarbage_collect) [MAX_SAVE_STACK > 0]: Use it. (USE_ALIGNED_MALLOC): Do not define if addresses are sanitized. (mark_memory): Use ATTRIBUTE_NO_SANITIZE_ADDRESS rather than a clang-only syntax. * src/conf_post.h (__has_feature): New macro, if not already defined. (ADDRESS_SANITIZER, ADDRESS_SANITIZER_WORKAROUND) (ATTRIBUTE_NO_SANITIZE_ADDRESS): New macros. diff: === modified file 'ChangeLog' --- ChangeLog 2013-12-24 18:27:53 +0000 +++ ChangeLog 2013-12-26 08:57:28 +0000 @@ -1,3 +1,11 @@ +2013-12-26 Paul Eggert + + Fix core dumps with gcc -fsanitize=address and GNU/Linux. + * configure.ac: Check whether addresses are sanitized. + (CANNOT_DUMP): Warn if addresses are sanitized and not CANNOT_DUMP. + (DOUG_LEA_MALLOC): Do not define if addresses are sanitized. + (SYSTEM_MALLOC): Define if addresses are sanitized. + 2013-12-24 Paul Eggert Automate the procedure for updating copyright year. === modified file 'configure.ac' --- configure.ac 2013-12-23 15:13:14 +0000 +++ configure.ac 2013-12-26 08:57:28 +0000 @@ -1048,6 +1048,21 @@ LDFLAGS="$late_LDFLAGS" +AC_CACHE_CHECK([whether addresses are sanitized], + [emacs_cv_sanitize_address], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __has_feature + #define __has_feature(f) 0 + #endif + #if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer) + #else + #error "Addresses are not sanitized." + #endif + ]])], + [emacs_cv_sanitize_address=yes], + [emacs_cv_sanitize_address=no])]) + dnl The function dump-emacs will not be defined and temacs will do dnl (load "loadup") automatically unless told otherwise. test "x$CANNOT_DUMP" = "x" && CANNOT_DUMP=no @@ -1055,8 +1070,11 @@ your-opsys-here) CANNOT_DUMP=yes ;; esac -test "$CANNOT_DUMP" = "yes" && \ +if test "$CANNOT_DUMP" = "yes"; then AC_DEFINE(CANNOT_DUMP, 1, [Define if Emacs cannot be dumped on your system.]) +elif test "$emacs_cv_sanitize_address" = yes; then + AC_MSG_WARN([[Addresses are sanitized; suggest CANNOT_DUMP=yes]]) +fi AC_SUBST(CANNOT_DUMP) @@ -1888,20 +1906,21 @@ AC_CACHE_CHECK( [whether malloc is Doug Lea style], [emacs_cv_var_doug_lea_malloc], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include - static void hook (void) {}]], - [[malloc_set_state (malloc_get_state ()); - __after_morecore_hook = hook; - __malloc_initialize_hook = hook;]])], - [emacs_cv_var_doug_lea_malloc=yes], - [emacs_cv_var_doug_lea_malloc=no])]) + [emacs_cv_var_doug_lea_malloc=no + dnl Hooks do not work with address sanitization. + if test "$emacs_cv_sanitize_address" != yes; then + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + static void hook (void) {}]], + [[malloc_set_state (malloc_get_state ()); + __after_morecore_hook = hook; + __malloc_initialize_hook = hook;]])], + [emacs_cv_var_doug_lea_malloc=yes])]) + fi doug_lea_malloc=$emacs_cv_var_doug_lea_malloc - -dnl See comments in aix4-2.h about maybe using system malloc there. -system_malloc=no +system_malloc=$emacs_cv_sanitize_address case "$opsys" in ## darwin ld insists on the use of malloc routines in the System framework. darwin|sol2-10) system_malloc=yes ;; === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-25 17:30:24 +0000 +++ src/ChangeLog 2013-12-26 08:57:28 +0000 @@ -1,3 +1,17 @@ +2013-12-26 Paul Eggert + + Fix core dumps with gcc -fsanitize=address and GNU/Linux. + On my Fedora 19 platform the core dumps were so big that + my desktop became nearly catatonic. + * alloc.c (no_sanitize_memcpy) [MAX_SAVE_STACK > 0]: New function. + (Fgarbage_collect) [MAX_SAVE_STACK > 0]: Use it. + (USE_ALIGNED_MALLOC): Do not define if addresses are sanitized. + (mark_memory): Use ATTRIBUTE_NO_SANITIZE_ADDRESS rather than + a clang-only syntax. + * conf_post.h (__has_feature): New macro, if not already defined. + (ADDRESS_SANITIZER, ADDRESS_SANITIZER_WORKAROUND) + (ATTRIBUTE_NO_SANITIZE_ADDRESS): New macros. + 2013-12-25 Eli Zaretskii * w32fns.c (Fw32_shell_execute): Make DOCUMENT absolute only if it === modified file 'src/alloc.c' --- src/alloc.c 2013-12-16 07:45:33 +0000 +++ src/alloc.c 2013-12-26 08:57:28 +0000 @@ -203,7 +203,27 @@ #if MAX_SAVE_STACK > 0 static char *stack_copy; static ptrdiff_t stack_copy_size; -#endif + +/* Copy to DEST a block of memory from SRC of size SIZE bytes, + avoiding any address sanitization. */ + +static void * ATTRIBUTE_NO_SANITIZE_ADDRESS +no_sanitize_memcpy (void *dest, void const *src, size_t size) +{ + if (! ADDRESS_SANITIZER) + return memcpy (dest, src, size); + else + { + size_t i; + char *d = dest; + char const *s = src; + for (i = 0; i < size; i++) + d[i] = s[i]; + return dest; + } +} + +#endif /* MAX_SAVE_STACK > 0 */ static Lisp_Object Qconses; static Lisp_Object Qsymbols; @@ -920,20 +940,26 @@ /* The entry point is lisp_align_malloc which returns blocks of at most BLOCK_BYTES and guarantees they are aligned on a BLOCK_ALIGN boundary. */ -#if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC -# define USE_ALIGNED_ALLOC 1 +/* Use aligned_alloc if it or a simple substitute is available. + Address sanitization breaks aligned allocation, as of gcc 4.8.2 and + clang 3.3 anyway. */ + +#if ! ADDRESS_SANITIZER +# if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC +# define USE_ALIGNED_ALLOC 1 /* Defined in gmalloc.c. */ void *aligned_alloc (size_t, size_t); -#elif defined HAVE_ALIGNED_ALLOC -# define USE_ALIGNED_ALLOC 1 -#elif defined HAVE_POSIX_MEMALIGN -# define USE_ALIGNED_ALLOC 1 +# elif defined HAVE_ALIGNED_ALLOC +# define USE_ALIGNED_ALLOC 1 +# elif defined HAVE_POSIX_MEMALIGN +# define USE_ALIGNED_ALLOC 1 static void * aligned_alloc (size_t alignment, size_t size) { void *p; return posix_memalign (&p, alignment, size) == 0 ? p : 0; } +# endif #endif /* BLOCK_ALIGN has to be a power of 2. */ @@ -4553,16 +4579,8 @@ /* Mark Lisp objects referenced from the address range START+OFFSET..END or END+OFFSET..START. */ -static void +static void ATTRIBUTE_NO_SANITIZE_ADDRESS mark_memory (void *start, void *end) -#if defined (__clang__) && defined (__has_feature) -#if __has_feature(address_sanitizer) - /* Do not allow -faddress-sanitizer to check this function, since it - crosses the function stack boundary, and thus would yield many - false positives. */ - __attribute__((no_address_safety_analysis)) -#endif -#endif { void **pp; int i; @@ -5477,7 +5495,7 @@ stack_copy = xrealloc (stack_copy, stack_size); stack_copy_size = stack_size; } - memcpy (stack_copy, stack, stack_size); + no_sanitize_memcpy (stack_copy, stack, stack_size); } } #endif /* MAX_SAVE_STACK > 0 */ === modified file 'src/conf_post.h' --- src/conf_post.h 2013-12-23 12:07:46 +0000 +++ src/conf_post.h 2013-12-26 08:57:28 +0000 @@ -50,8 +50,19 @@ #endif #endif +/* When not using Clang, assume its attributes and features are absent. */ #ifndef __has_attribute -# define __has_attribute(a) false /* non-clang */ +# define __has_attribute(a) false +#endif +#ifndef __has_feature +# define __has_feature(a) false +#endif + +/* True if addresses are being sanitized. */ +#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer) +# define ADDRESS_SANITIZER true +#else +# define ADDRESS_SANITIZER false #endif #ifdef DARWIN_OS @@ -204,6 +215,32 @@ #define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST +/* Work around GCC bug 59600: when a function is inlined, the inlined + code may have its addresses sanitized even if the function has the + no_sanitize_address attribute. This bug is present in GCC 4.8.2 + and clang 3.3, the latest releases as of December 2013, and the + only platforms known to support address sanitization. When the bug + is fixed the #if can be updated accordingly. */ +#if ADDRESS_SANITIZER +# define ADDRESS_SANITIZER_WORKAROUND NO_INLINE +#else +# define ADDRESS_SANITIZER_WORKAROUND +#endif + +/* Attribute of functions whose code should not have addresses + sanitized. */ + +#if (__has_attribute (no_sanitize_address) \ + || 4 < __GNUC__ + (8 <= __GNUC_MINOR__)) +# define ATTRIBUTE_NO_SANITIZE_ADDRESS \ + __attribute__ ((no_sanitize_address)) ADDRESS_SANITIZER_WORKAROUND +#elif __has_attribute (no_address_safety_analysis) +# define ATTRIBUTE_NO_SANITIZE_ADDRESS \ + __attribute__ ((no_address_safety_analysis)) ADDRESS_SANITIZER_WORKAROUND +#else +# define ATTRIBUTE_NO_SANITIZE_ADDRESS +#endif + /* Some versions of GNU/Linux define noinline in their headers. */ #ifdef noinline #undef noinline ------------------------------------------------------------ revno: 115755 committer: Chong Yidong branch nick: trunk timestamp: Thu 2013-12-26 11:27:45 +0800 message: Update doc for advice changes. * doc/lispref/advice.texi (Advising Functions, Defining Advice): Special forms can no longer be advised. * lisp/emacs-lisp/advice.el: Update commentary. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-12-25 10:24:52 +0000 +++ doc/lispref/ChangeLog 2013-12-26 03:27:45 +0000 @@ -1,3 +1,8 @@ +2013-12-26 Chong Yidong + + * advice.texi (Advising Functions, Defining Advice): Special forms + can no longer be advised. + 2013-12-25 Chong Yidong * keymaps.texi (Active Keymaps): Re-organize the text. === modified file 'doc/lispref/advice.texi' --- doc/lispref/advice.texi 2013-01-01 09:11:05 +0000 +++ doc/lispref/advice.texi 2013-12-26 03:27:45 +0000 @@ -6,41 +6,43 @@ @chapter Advising Emacs Lisp Functions @cindex advising functions +@cindex piece of advice The @dfn{advice} feature lets you add to the existing definition of -a function, by @dfn{advising the function}. This is a cleaner method -for a library to customize functions defined within Emacs---cleaner -than redefining the whole function. - -@cindex piece of advice - Each function can have multiple @dfn{pieces of advice}, each of -which can be separately defined and then @dfn{enabled} or -@dfn{disabled}. All the enabled pieces of advice for any given -function actually take effect when you @dfn{activate advice} for that -function, or when you define or redefine the function. Note that -enabling a piece of advice and activating advice for a function are -not the same thing. - - Advice is useful for altering the behavior of existing calls to an -existing function. If you want the new behavior for new function -calls or new key bindings, you should define a new function or -command, and have it use the existing function as a subroutine. - - Advising a function can cause confusion in debugging, since people -who debug calls to the original function may not notice that it has -been modified with advice. Therefore, if you have the possibility to -change the code of that function to run a hook, please solve the -problem that way. Advice should be reserved for the cases where you -cannot get the function changed. In particular, Emacs's own source -files should not put advice on functions in Emacs. There are -currently a few exceptions to this convention, but we aim to correct -them. - - Unless you know what you are doing, do @emph{not} advise a primitive -(@pxref{What Is a Function}). Some primitives are used by the advice -mechanism; advising them could cause an infinite recursion. Also, -many primitives are called directly from C code. Calls to the -primitive from Lisp code will take note of the advice, but calls from -C code will ignore the advice. +a function, by @dfn{advising the function}. A function can have +multiple @dfn{pieces of advice}, each of which can be separately +defined, and separately enabled or disabled (@pxref{Activation of +Advice}). Each piece of advice can alter almost anything about the +function, including its argument list, what the function does when it +runs, and the value it returns. + + Advice can be useful for altering the behavior of an existing +function without having to redefine the whole function. However, it +can be a source of bugs, since existing callers to the function may +assume the old behavior, and work incorrectly when the behavior is +changed by advice. Advice can also cause confusion in debugging, if +the person doing the debugging does not notice or remember that the +function has been modified by advice. + + For these reasons, advice should be reserved for the cases where you +cannot modify a function's behavior in any other way. If it is +possible to do the same thing via a hook, that is preferable +(@pxref{Hooks}). If you simply want to change what a particular key +does, it may be better to write a new command, and remap the old +command's key bindings to the new one (@pxref{Remapping Commands}). +In particular, Emacs's own source files should not put advice on +functions in Emacs. (There are currently a few exceptions to this +convention, but we aim to correct them.) + + Macros can also be advised, in much the same way as functions. +However, special forms (@pxref{Special Forms}) cannot be advised. + + It is possible to advise a primitive (@pxref{What Is a Function}), +but one should typically @emph{not} do so, for two reasons. Firstly, +some primitives are used by the advice mechanism, and advising them +could cause an infinite recursion. Secondly, many primitives are +called directly from C, and such calls ignore advice; hence, one ends +up in a confusing situation where some calls (occurring from Lisp +code) obey the advice and other calls (from C code) do not. @menu * Simple Advice:: A simple example to explain the basics of advice. @@ -140,10 +142,9 @@ @end example @noindent -Here, @var{function} is the name of the function (or macro or special -form) to be advised. From now on, we will write just ``function'' when -describing the entity being advised, but this always includes macros and -special forms. +Here, @var{function} is the name of the function (or macro) to be +advised. From now on, we will write just ``function'' when describing +the entity being advised, but this always includes macros. In place of the argument list in an ordinary definition, an advice definition calls for several different pieces of information. === modified file 'etc/NEWS' --- etc/NEWS 2013-12-25 10:24:52 +0000 +++ etc/NEWS 2013-12-26 03:27:45 +0000 @@ -901,9 +901,10 @@ ** `defadvice' does not honor the `freeze' flag and cannot advise special-forms any more. -** `dolist' in lexical-binding mode does not bind VAR in RESULT any more. -VAR was bound to nil which was not tremendously useful and just lead to -spurious warnings about an unused var. +--- +** `dolist' no longer binds VAR while evaluating the RESULT form, +when lexical binding is enabled. Previously, VAR was bound to nil, +which often led to spurious unused-variable warnings. ** The return value of `backup-buffer' has changed. The second argument is no longer an SELinux context, instead it is an === modified file 'lisp/emacs-lisp/advice.el' --- lisp/emacs-lisp/advice.el 2013-09-05 03:46:34 +0000 +++ lisp/emacs-lisp/advice.el 2013-12-26 03:27:45 +0000 @@ -295,8 +295,8 @@ ;; {}* ;; ad-return-value)) -;; Macros and special forms will be redefined as macros, hence the optional -;; [macro] in the beginning of the definition. +;; Macros are redefined as macros, hence the optional [macro] in the +;; beginning of the definition. ;; is either the argument list of the original function or the ;; first argument list defined in the list of before/around/after advices. @@ -698,6 +698,7 @@ ;; problems because they get expanded at compile or load time, hence, they ;; might not have all the necessary runtime support and such advice cannot be ;; de/activated or changed as it is possible for functions. +;; ;; Special forms cannot be advised. ;; ;; MORAL: - Only advise macros when you are absolutely sure what you are doing. @@ -1563,29 +1564,6 @@ ;; flexibility and effectiveness of the advice mechanism. Macros that were ;; compile-time expanded before the advice was activated will of course never ;; exhibit the advised behavior. -;; -;; @@ Advising special forms: -;; ========================== -;; Now for something that should be even more rare than advising macros: -;; Advising special forms. Because special forms are irregular in their -;; argument evaluation behavior (e.g., `setq' evaluates the second but not -;; the first argument) they have to be advised into macros. A dangerous -;; consequence of this is that the byte-compiler will not recognize them -;; as special forms anymore (well, in most cases) and use their expansion -;; rather than the proper byte-code. Also, because the original definition -;; of a special form cannot be `funcall'ed, `eval' has to be used instead -;; which is less efficient. -;; -;; MORAL: Do not advise special forms unless you are completely sure about -;; what you are doing (some of the forward advice behavior is -;; implemented via advice of the special forms `defun' and `defmacro'). -;; As a safety measure one should always do `ad-deactivate-all' before -;; one byte-compiles a file to avoid any interference of advised -;; special forms. -;; -;; Apart from the safety concerns advising special forms is not any different -;; from advising plain functions or subrs. - ;;; Code: ------------------------------------------------------------ revno: 115754 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2013-12-26 00:59:01 +0000 message: Misc changes made in Gnus master diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-12-25 22:28:09 +0000 +++ lisp/gnus/ChangeLog 2013-12-26 00:59:01 +0000 @@ -1,3 +1,13 @@ +2013-12-26 Sean Connor (tiny change) + + * gnus-sum.el (gnus-summary-enter-digest-group): Don't discard previous + value of the parameters if the current article has a Reply-To or From + field. + +2013-12-26 Lars Ingebrigtsen + + * gnus.el (gnus-group-buffer): Remove duplicate definition. + 2013-12-25 Lars Ingebrigtsen * gnus-sum.el (gnus-summary-exit): Stop animations. === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2013-12-25 22:28:09 +0000 +++ lisp/gnus/gnus-sum.el 2013-12-26 00:59:01 +0000 @@ -9202,6 +9202,7 @@ (gnus-fetch-field "from"))) (setq params (append + params (list (cons 'to-address (funcall gnus-decode-encoded-address-function to-address)))))) === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2013-12-19 22:12:12 +0000 +++ lisp/gnus/gnus.el 2013-12-26 00:59:01 +0000 @@ -2688,7 +2688,6 @@ (gnus-tree-mode "(gnus)Tree Display")) "Alist of major modes and related Info nodes.") -(defvar gnus-group-buffer "*Group*") (defvar gnus-summary-buffer "*Summary*") (defvar gnus-article-buffer "*Article*") (defvar gnus-server-buffer "*Server*") ------------------------------------------------------------ revno: 115753 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-12-25 15:25:32 -0800 message: Spelling fix. diff: === modified file 'admin/notes/years' --- admin/notes/years 2013-12-24 18:27:53 +0000 +++ admin/notes/years 2013-12-25 23:25:32 +0000 @@ -3,7 +3,7 @@ Maintaining copyright years is now very simple: every time a new year rolls around, add that year to every FSF (and AIST) copyright notice. Do this by running the 'admin/update-copyright' script on a fresh bzr -checkout. Inspect the results for plausiblity, then commit them. +checkout. Inspect the results for plausibility, then commit them. There's no need to worry about whether an individual file has changed in a given year - it's sufficient that Emacs as a whole has changed. ------------------------------------------------------------ revno: 115752 fixes bug: http://debbugs.gnu.org/16256 committer: Lars Ingebrigtsen branch nick: trunk timestamp: Wed 2013-12-25 23:52:15 +0100 message: Don't infloop when we can't find a good place to break lines in shr (shr-insert): Don't infloop if we can't find a good place to break the line. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-25 22:57:00 +0000 +++ lisp/ChangeLog 2013-12-25 22:52:15 +0000 @@ -12,6 +12,8 @@ 2013-12-25 Lars Ingebrigtsen * net/shr.el (shr-visit-file): Remove debugging function. + (shr-insert): Don't infloop if we can't find a good place to break + the line (bug#16256). 2013-12-25 Fabián Ezequiel Gallina === modified file 'lisp/net/shr.el' --- lisp/net/shr.el 2013-12-25 19:37:41 +0000 +++ lisp/net/shr.el 2013-12-25 22:52:15 +0000 @@ -455,11 +455,10 @@ (insert elem) (setq shr-state nil) (let (found) - (while (and (> (current-column) shr-width) - (> shr-width 0) - (progn - (setq found (shr-find-fill-point)) - (not (eolp)))) + (when (and (> (current-column) shr-width) + (progn + (setq found (shr-find-fill-point)) + (not (eolp)))) (when (eq (preceding-char) ? ) (delete-char -1)) (insert "\n") @@ -528,12 +527,12 @@ (not (memq (preceding-char) (list ?\C-@ ?\n ? ))) (or (shr-char-kinsoku-eol-p (preceding-char)) (shr-char-kinsoku-bol-p (following-char))))))) - (if (setq failed (= (current-column) shr-indentation)) - ;; There's no breakable point that doesn't violate kinsoku, - ;; so we go to the second best position. - (if (looking-at "\\(\\c<+\\)\\c<") - (goto-char (match-end 1)) - (forward-char 1)))) + (when (setq failed (= (current-column) shr-indentation)) + ;; There's no breakable point that doesn't violate kinsoku, + ;; so we go to the second best position. + (if (looking-at "\\(\\c<+\\)\\c<") + (goto-char (match-end 1)) + (forward-char 1)))) ((shr-char-kinsoku-bol-p (following-char)) ;; Find forward the point where kinsoku-bol characters end. (let ((count 4)) ------------------------------------------------------------ revno: 115751 [merge] fixes bug: http://debbugs.gnu.org/15754 committer: Xue Fuqiao branch nick: trunk timestamp: Thu 2013-12-26 06:57:00 +0800 message: Some fixes for vc-ignore (Bug#15754). Inspired by Andreas Politz and Dmitry Gutov. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-25 22:53:57 +0000 +++ lisp/ChangeLog 2013-12-25 22:57:00 +0000 @@ -1,3 +1,8 @@ +2013-12-25 Xue Fuqiao + + * vc/vc.el (vc-ignore): Use `vc-responsible-backend'. + Fix interactive spec. Doc fix. (Bug#15754) + 2013-12-25 Katsumi Yamaoka * emacs-lisp/byte-run.el (eval-when-compile): === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2013-11-26 19:17:55 +0000 +++ lisp/vc/vc.el 2013-12-25 22:24:37 +0000 @@ -1343,23 +1343,33 @@ (let ((vc-handled-backends (list backend))) (call-interactively 'vc-register))) -(defun vc-ignore (file &optional directory) - "Ignore FILE under the VCS of DIRECTORY (default is `default-directory'). -FILE is a file wildcard. -When called interactively and with a prefix argument, remove FILE -from ignored files. -When called from Lisp code, if DIRECTORY is non-nil, the -repository to use will be deduced by DIRECTORY." +(defun vc-ignore (file &optional directory remove) + "Ignore FILE under the VCS of DIRECTORY. + +Normally, FILE is a wildcard specification that matches the files +to be ignored. When REMOVE is non-nil, remove FILE from the list +of ignored files. + +DIRECTORY defaults to `default-directory' and is used to +determine the responsible VC backend. + +When called interactively, prompt for a FILE to ignore, unless a +prefix argument is given, in which case prompt for a file FILE to +remove from the list of ignored files." (interactive - (list (read-file-name "The file to ignore: ") - (completing-read - "The file to remove: " - (vc-call-backend - (vc-backend default-directory) - 'ignore-completion-table default-directory)))) + (list + (if (not current-prefix-arg) + (read-file-name "File to ignore: ") + (completing-read + "File to remove: " + (vc-call-backend + (or (vc-responsible-backend default-directory) + (error "Unknown backend")) + 'ignore-completion-table default-directory))) + nil current-prefix-arg)) (let* ((directory (or directory default-directory)) - (backend (vc-backend default-directory)) - (remove current-prefix-arg)) + (backend (or (vc-responsible-backend default-directory) + (error "Unknown backend")))) (vc-call-backend backend 'ignore file directory remove))) (defun vc-default-ignore (backend file &optional directory remove) ------------------------------------------------------------ revno: 115750 committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2013-12-25 22:53:57 +0000 message: lisp/ChangeLog: Fix last commit diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-25 22:37:04 +0000 +++ lisp/ChangeLog 2013-12-25 22:53:57 +0000 @@ -1,7 +1,7 @@ 2013-12-25 Katsumi Yamaoka * emacs-lisp/byte-run.el (eval-when-compile): - * lisp/progmodes/cc-defs.el (cc-eval-when-compile): + * progmodes/cc-defs.el (cc-eval-when-compile): Fix edebug spec (bug#16184). 2013-12-25 Lars Ingebrigtsen ------------------------------------------------------------ revno: 115749 committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2013-12-25 22:37:04 +0000 message: byte-run.el (eval-when-compile), cc-defs.el (cc-eval-when-compile): Fix edebug spec (bug#16184) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-25 19:38:08 +0000 +++ lisp/ChangeLog 2013-12-25 22:37:04 +0000 @@ -1,3 +1,9 @@ +2013-12-25 Katsumi Yamaoka + + * emacs-lisp/byte-run.el (eval-when-compile): + * lisp/progmodes/cc-defs.el (cc-eval-when-compile): + Fix edebug spec (bug#16184). + 2013-12-25 Lars Ingebrigtsen * net/shr.el (shr-visit-file): Remove debugging function. === modified file 'lisp/emacs-lisp/byte-run.el' --- lisp/emacs-lisp/byte-run.el 2013-11-21 02:46:00 +0000 +++ lisp/emacs-lisp/byte-run.el 2013-12-25 22:37:04 +0000 @@ -391,7 +391,7 @@ "Like `progn', but evaluates the body at compile time if you're compiling. Thus, the result of the body appears to the compiler as a quoted constant. In interpreted code, this is entirely equivalent to `progn'." - (declare (debug (def-body)) (indent 0)) + (declare (debug (&rest def-form)) (indent 0)) (list 'quote (eval (cons 'progn body) lexical-binding))) (defmacro eval-and-compile (&rest body) === modified file 'lisp/progmodes/cc-defs.el' --- lisp/progmodes/cc-defs.el 2013-06-01 20:08:52 +0000 +++ lisp/progmodes/cc-defs.el 2013-12-25 22:37:04 +0000 @@ -1137,7 +1137,7 @@ ;; Make edebug understand the macros. ;(eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el. ; '(progn -(def-edebug-spec cc-eval-when-compile t) +(def-edebug-spec cc-eval-when-compile (&rest def-form)) (def-edebug-spec c-point t) (def-edebug-spec c-set-region-active t) (def-edebug-spec c-safe t) ------------------------------------------------------------ revno: 115748 author: Lars Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2013-12-25 22:28:09 +0000 message: lisp/gnus/gnus-sum.el (gnus-summary-exit): Stop animations diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-12-19 22:12:12 +0000 +++ lisp/gnus/ChangeLog 2013-12-25 22:28:09 +0000 @@ -1,3 +1,7 @@ +2013-12-25 Lars Ingebrigtsen + + * gnus-sum.el (gnus-summary-exit): Stop animations. + 2013-12-19 Juri Linkov * gnus.el (gnus-suppress-keymap): === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2013-12-19 22:12:12 +0000 +++ lisp/gnus/gnus-sum.el 2013-12-25 22:28:09 +0000 @@ -7278,6 +7278,7 @@ (not (string= group (gnus-group-group-name)))) (gnus-group-next-unread-group 1)) (setq group-point (point)) + (gnus-article-stop-animations) (if temporary nil ;Nothing to do. (set-buffer buf) @@ -7368,6 +7369,7 @@ (gnus-group-update-group group nil t)) (when (equal (gnus-group-group-name) group) (gnus-group-next-unread-group 1)) + (gnus-article-stop-animations) (when quit-config (gnus-handle-ephemeral-exit quit-config))))) ------------------------------------------------------------ revno: 115747 committer: Lars Ingebrigtsen branch nick: trunk timestamp: Wed 2013-12-25 20:38:08 +0100 message: Grammer fix diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-25 19:37:41 +0000 +++ lisp/ChangeLog 2013-12-25 19:38:08 +0000 @@ -1,6 +1,6 @@ 2013-12-25 Lars Ingebrigtsen - * net/shr.el (shr-visit-file): Removed debugging function. + * net/shr.el (shr-visit-file): Remove debugging function. 2013-12-25 Fabián Ezequiel Gallina ------------------------------------------------------------ revno: 115746 committer: Lars Ingebrigtsen branch nick: trunk timestamp: Wed 2013-12-25 20:37:41 +0100 message: * net/shr.el (shr-visit-file): Removed debugging function. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-25 18:14:49 +0000 +++ lisp/ChangeLog 2013-12-25 19:37:41 +0000 @@ -1,3 +1,7 @@ +2013-12-25 Lars Ingebrigtsen + + * net/shr.el (shr-visit-file): Removed debugging function. + 2013-12-25 Fabián Ezequiel Gallina * progmodes/python.el: === modified file 'lisp/net/shr.el' --- lisp/net/shr.el 2013-12-25 18:14:49 +0000 +++ lisp/net/shr.el 2013-12-25 19:37:41 +0000 @@ -179,13 +179,6 @@ (goto-char begin) (shr-insert-document dom)))) -(defun shr-visit-file (file) - "Parse FILE as an HTML document, and render it in a new buffer." - (interactive "fHTML file name: ") - (with-temp-buffer - (insert-file-contents file) - (shr-render-buffer (current-buffer)))) - ;;;###autoload (defun shr-insert-document (dom) "Render the parsed document DOM into the current buffer. ------------------------------------------------------------ revno: 115745 committer: Lars Ingebrigtsen branch nick: trunk timestamp: Wed 2013-12-25 19:14:49 +0100 message: Further shr quotation mark fill fixes (shr-char-kinsoku-bol-p): The quotation mark isn't a kinsoky BOL char. (shr-find-fill-point): Remove the special checks for the quotation mark, since `shr-char-kinsoku-bol-p' should now return the right thing. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-25 18:07:31 +0000 +++ lisp/ChangeLog 2013-12-25 18:14:49 +0000 @@ -17,6 +17,10 @@ * net/shr.el (shr-find-fill-point): Don't break lines before a quotation mark. + (shr-char-kinsoku-bol-p): The quotation mark isn't a kinsoky BOL char. + (shr-find-fill-point): Remove the special checks for the quotation + mark, since `shr-char-kinsoku-bol-p' should now return the right + thing. 2013-12-25 Kenjiro NAKAYAMA === modified file 'lisp/net/shr.el' --- lisp/net/shr.el 2013-12-25 17:31:39 +0000 +++ lisp/net/shr.el 2013-12-25 18:14:49 +0000 @@ -414,7 +414,9 @@ ;; of a line or the end of a line. (defmacro shr-char-kinsoku-bol-p (char) "Return non-nil if a line ought not to begin with CHAR." - `(aref (char-category-set ,char) ?>)) + `(let ((char ,char)) + (and (not (eq char ?')) + (aref (char-category-set char) ?>)))) (defmacro shr-char-kinsoku-eol-p (char) "Return non-nil if a line ought not to end with CHAR." `(aref (char-category-set ,char) ?<)) @@ -489,30 +491,19 @@ (eq (following-char) ? ) (shr-char-breakable-p (preceding-char)) (shr-char-breakable-p (following-char)) - (if (eq (preceding-char) ?') - (not (memq (char-after (- (point) 2)) - (list nil ?\n ? ))) - (and (shr-char-kinsoku-bol-p (preceding-char)) - (shr-char-breakable-p (following-char)) - (not (shr-char-kinsoku-bol-p (following-char))))) + (and (shr-char-kinsoku-bol-p (preceding-char)) + (shr-char-breakable-p (following-char)) + (not (shr-char-kinsoku-bol-p (following-char)))) (shr-char-kinsoku-eol-p (following-char)))) (backward-char 1)) - (if (and (not (or failed (eolp))) - (eq (preceding-char) ?')) - (while (not (or (setq failed (eolp)) - (eq (following-char) ? ) - (shr-char-breakable-p (following-char)) - (shr-char-kinsoku-eol-p (following-char)))) - (forward-char 1))) (if failed ;; There's no breakable point, so we give it up. (let (found) (goto-char bp) (unless shr-kinsoku-shorten - (while (and (setq found (re-search-forward - "\\(\\c>\\)\\| \\|\\c<\\|\\c|" - (line-end-position) 'move)) - (eq (preceding-char) ?'))) + (while (setq found (re-search-forward + "\\(\\c>\\)\\| \\|\\c<\\|\\c|" + (line-end-position) 'move))) (if (and found (not (match-beginning 1))) (goto-char (match-beginning 0))))) (or @@ -550,8 +541,7 @@ (if (looking-at "\\(\\c<+\\)\\c<") (goto-char (match-end 1)) (forward-char 1)))) - ((and (shr-char-kinsoku-bol-p (following-char)) - (not (eq (following-char) ?'))) + ((shr-char-kinsoku-bol-p (following-char)) ;; Find forward the point where kinsoku-bol characters end. (let ((count 4)) (while (progn ------------------------------------------------------------ revno: 115744 fixes bug: http://debbugs.gnu.org/16191 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Wed 2013-12-25 15:07:31 -0300 message: * lisp/progmodes/python.el: (python-nav--lisp-forward-sexp): New function. (python-nav--lisp-forward-sexp-safe): Use it. Rename from python-nav-lisp-forward-sexp-safe. (python-nav--forward-sexp): New argument SAFE allows switching forward sexp movement behavior for parens. (python-nav-forward-sexp): Throw errors on unterminated parens. (python-nav-backward-sexp, python-nav-forward-sexp-safe) (python-nav-backward-sexp-safe): New functions. (python-shell-buffer-substring): Use `python-nav-forward-sexp-safe'. * test/automated/python-tests.el (python-nav-lisp-forward-sexp-safe-1): Remove test. (python-nav-forward-sexp-safe-1): New test. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-25 17:31:39 +0000 +++ lisp/ChangeLog 2013-12-25 18:07:31 +0000 @@ -1,3 +1,18 @@ +2013-12-25 Fabián Ezequiel Gallina + + * progmodes/python.el: + (python-nav--lisp-forward-sexp): New function. + (python-nav--lisp-forward-sexp-safe): Use it. Rename from + python-nav-lisp-forward-sexp-safe. + (python-nav--forward-sexp): New argument SAFE allows switching + forward sexp movement behavior for parens. + (python-nav-forward-sexp): Throw errors on unterminated parens + (Bug#16191). + (python-nav-backward-sexp, python-nav-forward-sexp-safe) + (python-nav-backward-sexp-safe): New functions. + (python-shell-buffer-substring): Use + `python-nav-forward-sexp-safe'. + 2013-12-25 Lars Ingebrigtsen * net/shr.el (shr-find-fill-point): Don't break lines before a === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2013-12-24 19:48:40 +0000 +++ lisp/progmodes/python.el 2013-12-25 18:07:31 +0000 @@ -1424,25 +1424,36 @@ (and (goto-char starting-pos) nil) (and (not (= (point) starting-pos)) (point-marker))))) -(defun python-nav-lisp-forward-sexp-safe (&optional arg) +(defun python-nav--lisp-forward-sexp (&optional arg) + "Standard version `forward-sexp'. +It ignores completely the value of `forward-sexp-function' by +setting it to nil before calling `forward-sexp'. With positive +ARG move forward only one sexp, else move backwards." + (let ((forward-sexp-function) + (arg (if (or (not arg) (> arg 0)) 1 -1))) + (forward-sexp arg))) + +(defun python-nav--lisp-forward-sexp-safe (&optional arg) "Safe version of standard `forward-sexp'. -When ARG > 0 move forward, else if ARG is < 0." - (or arg (setq arg 1)) - (let ((forward-sexp-function) - (paren-regexp - (if (> arg 0) (python-rx close-paren) (python-rx open-paren))) - (search-fn - (if (> arg 0) #'re-search-forward #'re-search-backward))) +When at end of sexp (i.e. looking at a opening/closing paren) +skips it instead of throwing an error. With positive ARG move +forward only one sexp, else move backwards." + (let* ((arg (if (or (not arg) (> arg 0)) 1 -1)) + (paren-regexp + (if (> arg 0) (python-rx close-paren) (python-rx open-paren))) + (search-fn + (if (> arg 0) #'re-search-forward #'re-search-backward))) (condition-case nil - (forward-sexp arg) + (python-nav--lisp-forward-sexp arg) (error (while (and (funcall search-fn paren-regexp nil t) (python-syntax-context 'paren))))))) -(defun python-nav--forward-sexp (&optional dir) +(defun python-nav--forward-sexp (&optional dir safe) "Move to forward sexp. -With positive Optional argument DIR direction move forward, else -backwards." +With positive optional argument DIR direction move forward, else +backwards. When optional argument SAFE is non-nil do not throw +errors when at end of sexp, skip it instead." (setq dir (or dir 1)) (unless (= dir 0) (let* ((forward-p (if (> dir 0) @@ -1460,7 +1471,9 @@ (eq (syntax-class (syntax-after (1- (point)))) (car (string-to-syntax ")"))))) ;; Inside a paren or looking at it, lisp knows what to do. - (python-nav-lisp-forward-sexp-safe dir)) + (if safe + (python-nav--lisp-forward-sexp-safe dir) + (python-nav--lisp-forward-sexp dir))) (t ;; This part handles the lispy feel of ;; `python-nav-forward-sexp'. Knowing everything about the @@ -1474,7 +1487,9 @@ ((python-info-end-of-statement-p) 'statement-end))) (next-sexp-pos (save-excursion - (python-nav-lisp-forward-sexp-safe dir) + (if safe + (python-nav--lisp-forward-sexp-safe dir) + (python-nav--lisp-forward-sexp dir)) (point))) (next-sexp-context (save-excursion @@ -1528,22 +1543,47 @@ (python-nav-beginning-of-statement)) (t (goto-char next-sexp-pos)))))))))) -(defun python-nav--backward-sexp () - "Move to backward sexp." - (python-nav--forward-sexp -1)) - (defun python-nav-forward-sexp (&optional arg) - "Move forward across one block of code. -With ARG, do it that many times. Negative arg -N means -move backward N times." - (interactive "^p") - (or arg (setq arg 1)) - (while (> arg 0) - (python-nav--forward-sexp) - (setq arg (1- arg))) - (while (< arg 0) - (python-nav--backward-sexp) - (setq arg (1+ arg)))) + "Move forward across expressions. +With ARG, do it that many times. Negative arg -N means move +backward N times." + (interactive "^p") + (or arg (setq arg 1)) + (while (> arg 0) + (python-nav--forward-sexp 1) + (setq arg (1- arg))) + (while (< arg 0) + (python-nav--forward-sexp -1) + (setq arg (1+ arg)))) + +(defun python-nav-backward-sexp (&optional arg) + "Move backward across expressions. +With ARG, do it that many times. Negative arg -N means move +backward N times." + (interactive "^p") + (or arg (setq arg 1)) + (python-nav-forward-sexp (- arg))) + +(defun python-nav-forward-sexp-safe (&optional arg) + "Move forward safely across expressions. +With ARG, do it that many times. Negative arg -N means move +backward N times." + (interactive "^p") + (or arg (setq arg 1)) + (while (> arg 0) + (python-nav--forward-sexp 1 t) + (setq arg (1- arg))) + (while (< arg 0) + (python-nav--forward-sexp -1 t) + (setq arg (1+ arg)))) + +(defun python-nav-backward-sexp-safe (&optional arg) + "Move backward safely across expressions. +With ARG, do it that many times. Negative arg -N means move +backward N times." + (interactive "^p") + (or arg (setq arg 1)) + (python-nav-forward-sexp-safe (- arg))) (defun python-nav--up-list (&optional dir) "Internal implementation of `python-nav-up-list'. @@ -2212,7 +2252,7 @@ (save-excursion (when (python-nav-if-name-main) (cons (point) - (progn (python-nav-forward-sexp) + (progn (python-nav-forward-sexp-safe) (point))))))) ;; Oh destructuring bind, how I miss you. (if-name-main-start (car if-name-main-start-end)) === modified file 'test/ChangeLog' --- test/ChangeLog 2013-12-20 05:20:33 +0000 +++ test/ChangeLog 2013-12-25 18:07:31 +0000 @@ -1,3 +1,9 @@ +2013-12-25 Fabián Ezequiel Gallina + + * automated/python-tests.el + (python-nav-lisp-forward-sexp-safe-1): Remove test. + (python-nav-forward-sexp-safe-1): New test. + 2013-12-20 Dmitry Gutov * automated/ruby-mode-tests.el: Add tests for === modified file 'test/automated/python-tests.el' --- test/automated/python-tests.el 2013-12-12 23:32:05 +0000 +++ test/automated/python-tests.el 2013-12-25 18:07:31 +0000 @@ -1339,28 +1339,6 @@ (python-tests-look-at "if request.user.is_authenticated():" -1))))) -(ert-deftest python-nav-lisp-forward-sexp-safe-1 () - (python-tests-with-temp-buffer - " -profile = Profile.objects.create(user=request.user) -profile.notify() -" - (python-tests-look-at "profile =") - (python-nav-lisp-forward-sexp-safe 4) - (should (looking-at "(user=request.user)")) - (python-tests-look-at "user=request.user") - (python-nav-lisp-forward-sexp-safe -1) - (should (looking-at "(user=request.user)")) - (python-nav-lisp-forward-sexp-safe -4) - (should (looking-at "profile =")) - (python-tests-look-at "user=request.user") - (python-nav-lisp-forward-sexp-safe 3) - (should (looking-at ")")) - (python-nav-lisp-forward-sexp-safe 1) - (should (looking-at "$")) - (python-nav-lisp-forward-sexp-safe 1) - (should (looking-at ".notify()")))) - (ert-deftest python-nav-forward-sexp-1 () (python-tests-with-temp-buffer " @@ -1477,6 +1455,29 @@ (python-nav-forward-sexp -1) (should (looking-at "from some_module import some_sub_module")))) +(ert-deftest python-nav-forward-sexp-safe-1 () + (python-tests-with-temp-buffer + " +profile = Profile.objects.create(user=request.user) +profile.notify() +" + (python-tests-look-at "profile =") + (python-nav-forward-sexp-safe 1) + (should (looking-at "$")) + (beginning-of-line 1) + (python-tests-look-at "user=request.user") + (python-nav-forward-sexp-safe -1) + (should (looking-at "(user=request.user)")) + (python-nav-forward-sexp-safe -4) + (should (looking-at "profile =")) + (python-tests-look-at "user=request.user") + (python-nav-forward-sexp-safe 3) + (should (looking-at ")")) + (python-nav-forward-sexp-safe 1) + (should (looking-at "$")) + (python-nav-forward-sexp-safe 1) + (should (looking-at "$")))) + (ert-deftest python-nav-up-list-1 () (python-tests-with-temp-buffer " ------------------------------------------------------------ revno: 115743 committer: Lars Ingebrigtsen branch nick: trunk timestamp: Wed 2013-12-25 18:31:39 +0100 message: Fold shr text with single quotation marks better * net/shr.el (shr-find-fill-point): Don't break lines before a quotation mark. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-25 15:33:16 +0000 +++ lisp/ChangeLog 2013-12-25 17:31:39 +0000 @@ -1,3 +1,8 @@ +2013-12-25 Lars Ingebrigtsen + + * net/shr.el (shr-find-fill-point): Don't break lines before a + quotation mark. + 2013-12-25 Kenjiro NAKAYAMA * net/eww.el (eww-form-textarea): Use a different face for === modified file 'lisp/net/shr.el' --- lisp/net/shr.el 2013-12-21 17:54:16 +0000 +++ lisp/net/shr.el 2013-12-25 17:31:39 +0000 @@ -550,7 +550,8 @@ (if (looking-at "\\(\\c<+\\)\\c<") (goto-char (match-end 1)) (forward-char 1)))) - ((shr-char-kinsoku-bol-p (following-char)) + ((and (shr-char-kinsoku-bol-p (following-char)) + (not (eq (following-char) ?'))) ;; Find forward the point where kinsoku-bol characters end. (let ((count 4)) (while (progn ------------------------------------------------------------ revno: 115742 fixes bug: http://debbugs.gnu.org/16252 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2013-12-25 19:30:24 +0200 message: Fix bug #16252 with 'mailto:' documents passed to w32-shell-execute. src/w32fns.c (Fw32_shell_execute): Make DOCUMENT absolute only if it is a file name. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-25 10:24:52 +0000 +++ src/ChangeLog 2013-12-25 17:30:24 +0000 @@ -1,3 +1,8 @@ +2013-12-25 Eli Zaretskii + + * w32fns.c (Fw32_shell_execute): Make DOCUMENT absolute only if it + is a file name. (Bug#16252) + 2013-12-25 Chong Yidong * keyboard.c (Voverriding_terminal_local_map): === modified file 'src/w32fns.c' --- src/w32fns.c 2013-12-24 17:21:06 +0000 +++ src/w32fns.c 2013-12-25 17:30:24 +0000 @@ -6851,7 +6851,8 @@ DOCUMENT is typically the name of a document file or a URL, but can also be a program executable to run, or a directory to open in the -Windows Explorer. +Windows Explorer. If it is a file, it must be a local one; this +function does not support remote file names. If DOCUMENT is a program executable, the optional third arg PARAMETERS can be a string containing command line parameters that will be passed @@ -6875,6 +6876,7 @@ #ifndef CYGWIN int use_unicode = w32_unicode_filenames; char *doc_a = NULL, *params_a = NULL, *ops_a = NULL; + Lisp_Object absdoc; #endif CHECK_STRING (document); @@ -6903,7 +6905,16 @@ ? XINT (show_flag) : SW_SHOWDEFAULT)); #else /* !CYGWIN */ current_dir = ENCODE_FILE (current_dir); - document = ENCODE_FILE (Fexpand_file_name (document, Qnil)); + /* We have a situation here. If DOCUMENT is a relative file name, + and is not in CURRENT_DIR, ShellExecute below will fail to find + it. So we need to make the file name absolute. But DOCUMENT + does not have to be a file, it can be a URL, for example. So we + make it absolute only if it is an existing file; if it is a file + that does not exist, tough. */ + absdoc = Fexpand_file_name (document, Qnil); + if (!NILP (Ffile_exists_p (absdoc))) + document = absdoc; + document = ENCODE_FILE (document); if (use_unicode) { wchar_t document_w[MAX_PATH], current_dir_w[MAX_PATH]; ------------------------------------------------------------ revno: 115741 fixes bug: http://debbugs.gnu.org/16142 author: Kenjiro NAKAYAMA committer: Lars Ingebrigtsen branch nick: trunk timestamp: Wed 2013-12-25 16:33:16 +0100 message: eww textarea fixups * net/eww.el (eww-form-textarea): Use a different face for textareas than text input since they have different keymaps. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-24 19:48:40 +0000 +++ lisp/ChangeLog 2013-12-25 15:33:16 +0000 @@ -1,3 +1,9 @@ +2013-12-25 Kenjiro NAKAYAMA + + * net/eww.el (eww-form-textarea): Use a different face for + textareas than text input since they have different keymaps + (bug#16142). + 2013-12-24 Fabián Ezequiel Gallina * progmodes/python.el (python-nav-beginning-of-statement): Speed === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-12-24 18:07:55 +0000 +++ lisp/net/eww.el 2013-12-25 15:33:16 +0000 @@ -115,6 +115,14 @@ :version "24.4" :group 'eww) +(defface eww-form-textarea + '((t (:background "#C0C0C0" + :foreground "black" + :box (:line-width 1)))) + "Face for eww textarea inputs." + :version "24.4" + :group 'eww) + (defvar eww-current-url nil) (defvar eww-current-dom nil) (defvar eww-current-source nil) @@ -776,7 +784,7 @@ (when (> pad 0) (insert (make-string pad ? )))) (add-face-text-property (line-beginning-position) - (point) 'eww-form-text) + (point) 'eww-form-textarea) (put-text-property (line-beginning-position) (point) 'local-map eww-textarea-map) (forward-line 1)) ------------------------------------------------------------ revno: 115740 committer: Chong Yidong branch nick: trunk timestamp: Wed 2013-12-25 18:24:52 +0800 message: Doc updates for several Emacs 24.4 changes. * doc/lispref/commands.texi (Event Input Misc): Document new arg to input-pending-p. * doc/lispref/display.texi (Font Selection): Tweak example. * doc/lispref/keymaps.texi (Active Keymaps): Re-organize the text. (Searching Keymaps): Rewrite the pseudo-code for 24.4 changes. (Controlling Active Maps): Note that set-transient-map uses overriding-terminal-local-map. * doc/lispref/nonascii.texi (Specifying Coding Systems): Don't refer to emacs-mule-dos. (Lisp and Coding Systems): Describe emacs-mule return value in modern terms. * doc/lispref/tips.texi (Coding Conventions): Tweak the coding system tip; Emacs now uses utf-8 by default for Emacs Lisp source files. * doc/emacs/glossary.texi (Glossary): Define MULE in modern terms. * src/keyboard.c (Voverriding_terminal_local_map): (Voverriding_local_map): Doc fix. * src/keymap.c (Vemulation_mode_map_alists): Doc fix. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-12-25 02:18:43 +0000 +++ doc/emacs/ChangeLog 2013-12-25 10:24:52 +0000 @@ -1,3 +1,7 @@ +2013-12-25 Chong Yidong + + * glossary.texi (Glossary): Define MULE in modern terms. + 2013-12-25 Xue Fuqiao * files.texi (Diff Mode): Add an index. === modified file 'doc/emacs/glossary.texi' --- doc/emacs/glossary.texi 2013-10-23 17:20:09 +0000 +++ doc/emacs/glossary.texi 2013-12-25 10:24:52 +0000 @@ -953,9 +953,15 @@ yanking (q.v.@:) it. @xref{Killing}. @item MULE -MULE refers to the Emacs features for editing multilingual -non-@acronym{ASCII} text using multibyte characters (q.v.). -@xref{International}. +@cindex MULE +Prior to Emacs 23, @acronym{MULE} was the name of a software package +which provided a @dfn{MULtilingual Enhancement} to Emacs, by adding +support for multiple character sets (q.v.). @acronym{MULE} was later +integrated into Emacs, and much of it was replaced when Emacs gained +internal Unicode support in version 23. + +Some parts of Emacs that deal with character set support still use the +@acronym{MULE} name. @xref{International}. @item Multibyte Character A multibyte character is a character that takes up several bytes in a === modified file 'doc/emacs/mule.texi' --- doc/emacs/mule.texi 2013-12-07 16:51:33 +0000 +++ doc/emacs/mule.texi 2013-12-25 10:24:52 +0000 @@ -5,7 +5,6 @@ @chapter International Character Set Support @c This node is referenced in the tutorial. When renaming or deleting @c it, the tutorial needs to be adjusted. (TUTORIAL.de) -@cindex MULE @cindex international scripts @cindex multibyte characters @cindex encoding of characters === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-12-25 09:12:24 +0000 +++ doc/lispref/ChangeLog 2013-12-25 10:24:52 +0000 @@ -1,3 +1,23 @@ +2013-12-25 Chong Yidong + + * keymaps.texi (Active Keymaps): Re-organize the text. + (Searching Keymaps): Rewrite the pseudo-code for 24.4 changes. + (Controlling Active Maps): Note that set-transient-map uses + overriding-terminal-local-map. + + * tips.texi (Coding Conventions): Tweak the coding system tip; + Emacs now uses utf-8 by default for Emacs Lisp source files. + + * display.texi (Font Selection): Tweak example. + + * commands.texi (Event Input Misc): Document new arg to + input-pending-p. + + * nonascii.texi (Specifying Coding Systems): Don't refer to + emacs-mule-dos. + (Lisp and Coding Systems): Describe emacs-mule return value in + modern terms. + 2013-12-25 Tassilo Horn * control.texi (Pattern matching case statement): Rephrase lexical === modified file 'doc/lispref/commands.texi' --- doc/lispref/commands.texi 2013-01-09 21:26:08 +0000 +++ doc/lispref/commands.texi 2013-12-25 10:24:52 +0000 @@ -2739,12 +2739,16 @@ individual events, which you can put in @code{unread-command-events}. @end defun -@defun input-pending-p +@defun input-pending-p &optional check-timers @cindex waiting for command key input This function determines whether any command input is currently available to be read. It returns immediately, with value @code{t} if there is available input, @code{nil} otherwise. On rare occasions it may return @code{t} when no input is available. + +If the optional argument @var{check-timers} is non-@code{nil}, then if +no input is available, Emacs runs any timers which are ready. +@xref{Timers}. @end defun @defvar last-input-event === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2013-12-20 14:28:01 +0000 +++ doc/lispref/display.texi 2013-12-25 10:24:52 +0000 @@ -2962,11 +2962,11 @@ expression in the list. For example, @example -(setq scalable-fonts-allowed '("muleindian-2$")) +(setq scalable-fonts-allowed '("iso10646-1$")) @end example @noindent -allows the use of scalable fonts with registry @code{muleindian-2}. +allows the use of scalable fonts with registry @code{iso10646-1}. @end defopt @defvar face-font-rescale-alist === modified file 'doc/lispref/keymaps.texi' --- doc/lispref/keymaps.texi 2013-12-23 03:59:10 +0000 +++ doc/lispref/keymaps.texi 2013-12-25 10:24:52 +0000 @@ -622,75 +622,67 @@ @node Active Keymaps @section Active Keymaps @cindex active keymap -@cindex global keymap + + Emacs contains many keymaps, but at any time only a few keymaps are +@dfn{active}. When Emacs receives user input, it translates the input +event (@pxref{Translation Keymaps}), and looks for a key binding in +the active keymaps. + + Usually, the active keymaps are: (i) the keymap specified by the +@code{keymap} property, (ii) the keymaps of enabled minor modes, (iii) +the current buffer's local keymap, and (iv) the global keymap, in that +order. Emacs searches for each input key sequence in all these +keymaps. + + Of these ``usual'' keymaps, the highest-precedence one is specified +by the @code{keymap} text or overlay property at point, if any. (For +a mouse input event, Emacs uses the event position instead of point; +@iftex +see the next section for details.) +@end iftex +@ifnottex +@pxref{Searching Keymaps}.) +@end ifnottex + + Next in precedence are keymaps specified by enabled minor modes. +These keymaps, if any, are specified by the variables +@code{emulation-mode-map-alists}, +@code{minor-mode-overriding-map-alist}, and +@code{minor-mode-map-alist}. @xref{Controlling Active Maps}. + @cindex local keymap - - Emacs normally contains many keymaps; at any given time, just a few -of them are @dfn{active}, meaning that they participate in the -interpretation of user input. All the active keymaps are used -together to determine what command to execute when a key is entered. - - Normally the active keymaps are the @code{keymap} property keymap, -the keymaps of any enabled minor modes, the current buffer's local -keymap, and the global keymap, in that order. Emacs searches for each -input key sequence in all these keymaps. @xref{Searching Keymaps}, -for more details of this procedure. - - When the key sequence starts with a mouse event, -the active keymaps are determined based on the -position in that event. If the event happened on a string embedded -with a @code{display}, @code{before-string}, or @code{after-string} -property (@pxref{Special Properties}), the non-@code{nil} map -properties of the string override those of the buffer (if the -underlying buffer text contains map properties in its text properties -or overlays, they are ignored). - - The @dfn{global keymap} holds the bindings of keys that are defined -regardless of the current buffer, such as @kbd{C-f}. The variable -@code{global-map} holds this keymap, which is always active. - - Each buffer may have another keymap, its @dfn{local keymap}, which -may contain new or overriding definitions for keys. The current -buffer's local keymap is always active except when -@code{overriding-local-map} overrides it. The @code{local-map} text -or overlay property can specify an alternative local keymap for certain -parts of the buffer; see @ref{Special Properties}. - - Each minor mode can have a keymap; if it does, the keymap is active -when the minor mode is enabled. Modes for emulation can specify -additional active keymaps through the variable -@code{emulation-mode-map-alists}. - - The highest precedence normal keymap comes from the @code{keymap} -text or overlay property. If that is non-@code{nil}, it is the first -keymap to be processed, in normal circumstances. - - However, there are also special ways for programs to substitute -other keymaps for some of those. The variable -@code{overriding-local-map}, if non-@code{nil}, specifies a keymap -that replaces all the usual active keymaps except the global keymap. - -The very highest precedence keymap comes from -@code{overriding-terminal-local-map}; it operates on a per-terminal basis and -is normally used for modal/transient keybindings. + Next in precedence is the buffer's @dfn{local keymap}, containing +key bindings specific to the buffer. The minibuffer also has a local +keymap (@pxref{Intro to Minibuffers}). If there is a @code{local-map} +text or overlay property at point, that specifies the local keymap to +use, in place of the buffer's default local keymap. @cindex major mode keymap - Since every buffer that uses the same major mode normally uses the -same local keymap, you can think of the keymap as local to the mode. A -change to the local keymap of a buffer (using @code{local-set-key}, for -example) is seen also in the other buffers that share that keymap. - - The local keymaps that are used for Lisp mode and some other major -modes exist even if they have not yet been used. These local keymaps are -the values of variables such as @code{lisp-mode-map}. For most major -modes, which are less frequently used, the local keymap is constructed -only when the mode is used for the first time in a session. - - The minibuffer has local keymaps, too; they contain various completion -and exit commands. @xref{Intro to Minibuffers}. - - Emacs has other keymaps that are used in a different way---translating -events within @code{read-key-sequence}. @xref{Translation Keymaps}. + The local keymap is normally set by the buffer's major mode, and +every buffer with the same major mode shares the same local keymap. +Hence, if you call @code{local-set-key} (@pxref{Key Binding Commands}) +to change the local keymap in one buffer, that also affects the local +keymaps in other buffers with the same major mode. + +@cindex global keymap + Finally, the @dfn{global keymap} contains key bindings that are +defined regardless of the current buffer, such as @kbd{C-f}. It is +always active, and is bound to the variable @code{global-map}. + + Apart from the above ``usual'' keymaps, Emacs provides special ways +for programs to make other keymaps active. Firstly, the variable +@code{overriding-local-map} specifies a keymap that replaces the usual +active keymaps, except for the global keymap. Secondly, the +terminal-local variable @code{overriding-terminal-local-map} specifies +a keymap that takes precedence over @emph{all} other keymaps +(including @code{overriding-local-map}); this is normally used for +modal/transient keybindings (the function @code{set-transient-map} +provides a convenient interface for this). @xref{Controlling Active +Maps}, for details. + + Making keymaps active is not the only way to use them. Keymaps are +also used in other ways, such as for translating events within +@code{read-key-sequence}. @xref{Translation Keymaps}. @xref{Standard Keymaps}, for a list of some standard keymaps. @@ -727,7 +719,7 @@ position or an event position like the value of @code{event-start}. Then the maps consulted are determined based on @var{position}. -An error is signaled if @var{key} is not a string or a vector. +Emacs signals an error if @var{key} is not a string or a vector. @example @group @@ -741,49 +733,52 @@ @section Searching the Active Keymaps @cindex searching active keymaps for keys - After translation of event subsequences (@pxref{Translation -Keymaps}) Emacs looks for them in the active keymaps. Here is a -pseudo-Lisp description of the order and conditions for searching -them: +Here is a pseudo-Lisp summary of how Emacs searches the active +keymaps: @lisp -(or (@var{find-in} @var{transient-map}) - (cond - (overriding-terminal-local-map - (@var{find-in} overriding-terminal-local-map)) - (overriding-local-map - (@var{find-in} overriding-local-map)) - ((or (@var{find-in} (get-char-property (point) 'keymap)) +(or (if overriding-terminal-local-map + (@var{find-in} overriding-terminal-local-map)) + (if overriding-local-map + (@var{find-in} overriding-local-map) + (or (@var{find-in} (get-char-property (point) 'keymap)) (@var{find-in-any} emulation-mode-map-alists) (@var{find-in-any} minor-mode-overriding-map-alist) (@var{find-in-any} minor-mode-map-alist) (if (get-text-property (point) 'local-map) (@var{find-in} (get-char-property (point) 'local-map)) - (@var{find-in} (current-local-map)))))) + (@var{find-in} (current-local-map))))) (@var{find-in} (current-global-map))) @end lisp @noindent Here, @var{find-in} and @var{find-in-any} are pseudo functions that -search in one keymap and in an alist of keymaps, respectively. -(Searching a single keymap for a binding is called @dfn{key lookup}; -see @ref{Key Lookup}.) @var{transient-map} is a pseudo variable that -represents the effect of a @code{set-transient-map} call -(@pxref{Controlling Active Maps}). +search in one keymap and in an alist of keymaps, respectively. Note +that the @code{set-transient-map} function works by setting +@code{overriding-terminal-local-map} (@pxref{Controlling Active +Maps}). In the above pseudo-code, if a key sequence starts with a mouse -event, that event's position is used instead of point and the current -buffer. Mouse events on an embedded string use non-@code{nil} text -properties from that string instead of the buffer. - - When a match is found (@pxref{Key Lookup}), if the binding in the -keymap is a function, the search is over. However if the keymap entry -is a symbol with a value or a string, Emacs replaces the input key -sequences with the variable's value or the string, and restarts the -search of the active keymaps. - - The function finally found might also be remapped. @xref{Remapping -Commands}. +event (@pxref{Mouse Events}), that event's position is used instead of +point, and the event's buffer is used instead of the current buffer. +In particular, this affects how the @code{keymap} and @code{local-map} +properties are looked up. If a mouse event occurs on a string +embedded with a @code{display}, @code{before-string}, or +@code{after-string} property (@pxref{Special Properties}), and the +string has a non-@code{nil} @code{keymap} or @code{local-map} +property, that overrides the corresponding property in the underlying +buffer text (i.e., the property specified by the underlying text is +ignored). + + When a key binding is found in one of the active keymaps, and that +binding is a command, the search is over---the command is executed. +However, if the binding is a symbol with a value or a string, Emacs +replaces the input key sequences with the variable's value or the +string, and restarts the search of the active keymaps. @xref{Key +Lookup}. + + The command which is finally found might also be remapped. +@xref{Remapping Commands}. @node Controlling Active Maps @section Controlling the Active Keymaps @@ -860,7 +855,6 @@ commands use this function. @end defun -@c Emacs 19 feature @defvar minor-mode-map-alist @anchor{Definition of minor-mode-map-alist} This variable is an alist describing keymaps that may or may not be @@ -945,7 +939,7 @@ @end defvar @defvar emulation-mode-map-alists -This variable holds a list of keymap alists to use for emulations +This variable holds a list of keymap alists to use for emulation modes. It is intended for modes or packages using multiple minor-mode keymaps. Each element is a keymap alist which has the same format and meaning as @code{minor-mode-map-alist}, or a symbol with a variable @@ -970,11 +964,9 @@ while @var{keymap} is active; it should return non-@code{nil} if @var{keymap} should stay active. -The transient keymap takes precedence over the ``overriding'' maps -(see above); and unlike them, if no match for a key is found in -@var{keymap}, the key lookup process continues. For a pseudo-Lisp -description of exactly how and when this keymap applies, -@xref{Searching Keymaps}. +This function works by adding and removing @code{keymap} from the +variable @code{overriding-terminal-local-map}, which takes precedence +over all other active keymaps (@pxref{Searching Keymaps}). @end defun @node Key Lookup === modified file 'doc/lispref/nonascii.texi' --- doc/lispref/nonascii.texi 2013-12-22 18:17:20 +0000 +++ doc/lispref/nonascii.texi 2013-12-25 10:24:52 +0000 @@ -1289,17 +1289,18 @@ support too many character sets to list them all yield special values: @itemize @bullet @item -If @var{coding-system} supports all the ISO-2022 charsets, the value -is @code{iso-2022}. -@item If @var{coding-system} supports all Emacs characters, the value is @code{(emacs)}. @item -If @var{coding-system} supports all emacs-mule characters, the value -is @code{emacs-mule}. -@item If @var{coding-system} supports all Unicode characters, the value is @code{(unicode)}. +@item +If @var{coding-system} supports all ISO-2022 charsets, the value is +@code{iso-2022}. +@item +If @var{coding-system} supports all the characters in the internal +coding system used by Emacs version 21 (prior to the implementation of +internal Unicode support), the value is @code{emacs-mule}. @end itemize @end defun @@ -1617,8 +1618,7 @@ @example ;; @r{Read the file with no character code conversion.} -;; @r{Assume @acronym{crlf} represents end-of-line.} -(let ((coding-system-for-read 'emacs-mule-dos)) +(let ((coding-system-for-read 'no-conversion)) (insert-file-contents filename)) @end example === modified file 'doc/lispref/tips.texi' --- doc/lispref/tips.texi 2013-10-07 03:46:32 +0000 +++ doc/lispref/tips.texi 2013-12-25 10:24:52 +0000 @@ -223,18 +223,13 @@ coherent if all libraries use the same conventions. @item -If your program contains non-ASCII characters in string or character -constants, you should make sure Emacs always decodes these characters -the same way, regardless of the user's settings. The easiest way to -do this is to use the coding system @code{utf-8-emacs} (@pxref{Coding -System Basics}), and specify that coding in the @samp{-*-} line or the +The default file coding system for Emacs Lisp source files is UTF-8 +(@pxref{Text Representations}). In the rare event that your program +contains characters which are @emph{not} in UTF-8, you should specify +an appropriate coding system in the source file's @samp{-*-} line or local variables list. @xref{File Variables, , Local Variables in Files, emacs, The GNU Emacs Manual}. -@example -;; XXX.el -*- coding: utf-8-emacs; -*- -@end example - @item Indent the file using the default indentation parameters. === modified file 'etc/NEWS' --- etc/NEWS 2013-12-25 03:05:11 +0000 +++ etc/NEWS 2013-12-25 10:24:52 +0000 @@ -545,7 +545,7 @@ *** New option `imenu-generic-skip-comments-and-strings'. ** Info - +--- *** New face `info-index-match' is used to highlight matches in index entries displayed by `Info-index-next', `Info-virtual-index' and `info-apropos'. @@ -849,19 +849,23 @@ * Incompatible Lisp Changes in Emacs 24.4 +--- ** `kill-region' lost its `yank-handler' optional argument. ++++ ** `(input-pending-p)' no longer runs other timers which are ready to run. The new optional CHECK-TIMERS param allows for the prior behavior. ** `defvar' and `defcustom' in a let-binding affect the "external" default. +--- ** The syntax of ?» and ?« is now punctuation instead of matched parens. Some languages match those as »...« and others as «...» so better stay neutral. --- ** In compiled Lisp files, the header no longer includes a timestamp. ++++ ** The default file coding for Emacs Lisp files is now utf-8. (See `file-coding-system-alist'.) In most cases, this change is transparent, but files that contain unusual characters without @@ -869,6 +873,7 @@ errors. You should either convert them to utf-8 or add an explicit `coding:' cookie. ++++ ** `overriding-terminal-local-map' no longer replaces the local keymaps. It used to disable the minor mode, major mode, and text-property keymaps, whereas now it simply has higher precedence. @@ -881,9 +886,11 @@ keyboard-coding-system is not performed in read-event any more. But contrary to that past, it is still done before input-decode-map/function-key-map/... -** Removed inhibit-local-menu-bar-menus. +--- +** Removed `inhibit-local-menu-bar-menus'. -** frame-local variables that affect redisplay do not work any more. +--- +** Frame-local variables that affect redisplay do not work any more. More specifically, the redisplay does not bother to check for a frame-local value when looking up variables. === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-24 17:21:06 +0000 +++ src/ChangeLog 2013-12-25 10:24:52 +0000 @@ -1,3 +1,10 @@ +2013-12-25 Chong Yidong + + * keyboard.c (Voverriding_terminal_local_map): + (Voverriding_local_map): Doc fix. + + * keymap.c (Vemulation_mode_map_alists): Doc fix. + 2013-12-24 Eli Zaretskii * w32fns.c (Fw32_shell_execute): Ensure DOCUMENT is an absolute === modified file 'src/keyboard.c' --- src/keyboard.c 2013-12-12 04:04:35 +0000 +++ src/keyboard.c 2013-12-25 10:24:52 +0000 @@ -11415,18 +11415,19 @@ DEFVAR_KBOARD ("overriding-terminal-local-map", Voverriding_terminal_local_map, doc: /* Per-terminal keymap that takes precedence over all other keymaps. - This variable is intended to let commands such as `universal-argument' set up a different keymap for reading the next command. `overriding-terminal-local-map' has a separate binding for each -terminal device. -See Info node `(elisp)Multiple Terminals'. */); +terminal device. See Info node `(elisp)Multiple Terminals'. */); DEFVAR_LISP ("overriding-local-map", Voverriding_local_map, - doc: /* Keymap that overrides almost all other local keymaps. -If this variable is non-nil, it is used as a keymap--replacing the -buffer's local map, the minor mode keymaps, and char property keymaps. */); + doc: /* Keymap that replaces (overrides) local keymaps. +If this variable is non-nil, Emacs looks up key bindings in this +keymap INSTEAD OF the keymap char property, minor mode maps, and the +buffer's local map. Hence, the only active keymaps would be +`overriding-terminal-local-map', this keymap, and `global-keymap', in +order of precedence. */); Voverriding_local_map = Qnil; DEFVAR_LISP ("overriding-local-map-menu-flag", Voverriding_local_map_menu_flag, === modified file 'src/keymap.c' --- src/keymap.c 2013-11-16 09:27:19 +0000 +++ src/keymap.c 2013-12-25 10:24:52 +0000 @@ -3753,7 +3753,7 @@ Vminor_mode_overriding_map_alist = Qnil; DEFVAR_LISP ("emulation-mode-map-alists", Vemulation_mode_map_alists, - doc: /* List of keymap alists to use for emulations modes. + doc: /* List of keymap alists to use for emulation modes. It is intended for modes or packages using multiple minor-mode keymaps. Each element is a keymap alist just like `minor-mode-map-alist', or a symbol with a variable binding which is a keymap alist, and it is used ------------------------------------------------------------ revno: 115739 committer: Tassilo Horn branch nick: trunk timestamp: Wed 2013-12-25 10:12:24 +0100 message: Rephrase lexical binding requirement sentence. * doc/lispref/control.texi (Pattern matching case statement): Rephrase lexical binding requirement: the example needs it, not `pcase' itself. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-12-25 03:05:11 +0000 +++ doc/lispref/ChangeLog 2013-12-25 09:12:24 +0000 @@ -1,3 +1,8 @@ +2013-12-25 Tassilo Horn + + * control.texi (Pattern matching case statement): Rephrase lexical + binding requirement: the example needs it, not `pcase' itself. + 2013-12-25 Chong Yidong * eval.texi (Eval): Document the LEXICAL arg to eval. === modified file 'doc/lispref/control.texi' --- doc/lispref/control.texi 2013-12-24 15:30:59 +0000 +++ doc/lispref/control.texi 2013-12-25 09:12:24 +0000 @@ -342,19 +342,20 @@ @code{(pred numberp)} is a pattern that simply checks that @code{exp} is a number, and @code{_} is the catch-all pattern that matches anything. +Note that the the lambda being the result of the @code{fn} clause is a +closure (@pxref{Closures}), so the file defining @code{evaluate} must +have lexical binding enabled (@pxref{Using Lexical Binding}, for how +to enable it). + Here are some sample programs including their evaluation results: @example (evaluate '(add 1 2) nil) ;=> 3 (evaluate '(add x y) '((x . 1) (y . 2))) ;=> 3 (evaluate '(call (fn x (add 1 x)) 2) nil) ;=> 3 -(evaluate '(sub 1 2) nil) ;=> (error "Unknown expression (sub 1 2)") +(evaluate '(sub 1 2) nil) ;=> error @end example -Note that (parts of) @code{pcase} only work as expected with lexical -binding, so lisp files using @code{pcase} should have enable it -(@pxref{Using Lexical Binding}, for how to enable lexical binding). - There are two kinds of patterns involved in @code{pcase}, called @emph{U-patterns} and @emph{Q-patterns}. The @var{upattern} mentioned above are U-patterns and can take the following forms: ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.