emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Fixes to allow erc-dcc-get-filter to work properly


From: Eli Zaretskii
Subject: Re: [PATCH] Fixes to allow erc-dcc-get-filter to work properly
Date: Sat, 09 Feb 2019 11:49:58 +0200

> From: Victor Orlikowski <address@hidden>
> CC: "address@hidden" <address@hidden>
> Date: Fri, 8 Feb 2019 22:00:31 +0000
> 
> The error checking I added came as a result of debugging the
> problem, and *may* not be strictly necessary (the nil check for str,
> the nil check for erc-dcc-byte-count).
> 
> I run ERC with erc-dcc-verbose set to t.
> I was getting the following error message, repeating several times:
> 
> error in process filter: erc-dcc-get-filter: Wrong type argument: stringp, nil
> 
> when trying to receive a file from a colleague using the DCC mechanism. I
> run ERC to communicate with colleagues via XMPP, using bitlbee as a
> gateway.
> 
> After putting in the error checks mentioned above, I managed to get
> a different error (again repeating several times) from
> erc-dcc-get-filter:
> 
> error in process filter: erc-display-message: Wrong type argument: stringp, 
> nil
> 
> When I set erc-dcc-verbose to nil, the above errors went away.
> 
> I set erc-dcc-verbose to t once more, and added code to the function
> to print each of:
> 
> buffer-file-name
> received-bytes
> 
> I discovered that buffer-file-name was nil - which was what
> had been causing these errors to occur.

Could it be that the problem is elsewhere?  erc-dcc-get-filter is a
filter function of a process, which is set up like this:

  (let* ((buffer (generate-new-buffer (file-name-nondirectory file)))
         proc)
    (with-current-buffer buffer
    [...]
      (setq erc-dcc-file-name file)

      [...]
      (setq proc
            (funcall erc-dcc-connect-function
                     "dcc-get" buffer
                     (plist-get entry :ip)
                     (string-to-number (plist-get entry :port))
                     entry))
      (set-process-buffer proc buffer)
      (set-process-coding-system proc 'binary 'binary)
      (set-buffer-file-coding-system 'binary t)

      (set-process-filter proc 'erc-dcc-get-filter)

As you see, the process whose filter is erc-dcc-get-filter is set up
so that the name of its process-buffer is derived from
erc-dcc-file-name, but I don't see the buffer-file-name of that buffer
being set anywhere.  If I'm right, then your change should use
buffer-name (the function) instead of buffer-file-name.  Can you
verify that buffer-name returns the name of erc-dcc-file-name, and
that using that return value resolves the problems you saw?



reply via email to

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