summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfpi2020-01-29 17:37:23 +0100
committerfpi2020-01-29 17:59:01 +0100
commit7b8d9c9da4cfaba9e1fcb7a2796bdf084340e95a (patch)
tree2cd505318b03ab078a5e9bae881ceda8a8a4391c
parentEasier prefix for pdf-annot keybindings (diff)
Functions to create floating frames
Diffstat (limited to '')
-rw-r--r--emacs-init.org31
1 files changed, 31 insertions, 0 deletions
diff --git a/emacs-init.org b/emacs-init.org
index 6b2ad17..afb6f90 100644
--- a/emacs-init.org
+++ b/emacs-init.org
@@ -1693,6 +1693,7 @@ Use imagemagick and standalone class for latex preview.
#+END_SRC
*** Org-Capture
+Templates
#+BEGIN_SRC emacs-lisp
(use-package org-capture
:custom (
@@ -1760,6 +1761,36 @@ Use imagemagick and standalone class for latex preview.
)
)))
#+END_SRC
+Setup for floating capture window. For reference see [[https://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml][here]].
+#+begin_src emacs-lisp
+(defun fpi/make-floating-frame (&optional width height minibuffer name)
+ (interactive)
+ (let ((width (or width 80))
+ (height (or height 36))
+ (name (or name "*Floating Emacs*")))
+ (make-frame `((name . ,name)
+ (window-system . x)
+ (width . ,width)
+ (height . ,height)
+ (minibuffer . ,minibuffer)))))
+
+(defadvice org-capture-finalize
+ (after delete-capture-frame activate)
+ "Advise capture-finalize to close the frame"
+ (if (equal "*Capture*" (frame-parameter nil 'name))
+ (delete-frame)))
+(defadvice org-capture-destroy
+ (after delete-capture-frame activate)
+ "Advise capture-destroy to close the frame"
+ (if (equal "*Capture*" (frame-parameter nil 'name))
+ (delete-frame)))
+(defun fpi/make-floating-capture-frame ()
+ (interactive)
+ (select-frame (fpi/make-floating-frame 70 20 t "*Capture*"))
+ (add-hook 'org-capture-mode-hook 'delete-other-windows)
+ (org-capture)
+ (remove-hook 'org-capture-mode-hook 'delete-other-windows))
+#+end_src
*** Ricing
#+begin_src emacs-lisp
(setq line-spacing 0.1)