From f6e36faeb53e884918831142452d5feece3d0db9 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Fri, 14 Feb 2025 08:36:32 +0100 Subject: [PATCH] Revert "New command project-find-matching-file" This reverts commit 5feb78ce7fda711dfd5e332bb04c951d312baadb. --- lisp/progmodes/project.el | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 3d12c50b15e..ca19febce8f 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1286,34 +1286,6 @@ directories listed in `vc-directory-exclusion-list'." (user-error "You didn't specify the file") (find-file file)))) -;;;###autoload -(defun project-find-matching-file () - "Visit the file that matches the current one, in another project. -It will skip to the same line number as well. -A matching file has the same file name relative to the project root. -When called during switching to another project, this command will -detect it and use the override. Otherwise, it prompts for the project -to use from the known list." - (interactive) - (let* ((pr (project-current)) - (line (line-number-at-pos nil t)) - relative-name mirror-name) - (if project-current-directory-override - (let* (project-current-directory-override - (real-project (project-current t))) - (setq relative-name (file-relative-name buffer-file-name - (project-root real-project)))) - (setq relative-name (file-relative-name buffer-file-name (project-root pr))) - (setq pr (project-read-project))) - (setq mirror-name (expand-file-name relative-name (project-root pr))) - (if (not (file-exists-p mirror-name)) - (user-error "File `%s' not found in `%s'" relative-name (project-root pr)) - (find-file mirror-name) - (save-restriction - (widen) - (goto-char (point-min)) - (forward-line (1- line)))))) - (defun project--completing-read-strict (prompt collection &optional predicate hist mb-default -- 2.39.5