unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50279: 28.0.50; ffap-file-finder customization no longer works
@ 2021-08-30 17:07 Bob Rogers
  2021-08-31  1:59 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Bob Rogers @ 2021-08-30 17:07 UTC (permalink / raw)
  To: 50279

   I have a long-standing customization to ffap-file-finder which offers
external applications depending on file extension that is broken by the
following commit:

    commit 253b36bd40d1b342cdda09b0bee183788120f67e
    Author: dickmao <none>
    Date:   Tue Aug 3 12:02:48 2021 -0400

	ffap ido accommodation

	Now that ffap-file-finder can be ido-find-file, the
	noninteractive portion of find-file-at-point cannot
	assume ffap-file-finder always takes an argument
	(ido-find-file does not).

	* lisp/ffap.el (find-file-at-point): Do not call ffap-file-finder.
	* test/lisp/ffap-tests.el (ffap-ido-mode): Test it.

The essence of the change is that it does find-file at the critical
point instead of funcalling ffap-file-finder.  I assume that breaking
such extensions was not the intent, as it is an incompatible change to a
defcustom variable, and there is no associated NEWS entry.

					-- Bob Rogers
					   http://www.rgrjr.com/





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2021-08-30 17:07 bug#50279: 28.0.50; ffap-file-finder customization no longer works Bob Rogers
@ 2021-08-31  1:59 ` Lars Ingebrigtsen
       [not found]   ` <24877.41211.907036.418118@orion.rgrjr.com>
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-31  1:59 UTC (permalink / raw)
  To: Bob Rogers; +Cc: 50279, dick.r.chiang

Bob Rogers <rogers@rgrjr.com> writes:

>    I have a long-standing customization to ffap-file-finder which offers
> external applications depending on file extension that is broken by the
> following commit:
>
>     commit 253b36bd40d1b342cdda09b0bee183788120f67e
>     Author: dickmao <none>
>     Date:   Tue Aug 3 12:02:48 2021 -0400
>
> 	ffap ido accommodation

Do you have a test case that demonstrates the breakage?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
       [not found]   ` <24877.41211.907036.418118@orion.rgrjr.com>
@ 2021-08-31  3:43     ` Lars Ingebrigtsen
  2021-09-29 16:02       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-31  3:43 UTC (permalink / raw)
  To: Bob Rogers; +Cc: 50279

(Re-sending the mail to the bug tracker.)

Bob Rogers <rogers@rgrjr.com> writes:

>    From: Lars Ingebrigtsen <larsi@gnus.org>
>    Date: Tue, 31 Aug 2021 03:59:34 +0200
>
>    Do you have a test case that demonstrates the breakage?
>
> I can reproduce this using my full customizations, but not in emacs -Q
> with an excerpt of my code.  More precisely, the problem reproduces, but
> not the desired behavior after reverting the change.  And indeed,
> looking closer at the code, I don't understand why reverting this
> particular change should make a difference.  But it worked when I built
> emacs on 31-Jul (d3d6ea50d2) and didn't when I next built it on 11-Aug
> (3b5f8ab0d0), and I don't see any other change to ffap.el that might
> explain the difference.
>
>    I'll be out of town tomorrow, so I'll have to give this another look
> on Wednesday.
>
> 					-- Bob





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2021-08-31  3:43     ` Lars Ingebrigtsen
@ 2021-09-29 16:02       ` Lars Ingebrigtsen
  2021-09-29 16:11         ` Bob Rogers
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-29 16:02 UTC (permalink / raw)
  To: Bob Rogers; +Cc: 50279

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> I can reproduce this using my full customizations, but not in emacs -Q
>> with an excerpt of my code.  More precisely, the problem reproduces, but
>> not the desired behavior after reverting the change.  And indeed,
>> looking closer at the code, I don't understand why reverting this
>> particular change should make a difference.  But it worked when I built
>> emacs on 31-Jul (d3d6ea50d2) and didn't when I next built it on 11-Aug
>> (3b5f8ab0d0), and I don't see any other change to ffap.el that might
>> explain the difference.
>>
>>    I'll be out of town tomorrow, so I'll have to give this another look
>> on Wednesday.

This was a month ago -- did you make any further progress in debugging
this?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2021-09-29 16:02       ` Lars Ingebrigtsen
@ 2021-09-29 16:11         ` Bob Rogers
  2021-09-30  6:09           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Bob Rogers @ 2021-09-29 16:11 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50279

   From: Lars Ingebrigtsen <larsi@gnus.org>
   Date: Wed, 29 Sep 2021 18:02:52 +0200

   Lars Ingebrigtsen <larsi@gnus.org> writes:

   >> I can reproduce this using my full customizations, but not in emacs -Q
   >> with an excerpt of my code.  More precisely, the problem reproduces, but
   >> not the desired behavior after reverting the change.  And indeed,
   >> looking closer at the code, I don't understand why reverting this
   >> particular change should make a difference.  But it worked when I built
   >> emacs on 31-Jul (d3d6ea50d2) and didn't when I next built it on 11-Aug
   >> (3b5f8ab0d0), and I don't see any other change to ffap.el that might
   >> explain the difference.
   >>
   >>    I'll be out of town tomorrow, so I'll have to give this another look
   >> on Wednesday.

   This was a month ago -- did you make any further progress in debugging
   this?

It definitely has to do with my initializations, but I've been swamped
for the last three weeks and unable to get any further.  I should be
able to get back to it this week.

					-- Bob





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2021-09-29 16:11         ` Bob Rogers
@ 2021-09-30  6:09           ` Lars Ingebrigtsen
  2022-08-22 18:52             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-30  6:09 UTC (permalink / raw)
  To: Bob Rogers; +Cc: 50279

Bob Rogers <rogers@rgrjr.com> writes:

> It definitely has to do with my initializations, but I've been swamped
> for the last three weeks and unable to get any further.  I should be
> able to get back to it this week.

Great; there's no hurry.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2021-09-30  6:09           ` Lars Ingebrigtsen
@ 2022-08-22 18:52             ` Lars Ingebrigtsen
  2022-08-22 19:08               ` Bob Rogers
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-22 18:52 UTC (permalink / raw)
  To: Bob Rogers; +Cc: 50279

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> It definitely has to do with my initializations, but I've been swamped
>> for the last three weeks and unable to get any further.  I should be
>> able to get back to it this week.
>
> Great; there's no hurry.

This was almost a year ago.  Any progress?







^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2022-08-22 18:52             ` Lars Ingebrigtsen
@ 2022-08-22 19:08               ` Bob Rogers
  2022-08-23 10:00                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Bob Rogers @ 2022-08-22 19:08 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50279

   From: Lars Ingebrigtsen <larsi@gnus.org>
   Date: Mon, 22 Aug 2022 20:52:30 +0200

   Lars Ingebrigtsen <larsi@gnus.org> writes:

   >> It definitely has to do with my initializations, but I've been swamped
   >> for the last three weeks and unable to get any further.  I should be
   >> able to get back to it this week.
   >
   > Great; there's no hurry.

   This was almost a year ago.  Any progress?

I spent a while trying bifurcation last winter with no result.  I really
do want to resolve this issue, but I just moved my family across the
continent, and have barely had time to think for months now.  Our
furniture delivery has been delayed, so I've started to clean up some
software loose ends (and catch up on emacs-devel); with any luck I may
have time to look at this again.

   For once I have something to blame other than my world-class
procrastination skills . . .

					-- Bob





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2022-08-22 19:08               ` Bob Rogers
@ 2022-08-23 10:00                 ` Lars Ingebrigtsen
  2022-09-06  3:10                   ` Bob Rogers
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-23 10:00 UTC (permalink / raw)
  To: Bob Rogers; +Cc: 50279

Bob Rogers <rogers@rgrjr.com> writes:

> Our furniture delivery has been delayed, so I've started to clean up
> some software loose ends (and catch up on emacs-devel); with any luck
> I may have time to look at this again.

Great!

>    For once I have something to blame other than my world-class
> procrastination skills . . .

😀





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2022-08-23 10:00                 ` Lars Ingebrigtsen
@ 2022-09-06  3:10                   ` Bob Rogers
  2022-09-06 10:25                     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Bob Rogers @ 2022-09-06  3:10 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50279

   From: Lars Ingebrigtsen <larsi@gnus.org>
   Date: Tue, 23 Aug 2022 12:00:51 +0200

   Bob Rogers <rogers@rgrjr.com> writes:

   > Our furniture delivery has been delayed, so I've started to clean up
   > some software loose ends (and catch up on emacs-devel); with any luck
   > I may have time to look at this again.

   Great!

Having finally gotten around to investigating this properly, I find that
the solution should have been obvious:  dickmao removed the feature in
the following commit:

	commit 253b36bd40d1b342cdda09b0bee183788120f67e
	Author: dickmao <none>
	Date:   Tue Aug 3 12:02:48 2021 -0400

	    ffap ido accommodation

	    Now that ffap-file-finder can be ido-find-file, the
	    noninteractive portion of find-file-at-point cannot
	    assume ffap-file-finder always takes an argument
	    (ido-find-file does not).

	    * lisp/ffap.el (find-file-at-point): Do not call ffap-file-finder.
	    * test/lisp/ffap-tests.el (ffap-ido-mode): Test it.

I no longer understand why we thought it could not be reproduced in
"emacs -Q", as I can do so with the following code:

	(defun rgr-ffap-file-finder (file-name &optional wildcards)
	  (interactive "FFind file: \np")
	  (message "[got %S]" file-name)
	  (find-file file-name wildcards))

	(setq ffap-file-finder 'rgr-ffap-file-finder)

and this recipe:

   1.  "emacs -Q"

   2.  Load the code above.

   3.  Locate a suitable file in dired (I used a JPEG).

   4.  Position point on the file name, and do "M-x ffap".

The JPEG will appear in emacs but the "[got ...]" message will not
appear.  Additionally, find-file-at-point can be instrumented with the
patch below.  That will identify the exact find-file call being used,
and is how I traced it to this commit.

   But of course resolving my issue without breaking dickmao's issue is
beyond my pay grade.  ;-}  Though I do notice that ffap.el already has

	(memq ffap-file-finder '(find-file find-alternate-file))

as a way of testing for arg-handling capability.  But maybe that's
enough of a code smell.

					-- Bob

------------------------------------------------------------------------
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 88b4bce9fd..a4dec5e792 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1623,6 +1623,7 @@ find-file-at-point
        ((or (not ffap-newfile-prompt)
 	    (file-exists-p filename)
 	    (y-or-n-p "File does not exist, create buffer? "))
+        (message "ffap calling find-file on %S directly" filename)
 	(find-file
          ;; expand-file-name fixes "~/~/.emacs" bug
 	 (expand-file-name filename)))





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2022-09-06  3:10                   ` Bob Rogers
@ 2022-09-06 10:25                     ` Lars Ingebrigtsen
  2022-09-06 17:03                       ` Bob Rogers
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-06 10:25 UTC (permalink / raw)
  To: Bob Rogers; +Cc: 50279

Bob Rogers <rogers@rgrjr.com> writes:

>    But of course resolving my issue without breaking dickmao's issue is
> beyond my pay grade.  ;-}  Though I do notice that ffap.el already has
>
> 	(memq ffap-file-finder '(find-file find-alternate-file))
>
> as a way of testing for arg-handling capability.  But maybe that's
> enough of a code smell.

Yeah, the ffap code is kinda gross.

I think I've now fixed this in Emacs 29 by restoring the old code in
ffap and adjusting the hooks in ido instead.  Can you check whether this
fixed the problem for you?





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2022-09-06 10:25                     ` Lars Ingebrigtsen
@ 2022-09-06 17:03                       ` Bob Rogers
  2022-09-06 20:14                         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Bob Rogers @ 2022-09-06 17:03 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50279

   From: Lars Ingebrigtsen <larsi@gnus.org>
   Date: Tue, 06 Sep 2022 12:25:31 +0200

   Bob Rogers <rogers@rgrjr.com> writes:

   >    But of course resolving my issue without breaking dickmao's issue is
   > beyond my pay grade.  ;-}  Though I do notice that ffap.el already has
   >
   > 	(memq ffap-file-finder '(find-file find-alternate-file))
   >
   > as a way of testing for arg-handling capability.  But maybe that's
   > enough of a code smell.

   Yeah, the ffap code is kinda gross.

No argument from this quarter.

   I think I've now fixed this in Emacs 29 by restoring the old code in
   ffap and adjusting the hooks in ido instead.  Can you check whether this
   fixed the problem for you?

Works like a charm.  Another thorn in my side removed; thanks!

					-- Bob





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#50279: 28.0.50; ffap-file-finder customization no longer works
  2022-09-06 17:03                       ` Bob Rogers
@ 2022-09-06 20:14                         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-06 20:14 UTC (permalink / raw)
  To: Bob Rogers; +Cc: 50279

Bob Rogers <rogers@rgrjr.com> writes:

> Works like a charm.  Another thorn in my side removed; thanks!

Thanks for checking; I'm closing this bug report, then.






^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-09-06 20:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 17:07 bug#50279: 28.0.50; ffap-file-finder customization no longer works Bob Rogers
2021-08-31  1:59 ` Lars Ingebrigtsen
     [not found]   ` <24877.41211.907036.418118@orion.rgrjr.com>
2021-08-31  3:43     ` Lars Ingebrigtsen
2021-09-29 16:02       ` Lars Ingebrigtsen
2021-09-29 16:11         ` Bob Rogers
2021-09-30  6:09           ` Lars Ingebrigtsen
2022-08-22 18:52             ` Lars Ingebrigtsen
2022-08-22 19:08               ` Bob Rogers
2022-08-23 10:00                 ` Lars Ingebrigtsen
2022-09-06  3:10                   ` Bob Rogers
2022-09-06 10:25                     ` Lars Ingebrigtsen
2022-09-06 17:03                       ` Bob Rogers
2022-09-06 20:14                         ` Lars Ingebrigtsen

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).