Comments? [email protected]
- 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!)
Comments? [email protected]
#!/usr/bin/env zsh | |
# -*- coding: UTF8 -*- | |
# Author: Guillaume Bouvier -- [email protected] | |
# 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.
;; This function replaces all words in a buffer with words of the same length, | |
;; chosen at random from /usr/share/dict/words. Words are replaced consistently, | |
;; so e.g. "A" is always replaced with "Z". The mapping changes when Emacs is | |
;; restarted or when the cache buffer is killed. If all unique words of a certain | |
;; length are exhausted, random strings are used. | |
(defun ap/replace-words-randomly (&optional buffer) | |
"Replace all words in BUFFER or current buffer with randomly selected words from the dictionary. | |
Every time a new word is found, it is mapped to a replacement | |
word, so every instance of word A will be replaced with word Z." |
;;; 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 |
;;;;;; CIDER overlays | |
;; Very cool! | |
;; http://endlessparentheses.com/eval-result-overlays-in-emacs-lisp.html | |
;;;;;;; CIDER code | |
;; If I ever install CIDER, I can remove this part. | |
(defface cider-result-overlay-face |
(defmacro -$ (&rest body) | |
(cl-labels ((collect-vars | |
(&rest forms) | |
(cl-loop for form in forms | |
append (cl-loop for atom in form | |
if (and (symbolp atom) | |
(string-match (rx bos "$") | |
(symbol-name atom))) | |
collect atom | |
else if (consp form) |