From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#31357: 26.1; tramp-make-tramp-file-name: incompatible lisp changes in 26.1 ? Date: Thu, 03 May 2018 17:26:11 +0200 Message-ID: <87k1sksquk.fsf@gmx.de> References: <0a062d8f1fea73fcead8cafe8f225378@webmail.orcon.net.nz> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1525361109 29969 195.159.176.226 (3 May 2018 15:25:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 3 May 2018 15:25:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 31357@debbugs.gnu.org To: Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 03 17:25:04 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fEG6S-0007iB-Kj for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 May 2018 17:25:04 +0200 Original-Received: from localhost ([::1]:57268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEG8Z-00036B-Nh for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 May 2018 11:27:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEG8Q-00033o-22 for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 11:27:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEG8M-0007ay-2C for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 11:27:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40483) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEG8L-0007ao-V1 for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 11:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fEG8L-0003Ay-Me for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 11:27:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <0a062d8f1fea73fcead8cafe8f225378@webmail.orcon.net.nz> Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 May 2018 15:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31357 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31357-submit@debbugs.gnu.org id=B31357.152536118812166 (code B ref 31357); Thu, 03 May 2018 15:27:01 +0000 Original-Received: (at 31357) by debbugs.gnu.org; 3 May 2018 15:26:28 +0000 Original-Received: from localhost ([127.0.0.1]:48380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fEG7o-0003A9-9s for submit@debbugs.gnu.org; Thu, 03 May 2018 11:26:28 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:51019) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fEG7m-00039x-Q9 for 31357@debbugs.gnu.org; Thu, 03 May 2018 11:26:27 -0400 Original-Received: from detlef.gmx.de ([212.86.52.157]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0McEI3-1ex0WB3ppv-00JcfE; Thu, 03 May 2018 17:26:13 +0200 X-Provags-ID: V03:K1:PNxCu5kQi8ByYFa4Q+CRL6edRaBT/UaUh6daRx8LkpFo2Qk7xDe KTJEwm/rn9VZ+DCA4m4vFoWd5SRpFePpezS9YgOV18DdjOJe8Lj4+fzYp/coOtDoG86AyOs TyrRi6x/Js+/hIAO4Qjwrqw86CSl8+CeN2sQ/xkSzSfT+C7UV0l4NF74gkTdkDPPw75JedO eeqj6aTNwjBJXn/Dx92Qg== X-UI-Out-Filterresults: notjunk:1;V01:K0:yqAQtQ7b6F4=:qFDUEhyz75/8Qyv6zPU/PG bsAYOeR6+VpkIPIVoquMXe7Ewv3NgHAwNaZAwAzLODULQbrxMMfYQcEJjgxxG9lrbv/Y9151O f/eGLe5sTAm5VSt14XeXMfNqTUw52GkGkZ9MpQmpmn1Go125wtXKO+B+ReLyk6nhDcxKqVGh1 agIOm8MIPlK1LhN1GDzSKv7swCHpRMeF0fzmI5ocjcTsURn3NnBwsJUVh6dX9NRxml6PI/lr3 TctnVKn5KURPYxT+ce6t7hckIf2HNBgJYkgEh8W5gdvC2/1+4bh5fB3x2L8hFLf9DAw26wAJp U6yII4m6SmOtQ9Rt4cMKLJhY9OeCBGFPLEwgn0VvDwsiHZ63V41M+t+uI6KQHnbVQkSERzwo3 577LGRyYYX2nZ/xIbr1R6JFhn9UFQ5cCAXgBXzgQITKxJeB9N5UfYxP4Pn0epBNRnd2J+SsrH eYHcSjVGzV0Kb9A+5e5Qq6ZTRGEcJYbmaAbKtlClHElnKois+rAHUMGLSoXAQLelUfZvbcQUi LHj3TeF/grTkXP3aboQGeGPvrCMLjY8GIwHer0tBztw27EcInOO05Wv6qIVk5V722CiwoS/cW QLY2qcnourWWXqDF3izZa/nxQ4LGhe5ObBSP+JCWuJhZm36VH+gSEjGIpPGi1w2XjXcA140Gl YvMn7juS7e/aCmt84DytEyYAlttEqCoTLUi2qnnRCK2eivs8vXVU/f8wMeAKSUw5RNFVXGP2d jRNZzO5F5ITzFB+hqGeYDWPp5Y6wNsqmqLSb8+olZ6EcDSFPGbq0LWIMh1j+ukV2vS+oojAa X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:145976 Archived-At: Phil Sainty writes: Hi Phil, > In Emacs 25 `tramp-make-tramp-file-name' takes 4-5 arguments: > (method user host localname &optional hop) > > In Emacs 26.1 it takes 6-7 > (method user domain host port localname &optional hop) > > That can then trigger a "wrong-number-of-arguments" error. > > This should surely be covered in NEWS under the "Incompatible Lisp > Changes in Emacs 26.1" section? `tramp-make-tramp-file-name' has never been documented as public function, it is intended for internal use. Granted, this should have been signalled better. > I have custom code where I am presently using the following construct > to deal with this. > > (if (version< emacs-version "26") > (tramp-make-tramp-file-name > method user host localname hop) > (tramp-make-tramp-file-name > method user domain host port localname hop)) > > (With a consequential complaint from the 26.1 byte-compiler about > the first of those two calls.) That's the way to go. You could use (funcall 'tramp-make-tramp-file-name ...) in order to make the byte compiler quiet. However, I wouldn't check for emacs-version. Tramp exist as separate package, and the recent Tramp 2.4 runs with all Emacs 24, 25, 26 and 27. You might check for tramp-version. > Is there a single approach which is backwards-compatible (at least with > Emacs 25) ? No. > For my specific use-case, what I really wanted was a way to modify only > a specific named component of a tramp file name, but I ended up using > `tramp-dissect-file-name', extracting the components with the various > `tramp-file-name-COMPONENT' functions, and using `tramp-make-file-name' > to put it all back together. I thought there might be a simpler way to > do this, but I didn't see one. Well, with Emacs 27 (Tramp 2.4) the function's signature has changed, again. It is now (&rest ARGS). This is backwards compatible to Tramp 2.3 / Emacs 26, that means (METHOD USER DOMAIN HOST PORT LOCALNAME &optional HOP) still works. More interesting is the new signature, (VEC &optional LOCALNAME HOP). Usually, you retrieve VEC by tramp-dissect-file-name, or it is already provided as argument (many Tramp functions do so). Then, most of the cases you want to change only the LOCALNAME, which you could do directly in the function call. If you want to change another component of VEC, you could do this via the access functions for the tramp-file-name structure VEC, like (setf (tramp-file-name-host vec) "whatever") (tramp-make-tramp-file-name vec "/remote/dir") So yes, if you want to support several Tramp versions, you must write compatibility functions. > -Phil Best regards, Michael.