4

You could use this version of the function: (defun journal-entry () (interactive) (let* ((daily-name (format-time-string "%Y-%m-%d)")) (journal-path "~/Dropbox (Personal)/journal/") (journal-file (concat journal-path daily-name ".md"))) (find-file journal-file) (unless (file-exists-p journal-file) (insert "JOURNAL" "\n" ...


4

See standard library auto-insert.el, which is part of Emacs. To use it, customize options auto-insert and auto-insert-directory, then do this: (add-hook 'find-file-hook 'auto-insert) auto-insert is a variable defined in autoinsert.el. Its value is not-modified Documentation: Controls automatic insertion into newly found empty files. ...


4

You'll want to take a look at Agenda Views, Org-Mode Capture Templates and / or YASnippet. With Org-Mode you can set up capture templates for various tasks and for different target locations, and consolidate all that information in Agenda Views. Morever you can quickly store notes with little interruption to your workflow. There's a wealth of information ...


3

You can use the templating system of org-mode. If you insert the following lines at the end of your init.el file: (add-to-list 'org-structure-template-alist '("P" "#+TITLE:\n#+OPTIONS: html-postamble:nil whn:nil toc:nil nav:nil\n#+HTML_HEAD:\n#+HTML_HEAD_EXTRA:\n\n? ")) After you restart emacs or source your init.el file, you only have to ...


2

At @Drew's suggestion, here's a short example of combining YASnippet and auto-insert to achieve dynamic or interactive boilerplate. From my ~/.emacs.d/init.el: ;;{{{ yasnippet & auto-insert (use-package yasnippet :config (add-to-list 'yas-snippet-dirs "~/.emacs.d/snippets") (yas-global-mode 1)) (defun nega/yas-cmake-bp () (interactive) (yas-...


2

Try adding :empty-lines 0 to each template's set of properties. Zero is in fact the default value, so it would be strange if this was the solution, but maybe worth a try.


1

This seems to do the required trick. Found the jk-org-insert-time-stamp function here: https://emacs.stackexchange.com/a/27323/20123 . * PROJ %(progn (defun jk-org-insert-time-stamp (time-string) (interactive "sTime: ") (let ((default-time (apply 'encode-time (decode-time)))) (org-insert-time-stamp (apply 'encode-time (org-read-date-analyze ...


1

Library header2.el is generally for file headers, which use only code comments (see automatic file headers). But it really is about adding and updating (including automatically) boilerplate text that you define. That text need not be comment text. And it can be mode-specific or be applied conditionally in any other way.


1

I found the solution although I must admit, I still don’t see, why this problem never occured in Org outlines I typed in directly: The custom-set-variable is called org-adapt-indentation and it has to be set to nil. In other words, after I added: '(org-adapt-indentation nil) to my .emacs file I finally got rid of the white space (actually the indentation) ...


1

You are looking for org-capture-before-finalize-hook. (defcustom org-capture-before-finalize-hook nil "Hook that is run right before a capture process is finalized. The capture buffer is still current when this hook runs and it is widened to the entire buffer." :group 'org-capture :version "24.1" :type 'hook)


1

Maybe not exactly what you are expecting as not in .emacs file, but in another Org file, the solution I use for a long time is to use #+SETUPFILE: In your .org files: #+SETUPFILE: path_to_your_setup/setupFile.org #+TITLE: My Org document In the path_to_your_setup/ directory (your project root for instance), my setupFile.org is: #+OPTIONS: H:3 toc:t num:...


1

I don't know how much elisp you know, so I'll post this for whoever can use it. I have not tested this code, but here's another defun (modelled after the one above) that will copy N of your favorite templates into a new project directory, creating xxx_main.tex, xxx_coverpage.tex, etc. There are more flexible and sophisticated ways of doing this, but I just ...


1

It seems to me that you could do all that with some elisp programming. It doesn't sound too hard to me (mostly some keys bound to defuns that will copy / open / insert / write-out the files that you are talking about. Maybe with a comint call to the operating system, if need be. For example, here's my code that I use for fetching / inserting various code, ...


1

You can't do this with the t%^ template format strings. You can however call org-set-property when your template is constructed using the %(func) syntax. When called interactively org-set-property prompts for both the property and the value. Here's a simple example: (setq org-capture-templates '(("P" "Property" entry "* %? %(call-interactively #'...


Only top voted, non community-wiki answers of a minimum length are eligible