# HG changeset patch # User Stefan Monnier # Date 1275359689 14400 # Node ID bace4ba4c1379e62b67a8232e293dad1862b6365 # Parent 481f67c74989346d99c6a11adaccc6de3e5e4a07# Parent 1b1048318854ac76502b329c239f4af2f7304354 Merge from emacs-23 diff -r 481f67c74989 -r bace4ba4c137 ChangeLog --- a/ChangeLog Mon May 31 21:49:15 2010 -0400 +++ b/ChangeLog Mon May 31 22:34:49 2010 -0400 @@ -1,3 +1,8 @@ +2010-05-30 Stefan Monnier + + * .bzrignore: Ignore new files from trunk, which appear if you use + colocated branches (i.e. "bzr switch"). + 2010-05-28 Glenn Morris * configure.in: Simplify some of the $canonical tests. diff -r 481f67c74989 -r bace4ba4c137 doc/lispref/ChangeLog --- a/doc/lispref/ChangeLog Mon May 31 21:49:15 2010 -0400 +++ b/doc/lispref/ChangeLog Mon May 31 22:34:49 2010 -0400 @@ -1,3 +1,12 @@ +2010-05-30 Juanma Barranquero + + * minibuf.texi (Basic Completion): Add missing "@end defun". + +2010-05-30 Stefan Monnier + + * minibuf.texi (Basic Completion): Document completion-boundaries. + (Programmed Completion): Document the new fourth method for boundaries. + 2010-05-22 Chong Yidong * display.texi (Image Cache): Update documentation about image diff -r 481f67c74989 -r bace4ba4c137 doc/lispref/minibuf.texi --- a/doc/lispref/minibuf.texi Mon May 31 21:49:15 2010 -0400 +++ b/doc/lispref/minibuf.texi Mon May 31 22:34:49 2010 -0400 @@ -814,6 +814,25 @@ it returns, @code{test-completion} returns in turn. @end defun +@defun completion-boundaries string collection predicate suffix +This function returns the boundaries of the field on which @var{collection} +will operate, assuming that @var{string} holds the text before point +and @var{suffix} holds the text after point. + +Normally completion operates on the whole string, so for all normal +collections, this will always return @code{(0 . (length +@var{suffix}))}. But more complex completion such as completion on +files is done one field at a time. For example, completion of +@code{"/usr/sh"} will include @code{"/usr/share/"} but not +@code{"/usr/share/doc"} even if @code{"/usr/share/doc"} exists. +Also @code{all-completions} on @code{"/usr/sh"} will not include +@code{"/usr/share/"} but only @code{"share/"}. So if @var{string} is +@code{"/usr/sh"} and @var{suffix} is @code{"e/doc"}, +@code{completion-boundaries} will return @code{(5 . 1)} which tells us +that the @var{collection} will only return completion information that +pertains to the area after @code{"/usr/"} and before @code{"/doc"}. +@end defun + If you store a completion alist in a variable, you should mark the variable as ``risky'' with a non-@code{nil} @code{risky-local-variable} property. @xref{File Local Variables}. @@ -1618,13 +1637,14 @@ can supply your own function to compute the completion of a given string. This is called @dfn{programmed completion}. Emacs uses programmed completion when completing file names (@pxref{File Name -Completion}). +Completion}), among many other cases. - To use this feature, pass a symbol with a function definition as the -@var{collection} argument to @code{completing-read}. The function + To use this feature, pass a function as the @var{collection} +argument to @code{completing-read}. The function @code{completing-read} arranges to pass your completion function along -to @code{try-completion} and @code{all-completions}, which will then let -your function do all the work. +to @code{try-completion}, @code{all-completions}, and other basic +completion functions, which will then let your function do all +the work. The completion function should accept three arguments: @@ -1638,10 +1658,14 @@ and ignore the possible match if the predicate returns @code{nil}. @item -A flag specifying the type of operation. +A flag specifying the type of operation. The best way to think about +it is that the function stands for an object (in the +``object-oriented'' sense of the word), and this third argument +specifies which method to run. @end itemize - There are three flag values for three operations: + There are currently four methods, i.e. four flag values, one for + each of the four different basic operations: @itemize @bullet @item @@ -1663,6 +1687,13 @@ @code{lambda} specifies @code{test-completion}. The completion function should return @code{t} if the specified string is an exact match for some possibility; @code{nil} otherwise. + +@item +@code{(boundaries . SUFFIX)} specifies @code{completion-boundaries}. +The function should return a value of the form @code{(boundaries +START . END)} where START is the position of the beginning boundary in +in the string to complete, and END is the position of the end boundary +in SUFFIX. @end itemize It would be consistent and clean for completion functions to allow diff -r 481f67c74989 -r bace4ba4c137 etc/TODO --- a/etc/TODO Mon May 31 21:49:15 2010 -0400 +++ b/etc/TODO Mon May 31 22:34:49 2010 -0400 @@ -410,7 +410,7 @@ the whole menu bar. In the mean time, it should process other messages. ** Get some major packages installed: W3 (development version needs - significant work), PSGML, _possibly_ Cedet and ECB. + significant work), PSGML, _possibly_ ECB. http://lists.gnu.org/archive/html/emacs-devel/2007-05/msg01493.html Check the assignments file for other packages which might go in and have been missed. diff -r 481f67c74989 -r bace4ba4c137 lisp/ChangeLog --- a/lisp/ChangeLog Mon May 31 21:49:15 2010 -0400 +++ b/lisp/ChangeLog Mon May 31 22:34:49 2010 -0400 @@ -1,3 +1,17 @@ +2010-06-01 Stefan Monnier + + * vc-bzr.el (vc-bzr-revision-completion-table): Apply + `file-directory-p' to the filename part rather than to the whole text. + +2010-05-31 Jonathan Marchand (tiny change) + + * cedet/ede/cpp-root.el (ede-set-project-variables): Fix feature name + (bug#6231). + +2010-05-31 Stefan Monnier + + * man.el (Man-completion-table): Let the user type "-k " (bug#6319). + 2010-05-31 Drew Adams * files.el (directory-files-no-dot-files-regexp): Doc fix (bug#6298). @@ -66,6 +80,14 @@ (ls-lisp-classify): Call ls-lisp-classify-file. (insert-directory): Remove blanks from switches. +2010-05-29 Chong Yidong + + * ansi-color.el: Delete unused escape sequences (Bug#6085). + (ansi-color-drop-regexp): New constant. + (ansi-color-apply, ansi-color-filter-region) + (ansi-color-apply-on-region): Delete unrecognized control sequences. + (ansi-color-apply): Build string list before calling concat. + 2010-05-28 Juri Linkov * image-dired.el (image-dired-dired-toggle-marked-thumbs): @@ -212,6 +234,16 @@ (smie-next-sexp): Handle nil results from next-token. (smie-indent-calculate): Add a new case for special `fixindent' comments. +2010-05-27 Chong Yidong + + * progmodes/verilog-mode.el (verilog-type-font-keywords): + Use font-lock-constant-face, not obsolete font-lock-reference-face. + +2010-05-27 Masatake YAMATO + + * htmlfontify.el (hfy-face-resolve-face): New function. + (hfy-face-to-style): Use it (Bug#6279). + 2010-05-26 Stefan Monnier * progmodes/ada-xref.el (ada-gnat-parse-gpr): @@ -316,7 +348,13 @@ Register it in composition-function-table for all Hebrew combining characters. +2010-05-25 Stefan Monnier + + * epa.el (epa--select-keys): Don't explicitly delete the window since + that can fail (e.g. sole window in frame). Use dedication instead. + 2010-05-24 Uday S Reddy (tiny change) +2010-05-19 Uday S Reddy (tiny change) * textmodes/fill.el (fill-region): Don't fill past the end (bug#6201). diff -r 481f67c74989 -r bace4ba4c137 lisp/cedet/ede/cpp-root.el --- a/lisp/cedet/ede/cpp-root.el Mon May 31 21:49:15 2010 -0400 +++ b/lisp/cedet/ede/cpp-root.el Mon May 31 22:34:49 2010 -0400 @@ -467,7 +467,7 @@ "Set variables local to PROJECT in BUFFER. Also set up the lexical preprocessor map." (call-next-method) - (when (and (featurep 'semantic/c) (featurep 'semantic/lex-spp)) + (when (and (featurep 'semantic/bovine/c) (featurep 'semantic/lex-spp)) (setq semantic-lex-spp-project-macro-symbol-obarray (semantic-lex-make-spp-table (oref project spp-table))) )) diff -r 481f67c74989 -r bace4ba4c137 lisp/epa.el --- a/lisp/epa.el Mon May 31 21:49:15 2010 -0400 +++ b/lisp/epa.el Mon May 31 22:34:49 2010 -0400 @@ -508,13 +508,12 @@ (set-keymap-parent (current-local-map) widget-keymap) (setq epa-exit-buffer-function #'abort-recursive-edit) (goto-char (point-min)) - (pop-to-buffer (current-buffer))) + (let ((display-buffer-mark-dedicated 'soft)) + (pop-to-buffer (current-buffer)))) (unwind-protect (progn (recursive-edit) (epa--marked-keys)) - (if (get-buffer-window epa-keys-buffer) - (delete-window (get-buffer-window epa-keys-buffer))) (kill-buffer epa-keys-buffer)))) ;;;###autoload diff -r 481f67c74989 -r bace4ba4c137 lisp/man.el --- a/lisp/man.el Mon May 31 21:49:15 2010 -0400 +++ b/lisp/man.el Mon May 31 22:34:49 2010 -0400 @@ -759,6 +759,9 @@ (cond ((eq action 'lambda) (not (string-match "([^)]*\\'" string))) + ((equal string "-k") + ;; Let SPC (minibuffer-complete-word) insert the space. + (complete-with-action action '("-k ") string pred)) (t (let ((table (cdr Man-completion-cache)) (section nil) diff -r 481f67c74989 -r bace4ba4c137 lisp/vc-bzr.el --- a/lisp/vc-bzr.el Mon May 31 21:49:15 2010 -0400 +++ b/lisp/vc-bzr.el Mon May 31 22:34:49 2010 -0400 @@ -999,10 +999,12 @@ ((string-match "\\`\\(ancestor\\|branch\\|\\(revno:\\)?[-0-9]+:\\):" string) (completion-table-with-context (substring string 0 (match-end 0)) - 'completion-file-name-table + (apply-partially + 'completion-table-with-predicate + 'completion-file-name-table + 'file-directory-p t) (substring string (match-end 0)) - ;; Dropping `pred' for no good reason. - 'file-directory-p + pred action)) ((string-match "\\`\\(before\\):" string) (completion-table-with-context (substring string 0 (match-end 0)) diff -r 481f67c74989 -r bace4ba4c137 src/ChangeLog --- a/src/ChangeLog Mon May 31 21:49:15 2010 -0400 +++ b/src/ChangeLog Mon May 31 22:34:49 2010 -0400 @@ -3,6 +3,11 @@ * sysdep.c (child_setup_tty): Move the non-canonical initialization to the HAVE_TERMIO where it belongs (bug#6149). +2010-05-31 Stefan Monnier + + * keymap.c (Fwhere_is_internal): Fix handling of remapping (in thread + of bug#6305). + 2010-05-30 Eli Zaretskii * bidi.c (bidi_move_to_visually_next): Make sure the sentinel @@ -123,6 +128,11 @@ * dispextern.h (init_iterator): Sync prototype with changed definition. +2010-05-20 enami tsugutomo + + * s/netbsd.h: If terminfo is found, use it in preference to + termcap. (Bug#6190) [Backport from trunk] + 2010-05-19 Eli Zaretskii Redesign and reimplement bidi-aware edge positions of glyph rows. @@ -2270,7 +2280,7 @@ (xg_toggle_notify_cb, xg_set_toolkit_scroll_bar_thumb) (xg_create_tool_bar): Remove unused variables. (x_wm_set_size_hint): Move declarations before statements. - (xg_create_frame_widgets): Remove variable grav, + (xg_create_frame_widgets): Remove variable grav. 2010-02-21 Chong Yidong @@ -2388,7 +2398,7 @@ * xfns.c (Fx_create_frame): Remove window size matching code from 2010-01-15. - (x_get_current_desktop, x_get_desktop_workarea): Remove + (x_get_current_desktop, x_get_desktop_workarea): Remove. 2010-01-27 Jason Rumney @@ -3225,7 +3235,7 @@ fontconfig settings like hinting. (font_load_for_lface): If spec had a name in it, store it in entity. - * emacs.c (main): Call syms_of_xsettings + * emacs.c (main): Call syms_of_xsettings. * config.in: HAVE_GCONF is new. @@ -8810,7 +8820,7 @@ (composition_adjust_point, Fcomposition_get_gstring): New functions. (syms_of_composite): Initialize gstring_hash_table, gstrint_work, and gstring_work_headers. DEFVAR_LISP composition-function-table. - Defsubr compostion_get_gstring. + Defsubr composition_get_gstring. * dispextern.h (struct glyph): New union u.cmp. Delete the member cmp_id. diff -r 481f67c74989 -r bace4ba4c137 src/config.in --- a/src/config.in Mon May 31 21:49:15 2010 -0400 +++ b/src/config.in Mon May 31 22:34:49 2010 -0400 @@ -312,10 +312,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_KERBEROS_KRB_H -/* Define to 1 if `e_text' is member of `krb5_error'. */ +/* Define to 1 if `e_text' is a member of `krb5_error'. */ #undef HAVE_KRB5_ERROR_E_TEXT -/* Define to 1 if `text' is member of `krb5_error'. */ +/* Define to 1 if `text' is a member of `krb5_error'. */ #undef HAVE_KRB5_ERROR_TEXT /* Define to 1 if you have the header file. */ @@ -606,25 +606,25 @@ /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL -/* Define to 1 if `ifr_addr' is member of `struct ifreq'. */ +/* Define to 1 if `ifr_addr' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_ADDR -/* Define to 1 if `ifr_broadaddr' is member of `struct ifreq'. */ +/* Define to 1 if `ifr_broadaddr' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_BROADADDR -/* Define to 1 if `ifr_flags' is member of `struct ifreq'. */ +/* Define to 1 if `ifr_flags' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_FLAGS -/* Define to 1 if `ifr_hwaddr' is member of `struct ifreq'. */ +/* Define to 1 if `ifr_hwaddr' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_HWADDR -/* Define to 1 if `ifr_netmask' is member of `struct ifreq'. */ +/* Define to 1 if `ifr_netmask' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_NETMASK -/* Define to 1 if `n_un.n_name' is member of `struct nlist'. */ +/* Define to 1 if `n_un.n_name' is a member of `struct nlist'. */ #undef HAVE_STRUCT_NLIST_N_UN_N_NAME -/* Define to 1 if `tm_zone' is member of `struct tm'. */ +/* Define to 1 if `tm_zone' is a member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* Define to 1 if `struct utimbuf' is declared by . */ @@ -853,6 +853,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -912,6 +915,28 @@ /* Define to 1 if using the Motif X toolkit. */ #undef USE_MOTIF +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Define to 1 if we should use toolkit scroll bars. */ #undef USE_TOOLKIT_SCROLL_BARS @@ -947,28 +972,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - /* Define to rpl_ if the getopt replacement functions and variables should be used. */ #undef __GETOPT_PREFIX diff -r 481f67c74989 -r bace4ba4c137 src/keymap.c --- a/src/keymap.c Mon May 31 21:49:15 2010 -0400 +++ b/src/keymap.c Mon May 31 22:34:49 2010 -0400 @@ -2829,16 +2829,16 @@ Lisp_Object found = Qnil; /* 1 means ignore all menu bindings entirely. */ int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii); - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; /* List of sequences found via remapping. Keep them in a separate variable, so as to push them later, since we prefer non-remapped binding. */ Lisp_Object remapped_sequences = Qnil; /* Whether or not we're handling remapped sequences. This is needed because remapping is not done recursively by Fcommand_remapping: you - can't remap and remapped command. */ + can't remap a remapped command. */ int remapped = 0; - Lisp_Object tem; + Lisp_Object tem = Qnil; /* Refresh the C version of the modifier preference. */ where_is_preferred_modifier @@ -2852,17 +2852,25 @@ else keymaps = Fcurrent_active_maps (Qnil, Qnil); - GCPRO5 (definition, keymaps, found, sequences, remapped_sequences); - - /* If this command is remapped, then it has no key bindings of its own. - FIXME: Actually, this is not quite right: if A is remapped to - `definition', then bindings to A will actually bind the key to - `definition' despite the remapping from `definition' to something else. - Another corner case is if `definition' is remapped to itself. */ - if (NILP (no_remap) - && SYMBOLP (definition) - && !NILP (Fcommand_remapping (definition, Qnil, keymaps))) - RETURN_UNGCPRO (Qnil); + GCPRO6 (definition, keymaps, found, sequences, remapped_sequences, tem); + + tem = Fcommand_remapping (definition, Qnil, keymaps); + /* If `definition' is remapped to tem', then OT1H no key will run + that command (since they will run `tem' instead), so we should + return nil; but OTOH all keys bound to `definition' (or to `tem') + will run the same command. + So for menu-shortcut purposes, we want to find all the keys bound (maybe + via remapping) to `tem'. But for the purpose of finding the keys that + run `definition', then we'd want to just return nil. + We choose to make it work right for menu-shortcuts, since it's the most + common use. + Known bugs: if you remap switch-to-buffer to toto, C-h f switch-to-buffer + will tell you that switch-to-buffer is bound to C-x b even though C-x b + will run toto instead. And if `toto' is itself remapped to forward-char, + then C-h f toto will tell you that it's bound to C-f even though C-f does + not run toto and it won't tell you that C-x b does run toto. */ + if (NILP (no_remap) && !NILP (tem)) + definition = tem; if (SYMBOLP (definition) && !NILP (firstonly)