From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alejandro =?UTF-8?Q?P=C3=A9rez?= Carballo Newsgroups: gmane.emacs.bugs Subject: bug#58964: 28.2; `file-notify--handle-event` setting callback function to nil Date: Thu, 3 Nov 2022 20:11:34 -0400 Message-ID: <02BBE794-5B9D-4249-8A7F-51E1B03146E5@umass.edu> References: <87fsf0bhus.fsf@gmx.de> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8032"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58964@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 04 01:26:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqkXL-0001rA-DJ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Nov 2022 01:26:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqkX9-0006Is-BC; Thu, 03 Nov 2022 20:26:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqkJX-0005bt-8g for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 20:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqkJW-0003wk-Ko for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 20:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqkJW-0003uf-4V for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 20:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alejandro =?UTF-8?Q?P=C3=A9rez?= Carballo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Nov 2022 00:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58964 X-GNU-PR-Package: emacs Original-Received: via spool by 58964-submit@debbugs.gnu.org id=B58964.166752070515018 (code B ref 58964); Fri, 04 Nov 2022 00:12:02 +0000 Original-Received: (at 58964) by debbugs.gnu.org; 4 Nov 2022 00:11:45 +0000 Original-Received: from localhost ([127.0.0.1]:51032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqkJF-0003uA-61 for submit@debbugs.gnu.org; Thu, 03 Nov 2022 20:11:45 -0400 Original-Received: from mail-qt1-f195.google.com ([209.85.160.195]:45982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqkJC-0003tt-GP for 58964@debbugs.gnu.org; Thu, 03 Nov 2022 20:11:44 -0400 Original-Received: by mail-qt1-f195.google.com with SMTP id cg5so2230171qtb.12 for <58964@debbugs.gnu.org>; Thu, 03 Nov 2022 17:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umass.edu; s=google; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YXouRhLMsdBdhQ1oh1xyjeUzN/Y3CEKiimk4zPNkO94=; b=iyz/P3homTGMKlMWnWGwoSRnBrLno71cNuxA/mP3+Z3/ZbJ46tUMHKMdQEQAscjfbg PoK0D/+0om5Ki4c/+l/AWyfVuk1Dx5vJLI7Hqi5nwXh8qYRCtMs9y1vpB5B6D5ddEr4W 3bgYTxZpHEKPuJm3rBQyrE22rXE+JgpvCZd2U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YXouRhLMsdBdhQ1oh1xyjeUzN/Y3CEKiimk4zPNkO94=; b=Vti622X7pWBp5iS4BCNSGOSKE4aq+ytOVlqT7Brtb4iGDCF7pZKZWARujhh64Wgvts vDhxOW0eHfKi0Ca8M70q8L4Sy+sbZL5RT846L1kt9on8sclVEk1vaOamThGbzum6TG/9 RATSrfPiFAZAxsK6RiTkzJ0EooHO2bO+ek8Ms0qqzowupSb3z+zpNnnOBYa3kgw8bTAV r+ykyMNRuEHGFZSWUIHAU1wLe2OhHO4HGvFhzxrwAHmDRChsig9Vrbec8y0zbkqrN6Wm 0cAnipJEp99zwUqbWMrmhDpoe9mJ/+sqmfKM5P7ZDVpF5R90TgRkBy6EQR/86uCvkvxW 3gNQ== X-Gm-Message-State: ACrzQf2QfDMMAjWhIp3V12UQVq4NLPImNNtMA3ue2r59zg45oW2WWFwU 9vTpDy06/xv4ze3DFywUpP51cA== X-Google-Smtp-Source: AMsMyM7NLdozS+4GG7PEaCp3eSWtpCzfbjlNydff5Ny7/zDRUvON8d8pu/EXDeE284vdIk/DPhQO6Q== X-Received: by 2002:a05:622a:4d3:b0:3a5:c99:9471 with SMTP id q19-20020a05622a04d300b003a50c999471mr26999622qtx.325.1667520696758; Thu, 03 Nov 2022 17:11:36 -0700 (PDT) Original-Received: from smtpclient.apple (c-71-234-176-197.hsd1.ma.comcast.net. [71.234.176.197]) by smtp.gmail.com with ESMTPSA id x10-20020a05620a448a00b006cf19068261sm1866347qkp.116.2022.11.03.17.11.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Nov 2022 17:11:36 -0700 (PDT) In-Reply-To: <87fsf0bhus.fsf@gmx.de> X-Mailer: Apple Mail (2.3696.120.41.1.1) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247029 Archived-At: Hi Michael,=20 Thanks for writing back.=20 > 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.=20 Signature (file-notify--handle-event DESC ACTIONS FILE FILE1-OR-COOKIE) =20 Documentation Handle an event returned from file notification. =20 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:=20 (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. =46rom 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).=20 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.=20= Best,=20 A. > On Nov 3, 2022, at 3:46 AM, Michael Albinus = wrote: >=20 > Alejandro P=C3=A9rez Carballo writes: >=20 > Hi Alejandro, >=20 >> The following minimal configuration can be used to trigger the bug on = my >> end, replacing =E2=80=9C~/tmp/test.el=E2=80=9D with a path to a file = of your choice: >>=20 >> (require 'filenotify) >> (require 'autorevert) >> (require 'subr-x) >> (global-auto-revert-mode) >>=20 >> (save-window-excursion >> (find-file "~/tmp/test.el")) >>=20 >> Once that=E2=80=99s loaded, calling this: >>=20 >> (file-notify--handle-event (car (hash-table-keys = file-notify-descriptors)) '(renamed attribute-changed deleted) = (expand-file-name "~/tmp/test.el") nil) >>=20 >> gives me an error >>=20 >> file-notify--call-handler: Symbol=E2=80=99s function definition is = void: nil >=20 > This is not a valid call of `file-notify--handle-event', see its > docstring how it shall be applied. >=20 > Furthermore, this function is an internal one which shouldn't be = called > from outside filenotify.el. What's your use case for this? >=20 > Best regards, Michael.