]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert "New command project-find-matching-file"
authorEshel Yaron <me@eshelyaron.com>
Fri, 14 Feb 2025 07:36:32 +0000 (08:36 +0100)
committerEshel Yaron <me@eshelyaron.com>
Fri, 14 Feb 2025 07:36:32 +0000 (08:36 +0100)
This reverts commit 5feb78ce7fda711dfd5e332bb04c951d312baadb.

lisp/progmodes/project.el

index 3d12c50b15ea3c221552d7ea5b290e0424cd89f9..ca19febce8fb229604ae753be361105ba77d5cc7 100644 (file)
@@ -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