unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Alejandro Pérez Carballo" <apc@umass.edu>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 58964@debbugs.gnu.org
Subject: bug#58964: 28.2; `file-notify--handle-event` setting callback function to nil
Date: Thu, 3 Nov 2022 20:11:34 -0400	[thread overview]
Message-ID: <02BBE794-5B9D-4249-8A7F-51E1B03146E5@umass.edu> (raw)
In-Reply-To: <87fsf0bhus.fsf@gmx.de>

Hi Michael, 

Thanks for writing back. 

> This is not a valid call of `file-notify--handle-event', see its
> docstring how it shall be applied.

I've looked at the docstring but don't really see why what I gave is not a valid call of the function. 

    Signature
    (file-notify--handle-event DESC ACTIONS FILE FILE1-OR-COOKIE)
    
    Documentation
    Handle an event returned from file notification.
    
    DESC is the back-end descriptor.  ACTIONS is a list of:
     created
     changed
     attribute-changed
     deleted
     renamed           -- FILE is old name, FILE1-OR-COOKIE is new name or nil
     renamed-from      -- FILE is old name, FILE1-OR-COOKIE is cookie or nil
     renamed-to        -- FILE is new name, FILE1-OR-COOKIE is cookie or nil
     stopped           -- no more events after this should be sent


I thought the descriptor would just be one of the keys in the hash table that is the value of `file-notify-descriptors', but maybe I'm misunderstanding how that's all supposed to work. So basically, the call that's giving me the error is this: 

    (file-notify--handle-event 18 '(renamed attribute-changed deleted) "/Users/apc/tmp/test.el" nil)

Is that not a valid call? (I was passing as first argument `(car (hash-table-keys file-notify-descriptors))` because I thought it would be easier to use for reproduction purposes than asking people to see what the key associated with the visited file in `file-notify-descriptors` was.)

As for your other questions: I am not trying to call this function directly, but instead trying to find the source of an error message I've been getting on and off for months. After leaving `debug-on-error' on for a while, I finally got a backtrace. From what I could tell, that was the cause of the trouble. Something in my system is making a call to `file-notify--handle-event' with similar arguments (it was a different file, and a different key, the one that in fact was associated with the file in question in the `file-notify-descriptors` table). 

Unfortunately, I cannot find the original backtrace information. If indeed what I provided was not a valid call of the function, I'll have to wait until next time the error shows up and see if I get more information about what could be making that invalid call in my system. 

Best, 

A.

> On Nov 3, 2022, at 3:46 AM, Michael Albinus <michael.albinus@gmx.de> wrote:
> 
> Alejandro Pérez Carballo <apc@umass.edu> writes:
> 
> Hi Alejandro,
> 
>> The following minimal configuration can be used to trigger the bug on my
>> end, replacing “~/tmp/test.el” with a path to a file of your choice:
>> 
>>    (require 'filenotify)
>>    (require 'autorevert)
>>    (require 'subr-x)
>>    (global-auto-revert-mode)
>> 
>>    (save-window-excursion
>>      (find-file "~/tmp/test.el"))
>> 
>> Once that’s loaded, calling this:
>> 
>>    (file-notify--handle-event (car (hash-table-keys file-notify-descriptors)) '(renamed attribute-changed deleted) (expand-file-name "~/tmp/test.el") nil)
>> 
>> gives me an error
>> 
>>    file-notify--call-handler: Symbol’s function definition is void: nil
> 
> This is not a valid call of `file-notify--handle-event', see its
> docstring how it shall be applied.
> 
> Furthermore, this function is an internal one which shouldn't be called
> from outside filenotify.el. What's your use case for this?
> 
> Best regards, Michael.






  reply	other threads:[~2022-11-04  0:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 12:41 bug#58964: 28.2; `file-notify--handle-event` setting callback function to nil Alejandro Pérez Carballo
2022-11-03  7:46 ` Michael Albinus
2022-11-04  0:11   ` Alejandro Pérez Carballo [this message]
2022-11-04 13:09     ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02BBE794-5B9D-4249-8A7F-51E1B03146E5@umass.edu \
    --to=apc@umass.edu \
    --cc=58964@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).