chiark
/
gitweb
/
~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a677bd3
)
el/dot-emacs.el: Trim leading spaces from diary entry strings.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 20 Mar 2016 19:42:15 +0000
(19:42 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sun, 20 Mar 2016 19:42:15 +0000
(19:42 +0000)
el/dot-emacs.el
patch
|
blob
|
blame
|
history
diff --git
a/el/dot-emacs.el
b/el/dot-emacs.el
index 91283d9a80dff576dfe70f504c3ab87eac9bd527..e50d77383b09645a62464209bcd56629ecb015c6 100644
(file)
--- a/
el/dot-emacs.el
+++ b/
el/dot-emacs.el
@@
-333,6
+333,14
@@
(defun mdw-todo (&optional when)
(nth 2 when))))))))
(eq w d)))
(nth 2 when))))))))
(eq w d)))
+(defadvice diary-add-to-list (before mdw-trim-leading-space activate)
+ "Trim leading space from the diary entry string."
+ (save-match-data
+ (let ((str (ad-get-arg 1)))
+ (if (and str (string-match "^[ \t]+" str))
+ (let ((new (replace-match "" nil nil str)))
+ (ad-set-arg 1 new))))))
+
;; Fighting with Org-mode's evil key maps.
(defvar mdw-evil-keymap-keys
;; Fighting with Org-mode's evil key maps.
(defvar mdw-evil-keymap-keys