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 | |
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')
-rw-r--r-- | contrib/raw/dotemacs.el | 82 | ||||
-rw-r--r-- | contrib/raw/ledger-matching.el | 92 |
2 files changed, 87 insertions, 87 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." diff --git a/contrib/raw/ledger-matching.el b/contrib/raw/ledger-matching.el index 7c568126..b8e62dd9 100644 --- a/contrib/raw/ledger-matching.el +++ b/contrib/raw/ledger-matching.el @@ -202,13 +202,13 @@ (defun ledger-receipt-skip () "Move the current image to the Skip directory because its not relevant." - (rename-file (concat ledger-matching-sourcedir "/" - ledger-matching-image-name) - (concat ledger-matching-sourcedir "/Skip/" - ledger-matching-image-name)) + (rename-file (concat ledger-matching-sourcedir "/" + ledger-matching-image-name) + (concat ledger-matching-sourcedir "/Skip/" + ledger-matching-image-name)) - ;; Update the receipt screen at the same offset - (ledger-matching-update-current-image)) + ;; Update the receipt screen at the same offset + (ledger-matching-update-current-image)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Items below are speed entry macros, and should eventually migrate to their own file. @@ -242,19 +242,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." @@ -296,33 +296,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." |