# HG changeset patch # User Katsumi Yamaoka # Date 1275432696 0 # Node ID 36500bfff4e87ccdcd8daea44bd9cd42a9c8db95 # Parent a82e98d2915bd4647dc34e2da8c01ea9c8ad7e7e# Parent 9754518b7ea0b72f6c79cddd80cfc5ccc720c0ef Merge from mainline. diff -r a82e98d2915b -r 36500bfff4e8 ChangeLog --- a/ChangeLog Mon May 31 22:50:25 2010 +0000 +++ b/ChangeLog Tue Jun 01 22:51:36 2010 +0000 @@ -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 a82e98d2915b -r 36500bfff4e8 doc/lispref/ChangeLog --- a/doc/lispref/ChangeLog Mon May 31 22:50:25 2010 +0000 +++ b/doc/lispref/ChangeLog Tue Jun 01 22:51:36 2010 +0000 @@ -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 a82e98d2915b -r 36500bfff4e8 doc/lispref/minibuf.texi --- a/doc/lispref/minibuf.texi Mon May 31 22:50:25 2010 +0000 +++ b/doc/lispref/minibuf.texi Tue Jun 01 22:51:36 2010 +0000 @@ -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 a82e98d2915b -r 36500bfff4e8 etc/TODO --- a/etc/TODO Mon May 31 22:50:25 2010 +0000 +++ b/etc/TODO Tue Jun 01 22:51:36 2010 +0000 @@ -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 a82e98d2915b -r 36500bfff4e8 lisp/ChangeLog --- a/lisp/ChangeLog Mon May 31 22:50:25 2010 +0000 +++ b/lisp/ChangeLog Tue Jun 01 22:51:36 2010 +0000 @@ -1,3 +1,35 @@ +2010-06-01 Juanma Barranquero + + * emacs-lisp/eldoc.el: Add completions for new commands left-* and + right-*. (Bug#6265) + +2010-06-01 Dan Nicolaescu + + Add support for vc-log-incoming, improve vc-log-outgoing for Git. + * vc-git.el (vc-git-compute-remote): New function. + (vc-git-log-outgoing): Use it instead of hard coding a value. + (vc-git-log-incoming): New function. + + Improve state updating for VC tag commands. + * vc.el (vc-create-tag, vc-retrieve-tag): Call vc-resynch-buffer + to update the state of all buffers in the directory. + + * vc-dir.el (vc-dir-update): Remove entries with a nil state (bug#5539). + +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 +98,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): @@ -120,8 +160,7 @@ 2010-05-27 Chong Yidong * dired.el (dired-delete-file): New arg TRASH. - (dired-internal-do-deletions): New arg TRASH. Use progress - reporter. + (dired-internal-do-deletions): New arg TRASH. Use progress reporter. (dired-do-flagged-delete, dired-do-delete): Use trash. * speedbar.el (speedbar-item-delete): Allow trashing. @@ -140,8 +179,7 @@ * net/tramp-compat.el (tramp-compat-delete-file): Rewrite to handle new TRASH arg of `delete-file'. - * net/tramp.el (tramp-handle-delete-file): Change FORCE arg to - TRASH. + * net/tramp.el (tramp-handle-delete-file): Change FORCE arg to TRASH. (tramp-handle-make-symbolic-link, tramp-handle-load) (tramp-do-copy-or-rename-file-via-buffer) (tramp-do-copy-or-rename-file-directly) @@ -212,6 +250,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,6 +364,11 @@ 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) * textmodes/fill.el (fill-region): Don't fill past the end (bug#6201). diff -r a82e98d2915b -r 36500bfff4e8 lisp/cedet/ede/cpp-root.el --- a/lisp/cedet/ede/cpp-root.el Mon May 31 22:50:25 2010 +0000 +++ b/lisp/cedet/ede/cpp-root.el Tue Jun 01 22:51:36 2010 +0000 @@ -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 a82e98d2915b -r 36500bfff4e8 lisp/emacs-lisp/eldoc.el --- a/lisp/emacs-lisp/eldoc.el Mon May 31 22:50:25 2010 +0000 +++ b/lisp/emacs-lisp/eldoc.el Tue Jun 01 22:51:36 2010 +0000 @@ -530,13 +530,13 @@ ;; Prime the command list. (eldoc-add-command-completions - "backward-" "beginning-of-" "move-beginning-of-" "delete-other-windows" - "delete-window" "handle-select-window" - "end-of-" "move-end-of-" "exchange-point-and-mark" "forward-" - "indent-for-tab-command" "goto-" "mark-page" "mark-paragraph" - "mouse-set-point" "move-" "pop-global-mark" "next-" "other-window" - "previous-" "recenter" "scroll-" "self-insert-command" - "split-window-" "up-list" "down-list") + "backward-" "beginning-of-" "delete-other-windows" "delete-window" + "down-list" "end-of-" "exchange-point-and-mark" "forward-" "goto-" + "handle-select-window" "indent-for-tab-command" "left-" "mark-page" + "mark-paragraph" "mouse-set-point" "move-" "move-beginning-of-" + "move-end-of-" "next-" "other-window" "pop-global-mark" "previous-" + "recenter" "right-" "scroll-" "self-insert-command" "split-window-" + "up-list") (provide 'eldoc) diff -r a82e98d2915b -r 36500bfff4e8 lisp/epa.el --- a/lisp/epa.el Mon May 31 22:50:25 2010 +0000 +++ b/lisp/epa.el Tue Jun 01 22:51:36 2010 +0000 @@ -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 a82e98d2915b -r 36500bfff4e8 lisp/man.el --- a/lisp/man.el Mon May 31 22:50:25 2010 +0000 +++ b/lisp/man.el Tue Jun 01 22:51:36 2010 +0000 @@ -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 a82e98d2915b -r 36500bfff4e8 lisp/vc-bzr.el --- a/lisp/vc-bzr.el Mon May 31 22:50:25 2010 +0000 +++ b/lisp/vc-bzr.el Tue Jun 01 22:51:36 2010 +0000 @@ -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 a82e98d2915b -r 36500bfff4e8 lisp/vc-dir.el --- a/lisp/vc-dir.el Mon May 31 22:50:25 2010 +0000 +++ b/lisp/vc-dir.el Tue Jun 01 22:51:36 2010 +0000 @@ -362,6 +362,7 @@ ;; Insert directory entries in the right places. (let ((entry (car entries)) (node (ewoc-nth vc-ewoc 0)) + (to-remove nil) (dotname (file-relative-name default-directory))) ;; Insert . if it is not present. (unless node @@ -388,10 +389,16 @@ ((string-lessp nodefile entryfile) (setq node (ewoc-next vc-ewoc node))) ((string-equal nodefile entryfile) - (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 entry)) - (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 entry)) - (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) nil) - (ewoc-invalidate vc-ewoc node) + (if (nth 1 entry) + (progn + (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 entry)) + (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 entry)) + (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) nil) + (ewoc-invalidate vc-ewoc node)) + ;; If the state is nil, the file does not exist + ;; anymore, so remember the entry so we can remove + ;; it after we are done inserting all ENTRIES. + (push node to-remove)) (setq entries (cdr entries)) (setq entry (car entries)) (setq node (ewoc-next vc-ewoc node))) @@ -427,7 +434,10 @@ vc-ewoc (vc-dir-create-fileinfo rd nil nil nil entrydir)))) ;; Now insert the node itself. (ewoc-enter-last vc-ewoc - (apply 'vc-dir-create-fileinfo entry))))))))) + (apply 'vc-dir-create-fileinfo entry)))))) + (when to-remove + (let ((inhibit-read-only t)) + (apply 'ewoc-delete vc-ewoc (nreverse to-remove))))))) (defun vc-dir-busy () (and (buffer-live-p vc-dir-process-buffer) diff -r a82e98d2915b -r 36500bfff4e8 lisp/vc-git.el --- a/lisp/vc-git.el Mon May 31 22:50:25 2010 +0000 +++ b/lisp/vc-git.el Tue Jun 01 22:51:36 2010 +0000 @@ -606,14 +606,38 @@ (when start-revision (list start-revision)) '("--"))))))) +(defun vc-git-compute-remote () + (let ((str (with-output-to-string + (with-current-buffer standard-output + (vc-git--out-ok "symbolic-ref" "HEAD")))) + branch remote) + (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str) + (progn + (setq branch (match-string 2 str)) + (setq remote + (with-output-to-string + (with-current-buffer standard-output + (vc-git--out-ok "config" + (concat "branch." branch ".remote"))))) + (when (string-match "\\([^\n]+\\)" remote) + (setq remote (match-string 1 remote))))))) + + (defun vc-git-log-outgoing (buffer remote-location) (interactive) (vc-git-command buffer 0 nil "log" (if (string= remote-location "") - ;; FIXME: this hardcodes the location, it should compute - ;; it properly. - "origin/master..HEAD" + (concat (vc-git-compute-remote) "..HEAD") + remote-location))) + + +(defun vc-git-log-incoming (buffer remote-location) + (interactive) + (vc-git-command + buffer 0 nil + "log" (if (string= remote-location "") + (concat "HEAD.." (vc-git-compute-remote)) remote-location))) (defvar log-view-message-re) diff -r a82e98d2915b -r 36500bfff4e8 lisp/vc.el --- a/lisp/vc.el Mon May 31 22:50:25 2010 +0000 +++ b/lisp/vc.el Tue Jun 01 22:51:36 2010 +0000 @@ -1903,6 +1903,7 @@ (when (file-directory-p dir) (setq dir (file-name-as-directory dir))) (vc-call-backend (vc-responsible-backend dir) 'create-tag dir name branchp) + (vc-resynch-buffer dir t t) (message "Making %s... done" (if branchp "branch" "tag"))) ;;;###autoload @@ -1923,6 +1924,7 @@ (message "%s" msg) (vc-call-backend (vc-responsible-backend dir) 'retrieve-tag dir name update) + (vc-resynch-buffer dir t t) (message "%s" (concat msg "done")))) ;; Miscellaneous other entry points diff -r a82e98d2915b -r 36500bfff4e8 src/ChangeLog --- a/src/ChangeLog Mon May 31 22:50:25 2010 +0000 +++ b/src/ChangeLog Tue Jun 01 22:51:36 2010 +0000 @@ -1,3 +1,13 @@ +2010-06-01 Stefan Monnier + + * 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 @@ -118,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. @@ -2265,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 @@ -2383,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 @@ -3220,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. @@ -8805,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 a82e98d2915b -r 36500bfff4e8 src/config.in --- a/src/config.in Mon May 31 22:50:25 2010 +0000 +++ b/src/config.in Tue Jun 01 22:51:36 2010 +0000 @@ -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 a82e98d2915b -r 36500bfff4e8 src/keymap.c --- a/src/keymap.c Mon May 31 22:50:25 2010 +0000 +++ b/src/keymap.c Tue Jun 01 22:51:36 2010 +0000 @@ -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) diff -r a82e98d2915b -r 36500bfff4e8 src/sysdep.c --- a/src/sysdep.c Mon May 31 22:50:25 2010 +0000 +++ b/src/sysdep.c Tue Jun 01 22:51:36 2010 +0000 @@ -537,15 +537,6 @@ s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */ #endif /* AIX */ -#else /* not HAVE_TERMIO */ - - s.main.sg_flags &= ~(ECHO | CRMOD | ANYP | ALLDELAY | RAW | LCASE - | CBREAK | TANDEM); - s.main.sg_flags |= LPASS8; - s.main.sg_erase = 0377; - s.main.sg_kill = 0377; - s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */ - /* We used to enable ICANON (and set VEOF to 04), but this leads to problems where process.c wants to send EOFs every once in a while to force the output, which leads to weird effects when the @@ -558,6 +549,15 @@ s.main.c_cc[VMIN] = 1; s.main.c_cc[VTIME] = 0; +#else /* not HAVE_TERMIO */ + + s.main.sg_flags &= ~(ECHO | CRMOD | ANYP | ALLDELAY | RAW | LCASE + | CBREAK | TANDEM); + s.main.sg_flags |= LPASS8; + s.main.sg_erase = 0377; + s.main.sg_kill = 0377; + s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */ + #endif /* not HAVE_TERMIO */ EMACS_SET_TTY (out, &s, 0);