Skip to content

Instantly share code, notes, and snippets.

@myme
Created June 22, 2018 11:39
Show Gist options
  • Save myme/654992463e0a6196d13428ae1bce0e40 to your computer and use it in GitHub Desktop.
Save myme/654992463e0a6196d13428ae1bce0e40 to your computer and use it in GitHub Desktop.
+lookup/file-fail.txt
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
find-file-name-handler(nil file-equal-p)
file-equal-p("/foo/bar/baz.txt" nil)
(if (file-equal-p fullpath buffer-file-name) (progn (user-error "Already here")))
(let ((fullpath (expand-file-name path))) (if (file-equal-p fullpath buffer-file-name) (progn (user-error "Already here"))) (let* ((insert-default-directory t) (project-root (doom-project-root 'nocache)) (ffap-file-finder (cond ((not (file-directory-p fullpath)) (function find-file)) ((file-in-directory-p fullpath project-root) (function (lambda (dir) (let ((default-directory dir)) (let (projectile-project-name projectile-require-project-root projectile-cached-buffer-file-name projectile-cached-project-root) (let ((file (projectile-completing-read "Find file: " (projectile-current-project-files) :initial-input path))) (find-file (expand-file-name file (projectile-project-root))) (run-hooks 'projectile-find-file-hook))))))) ((function doom-project-browse))))) (find-file-at-point path)))
(cond ((not path) (call-interactively (function find-file-at-point))) ((ffap-url-p path) (find-file-at-point path)) ((not (and +lookup-file-functions (+lookup--jump-to :file path))) (let ((fullpath (expand-file-name path))) (if (file-equal-p fullpath buffer-file-name) (progn (user-error "Already here"))) (let* ((insert-default-directory t) (project-root (doom-project-root 'nocache)) (ffap-file-finder (cond ((not (file-directory-p fullpath)) (function find-file)) ((file-in-directory-p fullpath project-root) (function (lambda (dir) (let ((default-directory dir)) (let (projectile-project-name projectile-require-project-root projectile-cached-buffer-file-name projectile-cached-project-root) (let ((file (projectile-completing-read "Find file: " (projectile-current-project-files) :initial-input path))) (find-file (expand-file-name file (projectile-project-root))) (run-hooks 'projectile-find-file-hook))))))) ((function doom-project-browse))))) (find-file-at-point path)))))
+lookup/file("/foo/bar/baz.txt")
funcall-interactively(+lookup/file "/foo/bar/baz.txt")
call-interactively(+lookup/file nil nil)
command-execute(+lookup/file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment