summaryrefslogtreecommitdiff
path: root/lisp/ledger-init.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ledger-init.el')
-rw-r--r--lisp/ledger-init.el42
1 files changed, 21 insertions, 21 deletions
diff --git a/lisp/ledger-init.el b/lisp/ledger-init.el
index fd06d4c5..4ceee4f1 100644
--- a/lisp/ledger-init.el
+++ b/lisp/ledger-init.el
@@ -35,33 +35,33 @@
(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
- (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)))))
+ (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)))))
(provide 'ledger-init)