From: Bob Rogers <rogers@rgrjr.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 50279@debbugs.gnu.org
Subject: bug#50279: 28.0.50; ffap-file-finder customization no longer works
Date: Mon, 5 Sep 2022 20:10:03 -0700 [thread overview]
Message-ID: <25366.47627.123588.827321@orion.rgrjr.com> (raw)
In-Reply-To: <87v8qjth2k.fsf@gnus.org>
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)))
next prev parent reply other threads:[~2022-09-06 3:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2022-09-06 10:25 ` Lars Ingebrigtsen
2022-09-06 17:03 ` Bob Rogers
2022-09-06 20:14 ` Lars Ingebrigtsen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25366.47627.123588.827321@orion.rgrjr.com \
--to=rogers@rgrjr.com \
--cc=50279@debbugs.gnu.org \
--cc=larsi@gnus.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.