bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#4410: 23.1.50; copy-file get wrong number of args with url-handler-m


From: Basil L. Contovounesios
Subject: bug#4410: 23.1.50; copy-file get wrong number of args with url-handler-mode
Date: Tue, 19 Mar 2019 16:33:31 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

found 4410 24.4
tags 4410 patch
quit

Chong Yidong <cyd@stupidchicken.com> writes:

>> Turn on url-handler-mode and evaluate
>>
>>   (copy-file
>>    "http://www.w3.org/QA/Tools/css-validator/css-validator.jar";
>>    "temp.tmp")
>>
>> This gives the error
>
> Thanks, I've checked in a fix.

This error was reintroduced in Emacs 24.4.
May I push the following fix to emacs-26?

>From bd5795e0d1eb1632909393612dd53b6beda606f0 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Tue, 19 Mar 2019 16:00:18 +0000
Subject: [PATCH] Fix url-copy-file arglist

* lisp/url/url-handlers.el: Silence byte-compiler.
(url-copy-file): Add 6th argument following change to copy-file in
2012-12-16T19:22:27+01:00!romain@orebokech.com. (bug#4410)
---
 lisp/url/url-handlers.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el
index 3af4e9e7b1..91f9b7f520 100644
--- a/lisp/url/url-handlers.el
+++ b/lisp/url/url-handlers.el
@@ -41,6 +41,9 @@
 (declare-function mm-decode-string "mm-bodies" (string charset))
 ;; mm-decode loads mail-parse.
 (declare-function mail-content-type-get "mail-parse" (ct attribute))
+;; mm-bodies loads mm-util.
+(declare-function mm-charset-to-coding-system "mm-util"
+                  (charset &optional lbt allow-override silent))
 
 ;; Implementation status
 ;; ---------------------
@@ -250,15 +253,15 @@ url-handler-file-remote-p
 ;; The actual implementation
 ;;;###autoload
 (defun url-copy-file (url newname &optional ok-if-already-exists
-                         _keep-time _preserve-uid-gid)
+                          _keep-time _preserve-uid-gid _preserve-permissions)
   "Copy URL to NEWNAME.  Both args must be strings.
-Signals a `file-already-exists' error if file NEWNAME already exists,
+Signal a `file-already-exists' error if file NEWNAME already exists,
 unless a third argument OK-IF-ALREADY-EXISTS is supplied and non-nil.
 A number as third arg means request confirmation if NEWNAME already exists.
 This is what happens in interactive use with M-x.
 Fourth arg KEEP-TIME non-nil means give the new file the same
 last-modified time as the old one.  (This works on only some systems.)
-Fifth arg PRESERVE-UID-GID is ignored.
+Args PRESERVE-UID-GID and PRESERVE-PERMISSIONS are ignored.
 A prefix arg makes KEEP-TIME non-nil."
   (if (and (file-exists-p newname)
           (not ok-if-already-exists))
@@ -341,7 +344,7 @@ url-insert-file-contents
     (unless buffer (signal 'file-error (list url "No Data")))
     (with-current-buffer buffer
       ;; XXX: This is HTTP/S specific and should be moved to url-http
-      ;; instead.  See https://debbugs.gnu.org/17549.
+      ;; instead.  See bug#17549.
       (when (bound-and-true-p url-http-response-status)
         ;; Don't signal an error if VISIT is non-nil, because
         ;; 'insert-file-contents' doesn't.  This is required to
@@ -354,7 +357,7 @@ url-insert-file-contents
                          (< url-http-response-status 300)))
           (let ((desc (nth 2 (assq url-http-response-status url-http-codes))))
             (kill-buffer buffer)
-            ;; Signal file-error per https://debbugs.gnu.org/16733.
+            ;; Signal file-error per bug#16733.
             (signal 'file-error (list url desc))))))
     (url-insert-buffer-contents buffer url visit beg end replace)))
 
-- 
2.20.1

Thanks,

-- 
Basil

reply via email to

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