1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-30 08:09:04 +00:00

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.
This commit is contained in:
dickmao 2021-08-03 12:02:48 -04:00 committed by Lars Ingebrigtsen
parent b4f3e6caba
commit 253b36bd40
2 changed files with 18 additions and 3 deletions

View File

@ -1670,9 +1670,9 @@ See also the variables `ffap-dired-wildcards', `ffap-newfile-prompt',
((or (not ffap-newfile-prompt)
(file-exists-p filename)
(y-or-n-p "File does not exist, create buffer? "))
(funcall ffap-file-finder
;; expand-file-name fixes "~/~/.emacs" bug sent by CHUCKR.
(expand-file-name filename)))
(find-file
;; expand-file-name fixes "~/~/.emacs" bug sent by CHUCKR.
(expand-file-name filename)))
;; User does not want to find a non-existent file:
((signal 'file-missing (list "Opening file buffer"
"No such file or directory"

View File

@ -123,6 +123,21 @@ left alone when opening a URL in an external browser."
(save-excursion (insert "type="))
(ffap-guess-file-name-at-point))))
(ert-deftest ffap-ido-mode ()
(require 'ido)
(with-temp-buffer
(let ((ido-mode t)
(read-filename-function read-file-name-function)
(read-buffer-function read-buffer-function))
(ido-everywhere)
(let ((read-file-name-function (lambda (&rest args)
(expand-file-name
(nth 4 args)
(nth 1 args)))))
(save-excursion (insert "ffap-tests.el"))
(let (kill-buffer-query-functions)
(kill-buffer (call-interactively #'find-file-at-point)))))))
(provide 'ffap-tests)
;;; ffap-tests.el ends here