2017-12-23 02:27:42 -05:00
|
|
|
;; private/default/autoload/default.el -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun +default/yank-buffer-filename ()
|
|
|
|
"Copy the current buffer's path to the kill ring."
|
|
|
|
(interactive)
|
|
|
|
(if-let* ((filename (or buffer-file-name (bound-and-true-p list-buffers-directory))))
|
|
|
|
(message (kill-new (abbreviate-file-name filename)))
|
|
|
|
(error "Couldn't find filename in current buffer")))
|
|
|
|
|
2017-12-23 02:50:07 -05:00
|
|
|
;;;###autoload
|
2017-12-23 16:16:12 -05:00
|
|
|
(defmacro +default--def-browse-in! (name dir)
|
|
|
|
(let ((prefix (cdr (doom-module-from-path (or load-file-name byte-compile-current-file)))))
|
|
|
|
`(defun ,(intern (format "%s/browse-%s" prefix name)) ()
|
2017-12-23 02:27:42 -05:00
|
|
|
(interactive)
|
|
|
|
(doom-project-browse ,dir))))
|
|
|
|
|
2017-12-23 02:50:07 -05:00
|
|
|
;;;###autoload
|
2017-12-23 02:27:42 -05:00
|
|
|
(defmacro +default--def-find-in! (name dir)
|
2017-12-23 16:16:12 -05:00
|
|
|
(let ((prefix (cdr (doom-module-from-path (or load-file-name byte-compile-current-file)))))
|
2017-12-23 02:27:42 -05:00
|
|
|
`(defun ,(intern (format "+%s/find-in-%s" prefix name)) ()
|
|
|
|
(interactive)
|
|
|
|
(doom-project-find-file ,dir))))
|
|
|
|
|
|
|
|
|
2017-12-23 02:50:07 -05:00
|
|
|
;;;###autoload (autoload '+default/browse-project "private/default/autoload/default" nil t)
|
|
|
|
(+default--def-browse-in! project (doom-project-root))
|
2017-12-23 02:27:42 -05:00
|
|
|
|
2017-12-23 02:50:07 -05:00
|
|
|
;;;###autoload (autoload '+default/find-in-templates "private/default/autoload/default" nil t)
|
2017-12-23 02:27:42 -05:00
|
|
|
(+default--def-find-in! templates +file-templates-dir)
|
2017-12-23 02:50:07 -05:00
|
|
|
;;;###autoload (autoload '+default/browse-templates "private/default/autoload/default" nil t)
|
2017-12-23 02:27:42 -05:00
|
|
|
(+default--def-browse-in! templates +file-templates-dir)
|
|
|
|
|
2017-12-23 02:50:07 -05:00
|
|
|
;;;###autoload (autoload '+default/find-in-emacsd "private/default/autoload/default" nil t)
|
2017-12-23 02:27:42 -05:00
|
|
|
(+default--def-find-in! emacsd doom-emacs-dir)
|
2017-12-23 02:50:07 -05:00
|
|
|
;;;###autoload (autoload '+default/browse-emacsd "private/default/autoload/default" nil t)
|
2017-12-23 02:27:42 -05:00
|
|
|
(+default--def-browse-in! emacsd doom-emacs-dir)
|
|
|
|
|
2017-12-23 02:50:07 -05:00
|
|
|
;;;###autoload (autoload '+default/find-in-notes "private/default/autoload/default" nil t)
|
2017-12-23 02:27:42 -05:00
|
|
|
(+default--def-find-in! notes +org-dir)
|
2017-12-23 02:50:07 -05:00
|
|
|
;;;###autoload (autoload '+default/browse-notes "private/default/autoload/default" nil t)
|
2017-12-23 02:27:42 -05:00
|
|
|
(+default--def-browse-in! notes +org-dir)
|
|
|
|
|
2017-12-23 02:50:07 -05:00
|
|
|
;;;###autoload (autoload '+default/find-in-snippets "private/default/autoload/default" nil t)
|
2017-12-23 02:27:42 -05:00
|
|
|
(+default--def-find-in! snippets +default-snippets-dir)
|
|
|
|
;; NOTE No need for a browse-snippets variant, use `yas-visit-snippet-file'
|
|
|
|
|