Skip to content

Commit

Permalink
Fix emacs 25 incompat in projectile--complementary-file
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceWarne authored and bbatsov committed Dec 20, 2021
1 parent f753cdb commit f7eba5e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -3442,17 +3442,17 @@ test file."
"No matching source file found for project type `%s'"
(projectile-project-type))))
;; find the matching test file
(if-let* ((error-msg (format
"No matching test file found for project type `%s'"
(projectile-project-type)))
(test-file (projectile-find-matching-test file-name))
(expanded-test-file (projectile-expand-root test-file)))
(cond ((file-exists-p expanded-test-file) expanded-test-file)
(projectile-create-missing-test-files
(projectile--create-directories-for expanded-test-file)
expanded-test-file)
(t (progn (error error-msg))))
(error error-msg))))
(let* ((error-msg (format
"No matching test file found for project type `%s'"
(projectile-project-type)))
(test-file (or (projectile-find-matching-test file-name)
(error error-msg)))
(expanded-test-file (projectile-expand-root test-file)))
(cond ((file-exists-p expanded-test-file) expanded-test-file)
(projectile-create-missing-test-files
(projectile--create-directories-for expanded-test-file)
expanded-test-file)
(t (progn (error error-msg)))))))

;;;###autoload
(defun projectile-find-implementation-or-test-other-window ()
Expand Down Expand Up @@ -3554,10 +3554,10 @@ More specifically, return DIR-FN applied to the directory of FILE-PATH
concatenated with FILENAME-FN applied to the file name of FILE-PATH.
If either function returns nil, return nil."
(when-let* ((filename (file-name-nondirectory file-path))
(complementary-filename (funcall filename-fn filename))
(dir (funcall dir-fn (file-name-directory file-path))))
(concat (file-name-as-directory dir) complementary-filename)))
(let ((filename (file-name-nondirectory file-path)))
(when-let ((complementary-filename (funcall filename-fn filename))
(dir (funcall dir-fn (file-name-directory file-path))))
(concat (file-name-as-directory dir) complementary-filename))))

(defun projectile--impl-file-from-src-dir-str (file-name)
"Return a path relative to the project root for the impl file of FILE-NAME using the src-dir and test-dir properties of the current project type which should be strings, nil returned if this is not the case."
Expand Down

0 comments on commit f7eba5e

Please sign in to comment.