parent
2254c5c6c6
commit
5666ae8631
5
init.el
5
init.el
|
@ -646,6 +646,11 @@
|
||||||
(:hook #'hl-line-mode)
|
(:hook #'hl-line-mode)
|
||||||
(add-hook 'org-agenda-after-show-hook 'org-narrow-to-subtree))
|
(add-hook 'org-agenda-after-show-hook 'org-narrow-to-subtree))
|
||||||
|
|
||||||
|
(setup org-attach
|
||||||
|
(:also-load +org-attach)
|
||||||
|
(:option org-attach-method 'lns)
|
||||||
|
(+org-attach-fix-args-mode +1))
|
||||||
|
|
||||||
(setup org-capture
|
(setup org-capture
|
||||||
(:require +org-capture)
|
(:require +org-capture)
|
||||||
(:+leader "c" #'org-capture "C-c" #'org-capture)
|
(:+leader "c" #'org-capture "C-c" #'org-capture)
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
;;; +org-attach.el --- Fixes for org-attach -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; `org-attach-attach' doesn't fix the path name. Before I submit a bug, I'm
|
||||||
|
;; just fixing it by advising `org-attach-attach'.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(defun +org-attach-attach-fix-args (args)
|
||||||
|
"ADVICE for `org-attach-attach' to normalize FILE first.
|
||||||
|
VISIT-DIR and METHOD are passed through unchanged.
|
||||||
|
|
||||||
|
This should be applied as `:filter-args' advice."
|
||||||
|
(cons (expand-file-name (car args)) (cdr args)))
|
||||||
|
|
||||||
|
(define-minor-mode +org-attach-fix-args-mode
|
||||||
|
"Fix the arguments passed to `org-attach-attach'.
|
||||||
|
This mode normalizes the filename passed to `org-attach-attach'
|
||||||
|
so that links can be properly made."
|
||||||
|
:lighter ""
|
||||||
|
:keymap nil
|
||||||
|
:global t ; I figure, what does this hurt?
|
||||||
|
(if +org-attach-fix-args-mode
|
||||||
|
(advice-add 'org-attach-attach :filter-args #'+org-attach-attach-fix-args)
|
||||||
|
(advice-remove 'org-attach-attach #'+org-attach-attach-fix-args)))
|
||||||
|
|
||||||
|
(provide '+org-attach)
|
||||||
|
;;; +org-attach.el ends here
|
Loading…
Reference in New Issue