all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jarek Czekalski <jarekczek@poczta.onet.pl>
To: 15461@debbugs.gnu.org
Subject: bug#15461: 24.3; [PATCH] exec-path on ms windows should contain current directory
Date: Thu, 26 Dec 2013 23:27:48 +0100	[thread overview]
Message-ID: <52BCAD64.70500@poczta.onet.pl> (raw)
In-Reply-To: <834n5v60p4.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2775 bytes --]

Hi Eli

This was a thorough review of the patch and exhausting answers. Thank you.

I no longer have any justification for creating a variable 
shell-completion-cur-dir. After removing this variable the patch, the 
code and the manual are better and cleaner.

"shell completion" concept index now points only to <TAB> paragraph in 
Shell Mode node.

Only a few things require an answer from me. Those omitted are the ones 
I completely agree with and took a lesson from them.

> >- Whether an unnumbered subsubsection Shell Mode Completion Options in
> >Shell Mode Options is a good idea
> It's not a catastrophe, but a @node is preferable.  Except that in
> this case, I don't think even a node is justified, as you only added a
> single variable to a node that was not very large anyway.

Half of this node regards shell completion options. It would be good to 
group these options in some way. I just wanted to give them a heading 
and separate from others. But after your remark I removed the node and 
the anchor. The grouping may be done later.

> + (defcustom shell-completion-cur-dir
> +   (member system-type '(windows-nt ms-dos t))
> Why 'member' and not 'memq'?  And why did you put t at the end of the
> list?
>

The t was a mistake, I thought it will make it return t. Member and memq 
have identical docstrings, so I actually don't know why this one. 
Changed to memq.

> !          ; 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 '("."))))
> The remark about Windows is no longer true on the trunk, and I think
> comments should explain better than that.  In any case, this is a
> completely separate issue, for which I will start a new thread.

The remark about cdr is valid at the moment and answers the question 
that was here before, so I don't remove it. However if the remark about 
windows was missed, I cut it. Actually I discovered it some time ago and 
not verified lately.

If you still want to strip the patch from some of the changes, please do.

Attached the modified patch, the commit message could be:

Shell completion for filenames from current directory, related docs.

     * doc/emacs/mini.texi (Completion Options): Add a link to Shell 
Options.
     * doc/emacs/misc.texi (Shell Mode): Move documentation of
     shell-completion-fignore from Shell Mode to Shell Options.
     * lisp/shell.el  Shell completion now matches executable filenames from
     the current buffer's directory, on systems in which this behaviour
     is the default (windows-nt, ms-dos).
     * src/callproc.c (Vexec_path): Documentation of the library path in it.

Jarek


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: complete_cur_dir_2_0.diff --]
[-- Type: text/x-diff; name="complete_cur_dir_2_0.diff", Size: 7526 bytes --]

=== modified file 'doc/emacs/ChangeLog'
*** doc/emacs/ChangeLog	2013-12-25 02:18:43 +0000
--- doc/emacs/ChangeLog	2013-12-26 21:30:14 +0000
***************
*** 1,3 ****
--- 1,10 ----
+ 2013-12-25  Jarek Czekalski  <jarekczek@poczta.onet.pl>
+ 
+ 	* mini.texi (Completion Options): Add a link to Shell Options.
+ 	* misc.texi (Shell Mode): Move documentation of
+ 	shell-completion-fignore from Shell Mode to Shell Options.
+ 
+ 
  2013-12-25  Xue Fuqiao  <xfq.free@gmail.com>
  
  	* 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-26 22:21:42 +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,
+ @pxref{Shell 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-26 22:16:37 +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}).
! For options controlling the completion, @pxref{Shell Options}.
  
  @item M-?
  @kindex M-? @r{(Shell mode)}
*************** the possible completions whenever comple
*** 1179,1184 ****
--- 1172,1191 ----
  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.
+ 
+ @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.
+ 
  @findex shell-pushd-tohome
  @findex shell-pushd-dextract
  @findex shell-pushd-dunique

=== modified file 'lisp/ChangeLog'
*** lisp/ChangeLog	2013-12-24 19:48:40 +0000
--- lisp/ChangeLog	2013-12-26 22:08:26 +0000
***************
*** 1,3 ****
--- 1,10 ----
+ 2013-12-25  Jarek Czekalski  <jarekczek@poczta.onet.pl>
+ 
+ 	* shell.el  Shell completion now matches executable filenames from
+ 	the current buffer's directory, on systems in which this behaviour
+ 	is the default (windows-nt, ms-dos).
+ 
+ 
  2013-12-24  Fabián Ezequiel Gallina  <fgallina@gnu.org>
  
  	* 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-26 22:24:11 +0000
*************** 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)
--- 1112,1120 ----
  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', plus those that affect file completion.  See Info
! node `Shell 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
--- 1139,1147 ----
           (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'
! 	 (path-dirs (append (cdr (reverse exec-path))
! 	   (if (memq system-type '(windows-nt ms-dos)) '("."))))
  	 (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-26 21:25:24 +0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2013-12-25  Jarek Czekalski  <jarekczek@poczta.onet.pl>
+ 
+ 	* callproc.c (Vexec_path): Documentation of the library path in it.
+ 
  2013-12-24  Eli Zaretskii  <eliz@gnu.org>
  
  	* 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.


  reply	other threads:[~2013-12-26 22:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-25 13:24 bug#15461: 24.3; exec-path on ms windows should contain current directory Jarek Czekalski
2013-09-25 15:48 ` Eli Zaretskii
2013-09-26 17:23 ` bug#15461: why do I need it Jarek Czekalski
2013-09-26 17:59   ` Eli Zaretskii
2013-09-26 20:39     ` Stefan Monnier
2013-09-26 20:40 ` bug#15461: answer Jarek Czekalski
2013-12-15 20:32 ` bug#15461: 24.3; exec-path on ms windows should contain current directory Jarek Czekalski
2013-12-15 21:16   ` Eli Zaretskii
2013-12-16  8:06 ` Jarek Czekalski
2013-12-16 16:45   ` Eli Zaretskii
2013-12-18  8:15     ` Jarek Czekalski
2013-12-25 23:14 ` bug#15461: 24.3; [PATCH] " Jarek Czekalski
2013-12-26 16:23   ` Eli Zaretskii
2013-12-26 22:27     ` Jarek Czekalski [this message]
2013-12-26 23:22       ` Juanma Barranquero
2013-12-27  8:19       ` Eli Zaretskii
2013-12-27 21:02         ` Jarek Czekalski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52BCAD64.70500@poczta.onet.pl \
    --to=jarekczek@poczta.onet.pl \
    --cc=15461@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.