Now on revision 110736. ------------------------------------------------------------ revno: 110736 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-10-30 14:23:31 +0800 message: Add a comment for the last isearch.el change. diff: === modified file 'lisp/isearch.el' --- lisp/isearch.el 2012-10-29 23:20:24 +0000 +++ lisp/isearch.el 2012-10-30 06:23:31 +0000 @@ -2159,6 +2159,8 @@ (if (and (integerp key) (>= key ?\s) (/= key 127) (< key 256)) (progn + ;; Ensure that the processed char is recorded in + ;; the keyboard macro, if any (Bug#4894) (store-kbd-macro-event key) (isearch-process-search-char key) (setq keylist (cdr keylist))) ------------------------------------------------------------ revno: 110735 committer: Daniel Colascione branch nick: cyg timestamp: Mon 2012-10-29 19:10:52 -0800 message: Complete fix for build break diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-29 17:24:29 +0000 +++ src/ChangeLog 2012-10-30 03:10:52 +0000 @@ -5,8 +5,8 @@ here... * coding.h, coding.c: ... to here, and compile them only when - WINDOWSNT or HAVE_NTGUI. Moving these functions out of cygw32 - proper lets us write cygw32-agnostic code for the HAVE_NTGUI case. + WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper + lets us write cygw32-agnostic code for the HAVE_NTGUI case. 2012-10-28 Eli Zaretskii === modified file 'src/coding.c' --- src/coding.c 2012-10-30 01:56:38 +0000 +++ src/coding.c 2012-10-30 03:10:52 +0000 @@ -343,7 +343,7 @@ Lisp_Object Qemacs_mule, Qraw_text; Lisp_Object Qutf_8_emacs; -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined (WINDOWSNT) || defined (CYGWIN) static Lisp_Object Qutf_16le; #endif ------------------------------------------------------------ revno: 110734 committer: Daniel Colascione branch nick: trunk timestamp: Mon 2012-10-29 17:56:38 -0800 message: Fix build break in non-Cygw32 Cygwin builds introduced in revision 110729. diff: === modified file 'src/coding.c' --- src/coding.c 2012-10-29 17:24:29 +0000 +++ src/coding.c 2012-10-30 01:56:38 +0000 @@ -7975,7 +7975,7 @@ return CODING_ID_NAME (id); } -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined (WINDOWSNT) || defined (CYGWIN) Lisp_Object from_unicode (Lisp_Object str) @@ -8006,7 +8006,8 @@ *buf = str; return WCSDATA (*buf); } -#endif /* WINDOWSNT || HAVE_NTGUI */ + +#endif /* WINDOWSNT || CYGWIN */ #ifdef emacs @@ -10321,7 +10322,7 @@ DEFSYM (Qutf_8, "utf-8"); DEFSYM (Qutf_8_emacs, "utf-8-emacs"); -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined (WINDOWSNT) || defined (CYGWIN) /* No, not utf-16-le: that one has a BOM. */ DEFSYM (Qutf_16le, "utf-16le"); #endif === modified file 'src/coding.h' --- src/coding.h 2012-10-29 17:24:29 +0000 +++ src/coding.h 2012-10-30 01:56:38 +0000 @@ -701,7 +701,7 @@ Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object); -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined (WINDOWSNT) || defined (CYGWIN) /* These functions use Lisp string objects to store the UTF-16LE strings that modern versions of Windows expect. These strings are @@ -721,7 +721,7 @@ failure modes. STR itself is not modified. */ extern Lisp_Object from_unicode (Lisp_Object str); -#endif /* WINDOWSNT || HAVE_NTGUI */ +#endif /* WINDOWSNT || CYGWIN */ /* Macros for backward compatibility. */ ------------------------------------------------------------ revno: 110733 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-10-30 08:29:37 +0800 message: Document more Emacs 24.3 changes. * frames.texi (Visibility of Frames): Document tty-top-frame. * loading.texi (Autoload): Document autoloadp, autoload-do-load. * symbols.texi (Symbol Plists): Document function-get. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-10-28 14:56:51 +0000 +++ doc/lispref/ChangeLog 2012-10-30 00:29:37 +0000 @@ -1,3 +1,11 @@ +2012-10-30 Chong Yidong + + * symbols.texi (Symbol Plists): Document function-get. + + * loading.texi (Autoload): Document autoloadp, autoload-do-load. + + * frames.texi (Visibility of Frames): Document tty-top-frame. + 2012-10-28 Stefan Monnier * keymaps.texi (Format of Keymaps): Document the multiple === modified file 'doc/lispref/frames.texi' --- doc/lispref/frames.texi 2012-10-27 05:03:52 +0000 +++ doc/lispref/frames.texi 2012-10-30 00:29:37 +0000 @@ -1493,8 +1493,9 @@ value is @code{t} if @var{frame} is visible, @code{nil} if it is invisible, and @code{icon} if it is iconified. -On a text terminal, all frames are considered visible, whether they -are currently being displayed or not. +On a text terminal, all frames are considered ``visible'' for the +purposes of this function, even though only one frame is displayed. +@xref{Raising and Lowering}. @end defun @deffn Command iconify-frame &optional frame @@ -1550,9 +1551,21 @@ that the minibuffer window is in. @end defopt -You can also enable auto-raise (raising automatically when a frame is -selected) or auto-lower (lowering automatically when it is deselected) -for any frame using frame parameters. @xref{Management Parameters}. + On window systems, you can also enable auto-raising (on frame +selection) or auto-lowering (on frame deselection) using frame +parameters. @xref{Management Parameters}. + +@cindex top frame + The concept of raising and lowering frames also applies to text +terminal frames. On each text terminal, only the top frame is +displayed at any one time. + +@defun tty-top-frame terminal +This function returns the top frame on @var{terminal}. @var{terminal} +should be a terminal object, a frame (meaning that frame's terminal), +or @code{nil} (meaning the selected frame's terminal). If it does not +refer to a text terminal, the return value is @code{nil}. +@end defun @node Frame Configurations @section Frame Configurations === modified file 'doc/lispref/loading.texi' --- doc/lispref/loading.texi 2012-10-23 15:06:07 +0000 +++ doc/lispref/loading.texi 2012-10-30 00:29:37 +0000 @@ -408,9 +408,9 @@ specifies the file to load to get the real definition of @var{function}. If @var{filename} does not contain either a directory name, or the -suffix @code{.el} or @code{.elc}, then @code{autoload} insists on adding -one of these suffixes, and it will not load from a file whose name is -just @var{filename} with no added suffix. (The variable +suffix @code{.el} or @code{.elc}, this function insists on adding one +of these suffixes, and it will not load from a file whose name is just +@var{filename} with no added suffix. (The variable @code{load-suffixes} specifies the exact required suffixes.) The argument @var{docstring} is the documentation string for the @@ -442,10 +442,11 @@ symbol @var{function}. @cindex function cell in autoload -If @var{function} already has a non-void function definition that is not -an autoload object, @code{autoload} does nothing and returns @code{nil}. -If the function cell of @var{function} is void, or is already an autoload -object, then it is defined as an autoload object like this: +if @var{function} already has non-void function definition that is not +an autoload object, this function does nothing and returns @code{nil}. +Otherwise, it constructs an autoload object (@pxref{Autoload Type}), +and stores it as the function definition for @var{function}. The +autoload object has this form: @example (autoload @var{filename} @var{docstring} @var{interactive} @var{type}) @@ -468,6 +469,16 @@ not a macro or a keymap. @end defun +@defun autoloadp object +This function returns non-@code{nil} if @var{object} is an autoload +object. For example, to check if @code{run-prolog} is defined as an +autoloaded function, evaluate + +@smallexample +(autoloadp (symbol-function 'run-prolog)) +@end smallexample +@end defun + @cindex autoload errors The autoloaded file usually contains other definitions and may require or provide one or more features. If the file is not completely loaded @@ -599,6 +610,19 @@ assumed to contain a trailer starting with a formfeed character. @end defvar + The following function may be used to explicitly load the library +specified by an autoload object: + +@defun autoload-do-load autoload &optional name macro-only +This function performs the loading specified by @var{autoload}, which +whould be an autoload object. The optional argument @var{name}, if +non-@code{nil}, should be a symbol whose function value is +@var{autoload}; in that case, the return value of this function is the +symbol's new function value. If the value of the optional argument +@var{macro-only} is @code{macro}, this function avoids loading a +function, only a macro. +@end defun + @node Repeated Loading @section Repeated Loading @cindex repeated loading === modified file 'doc/lispref/symbols.texi' --- doc/lispref/symbols.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/symbols.texi 2012-10-30 00:29:37 +0000 @@ -487,6 +487,12 @@ See @code{put} for an example. @end defun +@defun function-get symbol property +This function is identical to @code{get}, except that if @var{symbol} +is the name of a function alias, it looks in the property list of the +symbol naming the actual function. @xref{Defining Functions}. +@end defun + @defun put symbol property value This function puts @var{value} onto @var{symbol}'s property list under the property name @var{property}, replacing any previous property value. === modified file 'etc/NEWS' --- etc/NEWS 2012-10-29 23:48:02 +0000 +++ etc/NEWS 2012-10-30 00:29:37 +0000 @@ -898,12 +898,15 @@ describing the cycle. ** Miscellaneous new functions: - ++++ *** `autoloadp' ++++ *** `autoload-do-load' +++ *** `buffer-narrowed-p' tests if the buffer is narrowed. ++++ *** `file-name-base' returns a file name sans directory and extension. ++++ *** `function-get' fetches a function property, following aliases. +++ *** `posnp' tests if an object is a `posn'. @@ -912,6 +915,7 @@ *** `system-users' returns the user names on the system. +++ *** `system-groups' returns the group names on the system. ++++ *** `tty-top-frame' returns the topmost frame of a text terminal. ** New macros `setq-local' and `defvar-local'. ------------------------------------------------------------ revno: 110732 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-10-30 07:48:02 +0800 message: Document dired-do-async-shell-command changes. * dired.texi (Shell Commands in Dired): Document changes to the dired-do-async-shell-command. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-10-28 00:16:55 +0000 +++ doc/emacs/ChangeLog 2012-10-29 23:48:02 +0000 @@ -1,3 +1,8 @@ +2012-10-29 Chong Yidong + + * dired.texi (Shell Commands in Dired): Document changes to the + dired-do-async-shell-command. + 2012-10-28 Glenn Morris * ack.texi (Acknowledgments): Mention gv.el. === modified file 'doc/emacs/dired.texi' --- doc/emacs/dired.texi 2012-10-24 14:38:49 +0000 +++ doc/emacs/dired.texi 2012-10-29 23:48:02 +0000 @@ -799,15 +799,20 @@ @kindex ! @r{(Dired)} @kindex X @r{(Dired)} The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a -shell command string in the minibuffer and runs that shell command on +shell command string in the minibuffer, and runs that shell command on one or more files. The files that the shell command operates on are determined in the usual way for Dired commands (@pxref{Operating on Files}). The command @kbd{X} is a synonym for @kbd{!}. The command @kbd{&} (@code{dired-do-async-shell-command}) does the -same, except that it runs the shell command asynchronously. You can +same, except that it runs the shell command asynchronously. (You can also do this with @kbd{!}, by appending a @samp{&} character to the -end of the shell command. +end of the shell command.) When the command operates on more than one +file, it runs multiple parallel copies of the specified shell command, +one for each file. As an exception, if the specified shell command +ends in @samp{;} or @samp{;&}, the shell command is run in the +background on each file sequentially; Emacs waits for each invoked +shell command to terminate before running the next one. For both @kbd{!} and @kbd{&}, the working directory for the shell command is the top-level directory of the Dired buffer. === modified file 'etc/NEWS' --- etc/NEWS 2012-10-28 02:34:36 +0000 +++ etc/NEWS 2012-10-29 23:48:02 +0000 @@ -397,7 +397,7 @@ whitespace problems introduced by the diff. ** Dired - ++++ *** `dired-do-async-shell-command' executes each file sequentially if the command ends in `;' (when operating on multiple files). Otherwise, it executes the command on each file in parallel. ------------------------------------------------------------ revno: 110731 fixes bug: http://debbugs.gnu.org/4894 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-10-30 07:20:24 +0800 message: Fix isearch handling of keypad characters with kmacros. * isearch.el (isearch-other-meta-char): Ensure that a reprocessed function key is stored in a keyboard macro. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 22:58:53 +0000 +++ lisp/ChangeLog 2012-10-29 23:20:24 +0000 @@ -1,5 +1,8 @@ 2012-10-29 Chong Yidong + * isearch.el (isearch-other-meta-char): Ensure that a reprocessed + function key is stored in a keyboard macro (Bug#4894). + * thingatpt.el (number-at-point): Apply a thing-at-point property. 2012-10-29 Stefan Monnier === modified file 'lisp/isearch.el' --- lisp/isearch.el 2012-09-20 21:57:13 +0000 +++ lisp/isearch.el 2012-10-29 23:20:24 +0000 @@ -2149,7 +2149,8 @@ (setq prefix-arg arg) (apply 'isearch-unread keylist)) (setq keylist - (listify-key-sequence (lookup-key local-function-key-map key))) + (listify-key-sequence + (lookup-key local-function-key-map key))) (while keylist (setq key (car keylist)) ;; If KEY is a printing char, we handle it here @@ -2158,6 +2159,7 @@ (if (and (integerp key) (>= key ?\s) (/= key 127) (< key 256)) (progn + (store-kbd-macro-event key) (isearch-process-search-char key) (setq keylist (cdr keylist))) ;; As the remaining keys in KEYLIST can't be handled ------------------------------------------------------------ revno: 110730 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-10-30 06:58:53 +0800 message: * thingatpt.el (number-at-point): Apply a thing-at-point property. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 15:14:10 +0000 +++ lisp/ChangeLog 2012-10-29 22:58:53 +0000 @@ -1,3 +1,7 @@ +2012-10-29 Chong Yidong + + * thingatpt.el (number-at-point): Apply a thing-at-point property. + 2012-10-29 Stefan Monnier * vc/diff-mode.el (diff-context->unified): Don't get confused by "hunk === modified file 'lisp/thingatpt.el' --- lisp/thingatpt.el 2012-10-29 10:03:21 +0000 +++ lisp/thingatpt.el 2012-10-29 22:58:53 +0000 @@ -509,6 +509,7 @@ (defun number-at-point () "Return the number at point, or nil if none is found." (form-at-point 'sexp 'numberp)) +(put 'number 'thing-at-point 'number-at-point) ;;;###autoload (defun list-at-point () "Return the Lisp list at point, or nil if none is found." ------------------------------------------------------------ revno: 110729 committer: Daniel Colascione branch nick: trunk timestamp: Mon 2012-10-29 09:24:29 -0800 message: 2012-10-29 Daniel Colascione cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In preparation for fixing bug#12739, move these functions from here... * coding.h, coding.c: ... to here, and compile them only when WINDOWSNT or HAVE_NTGUI. Moving these functions out of cygw32 proper lets us write cygw32-agnostic code for the HAVE_NTGUI case. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-28 17:42:52 +0000 +++ src/ChangeLog 2012-10-29 17:24:29 +0000 @@ -1,3 +1,13 @@ +2012-10-29 Daniel Colascione + + * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In + preparation for fixing bug#12739, move these functions from + here... + + * coding.h, coding.c: ... to here, and compile them only when + WINDOWSNT or HAVE_NTGUI. Moving these functions out of cygw32 + proper lets us write cygw32-agnostic code for the HAVE_NTGUI case. + 2012-10-28 Eli Zaretskii * w32proc.c (TIMER_TICKS_PER_SEC): New macro. === modified file 'src/coding.c' --- src/coding.c 2012-10-19 12:59:42 +0000 +++ src/coding.c 2012-10-29 17:24:29 +0000 @@ -343,6 +343,10 @@ Lisp_Object Qemacs_mule, Qraw_text; Lisp_Object Qutf_8_emacs; +#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +static Lisp_Object Qutf_16le; +#endif + /* Coding-systems are handed between Emacs Lisp programs and C internal routines by the following three variables. */ /* Coding system to be used to encode text for terminal display when @@ -7971,6 +7975,39 @@ return CODING_ID_NAME (id); } +#if defined (WINDOWSNT) || defined (HAVE_NTGUI) + +Lisp_Object +from_unicode (Lisp_Object str) +{ + CHECK_STRING (str); + if (!STRING_MULTIBYTE (str) && + SBYTES (str) & 1) + { + str = Fsubstring (str, make_number (0), make_number (-1)); + } + + return code_convert_string_norecord (str, Qutf_16le, 0); +} + +wchar_t * +to_unicode (Lisp_Object str, Lisp_Object *buf) +{ + *buf = code_convert_string_norecord (str, Qutf_16le, 1); + /* We need to make a another copy (in addition to the one made by + code_convert_string_norecord) to ensure that the final string is + _doubly_ zero terminated --- that is, that the string is + terminated by two zero bytes and one utf-16le null character. + Because strings are already terminated with a single zero byte, + we just add one additional zero. */ + str = make_uninit_string (SBYTES (*buf) + 1); + memcpy (SDATA (str), SDATA (*buf), SBYTES (*buf)); + SDATA (str) [SBYTES (*buf)] = '\0'; + *buf = str; + return WCSDATA (*buf); +} +#endif /* WINDOWSNT || HAVE_NTGUI */ + #ifdef emacs /*** 8. Emacs Lisp library functions ***/ @@ -10284,6 +10321,11 @@ DEFSYM (Qutf_8, "utf-8"); DEFSYM (Qutf_8_emacs, "utf-8-emacs"); +#if defined (WINDOWSNT) || defined (HAVE_NTGUI) + /* No, not utf-16-le: that one has a BOM. */ + DEFSYM (Qutf_16le, "utf-16le"); +#endif + DEFSYM (Qutf_16, "utf-16"); DEFSYM (Qbig, "big"); DEFSYM (Qlittle, "little"); === modified file 'src/coding.h' --- src/coding.h 2012-10-02 00:31:56 +0000 +++ src/coding.h 2012-10-29 17:24:29 +0000 @@ -701,6 +701,28 @@ Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object); +#if defined (WINDOWSNT) || defined (HAVE_NTGUI) + +/* These functions use Lisp string objects to store the UTF-16LE + strings that modern versions of Windows expect. These strings are + not particularly useful to Lisp, and all Lisp strings should be + native Emacs multibyte. */ + +/* Access the wide-character string stored in a Lisp string object. */ +#define WCSDATA(x) ((wchar_t *) SDATA (x)) + +/* Convert the multi-byte string in STR to UTF-16LE encoded unibyte + string, and store it in *BUF. BUF may safely point to STR on entry. */ +extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf); + +/* Convert STR, a UTF-16LE encoded string embedded in a unibyte string + object, to a multi-byte Emacs string and return it. This function + calls code_convert_string_norecord internally and has all its + failure modes. STR itself is not modified. */ +extern Lisp_Object from_unicode (Lisp_Object str); + +#endif /* WINDOWSNT || HAVE_NTGUI */ + /* Macros for backward compatibility. */ #define decode_coding_region(coding, from, to) \ === modified file 'src/cygw32.c' --- src/cygw32.c 2012-10-17 15:37:55 +0000 +++ src/cygw32.c 2012-10-29 17:24:29 +0000 @@ -22,7 +22,6 @@ #include "buffer.h" #include #include -static Lisp_Object Qutf_16le; static Lisp_Object fchdir_unwind (Lisp_Object dir_fd) @@ -107,36 +106,6 @@ return unbind_to (count, DECODE_FILE (converted)); } -Lisp_Object -from_unicode (Lisp_Object str) -{ - CHECK_STRING (str); - if (!STRING_MULTIBYTE (str) && - SBYTES (str) & 1) - { - str = Fsubstring (str, make_number (0), make_number (-1)); - } - - return code_convert_string_norecord (str, Qutf_16le, 0); -} - -wchar_t * -to_unicode (Lisp_Object str, Lisp_Object *buf) -{ - *buf = code_convert_string_norecord (str, Qutf_16le, 1); - /* We need to make a another copy (in addition to the one made by - code_convert_string_norecord) to ensure that the final string is - _doubly_ zero terminated --- that is, that the string is - terminated by two zero bytes and one utf-16le null character. - Because strings are already terminated with a single zero byte, - we just add one additional zero. */ - str = make_uninit_string (SBYTES (*buf) + 1); - memcpy (SDATA (str), SDATA (*buf), SBYTES (*buf)); - SDATA (str) [SBYTES (*buf)] = '\0'; - *buf = str; - return WCSDATA (*buf); -} - DEFUN ("cygwin-convert-path-to-windows", Fcygwin_convert_path_to_windows, Scygwin_convert_path_to_windows, 1, 2, 0, @@ -162,8 +131,6 @@ void syms_of_cygw32 (void) { - /* No, not utf-16-le: that one has a BOM. */ - DEFSYM (Qutf_16le, "utf-16le"); defsubr (&Scygwin_convert_path_from_windows); defsubr (&Scygwin_convert_path_to_windows); } === modified file 'src/cygw32.h' --- src/cygw32.h 2012-10-08 12:53:18 +0000 +++ src/cygw32.h 2012-10-29 17:24:29 +0000 @@ -33,20 +33,6 @@ #include "lisp.h" #include "coding.h" -/* *** Character conversion *** */ - -/* Access the wide-character string stored in a Lisp string object. */ -#define WCSDATA(x) ((wchar_t *) SDATA (x)) - -/* Convert the multi-byte string in STR to UTF-16LE encoded unibyte - string, and store it in *BUF. BUF may safely point to STR on entry. */ -extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf); - -/* Convert STR, a UTF-16LE encoded string embedded in a unibyte string - object, to a multi-byte Emacs string, and return it. */ -extern Lisp_Object from_unicode (Lisp_Object str); - -/* *** Misc *** */ extern void syms_of_cygw32 (void); extern char * w32_strerror (int error_no); ------------------------------------------------------------ revno: 110728 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-10-29 11:14:10 -0400 message: * lisp/vc/diff-mode.el (diff-context->unified): Don't get confused by "hunk header comments". (diff-unified->context, diff-context->unified) (diff-reverse-direction, diff-fixup-modifs): Use `use-region-p'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 13:50:05 +0000 +++ lisp/ChangeLog 2012-10-29 15:14:10 +0000 @@ -1,5 +1,10 @@ 2012-10-29 Stefan Monnier + * vc/diff-mode.el (diff-context->unified): Don't get confused by "hunk + header comments". + (diff-unified->context, diff-context->unified) + (diff-reverse-direction, diff-fixup-modifs): Use `use-region-p'. + * emacs-lisp/cl.el (letf): Add missing indent rules (bug#12759). * files.el (find-alternate-file): Only ask one question (bug#12487). === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2012-10-26 15:51:42 +0000 +++ lisp/vc/diff-mode.el 2012-10-29 15:14:10 +0000 @@ -911,7 +911,7 @@ "Convert unified diffs to context diffs. START and END are either taken from the region (if a prefix arg is given) or else cover the whole buffer." - (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) + (interactive (if (or current-prefix-arg (use-region-p)) (list (region-beginning) (region-end)) (list (point-min) (point-max)))) (unless (markerp end) (setq end (copy-marker end t))) @@ -1035,7 +1035,7 @@ START and END are either taken from the region \(when it is highlighted) or else cover the whole buffer. With a prefix argument, convert unified format to context format." - (interactive (if (and transient-mark-mode mark-active) + (interactive (if (use-region-p) (list (region-beginning) (region-end) current-prefix-arg) (list (point-min) (point-max) current-prefix-arg))) (if to-context @@ -1045,7 +1045,7 @@ (inhibit-read-only t)) (save-excursion (goto-char start) - (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t) + (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)\\(?: \\(.*\\)\\|$\\)" nil t) (< (point) end)) (combine-after-change-calls (if (match-beginning 2) @@ -1061,7 +1061,9 @@ ;; Variables to use the special undo function. (old-undo buffer-undo-list) (old-end (marker-position end)) - (reversible t)) + ;; We currently throw away the comment that can follow + ;; the hunk header. FIXME: Preserve it instead! + (reversible (not (match-end 6)))) (replace-match "") (unless (re-search-forward diff-context-mid-hunk-header-re nil t) @@ -1131,7 +1133,7 @@ "Reverse the direction of the diffs. START and END are either taken from the region (if a prefix arg is given) or else cover the whole buffer." - (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) + (interactive (if (or current-prefix-arg (use-region-p)) (list (region-beginning) (region-end)) (list (point-min) (point-max)))) (unless (markerp end) (setq end (copy-marker end t))) @@ -1197,7 +1199,7 @@ "Fixup the hunk headers (in case the buffer was modified). START and END are either taken from the region (if a prefix arg is given) or else cover the whole buffer." - (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) + (interactive (if (or current-prefix-arg (use-region-p)) (list (region-beginning) (region-end)) (list (point-min) (point-max)))) (let ((inhibit-read-only t)) === modified file 'test/indent/shell.sh' --- test/indent/shell.sh 2012-07-17 08:38:12 +0000 +++ test/indent/shell.sh 2012-10-29 15:14:10 +0000 @@ -26,7 +26,10 @@ case $toto in a) echo 1;; b) echo 2;; - c) echo 3;; + (c) + echo 3;; + d) + echo 3;; esac case $as_nl`(ac_space=' '; set) 2>&1` in #( ------------------------------------------------------------ revno: 110727 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12759 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-10-29 09:50:05 -0400 message: * lisp/emacs-lisp/cl.el (letf): Add missing indent rules. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 13:28:41 +0000 +++ lisp/ChangeLog 2012-10-29 13:50:05 +0000 @@ -1,5 +1,7 @@ 2012-10-29 Stefan Monnier + * emacs-lisp/cl.el (letf): Add missing indent rules (bug#12759). + * files.el (find-alternate-file): Only ask one question (bug#12487). 2012-10-29 Chong Yidong === modified file 'lisp/emacs-lisp/cl.el' --- lisp/emacs-lisp/cl.el 2012-10-29 01:12:53 +0000 +++ lisp/emacs-lisp/cl.el 2012-10-29 13:50:05 +0000 @@ -512,6 +512,7 @@ (defmacro letf (bindings &rest body) "Dynamically scoped let-style bindings for places. Like `cl-letf', but with some extra backward compatibility." + (declare (indent 1) (debug cl-letf)) ;; Like cl-letf, but with special handling of symbol-function. `(cl-letf ,(mapcar (lambda (x) (if (eq (car-safe (car x)) 'symbol-function) `((cl--symbol-function ,@(cdar x)) ,@(cdr x)) ------------------------------------------------------------ revno: 110726 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12487 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-10-29 09:28:41 -0400 message: * lisp/files.el (find-alternate-file): Only ask one question. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 11:12:17 +0000 +++ lisp/ChangeLog 2012-10-29 13:28:41 +0000 @@ -1,3 +1,7 @@ +2012-10-29 Stefan Monnier + + * files.el (find-alternate-file): Only ask one question (bug#12487). + 2012-10-29 Chong Yidong * vc/vc-hooks.el (vc-file-clearprops): Kill vc-parent-buffer. === modified file 'lisp/files.el' --- lisp/files.el 2012-10-06 14:18:35 +0000 +++ lisp/files.el 2012-10-29 13:28:41 +0000 @@ -1537,12 +1537,9 @@ t))) (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) (error "Aborted")) - (when (and (buffer-modified-p) buffer-file-name) - (if (yes-or-no-p (format "Buffer %s is modified; save it first? " - (buffer-name))) - (save-buffer) - (unless (yes-or-no-p "Kill and replace the buffer without saving it? ") - (error "Aborted")))) + (and (buffer-modified-p) buffer-file-name + (not (yes-or-no-p "Kill and replace the buffer without saving it? ")) + (error "Aborted")) (let ((obuf (current-buffer)) (ofile buffer-file-name) (onum buffer-file-number) ------------------------------------------------------------ revno: 110725 fixes bug: http://debbugs.gnu.org/6326 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-10-29 19:12:17 +0800 message: * vc/vc-hooks.el (vc-file-clearprops): Kill vc-parent-buffer. Suggested by Dan Nicolaescu. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 10:42:58 +0000 +++ lisp/ChangeLog 2012-10-29 11:12:17 +0000 @@ -1,5 +1,8 @@ 2012-10-29 Chong Yidong + * vc/vc-hooks.el (vc-file-clearprops): Kill vc-parent-buffer. + Suggested by Dan Nicolaescu (Bug#6326). + * info.el (Info-complete-menu-item): Avoid duplicates (Bug#12705). * startup.el (fancy-about-screen): Don't message (Bug#12680). === modified file 'lisp/vc/vc-hooks.el' --- lisp/vc/vc-hooks.el 2012-09-24 12:23:25 +0000 +++ lisp/vc/vc-hooks.el 2012-10-29 11:12:17 +0000 @@ -224,6 +224,8 @@ (defun vc-file-clearprops (file) "Clear all VC properties of FILE." + (if (boundp 'vc-parent-buffer) + (kill-local-variable 'vc-parent-buffer)) (setplist (intern file vc-file-prop-obarray) nil)) ------------------------------------------------------------ revno: 110724 fixes bug: http://debbugs.gnu.org/12705 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-10-29 18:42:58 +0800 message: * info.el (Info-complete-menu-item): Avoid duplicates. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 10:30:11 +0000 +++ lisp/ChangeLog 2012-10-29 10:42:58 +0000 @@ -1,10 +1,7 @@ -2012-10-29 Kevin Ryde - - * woman.el (woman-parse-numeric-value): Handle picas correctly - (Bug#12639). - 2012-10-29 Chong Yidong + * info.el (Info-complete-menu-item): Avoid duplicates (Bug#12705). + * startup.el (fancy-about-screen): Don't message (Bug#12680). * thingatpt.el (thing-at-point): Doc fix (Bug#12691). @@ -14,6 +11,11 @@ * face-remap.el (face-remap-add-relative): Handle the case where a face-remapping-alist entry is a cons cell (Bug#12762). +2012-10-29 Kevin Ryde + + * woman.el (woman-parse-numeric-value): Handle picas correctly + (Bug#12639). + 2012-10-29 Glenn Morris * emacs-lisp/cl.el (defsetf): Doc fix. === modified file 'lisp/info.el' --- lisp/info.el 2012-09-12 20:51:46 +0000 +++ lisp/info.el 2012-10-29 10:42:58 +0000 @@ -2646,6 +2646,7 @@ (while (re-search-forward pattern nil t) (push (match-string-no-properties 1) completions)) + (setq completions (delete-dups completions)) ;; Check subsequent nodes if applicable. (or (and Info-complete-next-re (setq nextnode (Info-extract-pointer "next" t)) ------------------------------------------------------------ revno: 110723 fixes bug: http://debbugs.gnu.org/12639 author: Kevin Ryde committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-10-29 18:30:11 +0800 message: * woman.el (woman-parse-numeric-value): Handle picas correctly. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 10:14:50 +0000 +++ lisp/ChangeLog 2012-10-29 10:30:11 +0000 @@ -1,3 +1,8 @@ +2012-10-29 Kevin Ryde + + * woman.el (woman-parse-numeric-value): Handle picas correctly + (Bug#12639). + 2012-10-29 Chong Yidong * startup.el (fancy-about-screen): Don't message (Bug#12680). === modified file 'lisp/woman.el' --- lisp/woman.el 2012-08-26 10:29:37 +0000 +++ lisp/woman.el 2012-10-29 10:30:11 +0000 @@ -3632,7 +3632,9 @@ ((looking-at "[mnuv]")) ; ignore for now ((looking-at "i") (setq n (* n 10))) ; inch ((looking-at "c") (setq n (* n 3.9))) ; cm - ((looking-at "P") (setq n (* n 1.7))) ; Pica + ((let ((case-fold-search nil)) + (looking-at "P")) + (setq n (* n 1.7))) ; Pica ((looking-at "p") (setq n (* n 0.14))) ; point ;; NB: May be immediately followed by + or -, etc., ;; in which case do nothing and return nil. ------------------------------------------------------------ revno: 110722 fixes bug: http://debbugs.gnu.org/12680 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-10-29 18:14:50 +0800 message: Fix last change. * lisp/startup.el (fancy-about-screen): Don't message at all. (startup-echo-area-message): Revert last change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 10:10:15 +0000 +++ lisp/ChangeLog 2012-10-29 10:14:50 +0000 @@ -1,7 +1,6 @@ 2012-10-29 Chong Yidong - * startup.el (startup-echo-area-message): New arg. - (fancy-about-screen): Avoid a misleading message (Bug#12680). + * startup.el (fancy-about-screen): Don't message (Bug#12680). * thingatpt.el (thing-at-point): Doc fix (Bug#12691). === modified file 'lisp/startup.el' --- lisp/startup.el 2012-10-29 10:10:15 +0000 +++ lisp/startup.el 2012-10-29 10:14:50 +0000 @@ -1693,7 +1693,6 @@ (force-mode-line-update)) (use-local-map splash-screen-keymap) (setq tab-width 22) - (message "%s" (startup-echo-area-message t)) (setq buffer-read-only t) (goto-char (point-min)) (forward-line 3)))) @@ -2017,8 +2016,8 @@ 'follow-link t) (insert "\tBuying printed manuals from the FSF\n")) -(defun startup-echo-area-message (&optional about-screen-message) - (cond ((and (daemonp) (not about-screen-message)) +(defun startup-echo-area-message () + (cond ((daemonp) "Starting Emacs daemon.") ((eq (key-binding "\C-h\C-a") 'about-emacs) "For information about GNU Emacs and the GNU system, type C-h C-a.") ------------------------------------------------------------ revno: 110721 fixes bug: http://debbugs.gnu.org/12680 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-10-29 18:10:15 +0800 message: Avoid a misleading message on C-h C-a. * lisp/startup.el (startup-echo-area-message): New arg. (fancy-about-screen): Avoid a misleading message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 10:03:21 +0000 +++ lisp/ChangeLog 2012-10-29 10:10:15 +0000 @@ -1,5 +1,8 @@ 2012-10-29 Chong Yidong + * startup.el (startup-echo-area-message): New arg. + (fancy-about-screen): Avoid a misleading message (Bug#12680). + * thingatpt.el (thing-at-point): Doc fix (Bug#12691). * imenu.el (imenu): Inhibit push-mark message (Bug#12726). === modified file 'lisp/startup.el' --- lisp/startup.el 2012-10-23 02:39:13 +0000 +++ lisp/startup.el 2012-10-29 10:10:15 +0000 @@ -1693,7 +1693,7 @@ (force-mode-line-update)) (use-local-map splash-screen-keymap) (setq tab-width 22) - (message "%s" (startup-echo-area-message)) + (message "%s" (startup-echo-area-message t)) (setq buffer-read-only t) (goto-char (point-min)) (forward-line 3)))) @@ -2017,8 +2017,8 @@ 'follow-link t) (insert "\tBuying printed manuals from the FSF\n")) -(defun startup-echo-area-message () - (cond ((daemonp) +(defun startup-echo-area-message (&optional about-screen-message) + (cond ((and (daemonp) (not about-screen-message)) "Starting Emacs daemon.") ((eq (key-binding "\C-h\C-a") 'about-emacs) "For information about GNU Emacs and the GNU system, type C-h C-a.") ------------------------------------------------------------ revno: 110720 fixes bug: http://debbugs.gnu.org/12691 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-10-29 18:03:21 +0800 message: * thingatpt.el (thing-at-point): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 09:58:49 +0000 +++ lisp/ChangeLog 2012-10-29 10:03:21 +0000 @@ -1,5 +1,7 @@ 2012-10-29 Chong Yidong + * thingatpt.el (thing-at-point): Doc fix (Bug#12691). + * imenu.el (imenu): Inhibit push-mark message (Bug#12726). * face-remap.el (face-remap-add-relative): Handle the case where a === modified file 'lisp/thingatpt.el' --- lisp/thingatpt.el 2012-05-26 02:40:47 +0000 +++ lisp/thingatpt.el 2012-10-29 10:03:21 +0000 @@ -133,7 +133,7 @@ THING should be a symbol specifying a type of syntactic entity. Possibilities include `symbol', `list', `sexp', `defun', `filename', `url', `email', `word', `sentence', `whitespace', -`line', and `page'. +`line', `number', and `page'. See the file `thingatpt.el' for documentation on how to define a symbol as a valid THING." ------------------------------------------------------------ revno: 110719 fixes bug: http://debbugs.gnu.org/12726 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-10-29 17:58:49 +0800 message: * imenu.el (imenu): Inhibit push-mark message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 09:55:57 +0000 +++ lisp/ChangeLog 2012-10-29 09:58:49 +0000 @@ -1,5 +1,7 @@ 2012-10-29 Chong Yidong + * imenu.el (imenu): Inhibit push-mark message (Bug#12726). + * face-remap.el (face-remap-add-relative): Handle the case where a face-remapping-alist entry is a cons cell (Bug#12762). === modified file 'lisp/imenu.el' --- lisp/imenu.el 2012-09-25 04:13:02 +0000 +++ lisp/imenu.el 2012-10-29 09:58:49 +0000 @@ -1018,7 +1018,7 @@ (if (stringp index-item) (setq index-item (assoc index-item (imenu--make-index-alist)))) (when index-item - (push-mark) + (push-mark nil t) (let* ((is-special-item (listp (cdr index-item))) (function (if is-special-item ------------------------------------------------------------ revno: 110718 fixes bug: http://debbugs.gnu.org/12762 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-10-29 17:55:57 +0800 message: Manage face-remapping-alist properly in face-remap-add-relative. * face-remap.el (face-remap-add-relative): Handle the case where a face-remapping-alist entry is a cons cell. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 01:12:53 +0000 +++ lisp/ChangeLog 2012-10-29 09:55:57 +0000 @@ -1,3 +1,8 @@ +2012-10-29 Chong Yidong + + * face-remap.el (face-remap-add-relative): Handle the case where a + face-remapping-alist entry is a cons cell (Bug#12762). + 2012-10-29 Glenn Morris * emacs-lisp/cl.el (defsetf): Doc fix. === modified file 'lisp/face-remap.el' --- lisp/face-remap.el 2012-10-26 17:07:35 +0000 +++ lisp/face-remap.el 2012-10-29 09:55:57 +0000 @@ -132,7 +132,10 @@ (when (null entry) (setq entry (list face face)) ; explicitly merge with global def (push entry face-remapping-alist)) - (setcdr entry (face-remap-order (cons specs (cdr entry)))) + (let ((faces (cdr entry))) + (if (symbolp faces) + (setq faces (list faces))) + (setcdr entry (face-remap-order (cons specs faces)))) (cons face specs))) (defun face-remap-remove-relative (cookie) ------------------------------------------------------------ revno: 110717 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-10-28 18:36:29 -0700 message: * cl.texi (Modify Macros, Other Clauses): Remove mentions of obsolete features. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-10-29 01:31:10 +0000 +++ doc/misc/ChangeLog 2012-10-29 01:36:29 +0000 @@ -3,7 +3,8 @@ * cl.texi (Organization): More details on cl-lib.el versus cl.el. (Setf Extensions): Remove `apply' setf since it seems to be disabled. (Customizing Setf): Move contents to "Obsolete Setf Customization". - (Modify Macros, Multiple Values): Remove mentions of obsolete feature. + (Modify Macros, Multiple Values, Other Clauses): + Remove mentions of obsolete features. (Obsolete Setf Customization): Don't mention `apply' setf. 2012-10-28 Glenn Morris === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2012-10-29 01:31:10 +0000 +++ doc/misc/cl.texi 2012-10-29 01:36:29 +0000 @@ -973,6 +973,7 @@ Emacs place functions are suitable in this sense, this feature is only interesting when used with places you define yourself with @code{define-setf-method} or the long form of @code{defsetf}. +@xref{Obsolete Setf Customization}. @end ignore @item @@ -1208,10 +1209,9 @@ @end defmac The @code{cl-callf} and @code{cl-callf2} macros serve as building -blocks for other macros like @code{cl-incf}, @code{cl-pushnew}, and -@code{define-modify-macro}. The @code{letf} and @code{cl-letf*} -macros are used in the processing of symbol macros; -@pxref{Macro Bindings}. +blocks for other macros like @code{cl-incf}, and @code{cl-pushnew}. +The @code{letf} and @code{cl-letf*} macros are used in the processing +of symbol macros; @pxref{Macro Bindings}. @node Variable Bindings @@ -2438,13 +2438,12 @@ efficiently, though. @end table -While there is no high-level way to add user extensions to @code{cl-loop} -(comparable to @code{defsetf} for @code{setf}, say), this package -does offer two properties called @code{cl-loop-handler} and -@code{cl-loop-for-handler} which are functions to be called when -a given symbol is encountered as a top-level loop clause or -@code{for} clause, respectively. Consult the source code in -file @file{cl-macs.el} for details. +While there is no high-level way to add user extensions to @code{cl-loop}, +this package does offer two properties called @code{cl-loop-handler} +and @code{cl-loop-for-handler} which are functions to be called when a +given symbol is encountered as a top-level loop clause or @code{for} +clause, respectively. Consult the source code in file +@file{cl-macs.el} for details. This package's @code{cl-loop} macro is compatible with that of Common Lisp, except that a few features are not implemented: @code{loop-finish} ------------------------------------------------------------ revno: 110716 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-10-28 18:31:10 -0700 message: * doc/misc/cl.texi (Obsolete Setf Customization): Don't mention `apply' setf. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-10-29 01:29:22 +0000 +++ doc/misc/ChangeLog 2012-10-29 01:31:10 +0000 @@ -4,6 +4,7 @@ (Setf Extensions): Remove `apply' setf since it seems to be disabled. (Customizing Setf): Move contents to "Obsolete Setf Customization". (Modify Macros, Multiple Values): Remove mentions of obsolete feature. + (Obsolete Setf Customization): Don't mention `apply' setf. 2012-10-28 Glenn Morris === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2012-10-29 01:29:22 +0000 +++ doc/misc/cl.texi 2012-10-29 01:31:10 +0000 @@ -5067,10 +5067,10 @@ an @code{&environment} argument to the macro or setf-method that called @code{get-setf-method}. -See also the source code for the setf-methods for @code{apply} -and @code{substring}, each of which works by calling -@code{get-setf-method} on a simpler case, then massaging -the result in various ways. +See also the source code for the setf-method for +@c Also @code{apply}, but that is commented out. +@code{substring}, which works by calling @code{get-setf-method} on a +simpler case, then massaging the result. @end defun Modern Common Lisp defines a second, independent way to specify ------------------------------------------------------------ revno: 110715 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-10-28 18:29:22 -0700 message: Move some cl.texi setf extensions to the Obsolete appendix * doc/misc/cl.texi (Customizing Setf): Move contents to "Obsolete Setf Customization". (Modify Macros, Multiple Values): Remove mentions of obsolete feature. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-10-29 01:19:26 +0000 +++ doc/misc/ChangeLog 2012-10-29 01:29:22 +0000 @@ -2,6 +2,8 @@ * cl.texi (Organization): More details on cl-lib.el versus cl.el. (Setf Extensions): Remove `apply' setf since it seems to be disabled. + (Customizing Setf): Move contents to "Obsolete Setf Customization". + (Modify Macros, Multiple Values): Remove mentions of obsolete feature. 2012-10-28 Glenn Morris === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2012-10-29 01:19:26 +0000 +++ doc/misc/cl.texi 2012-10-29 01:29:22 +0000 @@ -883,7 +883,6 @@ @menu * Setf Extensions:: Additional @code{setf} places. * Modify Macros:: @code{cl-incf}, @code{cl-rotatef}, @code{letf}, @code{cl-callf}, etc. -* Customizing Setf:: @code{define-modify-macro}, @code{defsetf}, @code{define-setf-method}. @end menu @node Setf Extensions @@ -1198,9 +1197,7 @@ (cl-callf cl-union happy-people (list joe bob) :test 'same-person) @end example -@xref{Customizing Setf}, for @code{define-modify-macro}, a way -to create even more concise notations for modify macros. Note -again that @code{cl-callf} is an extension to standard Common Lisp. +Note again that @code{cl-callf} is an extension to standard Common Lisp. @end defmac @defmac cl-callf2 @var{function} @var{arg1} @var{place} @var{args}@dots{} @@ -1216,214 +1213,6 @@ macros are used in the processing of symbol macros; @pxref{Macro Bindings}. -@node Customizing Setf -@subsection Customizing Setf - -@noindent -Common Lisp defines three macros, @code{define-modify-macro}, -@code{defsetf}, and @code{define-setf-method}, that allow the -user to extend generalized variables in various ways. - -@defmac define-modify-macro name arglist function [doc-string] -This macro defines a ``read-modify-write'' macro similar to -@code{cl-incf} and @code{cl-decf}. The macro @var{name} is defined -to take a @var{place} argument followed by additional arguments -described by @var{arglist}. The call - -@example -(@var{name} @var{place} @var{args}...) -@end example - -@noindent -will be expanded to - -@example -(cl-callf @var{func} @var{place} @var{args}...) -@end example - -@noindent -which in turn is roughly equivalent to - -@example -(setf @var{place} (@var{func} @var{place} @var{args}...)) -@end example - -For example: - -@example -(define-modify-macro cl-incf (&optional (n 1)) +) -(define-modify-macro cl-concatf (&rest args) concat) -@end example - -Note that @code{&key} is not allowed in @var{arglist}, but -@code{&rest} is sufficient to pass keywords on to the function. - -Most of the modify macros defined by Common Lisp do not exactly -follow the pattern of @code{define-modify-macro}. For example, -@code{push} takes its arguments in the wrong order, and @code{pop} -is completely irregular. You can define these macros ``by hand'' -using @code{get-setf-method}, or consult the source -to see how to use the internal @code{setf} building blocks. -@end defmac - -@defmac defsetf access-fn update-fn -This is the simpler of two @code{defsetf} forms. Where -@var{access-fn} is the name of a function which accesses a place, -this declares @var{update-fn} to be the corresponding store -function. From now on, - -@example -(setf (@var{access-fn} @var{arg1} @var{arg2} @var{arg3}) @var{value}) -@end example - -@noindent -will be expanded to - -@example -(@var{update-fn} @var{arg1} @var{arg2} @var{arg3} @var{value}) -@end example - -@noindent -The @var{update-fn} is required to be either a true function, or -a macro which evaluates its arguments in a function-like way. Also, -the @var{update-fn} is expected to return @var{value} as its result. -Otherwise, the above expansion would not obey the rules for the way -@code{setf} is supposed to behave. - -As a special (non-Common-Lisp) extension, a third argument of @code{t} -to @code{defsetf} says that the @code{update-fn}'s return value is -not suitable, so that the above @code{setf} should be expanded to -something more like - -@example -(let ((temp @var{value})) - (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} temp) - temp) -@end example - -Some examples of the use of @code{defsetf}, drawn from the standard -suite of setf methods, are: - -@example -(defsetf car setcar) -(defsetf symbol-value set) -(defsetf buffer-name rename-buffer t) -@end example -@end defmac - -@defmac defsetf access-fn arglist (store-var) forms@dots{} -This is the second, more complex, form of @code{defsetf}. It is -rather like @code{defmacro} except for the additional @var{store-var} -argument. The @var{forms} should return a Lisp form which stores -the value of @var{store-var} into the generalized variable formed -by a call to @var{access-fn} with arguments described by @var{arglist}. -The @var{forms} may begin with a string which documents the @code{setf} -method (analogous to the doc string that appears at the front of a -function). - -For example, the simple form of @code{defsetf} is shorthand for - -@example -(defsetf @var{access-fn} (&rest args) (store) - (append '(@var{update-fn}) args (list store))) -@end example - -The Lisp form that is returned can access the arguments from -@var{arglist} and @var{store-var} in an unrestricted fashion; -macros like @code{setf} and @code{cl-incf} which invoke this -setf-method will insert temporary variables as needed to make -sure the apparent order of evaluation is preserved. - -Another example drawn from the standard package: - -@example -(defsetf nth (n x) (store) - (list 'setcar (list 'nthcdr n x) store)) -@end example -@end defmac - -@defmac define-setf-method access-fn arglist forms@dots{} -This is the most general way to create new place forms. When -a @code{setf} to @var{access-fn} with arguments described by -@var{arglist} is expanded, the @var{forms} are evaluated and -must return a list of five items: - -@enumerate -@item -A list of @dfn{temporary variables}. - -@item -A list of @dfn{value forms} corresponding to the temporary variables -above. The temporary variables will be bound to these value forms -as the first step of any operation on the generalized variable. - -@item -A list of exactly one @dfn{store variable} (generally obtained -from a call to @code{gensym}). - -@item -A Lisp form which stores the contents of the store variable into -the generalized variable, assuming the temporaries have been -bound as described above. - -@item -A Lisp form which accesses the contents of the generalized variable, -assuming the temporaries have been bound. -@end enumerate - -This is exactly like the Common Lisp macro of the same name, -except that the method returns a list of five values rather -than the five values themselves, since Emacs Lisp does not -support Common Lisp's notion of multiple return values. - -Once again, the @var{forms} may begin with a documentation string. - -A setf-method should be maximally conservative with regard to -temporary variables. In the setf-methods generated by -@code{defsetf}, the second return value is simply the list of -arguments in the place form, and the first return value is a -list of a corresponding number of temporary variables generated -by @code{cl-gensym}. Macros like @code{setf} and @code{cl-incf} which -use this setf-method will optimize away most temporaries that -turn out to be unnecessary, so there is little reason for the -setf-method itself to optimize. -@end defmac - -@defun get-setf-method place &optional env -This function returns the setf-method for @var{place}, by -invoking the definition previously recorded by @code{defsetf} -or @code{define-setf-method}. The result is a list of five -values as described above. You can use this function to build -your own @code{cl-incf}-like modify macros. (Actually, it is -@c FIXME? -better to use the internal functions @code{cl-setf-do-modify} -and @code{cl-setf-do-store}, which are a bit easier to use and -which also do a number of optimizations; consult the source -code for the @code{cl-incf} function for a simple example.) - -The argument @var{env} specifies the ``environment'' to be -passed on to @code{macroexpand} if @code{get-setf-method} should -need to expand a macro in @var{place}. It should come from -an @code{&environment} argument to the macro or setf-method -that called @code{get-setf-method}. - -See also the source code for the setf-methods for @code{apply} -and @code{substring}, each of which works by calling -@code{get-setf-method} on a simpler case, then massaging -the result in various ways. -@end defun - -Modern Common Lisp defines a second, independent way to specify -the @code{setf} behavior of a function, namely ``@code{setf} -functions'' whose names are lists @code{(setf @var{name})} -rather than symbols. For example, @code{(defun (setf foo) @dots{})} -defines the function that is used when @code{setf} is applied to -@code{foo}. This package does not currently support @code{setf} -functions. In particular, it is a compile-time error to use -@code{setf} on a form which has not already been @code{defsetf}'d -or otherwise declared; in newer Common Lisps, this would not be -an error since the function @code{(setf @var{func})} might be -defined later. @node Variable Bindings @section Variable Bindings @@ -2672,8 +2461,8 @@ package makes no attempt to emulate Common Lisp multiple return values; Emacs versions of Common Lisp functions that return more than one value either return just the first value (as in -@code{cl-compiler-macroexpand}) or return a list of values (as in -@code{get-setf-method}). This package @emph{does} define placeholders +@code{cl-compiler-macroexpand}) or return a list of values. +This package @emph{does} define placeholders for the Common Lisp functions that work with multiple values, but in Emacs Lisp these functions simply operate on lists instead. The @code{cl-values} form, for example, is a synonym for @code{list} @@ -5088,21 +4877,213 @@ @node Obsolete Setf Customization @appendixsec Obsolete Ways to Customize Setf -This section describes some obsolete ways to extend @code{setf}. -They are replaced by @file{gv.el} in Emacs 24.3. - -@c FIXME. -@defmac define-setf-method name arglist &rest body -Use @file{gv.el}. +Common Lisp defines three macros, @code{define-modify-macro}, +@code{defsetf}, and @code{define-setf-method}, that allow the +user to extend generalized variables in various ways. +In Emacs, these are obsolete, replaced by various features of +@file{gv.el} in Emacs 24.3. +@c FIXME details. + +@defmac define-modify-macro name arglist function [doc-string] +This macro defines a ``read-modify-write'' macro similar to +@code{cl-incf} and @code{cl-decf}. The macro @var{name} is defined +to take a @var{place} argument followed by additional arguments +described by @var{arglist}. The call + +@example +(@var{name} @var{place} @var{args}...) +@end example + +@noindent +will be expanded to + +@example +(cl-callf @var{func} @var{place} @var{args}...) +@end example + +@noindent +which in turn is roughly equivalent to + +@example +(setf @var{place} (@var{func} @var{place} @var{args}...)) +@end example + +For example: + +@example +(define-modify-macro cl-incf (&optional (n 1)) +) +(define-modify-macro cl-concatf (&rest args) concat) +@end example + +Note that @code{&key} is not allowed in @var{arglist}, but +@code{&rest} is sufficient to pass keywords on to the function. + +Most of the modify macros defined by Common Lisp do not exactly +follow the pattern of @code{define-modify-macro}. For example, +@code{push} takes its arguments in the wrong order, and @code{pop} +is completely irregular. You can define these macros ``by hand'' +using @code{get-setf-method}, or consult the source +to see how to use the internal @code{setf} building blocks. @end defmac @defmac defsetf access-fn update-fn -Use @file{gv.el}. -@end defmac - -@defmac define-modify-macro name arglist function [doc-string] -Use @file{gv.el}. -@end defmac +This is the simpler of two @code{defsetf} forms. Where +@var{access-fn} is the name of a function which accesses a place, +this declares @var{update-fn} to be the corresponding store +function. From now on, + +@example +(setf (@var{access-fn} @var{arg1} @var{arg2} @var{arg3}) @var{value}) +@end example + +@noindent +will be expanded to + +@example +(@var{update-fn} @var{arg1} @var{arg2} @var{arg3} @var{value}) +@end example + +@noindent +The @var{update-fn} is required to be either a true function, or +a macro which evaluates its arguments in a function-like way. Also, +the @var{update-fn} is expected to return @var{value} as its result. +Otherwise, the above expansion would not obey the rules for the way +@code{setf} is supposed to behave. + +As a special (non-Common-Lisp) extension, a third argument of @code{t} +to @code{defsetf} says that the @code{update-fn}'s return value is +not suitable, so that the above @code{setf} should be expanded to +something more like + +@example +(let ((temp @var{value})) + (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} temp) + temp) +@end example + +Some examples of the use of @code{defsetf}, drawn from the standard +suite of setf methods, are: + +@example +(defsetf car setcar) +(defsetf symbol-value set) +(defsetf buffer-name rename-buffer t) +@end example +@end defmac + +@defmac defsetf access-fn arglist (store-var) forms@dots{} +This is the second, more complex, form of @code{defsetf}. It is +rather like @code{defmacro} except for the additional @var{store-var} +argument. The @var{forms} should return a Lisp form which stores +the value of @var{store-var} into the generalized variable formed +by a call to @var{access-fn} with arguments described by @var{arglist}. +The @var{forms} may begin with a string which documents the @code{setf} +method (analogous to the doc string that appears at the front of a +function). + +For example, the simple form of @code{defsetf} is shorthand for + +@example +(defsetf @var{access-fn} (&rest args) (store) + (append '(@var{update-fn}) args (list store))) +@end example + +The Lisp form that is returned can access the arguments from +@var{arglist} and @var{store-var} in an unrestricted fashion; +macros like @code{setf} and @code{cl-incf} which invoke this +setf-method will insert temporary variables as needed to make +sure the apparent order of evaluation is preserved. + +Another example drawn from the standard package: + +@example +(defsetf nth (n x) (store) + (list 'setcar (list 'nthcdr n x) store)) +@end example +@end defmac + +@defmac define-setf-method access-fn arglist forms@dots{} +This is the most general way to create new place forms. When +a @code{setf} to @var{access-fn} with arguments described by +@var{arglist} is expanded, the @var{forms} are evaluated and +must return a list of five items: + +@enumerate +@item +A list of @dfn{temporary variables}. + +@item +A list of @dfn{value forms} corresponding to the temporary variables +above. The temporary variables will be bound to these value forms +as the first step of any operation on the generalized variable. + +@item +A list of exactly one @dfn{store variable} (generally obtained +from a call to @code{gensym}). + +@item +A Lisp form which stores the contents of the store variable into +the generalized variable, assuming the temporaries have been +bound as described above. + +@item +A Lisp form which accesses the contents of the generalized variable, +assuming the temporaries have been bound. +@end enumerate + +This is exactly like the Common Lisp macro of the same name, +except that the method returns a list of five values rather +than the five values themselves, since Emacs Lisp does not +support Common Lisp's notion of multiple return values. + +Once again, the @var{forms} may begin with a documentation string. + +A setf-method should be maximally conservative with regard to +temporary variables. In the setf-methods generated by +@code{defsetf}, the second return value is simply the list of +arguments in the place form, and the first return value is a +list of a corresponding number of temporary variables generated +by @code{cl-gensym}. Macros like @code{setf} and @code{cl-incf} which +use this setf-method will optimize away most temporaries that +turn out to be unnecessary, so there is little reason for the +setf-method itself to optimize. +@end defmac + +@defun get-setf-method place &optional env +This function returns the setf-method for @var{place}, by +invoking the definition previously recorded by @code{defsetf} +or @code{define-setf-method}. The result is a list of five +values as described above. You can use this function to build +your own @code{cl-incf}-like modify macros. (Actually, it is +@c FIXME? +better to use the internal functions @code{cl-setf-do-modify} +and @code{cl-setf-do-store}, which are a bit easier to use and +which also do a number of optimizations; consult the source +code for the @code{cl-incf} function for a simple example.) + +The argument @var{env} specifies the ``environment'' to be +passed on to @code{macroexpand} if @code{get-setf-method} should +need to expand a macro in @var{place}. It should come from +an @code{&environment} argument to the macro or setf-method +that called @code{get-setf-method}. + +See also the source code for the setf-methods for @code{apply} +and @code{substring}, each of which works by calling +@code{get-setf-method} on a simpler case, then massaging +the result in various ways. +@end defun + +Modern Common Lisp defines a second, independent way to specify +the @code{setf} behavior of a function, namely ``@code{setf} +functions'' whose names are lists @code{(setf @var{name})} +rather than symbols. For example, @code{(defun (setf foo) @dots{})} +defines the function that is used when @code{setf} is applied to +@code{foo}. This package does not currently support @code{setf} +functions. In particular, it is a compile-time error to use +@code{setf} on a form which has not already been @code{defsetf}'d +or otherwise declared; in newer Common Lisps, this would not be +an error since the function @code{(setf @var{func})} might be +defined later. @node GNU Free Documentation License ------------------------------------------------------------ revno: 110714 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-10-28 18:19:26 -0700 message: * cl.texi (Setf Extensions): Remove `apply' setf since it seems to be disabled. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-10-29 01:06:13 +0000 +++ doc/misc/ChangeLog 2012-10-29 01:19:26 +0000 @@ -1,6 +1,7 @@ 2012-10-29 Glenn Morris * cl.texi (Organization): More details on cl-lib.el versus cl.el. + (Setf Extensions): Remove `apply' setf since it seems to be disabled. 2012-10-28 Glenn Morris === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2012-10-29 01:14:50 +0000 +++ doc/misc/cl.texi 2012-10-29 01:19:26 +0000 @@ -964,6 +964,8 @@ @c FIXME? Also `eq'? (see cl-lib.el) +@c Currently commented out in cl.el. +@ignore @item A call of the form @code{(apply '@var{func} @dots{})} or @code{(apply (function @var{func}) @dots{})}, where @var{func} @@ -972,6 +974,7 @@ Emacs place functions are suitable in this sense, this feature is only interesting when used with places you define yourself with @code{define-setf-method} or the long form of @code{defsetf}. +@end ignore @item A macro call, in which case the macro is expanded and @code{setf} @@ -979,7 +982,7 @@ @item Any form for which a @code{defsetf} or @code{define-setf-method} -has been made. +has been made. @xref{Obsolete Setf Customization}. @end itemize @c FIXME should this be in lispref? It seems self-evident. ------------------------------------------------------------ revno: 110713 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-10-28 18:14:50 -0700 message: Doc fix (use an alias to be consistent with the rest of this manual) diff: === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2012-10-29 01:06:13 +0000 +++ doc/misc/cl.texi 2012-10-29 01:14:50 +0000 @@ -5089,7 +5089,7 @@ They are replaced by @file{gv.el} in Emacs 24.3. @c FIXME. -@defmac define-setf-expander name arglist &rest body +@defmac define-setf-method name arglist &rest body Use @file{gv.el}. @end defmac ------------------------------------------------------------ revno: 110712 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-10-28 18:12:53 -0700 message: * lisp/emacs-lisp/cl.el (defsetf): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-29 00:06:39 +0000 +++ lisp/ChangeLog 2012-10-29 01:12:53 +0000 @@ -1,3 +1,7 @@ +2012-10-29 Glenn Morris + + * emacs-lisp/cl.el (defsetf): Doc fix. + 2012-10-29 Stefan Monnier * progmodes/sh-script.el (sh-font-lock-paren): Also put punctuation === modified file 'lisp/emacs-lisp/cl.el' --- lisp/emacs-lisp/cl.el 2012-09-28 23:51:20 +0000 +++ lisp/emacs-lisp/cl.el 2012-10-29 01:12:53 +0000 @@ -568,9 +568,9 @@ the form (setf (NAME ARGS...) VAL) are transformed to function or macro calls of the form (FUNC ARGS... VAL). Example: - (cl-defsetf aref aset) + (defsetf aref aset) -Alternate form: (cl-defsetf NAME ARGLIST (STORE) BODY...). +Alternate form: (defsetf NAME ARGLIST (STORE) BODY...). Here, the above `setf' call is expanded by binding the argument forms ARGS according to ARGLIST, binding the value form VAL to STORE, then executing BODY, which must return a Lisp form that does the necessary `setf' operation. @@ -578,7 +578,7 @@ introduced automatically to preserve proper execution order of the arguments. Example: - (cl-defsetf nth (n x) (v) `(setcar (nthcdr ,n ,x) ,v)) + (defsetf nth (n x) (v) `(setcar (nthcdr ,n ,x) ,v)) \(fn NAME [FUNC | ARGLIST (STORE) BODY...])" (declare (debug ------------------------------------------------------------ revno: 110711 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-10-28 18:06:13 -0700 message: * doc/misc/cl.texi (Organization): More details on cl-lib.el versus cl.el. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-10-28 02:34:36 +0000 +++ doc/misc/ChangeLog 2012-10-29 01:06:13 +0000 @@ -1,3 +1,7 @@ +2012-10-29 Glenn Morris + + * cl.texi (Organization): More details on cl-lib.el versus cl.el. + 2012-10-28 Glenn Morris * cl.texi (Multiple Values, Common Lisp Compatibility): === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2012-10-28 02:34:36 +0000 +++ doc/misc/cl.texi 2012-10-29 01:06:13 +0000 @@ -182,17 +182,30 @@ will take care of pulling in the other files when they are needed. -There is another file, @file{cl.el}, which was the main entry point -to the CL package prior to Emacs 24.3. Nowadays, it is replaced -by @file{cl-lib.el}. The two provide the same features, but use -different function names (in fact, @file{cl.el} just defines aliases -to the @file{cl-lib.el} definitions). In particular, the old @file{cl.el} -does not use a clean namespace. For this reason, Emacs has a policy -that packages distributed with Emacs must not load @code{cl} at run time. -(It is ok for them to load @code{cl} at @emph{compile} time, with -@code{eval-when-compile}, and use the macros it provides.) There is -no such restriction on the use of @code{cl-lib}. New code should use -@code{cl-lib} rather than @code{cl}. @xref{Naming Conventions}. +There is another file, @file{cl.el}, which was the main entry point to +the CL package prior to Emacs 24.3. Nowadays, it is replaced by +@file{cl-lib.el}. The two provide the same features (in most cases), +but use different function names (in fact, @file{cl.el} mainly just +defines aliases to the @file{cl-lib.el} definitions). Where +@file{cl-lib.el} defines a function called, for example, +@code{cl-incf}, @file{cl.el} uses the same name but without the +@samp{cl-} prefix, e.g. @code{incf} in this example. There are a few +exceptions to this. First, functions such as @code{cl-defun} where +the unprefixed version was already used for a standard Emacs Lisp +function. In such cases, the @file{cl.el} version adds a @samp{*} +suffix, e.g. @code{defun*}. Second, there are some obsolete features +that are only implemented in @file{cl.el}, not in @file{cl-lib.el}, +because they are replaced by other standard Emacs Lisp features. +Finally, in a very few cases the old @file{cl.el} versions do not +behave in exactly the same way as the @file{cl-lib.el} versions. +@xref{Obsolete Features}. + +Since the old @file{cl.el} does not use a clean namespace, Emacs has a +policy that packages distributed with Emacs must not load @code{cl} at +run time. (It is ok for them to load @code{cl} at @emph{compile} +time, with @code{eval-when-compile}, and use the macros it provides.) +There is no such restriction on the use of @code{cl-lib}. New code +should use @code{cl-lib} rather than @code{cl}. There is one more file, @file{cl-compat.el}, which defines some routines from the older Quiroz CL package that are not otherwise @@ -4666,13 +4679,6 @@ Following is a list of all known incompatibilities between this package and Common Lisp as documented in Steele (2nd edition). -@ignore -Certain function names, such as @code{member}, @code{assoc}, and -@code{floor}, were already taken by (incompatible) Emacs Lisp -functions; this package appends @samp{*} to the names of its -Common Lisp versions of these functions. -@end ignore - The word @code{cl-defun} is required instead of @code{defun} in order to use extended Common Lisp argument lists in a function. Likewise, @code{cl-defmacro} and @code{cl-function} are versions of those forms @@ -4684,6 +4690,7 @@ between IEEE floating-point plus and minus zero. The @code{cl-equalp} predicate has several differences with Common Lisp; @pxref{Predicates}. +@c FIXME no longer provided by cl. The @code{setf} mechanism is entirely compatible, except that setf-methods return a list of five values rather than five values directly. Also, the new ``@code{setf} function'' concept ------------------------------------------------------------ revno: 110710 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12547 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-10-28 20:06:39 -0400 message: * lisp/progmodes/sh-script.el (sh-font-lock-paren): Also put punctuation syntax to the matching opener, if any. (sh-smie-sh-forward-token, sh-smie-sh-backward-token): Recognize this matching open as a "case-(". (sh-smie-rc-grammar): Add a corresponding rule for it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-28 20:41:49 +0000 +++ lisp/ChangeLog 2012-10-29 00:06:39 +0000 @@ -1,3 +1,11 @@ +2012-10-29 Stefan Monnier + + * progmodes/sh-script.el (sh-font-lock-paren): Also put punctuation + syntax to the matching opener, if any (bug#12547). + (sh-smie-sh-forward-token, sh-smie-sh-backward-token): Recognize this + matching open as a "case-(". + (sh-smie-rc-grammar): Add a corresponding rule for it. + 2012-10-28 Daniel Hackney * emacs-lisp/package.el (package-generate-autoloads): Kill buffer === modified file 'lisp/progmodes/sh-script.el' --- lisp/progmodes/sh-script.el 2012-10-06 20:34:45 +0000 +++ lisp/progmodes/sh-script.el 2012-10-29 00:06:39 +0000 @@ -1033,51 +1033,57 @@ (defun sh-font-lock-paren (start) (unless (nth 8 (syntax-ppss)) (save-excursion - (goto-char start) - ;; Skip through all patterns - (while - (progn - (while - (progn - (forward-comment (- (point-max))) - (when (and (eolp) (sh-is-quoted-p (point))) - (forward-char -1) - t))) - ;; Skip through one pattern - (while - (or (/= 0 (skip-syntax-backward "w_")) - (/= 0 (skip-chars-backward "-$=?[]*@/\\\\")) - (and (sh-is-quoted-p (1- (point))) - (goto-char (- (point) 2))) - (when (memq (char-before) '(?\" ?\' ?\})) - (condition-case nil (progn (backward-sexp 1) t) - (error nil))))) - ;; Patterns can be preceded by an open-paren (Bug#1320). - (if (eq (char-before (point)) ?\() + (let ((open nil)) + (goto-char start) + ;; Skip through all patterns + (while + (progn + (while + (progn + (forward-comment (- (point-max))) + (when (and (eolp) (sh-is-quoted-p (point))) + (forward-char -1) + t))) + ;; Skip through one pattern + (while + (or (/= 0 (skip-syntax-backward "w_")) + (/= 0 (skip-chars-backward "-$=?[]*@/\\\\")) + (and (sh-is-quoted-p (1- (point))) + (goto-char (- (point) 2))) + (when (memq (char-before) '(?\" ?\' ?\})) + (condition-case nil (progn (backward-sexp 1) t) + (error nil))))) + ;; Patterns can be preceded by an open-paren (bug#1320). + (when (eq (char-before (point)) ?\() + (backward-char 1) + (setq open (point))) + (while (progn + (forward-comment (- (point-max))) + ;; Maybe we've bumped into an escaped newline. + (sh-is-quoted-p (point))) (backward-char 1)) - (while (progn - (forward-comment (- (point-max))) - ;; Maybe we've bumped into an escaped newline. - (sh-is-quoted-p (point))) - (backward-char 1)) - (when (eq (char-before) ?|) - (backward-char 1) t))) - (and (> (point) (1+ (point-min))) - (progn (backward-char 2) - (if (> start (line-end-position)) - (put-text-property (point) (1+ start) - 'syntax-multiline t)) - ;; FIXME: The `in' may just be a random argument to - ;; a normal command rather than the real `in' keyword. - ;; I.e. we should look back to try and find the - ;; corresponding `case'. - (and (looking-at ";[;&]\\|\\_ (point) (1+ (point-min))) + (progn (backward-char 2) + (if (> start (line-end-position)) + (put-text-property (point) (1+ start) + 'syntax-multiline t)) + ;; FIXME: The `in' may just be a random argument to + ;; a normal command rather than the real `in' keyword. + ;; I.e. we should look back to try and find the + ;; corresponding `case'. + (and (looking-at ";[;&]\\|\\_ committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-10-28 16:41:49 -0400 message: * lisp/emacs-lisp/package.el (package-generate-autoloads): Kill buffer "PKGNAME-autoloads.el" in case we created it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-28 19:07:52 +0000 +++ lisp/ChangeLog 2012-10-28 20:41:49 +0000 @@ -1,3 +1,8 @@ +2012-10-28 Daniel Hackney + + * emacs-lisp/package.el (package-generate-autoloads): Kill buffer + "PKGNAME-autoloads.el" in case we created it. + 2012-10-28 Stefan Monnier * minibuffer.el (completion--sifn-requote): Rewrite to handle things === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2012-10-25 12:38:09 +0000 +++ lisp/emacs-lisp/package.el 2012-10-28 20:41:49 +0000 @@ -590,7 +590,9 @@ (version-control 'never)) (unless (fboundp 'autoload-ensure-default-file) (package-autoload-ensure-default-file generated-autoload-file)) - (update-directory-autoloads pkg-dir))) + (update-directory-autoloads pkg-dir) + (let ((buf (find-buffer-visiting generated-autoload-file))) + (when buf (kill-buffer buf))))) (defvar tar-parse-info) (declare-function tar-untar-buffer "tar-mode" ()) ------------------------------------------------------------ revno: 110708 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11714 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-10-28 15:07:52 -0400 message: * lisp/minibuffer.el (completion--twq-all): Disable too-strict assertions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-28 18:48:17 +0000 +++ lisp/ChangeLog 2012-10-28 19:07:52 +0000 @@ -2,6 +2,7 @@ * minibuffer.el (completion--sifn-requote): Rewrite to handle things like Tramp's "/foo:~bar//baz" -> "/scpc:foo:/baz" mapping (bug#11714). + (completion--twq-all): Disable too-strict assertions. * tmm.el (tmm-prompt): Use map-keymap (bug#12744). === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2012-10-28 18:48:17 +0000 +++ lisp/minibuffer.el 2012-10-28 19:07:52 +0000 @@ -529,10 +529,12 @@ (`(,qfullpos . ,qfun) (funcall requote (+ boundary (length prefix)) string)) (qfullprefix (substring string 0 qfullpos)) - (_ (cl-assert (completion--string-equal-p - (funcall unquote qfullprefix) - (concat (substring ustring 0 boundary) prefix)) - t)) + ;; FIXME: This assertion can be wrong, e.g. in Cygwin, where + ;; (unquote "c:\bin") => "/usr/bin" but (unquote "c:\") => "/". + ;;(cl-assert (completion--string-equal-p + ;; (funcall unquote qfullprefix) + ;; (concat (substring ustring 0 boundary) prefix)) + ;; t)) (qboundary (car (funcall requote boundary string))) (_ (cl-assert (<= qboundary qfullpos))) ;; FIXME: this split/quote/concat business messes up the carefully @@ -561,14 +563,16 @@ (let* ((new (substring completion (length prefix))) (qnew (funcall qfun new)) (qcompletion (concat qprefix qnew))) - (cl-assert - (completion--string-equal-p - (funcall unquote - (concat (substring string 0 qboundary) - qcompletion)) - (concat (substring ustring 0 boundary) - completion)) - t) + ;; FIXME: Similarly here, Cygwin's mapping trips this + ;; assertion. + ;;(cl-assert + ;; (completion--string-equal-p + ;; (funcall unquote + ;; (concat (substring string 0 qboundary) + ;; qcompletion)) + ;; (concat (substring ustring 0 boundary) + ;; completion)) + ;; t) qcompletion)) completions) qboundary)))) ------------------------------------------------------------ revno: 110707 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11714 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-10-28 14:48:17 -0400 message: * lisp/minibuffer.el (completion--sifn-requote): Rewrite to handle things like Tramp's "/foo:~bar//baz" -> "/scpc:foo:/baz" mapping. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-28 14:56:51 +0000 +++ lisp/ChangeLog 2012-10-28 18:48:17 +0000 @@ -1,5 +1,8 @@ 2012-10-28 Stefan Monnier + * minibuffer.el (completion--sifn-requote): Rewrite to handle things + like Tramp's "/foo:~bar//baz" -> "/scpc:foo:/baz" mapping (bug#11714). + * tmm.el (tmm-prompt): Use map-keymap (bug#12744). 2012-10-27 Eli Zaretskii === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2012-10-26 20:44:38 +0000 +++ lisp/minibuffer.el 2012-10-28 18:48:17 +0000 @@ -378,6 +378,8 @@ ;; that `concat' and `unquote' commute (which tends to be the case). ;; And we ask `requote' to do the work of mapping from unquoted positions ;; back to quoted positions. + ;; FIXME: For some forms of "quoting" such as the truncation behavior of + ;; substitute-in-file-name, it would be desirable not to requote completely. "Return a new completion table operating on quoted text. TABLE operates on the unquoted text. UNQUOTE is a function that takes a string and returns a new unquoted string. @@ -2161,53 +2163,49 @@ "use the regular PRED argument" "23.2") (defun completion--sifn-requote (upos qstr) - ;; We're looking for `qupos' such that: + ;; We're looking for `qpos' such that: ;; (equal (substring (substitute-in-file-name qstr) 0 upos) - ;; (substitute-in-file-name (substring qstr 0 qupos))) + ;; (substitute-in-file-name (substring qstr 0 qpos))) ;; Big problem here: we have to reverse engineer substitute-in-file-name to ;; find the position corresponding to UPOS in QSTR, but ;; substitute-in-file-name can do anything, depending on file-name-handlers. + ;; substitute-in-file-name does the following kind of things: + ;; - expand env-var references. + ;; - turn backslashes into slashes. + ;; - truncate some prefix of the input. + ;; - rewrite some prefix. + ;; Some of these operations are written in external libraries and we'd rather + ;; not hard code any assumptions here about what they actually do. IOW, we + ;; want to treat substitute-in-file-name as a black box, as much as possible. ;; Kind of like in rfn-eshadow-update-overlay, only worse. - ;; FIXME: example of thing we do not handle: Tramp's makes - ;; (substitute-in-file-name "/foo:~/bar//baz") -> "/scpc:foo:/baz". - ;; FIXME: One way to try and handle "all" cases is to require - ;; substitute-in-file-name to preserve text-properties, so we could - ;; apply text-properties to the input string and then look for them in - ;; the output to understand what comes from where. - (let ((qpos 0)) - ;; Handle substitute-in-file-name's truncation behavior. - (let (tpos) - (while (and (string-match "[\\/][~/\\]" qstr qpos) - ;; Hopefully our regexp covers all truncation cases. - ;; Also let's make sure sifn indeed truncates here. + ;; Example of things we need to handle: + ;; - Tramp (substitute-in-file-name "/foo:~/bar//baz") => "/scpc:foo:/baz". + ;; - Cygwin (substitute-in-file-name "C:\bin") => "/usr/bin" + ;; (substitute-in-file-name "C:\") => "/" + ;; (substitute-in-file-name "C:\bi") => "/bi" + (let* ((ustr (substitute-in-file-name qstr)) + (uprefix (substring ustr 0 upos)) + qprefix) + ;; Main assumption: nothing after qpos should affect the text before upos, + ;; so we can work our way backward from the end of qstr, one character + ;; at a time. + ;; Second assumptions: If qpos is far from the end this can be a bit slow, + ;; so we speed it up by doing a first loop that skips a word at a time. + ;; This word-sized loop is careful not to cut in the middle of env-vars. + (while (let ((boundary (string-match "\\(\\$+{?\\)?\\w+\\W*\\'" qstr))) + (and boundary (progn - (setq tpos (1+ (match-beginning 0))) - (equal (substitute-in-file-name qstr) - (substitute-in-file-name (substring qstr tpos))))) - (setq qpos tpos))) - ;; `upos' is relative to the position corresponding to `qpos' in - ;; (substitute-in-file-name qstr), so as qpos moves forward, upos - ;; gets smaller. - (while (and (> upos 0) - (string-match "\\$\\(\\$\\|\\([[:alnum:]_]+\\|{[^}]*}\\)\\)?" - qstr qpos)) - (cond - ((>= (- (match-beginning 0) qpos) upos) ; UPOS is before current match. - (setq qpos (+ qpos upos)) - (setq upos 0)) - ((not (match-end 1)) ;A sole $: probably an error. - (setq upos (- upos (- (match-end 0) qpos))) - (setq qpos (match-end 0))) - (t - (setq upos (- upos (- (match-beginning 0) qpos))) - (setq qpos (match-end 0)) - (setq upos (- upos (length (substitute-in-file-name - (match-string 0 qstr)))))))) - ;; If `upos' is negative, it's because it's within the expansion of an - ;; envvar, i.e. there is no exactly matching qpos, so we just use the next - ;; available qpos right after the envvar. - (cons (if (>= upos 0) (+ qpos upos) qpos) - #'minibuffer--double-dollars))) + (setq qprefix (substring qstr 0 boundary)) + (string-prefix-p uprefix + (substitute-in-file-name qprefix))))) + (setq qstr qprefix)) + (let ((qpos (length qstr))) + (while (and (> qpos 0) + (string-prefix-p uprefix + (substitute-in-file-name + (substring qstr 0 (1- qpos))))) + (setq qpos (1- qpos))) + (cons qpos #'minibuffer--double-dollars)))) (defalias 'completion--file-name-table (completion-table-with-quoting #'completion-file-name-table ------------------------------------------------------------ revno: 110706 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-10-28 19:42:52 +0200 message: Don't use CLOCKS_PER_SEC in w32 timers. src/w32proc.c (TIMER_TICKS_PER_SEC): New macro. (timer_loop, getitimer, setitimer): Use it instead of CLOCKS_PER_SEC, which is no longer pertinent, since we don't use 'clock'. (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a literal 10000. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-28 16:10:06 +0000 +++ src/ChangeLog 2012-10-28 17:42:52 +0000 @@ -1,3 +1,12 @@ +2012-10-28 Eli Zaretskii + + * w32proc.c (TIMER_TICKS_PER_SEC): New macro. + (timer_loop, getitimer, setitimer): Use it instead of + CLOCKS_PER_SEC, which is no longer pertinent, since we don't use + 'clock'. + (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a + literal 10000. + 2012-10-28 Jan Djärv * nsterm.m (NO_APPDEFINED_DATA): New define. === modified file 'src/w32proc.c' --- src/w32proc.c 2012-10-27 19:43:48 +0000 +++ src/w32proc.c 2012-10-28 17:42:52 +0000 @@ -272,6 +272,9 @@ static GetThreadTimes_Proc s_pfn_Get_Thread_Times; +#define MAX_SINGLE_SLEEP 30 +#define TIMER_TICKS_PER_SEC 1000 + /* Return a suitable time value, in 1-ms units, for THREAD, a handle to a thread. If THREAD is NULL or an invalid handle, return the current wall-clock time since January 1, 1601 (UTC). Otherwise, @@ -282,6 +285,8 @@ { ULONGLONG retval; int use_system_time = 1; + /* The functions below return times in 100-ns units. */ + const int tscale = 10 * TIMER_TICKS_PER_SEC; if (thread && thread != INVALID_HANDLE_VALUE && s_pfn_Get_Thread_Times != NULL) @@ -300,8 +305,8 @@ temp_user.LowPart = user_ftime.dwLowDateTime; temp_user.HighPart = user_ftime.dwHighDateTime; retval = - temp_creation.QuadPart / 10000 + temp_kernel.QuadPart / 10000 - + temp_user.QuadPart / 10000; + temp_creation.QuadPart / tscale + temp_kernel.QuadPart / tscale + + temp_user.QuadPart / tscale; } else DebPrint (("GetThreadTimes failed with error code %lu\n", @@ -318,14 +323,12 @@ temp.LowPart = current_ftime.dwLowDateTime; temp.HighPart = current_ftime.dwHighDateTime; - retval = temp.QuadPart / 10000; + retval = temp.QuadPart / tscale; } return retval; } -#define MAX_SINGLE_SLEEP 30 - /* Thread function for a timer thread. */ static DWORD WINAPI timer_loop (LPVOID arg) @@ -334,7 +337,7 @@ int which = itimer->type; int sig = (which == ITIMER_REAL) ? SIGALRM : SIGPROF; CRITICAL_SECTION *crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; - const DWORD max_sleep = MAX_SINGLE_SLEEP * 1000 / CLOCKS_PER_SEC; + const DWORD max_sleep = MAX_SINGLE_SLEEP * 1000 / TIMER_TICKS_PER_SEC; HANDLE hth = (which == ITIMER_REAL) ? NULL : itimer->caller_thread; while (1) @@ -379,7 +382,7 @@ return 0; if (sleep_time > 0) { - Sleep (sleep_time * 1000 / CLOCKS_PER_SEC); + Sleep (sleep_time * 1000 / TIMER_TICKS_PER_SEC); /* Always sleep past the expiration time, to make sure we never call the handler _before_ the expiration time, always slightly after it. Sleep(5) makes sure we don't @@ -629,11 +632,13 @@ if (expire) expire -= ticks_now; - value->it_value.tv_sec = expire / CLOCKS_PER_SEC; - usecs = (expire % CLOCKS_PER_SEC) * (__int64)1000000 / CLOCKS_PER_SEC; + value->it_value.tv_sec = expire / TIMER_TICKS_PER_SEC; + usecs = + (expire % TIMER_TICKS_PER_SEC) * (__int64)1000000 / TIMER_TICKS_PER_SEC; value->it_value.tv_usec = usecs; - value->it_interval.tv_sec = reload / CLOCKS_PER_SEC; - usecs = (reload % CLOCKS_PER_SEC) * (__int64)1000000 / CLOCKS_PER_SEC; + value->it_interval.tv_sec = reload / TIMER_TICKS_PER_SEC; + usecs = + (reload % TIMER_TICKS_PER_SEC) * (__int64)1000000 / TIMER_TICKS_PER_SEC; value->it_interval.tv_usec= usecs; return 0; @@ -690,26 +695,26 @@ return 0; } - reload = value->it_interval.tv_sec * CLOCKS_PER_SEC; + reload = value->it_interval.tv_sec * TIMER_TICKS_PER_SEC; usecs = value->it_interval.tv_usec; if (value->it_interval.tv_sec == 0 - && usecs && usecs * CLOCKS_PER_SEC < clocks_min * 1000000) + && usecs && usecs * TIMER_TICKS_PER_SEC < clocks_min * 1000000) reload = clocks_min; else { - usecs *= CLOCKS_PER_SEC; + usecs *= TIMER_TICKS_PER_SEC; reload += usecs / 1000000; } - expire = value->it_value.tv_sec * CLOCKS_PER_SEC; + expire = value->it_value.tv_sec * TIMER_TICKS_PER_SEC; usecs = value->it_value.tv_usec; if (value->it_value.tv_sec == 0 - && usecs * CLOCKS_PER_SEC < clocks_min * 1000000) + && usecs * TIMER_TICKS_PER_SEC < clocks_min * 1000000) expire = clocks_min; else { - usecs *= CLOCKS_PER_SEC; + usecs *= TIMER_TICKS_PER_SEC; expire += usecs / 1000000; } ------------------------------------------------------------ revno: 110705 fixes bug: http://debbugs.gnu.org/12698 committer: Jan D. branch nick: trunk timestamp: Sun 2012-10-28 17:10:06 +0100 message: * nsterm.m (NO_APPDEFINED_DATA): New define. (last_appdefined_event_data): New variable (last_appdefined_event): Remove. (ns_select): Initialize t from last_appdefined_event_data instead of [last_appdefined_event data1]. (sendEvent:): Save [theEvent data1] to last_appdefined_event_data, remove last_appdefined_event. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-28 15:52:42 +0000 +++ src/ChangeLog 2012-10-28 16:10:06 +0000 @@ -1,3 +1,13 @@ +2012-10-28 Jan Djärv + + * nsterm.m (NO_APPDEFINED_DATA): New define. + (last_appdefined_event_data): New variable + (last_appdefined_event): Remove. + (ns_select): Initialize t from last_appdefined_event_data instead + of [last_appdefined_event data1]. + (sendEvent:): Save [theEvent data1] to last_appdefined_event_data, + remove last_appdefined_event (Bug#12698). + 2012-10-28 Stefan Monnier * frame.c (x_set_font): Catch internal error. === modified file 'src/nsterm.m' --- src/nsterm.m 2012-10-18 18:54:37 +0000 +++ src/nsterm.m 2012-10-28 16:10:06 +0000 @@ -190,7 +190,8 @@ /* event loop */ static BOOL send_appdefined = YES; -static NSEvent *last_appdefined_event = 0; +#define NO_APPDEFINED_DATA (-8) +static int last_appdefined_event_data = NO_APPDEFINED_DATA; static NSTimer *timed_entry = 0; static NSTimer *scroll_repeat_entry = nil; static fd_set select_readfds, select_writefds; @@ -3436,8 +3437,7 @@ -------------------------------------------------------------------------- */ { int result; - NSEvent *ev; - int k, nr = 0; + int t, k, nr = 0; struct input_event event; char c; @@ -3521,16 +3521,11 @@ } unblock_input (); - ev = last_appdefined_event; + t = last_appdefined_event_data; - if (ev) + if (t != NO_APPDEFINED_DATA) { - int t; - if ([ev type] != NSApplicationDefined) - emacs_abort (); - - t = [ev data1]; - last_appdefined_event = 0; + last_appdefined_event_data = NO_APPDEFINED_DATA; if (t == -2) { @@ -4307,7 +4302,7 @@ modal loop. Just defer it until later. */ if ([NSApp modalWindow] == nil) { - last_appdefined_event = theEvent; + last_appdefined_event_data = [theEvent data1]; [self stop: self]; } else ------------------------------------------------------------ revno: 110704 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-10-28 11:52:42 -0400 message: * src/frame.c (x_set_font): Catch internal error. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-27 19:43:48 +0000 +++ src/ChangeLog 2012-10-28 15:52:42 +0000 @@ -1,7 +1,11 @@ +2012-10-28 Stefan Monnier + + * frame.c (x_set_font): Catch internal error. + 2012-10-27 Eli Zaretskii - Avoid overflow in w32 implementation of interval timers. When - possible, for ITIMER_PROF count only times the main thread + Avoid overflow in w32 implementation of interval timers. + When possible, for ITIMER_PROF count only times the main thread actually executes. * w32proc.c : 'expire' and 'reload' are now 'volatile ULONGLONG' types. All the other data which was @@ -11,8 +15,8 @@ for the timer. (timer_loop): Enter critical section when accessing ULONGLONG values of the itimer_data struct, as these accesses are no longer - atomic. Call 'w32_get_timer_time' instead of 'clock'. Remove - unused variable. + atomic. Call 'w32_get_timer_time' instead of 'clock'. + Remove unused variable. (init_timers): Initialize s_pfn_Get_Thread_Times. (start_timer_thread): Don't assign itimer->caller_thread here. (getitimer): Assign itimer->caller_thread here. @@ -92,8 +96,8 @@ 2012-10-19 Eli Zaretskii - * puresize.h (BASE_PURESIZE): Bump the base value to 1700000. See - http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html + * puresize.h (BASE_PURESIZE): Bump the base value to 1700000. + See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html for the reasons. * alloc.c (NSTATICS): Decrease to 0x800. @@ -712,8 +716,8 @@ (ns_clear_frame_area): Remove resize handle code. * nsfns.m (ns_in_resize): Remove. - (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove - ns_in_resize check. + (x_set_icon_name, ns_set_name, ns_set_name_as_filename): + Remove ns_in_resize check. 2012-10-07 Paul Eggert === modified file 'src/frame.c' --- src/frame.c 2012-10-20 21:30:51 +0000 +++ src/frame.c 2012-10-28 15:52:42 +0000 @@ -3242,6 +3242,9 @@ Lisp_Object ascii_font = fontset_ascii (fontset); Lisp_Object spec = font_spec_from_name (ascii_font); + if (NILP (spec)) + signal_error ("Invalid font name", ascii_font); + if (! font_match_p (spec, font_object)) fontset = -1; } ------------------------------------------------------------ revno: 110703 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12740 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-10-28 11:34:52 -0400 message: * lisp/erc/erc-backend.el: Fix last bug number. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2012-10-28 15:32:15 +0000 +++ lisp/erc/ChangeLog 2012-10-28 15:34:52 +0000 @@ -1,6 +1,6 @@ 2012-10-28 Stefan Monnier - * erc-backend.el: Only require `erc' during compilation (bug#12486). + * erc-backend.el: Only require `erc' during compilation (bug#12740). 2012-10-18 Stefan Monnier ------------------------------------------------------------ revno: 110702 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12486 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-10-28 11:32:15 -0400 message: * lisp/erc/erc-backend.el: Only require `erc' during compilation. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2012-10-18 15:51:28 +0000 +++ lisp/erc/ChangeLog 2012-10-28 15:32:15 +0000 @@ -1,3 +1,7 @@ +2012-10-28 Stefan Monnier + + * erc-backend.el: Only require `erc' during compilation (bug#12486). + 2012-10-18 Stefan Monnier * erc-backend.el: Require `erc' instead of autoloading its macros === modified file 'lisp/erc/erc-backend.el' --- lisp/erc/erc-backend.el 2012-10-18 15:51:28 +0000 +++ lisp/erc/erc-backend.el 2012-10-28 15:32:15 +0000 @@ -102,8 +102,7 @@ ;; There's a fairly strong mutual dependency between erc.el and erc-backend.el. ;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the ;; reverse is true: -(provide 'erc-backend) -(require 'erc) +(eval-when-compile (provide 'erc-backend) (require 'erc)) ;;;; Variables and options ------------------------------------------------------------ revno: 110701 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12744 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-10-28 10:56:51 -0400 message: * lisp/tmm.el (tmm-prompt): Use map-keymap. * doc/lispref/keymaps.texi (Format of Keymaps): Document the multiple inheritance format. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-10-28 12:56:15 +0000 +++ doc/lispref/ChangeLog 2012-10-28 14:56:51 +0000 @@ -1,3 +1,8 @@ +2012-10-28 Stefan Monnier + + * keymaps.texi (Format of Keymaps): Document the multiple + inheritance format. + 2012-10-28 Martin Rudalics * windows.texi (Basic Windows): Reformulate description of live, === modified file 'doc/lispref/keymaps.texi' --- doc/lispref/keymaps.texi 2012-10-24 03:48:50 +0000 +++ doc/lispref/keymaps.texi 2012-10-28 14:56:51 +0000 @@ -210,6 +210,11 @@ have a string as an element. This is called the @dfn{overall prompt string} and makes it possible to use the keymap as a menu. @xref{Defining Menus}. + +@item (keymap @dots{}) +If an element of a keymap is itself a keymap, it counts as if this inner keymap +were inlined in the outer keymap. This is used for multiple-inheritance, such +as in @code{make-composed-keymap}. @end table When the binding is @code{nil}, it doesn't constitute a definition === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-27 09:54:04 +0000 +++ lisp/ChangeLog 2012-10-28 14:56:51 +0000 @@ -1,3 +1,7 @@ +2012-10-28 Stefan Monnier + + * tmm.el (tmm-prompt): Use map-keymap (bug#12744). + 2012-10-27 Eli Zaretskii * profiler.el (profiler-report-make-entry-part): Fix help-echo === modified file 'lisp/tmm.el' --- lisp/tmm.el 2012-06-07 16:35:00 +0000 +++ lisp/tmm.el 2012-10-28 14:56:51 +0000 @@ -165,13 +165,15 @@ ;; tmm-km-list is an alist of (STRING . MEANING). ;; It has no other elements. ;; The order of elements in tmm-km-list is the order of the menu bar. - (dolist (elt menu) - (cond - ((stringp elt) (setq gl-str elt)) - ((listp elt) (tmm-get-keymap elt not-menu)) - ((vectorp elt) - (dotimes (i (length elt)) - (tmm-get-keymap (cons i (aref elt i)) not-menu))))) + (if (not not-menu) + (map-keymap (lambda (k v) (tmm-get-keymap (cons k v))) menu) + (dolist (elt menu) + (cond + ((stringp elt) (setq gl-str elt)) + ((listp elt) (tmm-get-keymap elt not-menu)) + ((vectorp elt) + (dotimes (i (length elt)) + (tmm-get-keymap (cons i (aref elt i)) not-menu)))))) ;; Choose an element of tmm-km-list; put it in choice. (if (and not-menu (= 1 (length tmm-km-list))) ;; If this is the top-level of an x-popup-menu menu, @@ -432,7 +434,7 @@ (or (keymapp (cdr-safe (cdr-safe elt))) (eq (car (cdr-safe (cdr-safe elt))) 'lambda)) (and (symbolp (cdr-safe (cdr-safe elt))) - (fboundp (cdr-safe (cdr-safe elt))))) + (fboundp (cdr-safe (cdr-safe elt))))) (setq km (cddr elt)) (and (stringp (car elt)) (setq str (car elt)))) @@ -458,14 +460,15 @@ (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda)) (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt)))) (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) - ; New style of easy-menu + ; New style of easy-menu (setq km (cdr (cddr elt))) (and (stringp (car elt)) (setq str (car elt)))) ((stringp event) ; x-popup or x-popup element - (if (or in-x-menu (stringp (car-safe elt))) - (setq str event event nil km elt) - (setq str event event nil km (cons 'keymap elt))))) + (setq str event) + (setq event nil) + (setq km (if (or in-x-menu (stringp (car-safe elt))) + elt (cons 'keymap elt))))) (unless (or (eq km 'ignore) (null str)) (let ((binding (where-is-internal km nil t))) (when binding ------------------------------------------------------------ revno: 110700 committer: martin rudalics branch nick: trunk timestamp: Sun 2012-10-28 13:56:15 +0100 message: Reformulate description of windows basics. Describe changes in window ordering. * windows.texi (Basic Windows): Reformulate description of live, internal and valid windows. (Cyclic Window Ordering): Describe new argument of get-lru-window and get-largest-window. Add description of window-in-direction. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-10-27 22:42:07 +0000 +++ doc/lispref/ChangeLog 2012-10-28 12:56:15 +0000 @@ -1,3 +1,11 @@ +2012-10-28 Martin Rudalics + + * windows.texi (Basic Windows): Reformulate description of live, + internal and valid windows. + (Cyclic Window Ordering): Describe new argument of + get-lru-window and get-largest-window. Add description of + window-in-direction. + 2012-10-27 Glenn Morris * variables.texi (Generalized Variables): New section, === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2012-10-27 05:03:52 +0000 +++ doc/lispref/windows.texi 2012-10-28 12:56:15 +0000 @@ -76,30 +76,35 @@ deleted, the change in window space is taken from or given to the adjacent windows, so that the total area of the frame is unchanged. -@cindex live windows -@cindex internal windows - A @dfn{live window} is one that is actually displaying a buffer in a -frame. Such a window can be @dfn{deleted}, i.e. removed from the -frame (@pxref{Deleting Windows}); then it is no longer live, but the -Lisp object representing it might be still referenced from other Lisp -objects. A deleted window may be brought back to life by restoring a -saved window configuration (@pxref{Window Configurations}). - @defun windowp object This function returns @code{t} if @var{object} is a window (whether or -not it is live). Otherwise, it returns @code{nil}. +not it displays a buffer). Otherwise, it returns @code{nil}. @end defun +@cindex live windows +A @dfn{live window} is one that is actually displaying a buffer in a +frame. + @defun window-live-p object This function returns @code{t} if @var{object} is a live window and @code{nil} otherwise. A live window is one that displays a buffer. @end defun - The windows in each frame are organized into a @dfn{window tree}. -@xref{Windows and Frames}. The leaf nodes of each window tree are -live windows---the ones actually displaying buffers. The internal -nodes of the window tree are internal windows, which are not live. -You can distinguish internal windows from deleted windows with +@cindex internal windows +The windows in each frame are organized into a @dfn{window tree}. +@xref{Windows and Frames}. The leaf nodes of each window tree are live +windows---the ones actually displaying buffers. The internal nodes of +the window tree are @dfn{internal windows}, which are not live. + +@cindex valid windows + A @dfn{valid window} is one that is either live or internal. A valid +window can be @dfn{deleted}, i.e. removed from its frame +(@pxref{Deleting Windows}); then it is no longer valid, but the Lisp +object representing it might be still referenced from other Lisp +objects. A deleted window may be made valid again by restoring a saved +window configuration (@pxref{Window Configurations}). + + You can distinguish valid windows from deleted windows with @code{window-valid-p}. @defun window-valid-p object @@ -1317,31 +1322,37 @@ criterion, without selecting it: @cindex least recently used window -@defun get-lru-window &optional all-frames dedicated +@defun get-lru-window &optional all-frames dedicated not-selected This function returns a live window which is heuristically the ``least recently used'' window. The optional argument @var{all-frames} has the same meaning as in @code{next-window}. If any full-width windows are present, only those windows are -considered. The selected window is never returned, unless it is the -only candidate. A minibuffer window is never a candidate. A -dedicated window (@pxref{Dedicated Windows}) is never a candidate -unless the optional argument @var{dedicated} is non-@code{nil}. +considered. A minibuffer window is never a candidate. A dedicated +window (@pxref{Dedicated Windows}) is never a candidate unless the +optional argument @var{dedicated} is non-@code{nil}. The selected +window is never returned, unless it is the only candidate. However, if +the optional argument @var{not-selected} is non-@code{nil}, this +function returns @code{nil} in that case. @end defun @cindex largest window -@defun get-largest-window &optional all-frames dedicated +@defun get-largest-window &optional all-frames dedicated not-selected This function returns the window with the largest area (height times -width). A minibuffer window is never a candidate. A dedicated window +width). The optional argument @var{all-frames} specifies the windows to +search, and has the same meaning as in @code{next-window}. + +A minibuffer window is never a candidate. A dedicated window (@pxref{Dedicated Windows}) is never a candidate unless the optional -argument @var{dedicated} is non-@code{nil}. +argument @var{dedicated} is non-@code{nil}. The selected window is not +a candidate if the optional argument @var{not-selected} is +non-@code{nil}. If the optional argument @var{not-selected} is +non-@code{nil} and the selected window is the only candidate, this +function returns @code{nil}. If there are two candidate windows of the same size, this function prefers the one that comes first in the cyclic ordering of windows, starting from the selected window. - -The optional argument @var{all-frames} specifies the windows to -search, and has the same meaning as in @code{next-window}. @end defun @cindex window that satisfies a predicate @@ -1359,6 +1370,26 @@ @code{next-window}. @end defun +@cindex window in direction +@defun window-in-direction direction &optional window ignore +This function returns the nearest window in direction @var{direction} as +seen from the position of @code{window-point} in window @var{window}. +The argument @var{direction} must be one of @code{above}, @code{below}, +@code{left} or @code{right}. The optional argument @var{window} must +denote a live window and defaults to the selected one. + +This function does not return a window whose @code{no-other-window} +parameter is non-@code{nil}. If the nearest window's +@code{no-other-window} parameter is non-@code{nil}, this function tries +to find another window in the indicated direction whose +@code{no-other-window} parameter is @code{nil}. If the optional +argument @var{ignore} is non-@code{nil}, a window may be returned even +if its @code{no-other-window} parameter is non-@code{nil}. + +If it doesn't find a suitable window, this function returns @code{nil}. +@end defun + + @node Buffers and Windows @section Buffers and Windows @cindex examining windows ------------------------------------------------------------ revno: 110699 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-10-27 19:34:36 -0700 message: More cl.texi updates * doc/misc/cl.texi (Multiple Values, Common Lisp Compatibility): More namespace updates. (Obsolete Features): Copyedits. (Obsolete Lexical Macros, Obsolete Setf Customization): New subsections. * etc/NEWS: Related edits. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-10-28 02:05:04 +0000 +++ doc/misc/ChangeLog 2012-10-28 02:34:36 +0000 @@ -1,5 +1,11 @@ 2012-10-28 Glenn Morris + * cl.texi (Multiple Values, Common Lisp Compatibility): + More namespace updates. + (Obsolete Features): Copyedits. + (Obsolete Lexical Macros, Obsolete Setf Customization): + New subsections. + * cl.texi (Porting Common Lisp, Lexical Bindings): Add some xrefs to the Elisp manual. === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2012-10-28 02:05:04 +0000 +++ doc/misc/cl.texi 2012-10-28 02:34:36 +0000 @@ -806,7 +806,7 @@ constructs. @c FIXME -@c flet is not cl-flet, values is not cl-values. +@c flet is not cl-flet. @menu * Assignment:: The @code{cl-psetq} form. * Generalized Variables:: Extensions to generalized variables. @@ -815,7 +815,7 @@ * Blocks and Exits:: @code{cl-block}, @code{cl-return}, @code{cl-return-from}. * Iteration:: @code{cl-do}, @code{cl-dotimes}, @code{cl-dolist}, @code{cl-do-symbols}. * Loop Facility:: The Common Lisp @code{cl-loop} macro. -* Multiple Values:: @code{values}, @code{cl-multiple-value-bind}, etc. +* Multiple Values:: @code{cl-values}, @code{cl-multiple-value-bind}, etc. @end menu @node Assignment @@ -2660,7 +2660,7 @@ @code{get-setf-method}). This package @emph{does} define placeholders for the Common Lisp functions that work with multiple values, but in Emacs Lisp these functions simply operate on lists instead. -The @code{values} form, for example, is a synonym for @code{list} +The @code{cl-values} form, for example, is a synonym for @code{list} in Emacs. @defmac cl-multiple-value-bind (var@dots{}) values-form forms@dots{} @@ -4701,9 +4701,9 @@ The multiple-value return facility treats lists as multiple values, since Emacs Lisp cannot support multiple return values directly. The macros will be compatible with Common Lisp if -@code{values} or @code{values-list} is always used to return to +@code{cl-values} or @code{cl-values-list} is always used to return to a @code{cl-multiple-value-bind} or other multiple-value receiver; -if @code{values} is used without @code{cl-multiple-value-@dots{}} +if @code{cl-values} is used without @code{cl-multiple-value-@dots{}} or vice-versa the effect will be different from Common Lisp. Many Common Lisp declarations are ignored, and others match @@ -4927,11 +4927,15 @@ @appendix Obsolete Features This section describes some features of the package that are obsolete -and should not be used in new code. They are only provided by the old -@file{cl.el} entry point, not by the newer @file{cl-lib.el}. +and should not be used in new code. They are either only provided by +the old @file{cl.el} entry point, not by the newer @file{cl-lib.el}; +or where versions with a @samp{cl-} prefix do exist they do not behave +in exactly the same way. @menu -* Lexical Bindings:: An approximation of lexical binding. +* Lexical Bindings:: An approximation of lexical binding. +* Obsolete Lexical Macros:: Obsolete macros using lexical-let. +* Obsolete Setf Customization:: Obsolete ways to customize setf. @end menu @node Lexical Bindings @@ -5050,6 +5054,46 @@ are made sequentially in the manner of @code{let*}. @end defmac +@node Obsolete Lexical Macros +@appendixsec Macros Defined Using Lexical-Let + +The following macros are defined using @code{lexical-let}. +They are replaced by versions with a @samp{cl-} prefix that use true +lexical binding (and hence rely on @code{lexical-binding} being set to +@code{t} in code using them). + +@defmac flet (bindings@dots{}) forms@dots{} +Replaced by @code{cl-flet} (@pxref{Function Bindings}) +or @code{cl-letf} (@pxref{Modify Macros}). +@end defmac + +@defmac labels (bindings@dots{}) forms@dots{} +Replaced by @code{cl-labels} (@pxref{Function Bindings}). +@end defmac + +@defmac letf (bindings@dots{}) forms@dots{} +Replaced by @code{cl-letf} (@pxref{Modify Macros}). +@end defmac + +@node Obsolete Setf Customization +@appendixsec Obsolete Ways to Customize Setf + +This section describes some obsolete ways to extend @code{setf}. +They are replaced by @file{gv.el} in Emacs 24.3. + +@c FIXME. +@defmac define-setf-expander name arglist &rest body +Use @file{gv.el}. +@end defmac + +@defmac defsetf access-fn update-fn +Use @file{gv.el}. +@end defmac + +@defmac define-modify-macro name arglist function [doc-string] +Use @file{gv.el}. +@end defmac + @node GNU Free Documentation License @appendix GNU Free Documentation License === modified file 'etc/NEWS' --- etc/NEWS 2012-10-27 05:03:52 +0000 +++ etc/NEWS 2012-10-28 02:34:36 +0000 @@ -323,11 +323,17 @@ to the `lexical-let' machinery used previously) to capture definitions in closures, so such closures will only work if `lexical-binding' is in use. +*** `cl-letf' is not exactly like `letf'. + +++ *** `progv' was rewritten to use the `let' machinery. A side effect is that vars without corresponding value are bound to nil rather than making them unbound. +*** The following methods of extending `setf' are obsolete. +Use gv.el instead (FIXME; details). +`define-setf-expander', `defsetf', `define-modify-macro' + ** Compilation mode +++ *** New option `compilation-always-kill'.