diff options
Diffstat (limited to 'org.org')
-rw-r--r-- | org.org | 36 |
1 files changed, 30 insertions, 6 deletions
@@ -234,6 +234,18 @@ (require 'ol-info nil t) (setq org-link-abbrev-alist '(("jao.io" "https://jao.io/"))) + (defun jao-org-link-at-point (&optional copy) + (when (thing-at-point-looking-at "\\[\\[\\([^]]+\\)\\]\\[[^]]+\\]\\]") + (when copy (kill-ring-save (match-beginning 1) (match-end 1))) + (match-string-no-properties 1))) + + (defun jao-org-copy-link-at-point () + (interactive) + (message "%s" (or (jao-org-link-at-point t) "No link at point"))) + + (defun jao-org-insert-link (url title) + (insert (format "[[%s][%s]]" url title))) + (defun jao-insert-eww-link () "Look for last eww buffer and insert an org link to it." (interactive) @@ -241,22 +253,34 @@ (let ((lnk (with-current-buffer b (format "[[%s][%s]]" (eww-current-url) (jao-eww--title))))) (insert lnk)))) - #+end_src -* jao-org - #+begin_src emacs-lisp - (use-package jao-org-utils) (use-package jao-org-links :commands jao-org-links-setup :bind (("C-c T" . jao-org-insert-doc))) - (jao-org-utils-setup) - (jao-org-utils-eldoc-setup) (jao-org-links-setup jao-sink-dir) (with-eval-after-load "pdf-view" (define-key pdf-view-mode-map (kbd "C-c o") #'jao-org-pdf-goto-org) (define-key pdf-view-mode-map (kbd "C-c O") #'jao-org-pdf-goto-org*)) + + #+end_src +* Eldoc + #+begin_src emacs-lisp + (defun jao-org-eldoc--hook () + (set (make-local-variable 'eldoc-documentation-function) + 'jao-org-link-at-point) + (eldoc-mode)) + (add-hook 'org-mode-hook 'jao-org-eldoc--hook) + #+end_src +* Savedoc + #+begin_src emacs-lisp + (defun jao-org--show-if-hidden () + (when (outline-invisible-p) + (save-excursion + (outline-previous-visible-heading 1) + (org-show-subtree)))) + (add-hook 'org-mode-hook 'jao-org--show-if-hidden t) #+end_src * Geiser and org #+begin_src emacs-lisp |