diff options
author | thdox <thdox@free.fr> | 2014-05-17 16:52:06 +0200 |
---|---|---|
committer | thdox <thdox@free.fr> | 2014-05-17 16:52:06 +0200 |
commit | d2db0f9102ac0a7a1a4d9c47e46ac2bba438fde1 (patch) | |
tree | 7d2a96dd5e6b2c7eb585c17956415fa7eeb3c32a /lisp/ledger-init.el | |
parent | 35a36f33aa1a5eeb40a028bbab30cf75ec04dd54 (diff) | |
download | fork-ledger-d2db0f9102ac0a7a1a4d9c47e46ac2bba438fde1.tar.gz fork-ledger-d2db0f9102ac0a7a1a4d9c47e46ac2bba438fde1.tar.bz2 fork-ledger-d2db0f9102ac0a7a1a4d9c47e46ac2bba438fde1.zip |
Indent & untabify
M-x mark-whole-buffer
M-x indent-region
M-x mark-whole-buffer
M-x untabify
Diffstat (limited to 'lisp/ledger-init.el')
-rw-r--r-- | lisp/ledger-init.el | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/lisp/ledger-init.el b/lisp/ledger-init.el index 531f2c45..491f20cf 100644 --- a/lisp/ledger-init.el +++ b/lisp/ledger-init.el @@ -37,34 +37,34 @@ (let (environment-alist) (goto-char (point-min)) (while (re-search-forward ledger-init-string-regex nil t ) - (let ((matchb (match-beginning 0)) ;; save the match data, string-match stamp on it - (matche (match-end 0))) - (end-of-line) - (setq environment-alist - (append environment-alist - (list (cons (let ((flag (buffer-substring-no-properties (+ 2 matchb) matche))) - (if (string-match "[ \t\n\r]+\\'" flag) - (replace-match "" t t flag) - flag)) - (let ((value (buffer-substring-no-properties matche (point) ))) - (if (> (length value) 0) - value - t)))))))) + (let ((matchb (match-beginning 0)) ;; save the match data, string-match stamp on it + (matche (match-end 0))) + (end-of-line) + (setq environment-alist + (append environment-alist + (list (cons (let ((flag (buffer-substring-no-properties (+ 2 matchb) matche))) + (if (string-match "[ \t\n\r]+\\'" flag) + (replace-match "" t t flag) + flag)) + (let ((value (buffer-substring-no-properties matche (point) ))) + (if (> (length value) 0) + value + t)))))))) environment-alist))) (defun ledger-init-load-init-file () (interactive) (let ((init-base-name (file-name-nondirectory ledger-init-file-name))) (if (get-buffer init-base-name) ;; init file already loaded, parse it and leave it - (setq ledger-environment-alist + (setq ledger-environment-alist (ledger-init-parse-initialization init-base-name)) - (when (and ledger-init-file-name - (file-exists-p ledger-init-file-name) - (file-readable-p ledger-init-file-name)) - (find-file-noselect ledger-init-file-name) - (setq ledger-environment-alist - (ledger-init-parse-initialization init-base-name)) - (kill-buffer init-base-name))))) + (when (and ledger-init-file-name + (file-exists-p ledger-init-file-name) + (file-readable-p ledger-init-file-name)) + (find-file-noselect ledger-init-file-name) + (setq ledger-environment-alist + (ledger-init-parse-initialization init-base-name)) + (kill-buffer init-base-name))))) (provide 'ledger-init) |