2016-04-04 14:09:59 +00:00
|
|
|
|
;;; funcs.el --- Org Layer functions File for Spacemacs
|
|
|
|
|
;;
|
2020-09-16 21:34:40 +00:00
|
|
|
|
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
|
2016-04-04 14:09:59 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
;;
|
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
2017-01-08 12:12:06 +00:00
|
|
|
|
;; Autoload space-doc-mode
|
|
|
|
|
(autoload 'space-doc-mode "space-doc" nil 'interactive)
|
|
|
|
|
|
2016-06-14 09:35:54 +00:00
|
|
|
|
(defun org-projectile/capture (&optional arg)
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(if arg
|
2017-10-22 08:59:34 +00:00
|
|
|
|
(org-projectile-project-todo-completing-read :empty-lines 1)
|
|
|
|
|
(org-projectile-capture-for-current-project :empty-lines 1)))
|
2016-04-04 14:09:59 +00:00
|
|
|
|
|
2016-06-14 09:35:54 +00:00
|
|
|
|
(defun org-projectile/goto-todos ()
|
2016-04-04 14:09:59 +00:00
|
|
|
|
(interactive)
|
2017-08-13 05:59:04 +00:00
|
|
|
|
(org-projectile-goto-location-for-project (projectile-project-name)))
|
2016-04-30 02:47:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun spacemacs/ob-fix-inline-images ()
|
|
|
|
|
"Fix redisplay of inline images after a code block evaluation."
|
|
|
|
|
(when org-inline-image-overlays
|
|
|
|
|
(org-redisplay-inline-images)))
|
2016-04-19 10:29:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun spacemacs//surround-drawer ()
|
|
|
|
|
(let ((dname (read-from-minibuffer "" "")))
|
|
|
|
|
(cons (format ":%s:" (upcase (or dname ""))) ":END:")))
|
|
|
|
|
|
|
|
|
|
(defun spacemacs//surround-code ()
|
|
|
|
|
(let ((dname (read-from-minibuffer "" "")))
|
|
|
|
|
(cons (format "#+BEGIN_SRC %s" (or dname "")) "#+END_SRC")))
|
2017-06-06 13:32:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun spacemacs//evil-org-mode ()
|
|
|
|
|
(evil-org-mode)
|
|
|
|
|
(evil-normalize-keymaps))
|
2018-06-16 07:52:32 +00:00
|
|
|
|
|
|
|
|
|
(defun spacemacs/org-setup-evil-surround ()
|
|
|
|
|
(with-eval-after-load 'evil-surround
|
|
|
|
|
(add-to-list 'evil-surround-pairs-alist '(?: . spacemacs//surround-drawer))
|
|
|
|
|
(add-to-list 'evil-surround-pairs-alist '(?# . spacemacs//surround-code))))
|
2018-08-24 17:42:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun spacemacs/org-trello-pull-buffer ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(org-trello-sync-buffer 1))
|
|
|
|
|
|
|
|
|
|
(defun spacemacs/org-trello-push-buffer ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(org-trello-sync-buffer))
|
2018-09-04 22:23:29 +00:00
|
|
|
|
|
|
|
|
|
(defun spacemacs/org-trello-pull-card ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(org-trello-sync-card 1))
|
|
|
|
|
|
|
|
|
|
(defun spacemacs/org-trello-push-card ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(org-trello-sync-card))
|
2019-01-22 09:46:43 +00:00
|
|
|
|
|
|
|
|
|
(defun spacemacs/org-clock-jump-to-current-clock ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(org-clock-jump-to-current-clock))
|
2019-09-20 16:16:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun spacemacs/org-reveal-advice (&rest _args)
|
|
|
|
|
"Unfold the org headings for a target line.
|
|
|
|
|
This can be used to advice functions that might open .org files.
|
|
|
|
|
|
|
|
|
|
For example: To unfold from a magit diff buffer, evaluate the following:
|
|
|
|
|
(advice-add 'magit-diff-visit-file :after #'spacemacs/org-reveal-advice)"
|
|
|
|
|
(when (derived-mode-p 'org-mode)
|
|
|
|
|
(org-reveal)))
|