Comments? sacha@sachachua.com
- Emacs learning curve?
- Mix of Emacs geeks skewed towards people who’ve been using this for a while (after all, takes a certain commitment to come all the way to an Emacs conference!)
(defun org-read-structure-template () | |
"Read org-mode structure template with completion. Returns template string." | |
(let* ((templates (map 'list 'second org-structure-template-alist)) | |
(prefixes (map 'list (lambda (tp) | |
;; Get template and pre-whitespace prefix for completion | |
(reverse (s-match (rx (group | |
(1+ (not (any "\n" space)))) | |
(1+ anything)) | |
tp))) | |
templates)) |
// createshortcut.js -- ++pentadactyl | |
// @Author: eric.zou (frederick.zou@gmail.com) | |
// @License: GPL (see http://www.gnu.org/licenses/gpl.txt) | |
// @Created: Tue 29 Nov 2011 01:24:05 PM CST | |
// @Last Change: Tue 29 Nov 2011 02:23:36 PM CST | |
// @Revision: 41 | |
// @Description: | |
// @Usage: | |
// @TODO: | |
// @CHANGES: |
(defun my/python-mode-outline-hook () | |
(setq outline-level 'my/python-outline-level) | |
(setq outline-regexp | |
(rx (or | |
;; Commented outline heading | |
(group | |
(* space) ; 0 or more spaces | |
(one-or-more (syntax comment-start)) | |
(one-or-more space) |
Comments? sacha@sachachua.com
#!/usr/bin/env zsh | |
# -*- coding: UTF8 -*- | |
# Author: Guillaume Bouvier -- guillaume.bouvier@ens-cachan.org | |
# 2016-05-10 15:36:06 (UTC+0200) | |
format_duration() | |
{ | |
diff=$1 # Duration in seconds | |
if test $diff -ge 86400; then |
(defun ap/org-return (&optional ignore) | |
"Add new list item, heading or table row with RET. | |
A double return on an empty element deletes it. Use a prefix arg | |
to get regular RET. " | |
;; See https://gist.github.com/alphapapa/61c1015f7d1f0d446bc7fd652b7ec4fe and | |
;; http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/ | |
(interactive "P") | |
(if ignore | |
(org-return) | |
(cond ((eq 'link (car (org-element-context))) |
(defun ap/org-avy-refile-as-child () | |
"Refile current heading as first child of heading selected with `avy.'" | |
;; Inspired by `org-teleport': http://kitchingroup.cheme.cmu.edu/blog/2016/03/18/Org-teleport-headlines/ | |
(interactive) | |
(let* ((org-reverse-note-order t) | |
(pos (save-excursion | |
(avy-with avy-goto-line (avy--generic-jump (rx bol "*") nil avy-style)) | |
(point))) | |
(filename (buffer-file-name (or (buffer-base-buffer (current-buffer)) | |
(current-buffer)))) |
Relations are maintained through the outline hierarchy and special properties on the entries so we can model arbitrary graphs instead of only DAGs. This means you can define parents or children completely outside the hierarchy or even in different files.
Relations are kept in sync bidirectionally so please only use the API to maintain them otherwise things might get lost. Because the relations are bidirectional the graph traversal and querying is extremly fast.
Parents are defined by the GRAPH_PARENTS
property as list of IDs and implicitly through the org outline hierarchy: all headlines above this one are this entry's parents.
;;; Neat convenience function for working with Elisp's EIEIO objects | |
(defmacro oref* (object &rest slots) | |
"Like `oref', but each slot in SLOTS is applied in sequence. | |
For example, | |
\(oref* obj :inner :property) | |
is equivalent to |