emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115775: Shell completion for filenames from current


From: Jarek Czekalski
Subject: [Emacs-diffs] trunk r115775: Shell completion for filenames from current directory, related docs.
Date: Fri, 27 Dec 2013 21:00:15 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115775
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15461
committer: Jarek Czekalski <address@hidden>
branch nick: emacs-bzr
timestamp: Fri 2013-12-27 21:58:21 +0100
message:
  Shell completion for filenames from current directory, related docs.
  
        * 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): Document that exec-directory is in it.
        * 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.
modified:
  doc/emacs/ChangeLog            changelog-20091113204419-o5vbwnq5f7feedwu-6227
  doc/emacs/mini.texi            mini.texi-20091113204419-o5vbwnq5f7feedwu-6266
  doc/emacs/misc.texi            misc.texi-20091113204419-o5vbwnq5f7feedwu-6267
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/shell.el                  shell.el-20091113204419-o5vbwnq5f7feedwu-150
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/callproc.c                 callproc.c-20091113204419-o5vbwnq5f7feedwu-248
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2013-12-26 22:02:49 +0000
+++ b/doc/emacs/ChangeLog       2013-12-27 20:58:21 +0000
@@ -1,3 +1,9 @@
+2013-12-27  Jarek Czekalski  <address@hidden>
+
+       * 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-26  João Távora <address@hidden>
        * emacs.texi (Matching): Describe new features of Electric Pair
        mode.

=== modified file 'doc/emacs/mini.texi'
--- a/doc/emacs/mini.texi       2013-01-01 09:11:05 +0000
+++ b/doc/emacs/mini.texi       2013-12-27 20:58:21 +0000
@@ -550,6 +550,9 @@
 disregards @code{completion-ignored-extensions} when showing
 completion alternatives in the completion list.
 
+  Shell completion is an extended version of filename completion,
address@hidden 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'
--- a/doc/emacs/misc.texi       2013-12-23 13:01:25 +0000
+++ b/doc/emacs/misc.texi       2013-12-27 20:58:21 +0000
@@ -677,20 +677,13 @@
 @item @key{TAB}
 @kindex TAB @r{(Shell mode)}
 @findex completion-at-point
address@hidden 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}).
-
address@hidden shell-completion-fignore
address@hidden 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.
+For options controlling the completion, @pxref{Shell Options}.
 
 @item M-?
 @kindex M-? @r{(Shell mode)}
@@ -1179,6 +1172,20 @@
 If you set @code{shell-completion-execonly} to @code{nil},
 it considers nonexecutable files as well.
 
address@hidden shell-completion-fignore
address@hidden 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.
+
address@hidden 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'
--- a/lisp/ChangeLog    2013-12-27 20:24:25 +0000
+++ b/lisp/ChangeLog    2013-12-27 20:58:21 +0000
@@ -1,3 +1,9 @@
+2013-12-27  Jarek Czekalski  <address@hidden>
+
+       * 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-27  Glenn Morris  <address@hidden>
 
        * emacs-lisp/lisp-mode.el (lisp-mode-variables): Unbreak bootstrap.

=== modified file 'lisp/shell.el'
--- a/lisp/shell.el     2013-09-12 05:40:50 +0000
+++ b/lisp/shell.el     2013-12-27 20:58:21 +0000
@@ -1108,12 +1108,13 @@
 (defun shell-dynamic-complete-command ()
   "Dynamically complete the command at point.
 This function is similar to `comint-dynamic-complete-filename', except that it
-searches `exec-path' (minus the trailing Emacs library path) for completion
+searches `exec-path' (minus trailing `exec-directory') for completion
 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.
+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)
@@ -1138,7 +1139,9 @@
          (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'?
+        ; 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'
--- a/src/ChangeLog     2013-12-27 10:43:11 +0000
+++ b/src/ChangeLog     2013-12-27 20:58:21 +0000
@@ -1,3 +1,7 @@
+2013-12-27  Jarek Czekalski  <address@hidden>
+
+       * callproc.c (Vexec_path): Document that exec-directory is in it.
+
 2013-12-27  Steve Purcell  <address@hidden>  (tiny change)
 
        * nsterm.m (syms_of_nsterm): Enable ns-use-srgb-colorspace by

=== modified file 'src/callproc.c'
--- a/src/callproc.c    2013-12-18 20:36:50 +0000
+++ b/src/callproc.c    2013-12-27 20:58:21 +0000
@@ -1686,7 +1686,11 @@
 
   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).  */);
+Each element is a string (directory name) or nil (try default directory).
+
+By default the last element of this list is `exec-directory'. 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 via email to

[Prev in Thread] Current Thread [Next in Thread]