Emacs: Also try and find a buffer named FILENAME, kinda WIP

This commit is contained in:
Joseph Ferano 2024-02-16 12:30:42 +08:00
parent 391e037d83
commit 29e1b25fef

View File

@ -1457,8 +1457,12 @@ These are functions to load a project specific file given the conventions I use.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun joe/project-open-project-file (FILENAME) (defun joe/project-open-project-file (FILENAME)
(when (project-current) (when (project-current)
(let ((proj-dir (project-root (project-current t)))) (let* ((proj-dir (project-root (project-current t)))
(find-file-other-window (expand-file-name FILENAME proj-dir))))) (file-path (expand-file-name FILENAME proj-dir)))
(if (file-exists-p file-path)
(find-file-other-window (expand-file-name FILENAME proj-dir))
(when (get-buffer FILENAME)
(switch-to-buffer (get-buffer FILENAME)))))))
(defun joe/project-open-project-todo () (defun joe/project-open-project-todo ()
(interactive) (interactive)