From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Recursive load? master build fail Date: Sun, 8 May 2016 00:17:08 -0700 Organization: UCLA Computer Science Department Message-ID: <572EE7F4.4060100@cs.ucla.edu> References: <52a1bc0e-762b-fbdc-8866-b03ef491b2ae@yandex.ru> <572E8365.9090803@cs.ucla.edu> <572E9CCB.7070401@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000104020604030408000704" X-Trace: ger.gmane.org 1462691868 25027 80.91.229.3 (8 May 2016 07:17:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 May 2016 07:17:48 +0000 (UTC) To: Kaushal Modi , Dmitry Gutov , Emacs developers , Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 08 09:17:39 2016 Return-path: Envelope-to: ged-emacs-devel@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 1azIyB-0002tH-0G for ged-emacs-devel@m.gmane.org; Sun, 08 May 2016 09:17:39 +0200 Original-Received: from localhost ([::1]:36153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azIyA-00041r-1t for ged-emacs-devel@m.gmane.org; Sun, 08 May 2016 03:17:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azIxu-0003xd-VD for emacs-devel@gnu.org; Sun, 08 May 2016 03:17:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azIxq-0002yA-Ke for emacs-devel@gnu.org; Sun, 08 May 2016 03:17:21 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azIxp-0002wo-89 for emacs-devel@gnu.org; Sun, 08 May 2016 03:17:18 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AD33F161215; Sun, 8 May 2016 00:17:13 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id HWvyK2mdd4y2; Sun, 8 May 2016 00:17:11 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 93700161216; Sun, 8 May 2016 00:17:11 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id b34wBx7qyUXk; Sun, 8 May 2016 00:17:11 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 64D17161215; Sun, 8 May 2016 00:17:11 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 In-Reply-To: <572E9CCB.7070401@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203692 Archived-At: This is a multi-part message in MIME format. --------------000104020604030408000704 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit After some experimenting I narrowed it down to the attached patch: reverting this change unbreaks the build on master. Michael? --------------000104020604030408000704 Content-Type: text/x-diff; name="0001-Continue-to-fix-Bug-10085.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Continue-to-fix-Bug-10085.patch" >From 97776f295d652aff97be91431ad53db5618ad2a2 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 7 May 2016 22:52:30 +0200 Subject: [PATCH] Continue to fix Bug#10085 * lisp/net/tramp.el (tramp-completion-file-name-handler-alist) : Add handler. (tramp-completion-handle-expand-file-name): New defun. (tramp-handle-file-name-as-directory): Handle completion mode case. * test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name): Fix test. (tramp-test24-file-name-completion): Extend test. --- lisp/net/tramp.el | 31 +++++++++++++++++--- test/lisp/net/tramp-tests.el | 67 +++++++++++++++++++++++++++++++------------- 2 files changed, 75 insertions(+), 23 deletions(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3da60e9..87ccae1 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1010,7 +1010,9 @@ tramp-current-connection ;;;###autoload (defconst tramp-completion-file-name-handler-alist - '((file-name-all-completions . tramp-completion-handle-file-name-all-completions) + '((expand-file-name . tramp-completion-handle-expand-file-name) + (file-name-all-completions + . tramp-completion-handle-file-name-all-completions) (file-name-completion . tramp-completion-handle-file-name-completion)) "Alist of completion handler functions. Used for file names matching `tramp-file-name-regexp'. Operations @@ -2261,6 +2263,23 @@ tramp-connectable-p (p (tramp-get-connection-process v))) (and p (processp p) (memq (process-status p) '(run open)))))))) +;;;###autoload +(defun tramp-completion-handle-expand-file-name + (name &optional dir) + "Like `expand-file-name' for Tramp files." + (if (tramp-completion-mode-p) + (progn + ;; If DIR is not given, use `default-directory' or "/". + (setq dir (or dir default-directory "/")) + ;; Unless NAME is absolute, concat DIR and NAME. + (unless (file-name-absolute-p name) + (setq name (concat (file-name-as-directory dir) name))) + ;; Return NAME. + name) + + (tramp-completion-run-real-handler + 'expand-file-name (list name dir)))) + ;; Method, host name and user name completion. ;; `tramp-completion-dissect-file-name' returns a list of ;; tramp-file-name structures. For all of them we return possible completions. @@ -2817,13 +2836,17 @@ tramp-handle-file-name-as-directory ;; `file-name-as-directory' would be sufficient except localname is ;; the empty string. (let ((v (tramp-dissect-file-name file t))) - ;; Run the command on the localname portion only. + ;; Run the command on the localname portion only unless we are in + ;; completion mode. (tramp-make-tramp-file-name (tramp-file-name-method v) (tramp-file-name-user v) (tramp-file-name-host v) - (tramp-run-real-handler - 'file-name-as-directory (list (or (tramp-file-name-localname v) ""))) + (if (and (tramp-completion-mode-p) + (zerop (length (tramp-file-name-localname v)))) + "" + (tramp-run-real-handler + 'file-name-as-directory (list (or (tramp-file-name-localname v) "")))) (tramp-file-name-hop v)))) (defun tramp-handle-file-name-completion diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index efb19e9..a85eed0 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -649,7 +649,9 @@ tramp--instrument-test-case (setq file (format "/%s:" file)) (should (string-equal (directory-file-name file) file)) (should - (string-equal (file-name-as-directory file) (concat file "./"))) + (string-equal + (file-name-as-directory file) + (if (tramp-completion-mode-p) file (concat file "./")))) (should (string-equal (file-name-directory file) file)) (should (string-equal (file-name-nondirectory file) ""))))))) @@ -1367,25 +1369,52 @@ tramp--instrument-test-case "Check `file-name-completion' and `file-name-all-completions'." (skip-unless (tramp--test-enabled)) - (let ((tmp-name (tramp--test-make-temp-name))) - (unwind-protect - (progn - (make-directory tmp-name) - (should (file-directory-p tmp-name)) - (write-region "foo" nil (expand-file-name "foo" tmp-name)) - (write-region "bar" nil (expand-file-name "bold" tmp-name)) - (make-directory (expand-file-name "boz" tmp-name)) - (should (equal (file-name-completion "fo" tmp-name) "foo")) - (should (equal (file-name-completion "b" tmp-name) "bo")) - (should - (equal (file-name-completion "b" tmp-name 'file-directory-p) "boz/")) - (should (equal (file-name-all-completions "fo" tmp-name) '("foo"))) - (should - (equal (sort (file-name-all-completions "b" tmp-name) 'string-lessp) - '("bold" "boz/")))) + (dolist (n-e '(nil t)) + (let ((non-essential n-e) + (tmp-name (tramp--test-make-temp-name)) + (method (file-remote-p tramp-test-temporary-file-directory 'method)) + (host (file-remote-p tramp-test-temporary-file-directory 'host))) + + (unwind-protect + (progn + ;; Method and host name in completion mode. + (when (tramp-completion-mode-p) + (unless (zerop (length method)) + (should + (member + (format "%s:" method) + (file-name-all-completions (substring method 0 1) "/")))) + (unless (zerop (length host)) + (should + (member + (format "%s:" host) + (file-name-all-completions (substring host 0 1) "/")))) + (unless (or (zerop (length method)) (zerop (length host))) + (should + (member + (format "%s:" host) + (file-name-all-completions + (substring host 0 1) (format "/%s:" method)))))) + + ;; Local files. + (make-directory tmp-name) + (should (file-directory-p tmp-name)) + (write-region "foo" nil (expand-file-name "foo" tmp-name)) + (write-region "bar" nil (expand-file-name "bold" tmp-name)) + (make-directory (expand-file-name "boz" tmp-name)) + (should (equal (file-name-completion "fo" tmp-name) "foo")) + (should (equal (file-name-completion "b" tmp-name) "bo")) + (should + (equal + (file-name-completion "b" tmp-name 'file-directory-p) "boz/")) + (should (equal (file-name-all-completions "fo" tmp-name) '("foo"))) + (should + (equal + (sort (file-name-all-completions "b" tmp-name) 'string-lessp) + '("bold" "boz/")))) - ;; Cleanup. - (ignore-errors (delete-directory tmp-name 'recursive))))) + ;; Cleanup. + (ignore-errors (delete-directory tmp-name 'recursive)))))) (ert-deftest tramp-test25-load () "Check `load'." -- 2.7.4 --------------000104020604030408000704--