aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs/.emacs.d/init/ycp-markup.el1
-rw-r--r--misc/.bashrc1
-rwxr-xr-xmisc/bin/org-a-sync.el27
3 files changed, 23 insertions, 6 deletions
diff --git a/emacs/.emacs.d/init/ycp-markup.el b/emacs/.emacs.d/init/ycp-markup.el
index 6dd2c6e..093e818 100644
--- a/emacs/.emacs.d/init/ycp-markup.el
+++ b/emacs/.emacs.d/init/ycp-markup.el
@@ -65,6 +65,7 @@
(my-keybind markdown-mode-map "C-c C-l" 'markdown-insert-link)
(setq markdown-hide-urls t)
(put 'markdown-translate-filename-function 'safe-local-variable 'functionp)
+ (add-hook 'markdown-mode-hook 'turn-off-auto-fill)
(require 'my-markdown)
(my-keybind markdown-mode-map "<ret>" 'my-markdown-maybe-follow-thing-at-point))
diff --git a/misc/.bashrc b/misc/.bashrc
index 2d44565..f64de44 100644
--- a/misc/.bashrc
+++ b/misc/.bashrc
@@ -140,7 +140,6 @@ alias which='alias | which -i'
alias chx="chmod +x"
# dedicated emacs instances for emms and erc, see `my-profile' in my
# emacs init files
-alias emms='EMACS_PROFILE=emms emacs'
alias erc='EMACS_PROFILE=erc emacs'
# Safer default for cp, mv, rm. These will print a verbose output of
diff --git a/misc/bin/org-a-sync.el b/misc/bin/org-a-sync.el
index 7123f04..4ed9052 100755
--- a/misc/bin/org-a-sync.el
+++ b/misc/bin/org-a-sync.el
@@ -7,6 +7,21 @@
(my-setq-from-local my-org-agenda-and-next-export-files)
(my-setq-from-local org-agenda-files)
+(defvar my-org-agenda-export-seen (make-hash-table :test #'equal)
+ "Hash table of headings already shown in the current agenda run.")
+
+(defun my-org-agenda-drop-seen (item)
+ "Return agenda ITEM, or nil if its heading was already shown.
+Meant for `org-agenda-before-sorting-filter-function'. Items without
+an `org-hd-marker' (diary entries and the like) are always kept."
+ (let ((m (get-text-property 0 'org-hd-marker item)))
+ (if (not (and my-org-agenda-export-seen (markerp m) (marker-buffer m)))
+ item
+ (let ((key (cons (marker-buffer m) (marker-position m))))
+ (unless (gethash key my-org-agenda-export-seen)
+ (puthash key t my-org-agenda-export-seen)
+ item)))))
+
(progn
(setq org-todo-keywords
'((sequence "TODO(t)" "DOIN(i)" "WAIT(w)" "|"
@@ -16,16 +31,18 @@
org-enforce-todo-checkbox-dependencies nil)
(setq org-use-fast-todo-selection 'expert)
(setq org-agenda-custom-commands
- `(("A" "Agenda and next"
- ((agenda ""
+ `(("E" "Agenda and next (export: each heading once)"
+ ((agenda ""
((org-agenda-span 32)
;; only works when `org-agenda-start-on-weekday'
;; is nil
(org-agenda-start-day "-2d")))
(tags-todo "PRIORITY=\"A\"" nil))
- nil
- ,my-org-agenda-and-next-export-files
- )))
+ ;; Command-level settings are evaluated once per run, so both
+ ;; blocks share one fresh table.
+ ((org-agenda-before-sorting-filter-function
+ #'my-org-agenda-drop-seen))
+ ,my-org-agenda-and-next-export-files)))
(setq large-file-warning-threshold nil)
(setq org-agenda-todo-ignore-time-comparison-use-seconds t)
(setq org-agenda-todo-ignore-deadlines 'all)