From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jarek Czekalski Newsgroups: gmane.emacs.bugs Subject: bug#15461: 24.3; [PATCH] exec-path on ms windows should contain current directory Date: Thu, 26 Dec 2013 00:14:47 +0100 Message-ID: <52BB66E7.2060302@poczta.onet.pl> References: <5242E42A.4050109@poczta.onet.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000708070001090509050709" X-Trace: ger.gmane.org 1388013250 23141 80.91.229.3 (25 Dec 2013 23:14:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Dec 2013 23:14:10 +0000 (UTC) To: 15461@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 26 00:14:17 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vvxea-0000dP-IZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Dec 2013 00:14:16 +0100 Original-Received: from localhost ([::1]:43713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vvxea-0007Al-5D for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Dec 2013 18:14:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvxeS-00070g-27 for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 18:14:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvxeN-0005H4-0W for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 18:14:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvxeM-0005H0-P7 for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 18:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VvxeM-0002vk-7V for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 18:14:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <5242E42A.4050109@poczta.onet.pl> Resent-From: Jarek Czekalski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Dec 2013 23:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15461 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Original-Received: via spool by 15461-submit@debbugs.gnu.org id=B15461.138801323111240 (code B ref 15461); Wed, 25 Dec 2013 23:14:02 +0000 Original-Received: (at 15461) by debbugs.gnu.org; 25 Dec 2013 23:13:51 +0000 Original-Received: from localhost ([127.0.0.1]:42126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvxeA-0002vC-51 for submit@debbugs.gnu.org; Wed, 25 Dec 2013 18:13:51 -0500 Original-Received: from smtpo53.poczta.onet.pl ([213.180.142.184]:59991) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vvxe5-0002ux-Oc for 15461@debbugs.gnu.org; Wed, 25 Dec 2013 18:13:48 -0500 Original-Received: from [192.168.17.5] (cj.e-siemianowice.pl [95.215.234.30]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jarekczek@poczta.onet.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 3dqVV04Hyzz9ttPX for <15461@debbugs.gnu.org>; Thu, 26 Dec 2013 00:13:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poczta.onet.pl; s=2011; t=1388013224; bh=X1pZb80lp3sGhJES9tOCJ655G5ftK44bau5+uQFHV4k=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type; b=chpdLIpexhv2MB3BD690jORaMYQL44a2+5Iqd/ShG+82STOcdR2/F3oSo2Qk+Cqdt /TTYd/h4iqWZXxeJMdnBeXtpK6QVB6dpF/PG8XM2UKgq/nnsWq8RAm9eXEGj+vnewZ aIfikXwgJqoJH2MFAaVQqL454I0LdN0hRHSzsM+A= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82614 Archived-At: This is a multi-part message in MIME format. --------------000708070001090509050709 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit I am attaching a patch to fix this thing. The change is very small, but when documenting it, I discovered some inconsistencies in the manual regarding shell completion options. I did my best to fix them. Now the documentation changes are bigger than the functional change. Below I pointed several things that may need attention: - Whether such broad changes in manual may be done together with a lisp change (new variable) - Whether an unnumbered subsubsection Shell Mode Completion Options in Shell Mode Options is a good idea - Whether anchors can be used, because our info viewer does not follow them correctly - Whether this new variable may be introduced despite the feature freeze - Whether a new position in concept index (shell completion) is fine Suggested commit message: Introduce a variable shell-completion-cur-dir and document it. Document a related detail in exec-path variable. Add some consistency in the documentation of completion in the manual: - add a link from Completion section to Shell Mode, - move documentation of shell-completion-fignore from Shell Mode to Shell Mode Options, - group Shell Mode Completion Options into a new unnumbered subsubsection. FIXME: anchors used in this commit currently do not work correctly in Emacs info viewer, however work correctly in Linux info viewer, so this must be a bug in our info viewer. * lisp/shell.el (shell-completion-cur-dir): New variable to allow shell completion to use filenames from current directory. (shell--command-completion-data): Use it. * src/callproc.c (Vexec_path): Documentation of the library path in it. * doc/mini.texi (Completion Options): Add a link to Shell Mode Completion Options. * doc/misc.texi (Shell Mode): Document new variable shell-completion-cur-dir. Move documentation of shell-completion-fignore from Shell Mode to Shell Mode Options. Add an unnumbered subsubsection to group completion options. This also required to move pushd paragraph above this group. --------------000708070001090509050709 Content-Type: text/x-diff; name="complete_cur_dir_1_0.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="complete_cur_dir_1_0.diff" === modified file 'doc/emacs/ChangeLog' *** doc/emacs/ChangeLog 2013-12-25 02:18:43 +0000 --- doc/emacs/ChangeLog 2013-12-25 22:39:00 +0000 *************** *** 1,3 **** --- 1,15 ---- + 2013-12-25 Jarek Czekalski + + * mini.texi (Completion Options): Add a link to Shell Mode Completion + Options. + * misc.texi (Shell Mode): Document new variable + shell-completion-cur-dir. + Move documentation of shell-completion-fignore from Shell Mode to Shell + Mode Options. + Add an unnumbered subsubsection to group completion options. This also + required to move pushd paragraph above this group. + + 2013-12-25 Xue Fuqiao * files.texi (Diff Mode): Add an index. === modified file 'doc/emacs/mini.texi' *** doc/emacs/mini.texi 2013-01-01 09:11:05 +0000 --- doc/emacs/mini.texi 2013-12-25 22:35:50 +0000 *************** previous example, @samp{foo.e} completes *** 550,555 **** --- 550,558 ---- disregards @code{completion-ignored-extensions} when showing completion alternatives in the completion list. + Shell completion is an extended version of filename completion, + @xref{Shell Mode Completion Options}. + @vindex completion-auto-help If @code{completion-auto-help} is set to @code{nil}, the completion commands never display the completion list buffer; you must type === modified file 'doc/emacs/misc.texi' *** doc/emacs/misc.texi 2013-12-23 13:01:25 +0000 --- doc/emacs/misc.texi 2013-12-25 22:36:30 +0000 *************** in the shell buffer to submit the curren *** 677,696 **** @item @key{TAB} @kindex TAB @r{(Shell mode)} @findex completion-at-point Complete the command name or file name before point in the shell buffer (@code{completion-at-point}). This uses the usual Emacs completion rules (@pxref{Completion}), with the completion alternatives being file names, environment variable names, the shell command history, and history references (@pxref{History References}). ! ! @vindex shell-completion-fignore ! @vindex comint-completion-fignore ! The variable @code{shell-completion-fignore} specifies a list of file ! name extensions to ignore in Shell mode completion. The default ! setting is @code{nil}, but some users prefer @code{("~" "#" "%")} to ! ignore file names ending in @samp{~}, @samp{#} or @samp{%}. Other ! related Comint modes use the variable @code{comint-completion-fignore} ! instead. @item M-? @kindex M-? @r{(Shell mode)} --- 677,689 ---- @item @key{TAB} @kindex TAB @r{(Shell mode)} @findex completion-at-point + @cindex shell completion Complete the command name or file name before point in the shell buffer (@code{completion-at-point}). This uses the usual Emacs completion rules (@pxref{Completion}), with the completion alternatives being file names, environment variable names, the shell command history, and history references (@pxref{History References}). ! Also @xref{Shell Mode Completion Options}. @item M-? @kindex M-? @r{(Shell mode)} *************** value means to omit an input that is the *** 1161,1169 **** --- 1154,1176 ---- The default is @code{nil}, which means to store each input even if it is equal to the previous input. + @findex shell-pushd-tohome + @findex shell-pushd-dextract + @findex shell-pushd-dunique + You can configure the behavior of @samp{pushd}. Variables control + whether @samp{pushd} behaves like @samp{cd} if no argument is given + (@code{shell-pushd-tohome}), pop rather than rotate with a numeric + argument (@code{shell-pushd-dextract}), and only add directories to the + directory stack if they are not already on it + (@code{shell-pushd-dunique}). The values you choose should match the + underlying shell, of course. + + @unnumberedsubsubsec Shell Mode Completion Options + @anchor{Shell Mode Completion Options} @vindex comint-completion-addsuffix @vindex comint-completion-recexact @vindex comint-completion-autolist + @cindex shell completion Three variables customize file name completion. The variable @code{comint-completion-addsuffix} controls whether completion inserts a space or a slash to indicate a fully completed file or directory name *************** the possible completions whenever comple *** 1179,1194 **** If you set @code{shell-completion-execonly} to @code{nil}, it considers nonexecutable files as well. ! @findex shell-pushd-tohome ! @findex shell-pushd-dextract ! @findex shell-pushd-dunique ! You can configure the behavior of @samp{pushd}. Variables control ! whether @samp{pushd} behaves like @samp{cd} if no argument is given ! (@code{shell-pushd-tohome}), pop rather than rotate with a numeric ! argument (@code{shell-pushd-dextract}), and only add directories to the ! directory stack if they are not already on it ! (@code{shell-pushd-dunique}). The values you choose should match the ! underlying shell, of course. @node Terminal emulator @subsection Emacs Terminal Emulator --- 1186,1208 ---- If you set @code{shell-completion-execonly} to @code{nil}, it considers nonexecutable files as well. ! @vindex shell-completion-fignore ! @vindex comint-completion-fignore ! The variable @code{shell-completion-fignore} specifies a list of file ! name extensions to ignore in Shell mode completion. The default ! setting is @code{nil}, but some users prefer @code{("~" "#" "%")} to ! ignore file names ending in @samp{~}, @samp{#} or @samp{%}. Other ! related Comint modes use the variable @code{comint-completion-fignore} ! instead. ! ! @vindex shell-completion-cur-dir ! The variable @code{shell-completion-cur-dir} controls whether filenames from ! the current buffer's directory will also be used as potential commands. ! ! @findex shell-dynamic-complete-command ! Some implementation details of the shell command completion may also be found ! in the lisp documentation of the @code{shell-dynamic-complete-command} ! function. @node Terminal emulator @subsection Emacs Terminal Emulator === modified file 'etc/NEWS' *** etc/NEWS 2013-12-25 03:05:11 +0000 --- etc/NEWS 2013-12-25 23:09:58 +0000 *************** the variable `explicit-shell-file-name' *** 2943,2948 **** --- 2943,2954 ---- *** TAB is now bound to the standard `completion-at-point' command, which now implements the pcomplete rules for shell command completion. + --- + *** New customizable variable shell-completion-cur-dir, which controls + whether filenames from current directory will be found by + completion. Initialized to t on systems on which this is default + behavior. + ** SMTPmail *** SMTPmail now uses encrypted connections (via STARTTLS) by default === modified file 'lisp/ChangeLog' *** lisp/ChangeLog 2013-12-24 19:48:40 +0000 --- lisp/ChangeLog 2013-12-25 21:17:16 +0000 *************** *** 1,3 **** --- 1,9 ---- + 2013-12-25 Jarek Czekalski + + * shell.el (shell-completion-cur-dir): New variable to allow shell + completion to use filenames from current directory. + (shell--command-completion-data): Use it. + 2013-12-24 Fabián Ezequiel Gallina * progmodes/python.el (python-nav-beginning-of-statement): Speed === modified file 'lisp/shell.el' *** lisp/shell.el 2013-09-12 05:40:50 +0000 --- lisp/shell.el 2013-12-25 22:54:47 +0000 *************** Detecting executability of files may slo *** 211,216 **** --- 211,223 ---- :type 'boolean :group 'shell) + (defcustom shell-completion-cur-dir + (member system-type '(windows-nt ms-dos t)) + "Non-nil if completion should match filenames from the current buffer's + directory. Initialized to t on systems in which this behavior is a default." + :type 'boolean + :group 'shell) + (defcustom shell-popd-regexp "popd" "Regexp to match subshell commands equivalent to popd." :type 'regexp *************** searches `exec-path' (minus the trailing *** 1112,1119 **** candidates. Note that this may not be the same as the shell's idea of the path. ! Completion is dependent on the value of `shell-completion-execonly', plus ! those that effect file completion. Returns t if successful." (interactive) --- 1119,1127 ---- candidates. Note that this may not be the same as the shell's idea of the path. ! Completion is dependent on the value of `shell-completion-execonly', ! `shell-completion-fignore', `shell-completion-cur-dir', plus those that affect ! file completion. See Info node `Shell Mode Completion Options'. Returns t if successful." (interactive) *************** Returns t if successful." *** 1138,1144 **** (start (if (zerop (length filename)) (point) (match-beginning 0))) (end (if (zerop (length filename)) (point) (match-end 0))) (filenondir (file-name-nondirectory filename)) ! (path-dirs (cdr (reverse exec-path))) ;FIXME: Why `cdr'? (cwd (file-name-as-directory (expand-file-name default-directory))) (ignored-extensions (and comint-completion-fignore --- 1146,1155 ---- (start (if (zerop (length filename)) (point) (match-beginning 0))) (end (if (zerop (length filename)) (point) (match-end 0))) (filenondir (file-name-nondirectory filename)) ! ; why cdr? see `shell-dynamic-complete-command', however on Windows ! ; we have 3 library directories and this does not fully work ! (path-dirs (append (cdr (reverse exec-path)) ! (if shell-completion-cur-dir '(".")))) (cwd (file-name-as-directory (expand-file-name default-directory))) (ignored-extensions (and comint-completion-fignore === modified file 'src/ChangeLog' *** src/ChangeLog 2013-12-24 17:21:06 +0000 --- src/ChangeLog 2013-12-25 22:44:31 +0000 *************** *** 1,3 **** --- 1,7 ---- + 2013-12-25 Jarek Czekalski + + * callproc.c (Vexec_path): Documentation of the library path in it. + 2013-12-24 Eli Zaretskii * w32fns.c (Fw32_shell_execute): Ensure DOCUMENT is an absolute === modified file 'src/callproc.c' *** src/callproc.c 2013-12-18 20:36:50 +0000 --- src/callproc.c 2013-12-25 08:45:33 +0000 *************** default if SHELL is not set. */); *** 1686,1692 **** DEFVAR_LISP ("exec-path", Vexec_path, doc: /* List of directories to search programs to run in subprocesses. ! Each element is a string (directory name) or nil (try default directory). */); DEFVAR_LISP ("exec-suffixes", Vexec_suffixes, doc: /* List of suffixes to try to find executable file names. --- 1686,1696 ---- DEFVAR_LISP ("exec-path", Vexec_path, doc: /* List of directories to search programs to run in subprocesses. ! Each element is a string (directory name) or nil (try default directory). ! ! By default the last element of this list is Emacs library path. The ! last element is not always used, for example in shell completion ! (`shell-dynamic-complete-command'). */); DEFVAR_LISP ("exec-suffixes", Vexec_suffixes, doc: /* List of suffixes to try to find executable file names. --------------000708070001090509050709--