commit 375bfbde06031d7e9ce363a6695b22b47c6a2798 (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Mon Apr 10 10:21:44 2017 +0200 Make sure that `shell' makes BUFFER current * lisp/shell.el (shell): Restrict scope of recently added `with-current-buffer' to make sure that BUFFER is current when `shell' returns. diff --git a/lisp/shell.el b/lisp/shell.el index e03ccbb4f9..c5e5cbbee7 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -729,25 +729,26 @@ Otherwise, one argument `-i' is passed to the shell. (file-local-name (read-file-name "Remote shell path: " default-directory shell-file-name - t shell-file-name)))))) - - ;; The buffer's window must be correctly set when we call comint - ;; (so that comint sets the COLUMNS env var properly). - (pop-to-buffer buffer) - (unless (comint-check-proc buffer) - (let* ((prog (or explicit-shell-file-name - (getenv "ESHELL") shell-file-name)) - (name (file-name-nondirectory prog)) - (startfile (concat "~/.emacs_" name)) - (xargs-name (intern-soft (concat "explicit-" name "-args")))) - (unless (file-exists-p startfile) - (setq startfile (concat user-emacs-directory "init_" name ".sh"))) - (apply 'make-comint-in-buffer "shell" buffer prog - (if (file-exists-p startfile) startfile) - (if (and xargs-name (boundp xargs-name)) - (symbol-value xargs-name) - '("-i"))) - (shell-mode)))) + t shell-file-name))))))) + + ;; The buffer's window must be correctly set when we call comint + ;; (so that comint sets the COLUMNS env var properly). + (pop-to-buffer buffer) + ;; Rain or shine, BUFFER must be current by now. + (unless (comint-check-proc buffer) + (let* ((prog (or explicit-shell-file-name + (getenv "ESHELL") shell-file-name)) + (name (file-name-nondirectory prog)) + (startfile (concat "~/.emacs_" name)) + (xargs-name (intern-soft (concat "explicit-" name "-args")))) + (unless (file-exists-p startfile) + (setq startfile (concat user-emacs-directory "init_" name ".sh"))) + (apply 'make-comint-in-buffer "shell" buffer prog + (if (file-exists-p startfile) startfile) + (if (and xargs-name (boundp xargs-name)) + (symbol-value xargs-name) + '("-i"))) + (shell-mode))) buffer) ;;; Directory tracking commit 0fb52dcc45742af58a081bd6ca27b70f6a6a1899 Author: Dmitry Gutov Date: Mon Apr 10 06:22:55 2017 +0300 ; Add a FIXME about handing a missing find or grep program diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index a8933b0103..e9c42a129a 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -931,6 +931,10 @@ IGNORES is a list of glob patterns." (with-current-buffer buf (erase-buffer) (call-process-shell-command command nil t) + ;; FIXME: What to do when the call fails? + ;; "find: ‘zzgrep’: No such file or directory\n" + ;; The problem is, find-grep can exit with a nonzero code even + ;; when there are some matches in the output. (goto-char (point-min)) (while (re-search-forward grep-re nil t) (push (list (string-to-number (match-string 2)) commit f3662966c3e8caded696dfd9f0e5d61666c4f886 Author: Jim Blandy Date: Mon Apr 10 05:52:09 2017 +0300 Default to PCRE syntax when reading .hgignore * lisp/vc/vc-hg.el (vc-hg--slurp-hgignore-1): Default to the PCRE syntax (bug#26249). diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 8a2b07718c..e10daad72f 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -826,7 +826,7 @@ if we don't understand a construct, we signal prefix))) (defun vc-hg--slurp-hgignore-1 (hgignore prefix) - (let ((default-syntax 'vc-hg--hgignore-add-glob)) + (let ((default-syntax 'vc-hg--hgignore-add-pcre)) (with-temp-buffer (let ((attr (file-attributes hgignore))) (when attr (insert-file-contents hgignore)) commit 9e1f45d98f82278845b57fce9796142c8e3bf778 Author: Michael Albinus Date: Sun Apr 9 13:28:24 2017 +0200 Document Tramp changes * doc/misc/tramp.texi (Change file name syntax): New node. * etc/NEWS: Mention `tramp-change-syntax'. * lisp/net/tramp.el (tramp-file-name-regexp): Reinsert it. External packages uses it. (tramp-syntax): Set also `tramp-file-name-regexp'. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index b19836d0b9..179578eea9 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -155,7 +155,10 @@ Configuring @value{tramp} for use Using @value{tramp} -* File name Syntax:: @value{tramp} file name conventions. +* File name syntax:: @value{tramp} file name conventions. +@ifset unified +* Change file name syntax:: Alternative file name syntax. +@end ifset * File name completion:: File name completion. * Ad-hoc multi-hops:: Declaring multiple hops in the file name. * Remote processes:: Integration with other Emacs packages. @@ -997,7 +1000,7 @@ Other methods to include are: @option{ftp} and @option{smb}. @cindex default method In a remote file name, the use of a default method is indicated by the -pseudo method @option{-}, @ref{File name Syntax}. +pseudo method @option{-}, @ref{File name syntax}. @defopt tramp-default-method Default method is for transferring files. The user option @@ -2131,7 +2134,10 @@ is a feature of Emacs that may cause missed prompts when using @value{tramp}. @menu -* File name Syntax:: @value{tramp} file name conventions. +* File name syntax:: @value{tramp} file name conventions. +@ifset unified +* Change file name syntax:: Alternative file name syntax. +@end ifset * File name completion:: File name completion. * Ad-hoc multi-hops:: Declaring multiple hops in the file name. * Remote processes:: Integration with other Emacs packages. @@ -2139,7 +2145,7 @@ is a feature of Emacs that may cause missed prompts when using @end menu -@node File name Syntax +@node File name syntax @section @value{tramp} file name conventions @cindex file name syntax @cindex file name examples @@ -2200,6 +2206,58 @@ pseudo method @file{-}. @end ifset +@ifset unified +@node Change file name syntax +@section Alternative file name syntax +@cindex change file name syntax +@cindex alternative file name syntax + +The syntax described in @ref{File name syntax} is the @code{default} +syntax, which is active after Emacs startup. However, this can be +changed. + +@deffn Command tramp-change-syntax syntax +This command changes the syntax @value{tramp} uses for remote file +names. Beside the @code{default} value, @var{syntax} can be + +@itemize +@item @code{simplified} +@cindex simplified syntax + +The remote file name syntax is similar to the syntax used by Ange FTP. +A remote file name has the form +@code{@value{prefix}user@@host@value{postfix}path/to/file}. The +@code{user@@} part is optional, and the method is determined by +@ref{Default Method}. + +@item @code{separate} +@cindex separate syntax + +@clear unified +@set separate +@include trampver.texi +The remote file name syntax is similar to the syntax used by XEmacs. +A remote file name has the form +@code{@trampfn{method,user@@host,path/to/file}}. The @code{method} +and @code{user@@} parts are optional. +@clear separate +@set unified +@include trampver.texi +@end itemize +@end deffn + +@defvar tramp-file-name-regexp +This variable keeps a regexp which matches the selected remote file +name syntax. However, it is not recommended to use this variable in +external packages, a call of @code{file-remote-p} is much more +appropriate. +@ifinfo +@pxref{Magic File Names, , , elisp} +@end ifinfo +@end defvar +@end ifset + + @node File name completion @section File name completion @cindex file name completion diff --git a/etc/NEWS b/etc/NEWS index e351abc159..b36db07360 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -655,6 +655,10 @@ remote file name starts with "/method:host:" or "/method:user@host:". "/-::" is the shortest remote file name then. +++ +*** The command 'tramp-change-syntax' allows to choose an alternative +remote file name syntax. + ++++ *** New connection method "sg", which supports editing files under a different group ID. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 818054676e..eb32bd6e0e 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -687,6 +687,8 @@ It can have the following values: (tramp-cleanup-all-buffers)) ;; Set the value: (set-default symbol value) + ;; Reset `tramp-file-name-regexp'. + (setq tramp-file-name-regexp (tramp-file-name-regexp)) ;; Rearrange file name handlers. (tramp-register-file-name-handlers))) @@ -892,6 +894,13 @@ This regexp should match Tramp file names but no other file names." "Value for `tramp-file-name-regexp' for autoload. It must match the initial `tramp-syntax' settings.") +;; External packages use constant `tramp-file-name-regexp'. In order +;; not to break them, we still provide it. It is a variable now. +;;;###autoload +(defvar tramp-file-name-regexp tramp-initial-file-name-regexp + "Value for `tramp-file-name-regexp' for autoload. +It must match the initial `tramp-syntax' settings.") + ;;;###autoload (defconst tramp-completion-file-name-regexp-default (concat