diff options
author | thdox <thdox@free.fr> | 2015-02-08 16:40:24 +0100 |
---|---|---|
committer | thdox <thdox@free.fr> | 2015-02-10 21:42:50 +0100 |
commit | 8162cc783da82b5383e6403c80930034582bb366 (patch) | |
tree | 98f5a4e1d305c6b74c8276619a2eef1f1690af5c /contrib/raw/dotemacs.el | |
parent | f8dd075e25fae467ad13776eb366a8eb4799f68a (diff) | |
download | fork-ledger-8162cc783da82b5383e6403c80930034582bb366.tar.gz fork-ledger-8162cc783da82b5383e6403c80930034582bb366.tar.bz2 fork-ledger-8162cc783da82b5383e6403c80930034582bb366.zip |
[emacs] C-x h M-x untabify RET
C-x h M-x indent-region RET
[ci skip]
Diffstat (limited to 'contrib/raw/dotemacs.el')
-rw-r--r-- | contrib/raw/dotemacs.el | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/contrib/raw/dotemacs.el b/contrib/raw/dotemacs.el index b270042e..a4babed7 100644 --- a/contrib/raw/dotemacs.el +++ b/contrib/raw/dotemacs.el @@ -1,5 +1,5 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Ledger +;; Ledger ;; Maybe later add this to the expense repo once it settles (add-to-list 'load-path "/home/adamsrl/.emacs.d/addons/ledger") @@ -104,19 +104,19 @@ (defun ledger-expense-shortcut () "Updates the ER and Project metadata with the current values of the shortcut variables." - (interactive) - (when (eq major-mode 'ledger-mode) - (if (or (eql *ledger-expense-shortcut-ER* "") - (eql *ledger-expense-shortcut-Proj* "")) - (message "Run ledger-expense-shortcut-setup first.") - (save-excursion - (search-forward "; ER:") - (kill-line nil) - (insert " " *ledger-expense-shortcut-ER*)) - (save-excursion - (search-forward "; PROJECT:") - (kill-line nil) - (insert " " *ledger-expense-shortcut-Proj*))))) + (interactive) + (when (eq major-mode 'ledger-mode) + (if (or (eql *ledger-expense-shortcut-ER* "") + (eql *ledger-expense-shortcut-Proj* "")) + (message "Run ledger-expense-shortcut-setup first.") + (save-excursion + (search-forward "; ER:") + (kill-line nil) + (insert " " *ledger-expense-shortcut-ER*)) + (save-excursion + (search-forward "; PROJECT:") + (kill-line nil) + (insert " " *ledger-expense-shortcut-Proj*))))) (defun ledger-expense-split () "Splits the current transaction between internal and projects." @@ -158,33 +158,33 @@ (defun ledger-expense-personal () "Makes the expense an personal one, eliminating metadata and receipts." - (interactive) - (when (eq major-mode 'ledger-mode) ; I made this local now, should only trigger in ldg-mode - (save-excursion - (end-of-line) - (re-search-backward "^[0-9]\\{4\\}/") - (let ((begin (point)) - (end (save-excursion (re-search-forward "^$")))) - (when (re-search-forward "^ Dest:Projects" end t) - (replace-match " Other:Personal")) - (goto-char begin) - (save-excursion - (when (re-search-forward "^ +; ER:" end t) - (beginning-of-line) - (kill-line 1))) - (save-excursion - (when (re-search-forward "^ +; PROJECT:" end t) - (beginning-of-line) - (kill-line 1))) - (save-excursion - (when (re-search-forward "^ +; CATEGORY:" end t) - (beginning-of-line) - (kill-line 1))) - (save-excursion - (when (re-search-forward "^ +; RECEIPT:" end t) - (beginning-of-line) - (kill-line 1))) - (ledger-toggle-current-entry))))) + (interactive) + (when (eq major-mode 'ledger-mode) ; I made this local now, should only trigger in ldg-mode + (save-excursion + (end-of-line) + (re-search-backward "^[0-9]\\{4\\}/") + (let ((begin (point)) + (end (save-excursion (re-search-forward "^$")))) + (when (re-search-forward "^ Dest:Projects" end t) + (replace-match " Other:Personal")) + (goto-char begin) + (save-excursion + (when (re-search-forward "^ +; ER:" end t) + (beginning-of-line) + (kill-line 1))) + (save-excursion + (when (re-search-forward "^ +; PROJECT:" end t) + (beginning-of-line) + (kill-line 1))) + (save-excursion + (when (re-search-forward "^ +; CATEGORY:" end t) + (beginning-of-line) + (kill-line 1))) + (save-excursion + (when (re-search-forward "^ +; RECEIPT:" end t) + (beginning-of-line) + (kill-line 1))) + (ledger-toggle-current-entry))))) (defun ledger-expense-show-receipt () "Uses the Receipt buffer to show the receipt of the txn we're on." |