From 7c3fef10d93bc54c540d2f26e11412ef487efc5d Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 8 Nov 2021 14:45:59 -0800 Subject: refactor(wpcarro/emacs): Prefer simpler project-find-file This version better interacts with google3. Change-Id: Ib65618dbdc7d76a27479a4e0cfc52c079537dc64 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4808 Tested-by: BuildkiteCI Reviewed-by: wpcarro Autosubmit: wpcarro --- users/wpcarro/emacs/.emacs.d/wpc/bookmark.el | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'users/wpcarro/emacs/.emacs.d/wpc/bookmark.el') diff --git a/users/wpcarro/emacs/.emacs.d/wpc/bookmark.el b/users/wpcarro/emacs/.emacs.d/wpc/bookmark.el index 47da863a676c..26c20399e2d4 100644 --- a/users/wpcarro/emacs/.emacs.d/wpc/bookmark.el +++ b/users/wpcarro/emacs/.emacs.d/wpc/bookmark.el @@ -34,22 +34,11 @@ (cl-defstruct bookmark label path kbd) -;; TODO: Consider hosting this function somewhere other than here, since it -;; feels useful above of the context of bookmarks. -;; TODO: Assess whether it'd be better to use the existing function: -;; `counsel-projectile-switch-project-action'. See the noise I made on GH for -;; more context: https://github.com/ericdanan/counsel-projectile/issues/137 - (defun bookmark-handle-directory-dwim (path) - "Open PATH as either a project directory or a regular directory. -If PATH is `projectile-project-p', open with `counsel-projectile-find-file'. -Otherwise, open with `counsel-find-file'." - (if (projectile-project-p path) - (with-temp-buffer - (cd (projectile-project-p path)) - (call-interactively #'counsel-projectile-find-file)) - (let ((ivy-extra-directories nil)) - (counsel-find-file path)))) + "Open PATH as either a project directory or a regular directory." + (with-temp-buffer + (cd path) + (call-interactively #'project-find-file))) (defconst bookmark-handle-directory #'bookmark-handle-directory-dwim "Function to call when a bookmark points to a directory.") -- cgit 1.4.1