>From 5ee3ab88fb9c439165a23fad03468c62e2f3ce4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Sun, 28 Nov 2021 00:19:20 +0100 Subject: [PATCH 1/3] Explicitly bind project-read-file-name-function * ada-mode.el (ada-find-file): let-bind project-read-file-name-function. * NEWS: announce the change. --- NEWS | 13 +++++++++++++ ada-mode.el | 9 +++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index fe3e518f11..ff64186a13 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,19 @@ Please send ada-mode bug reports to bug-gnu-emacs@gnu.org, with 'ada-mode' in the subject. If possible, use M-x report-emacs-bug. +* Ada Mode x.x.x +xx Xxx xxxx + +** Adapt to change in uniquify-files. + uniquify-files no longer sets project-read-file-name-function by + default. ada-find-file (C-c C-t) will still use this package's + completion style, but project-find-file (C-x p f) will not by + default. + + Set project-read-file-name-function to uniq-file-read if you would + like to keep using uniquify-files's completion style outside of + ada-find-file. + * Ada Mode 7.2.0 21 Nov 2021 diff --git a/ada-mode.el b/ada-mode.el index a65c7b47da..9997f35c99 100644 --- a/ada-mode.el +++ b/ada-mode.el @@ -1462,12 +1462,13 @@ For `wisi-indent-calculate-functions'. "Find a file in the current project. Prompts with completion, defaults to filename at point." (interactive) - ;; In emacs 27, we can just call 'project-find-file; - ;; project-read-file-name-function handles the uniquify-files alist - ;; completion table. In emacs 26, we must do that ourselves. + ;; In emacs 27, we can just set project-read-file-name-function to + ;; tell 'project-find-file to use the uniquify-files alist + ;; completion table. In emacs 26, we must do that ourselves. (cl-ecase emacs-major-version (27 - (project-find-file)) + (let ((project-read-file-name-function #'uniq-file-read)) + (project-find-file))) (26 (let* ((def (thing-at-point 'filename)) -- 2.34.0