summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-02-19 09:30:20 -0700
committerCraig Earls <enderw88@gmail.com>2013-02-19 09:30:20 -0700
commitcf39acfd8ba0ebb542cf32f86944b2b6361cc6db (patch)
tree9ef4ed998af7769b2ec1bd066e8b9de2f5e8a620 /lisp
parent7fc291aaf1fee11fe0fbe2f7e2fb64d924f45a85 (diff)
downloadfork-ledger-cf39acfd8ba0ebb542cf32f86944b2b6361cc6db.tar.gz
fork-ledger-cf39acfd8ba0ebb542cf32f86944b2b6361cc6db.tar.bz2
fork-ledger-cf39acfd8ba0ebb542cf32f86944b2b6361cc6db.zip
Fix another null buffer problem when closing ledger buffers
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ldg-new.el1
-rw-r--r--lisp/ldg-reconcile.el26
2 files changed, 15 insertions, 12 deletions
diff --git a/lisp/ldg-new.el b/lisp/ldg-new.el
index ab267747..1e70c432 100644
--- a/lisp/ldg-new.el
+++ b/lisp/ldg-new.el
@@ -47,6 +47,7 @@
(require 'ldg-fonts)
(require 'ldg-occur)
(require 'ldg-commodities)
+(require 'esh-arg)
;;; Code:
diff --git a/lisp/ldg-reconcile.el b/lisp/ldg-reconcile.el
index ebaf7949..6d7226de 100644
--- a/lisp/ldg-reconcile.el
+++ b/lisp/ldg-reconcile.el
@@ -232,23 +232,25 @@ and exit reconcile mode"
(interactive)
(let ((recon-buf (get-buffer ledger-recon-buffer-name))
buf)
- (with-current-buffer recon-buf
- (ledger-reconcile-quit-cleanup)
- (set 'buf ledger-buf)
- ;; Make sure you delete the window before you delete the buffer,
- ;; otherwise, madness ensues
- (delete-window (get-buffer-window recon-buf))
- (kill-buffer recon-buf)
- (set-window-buffer (selected-window) buf))))
+ (if recon-buf
+ (with-current-buffer recon-buf
+ (ledger-reconcile-quit-cleanup)
+ (set 'buf ledger-buf)
+ ;; Make sure you delete the window before you delete the buffer,
+ ;; otherwise, madness ensues
+ (delete-window (get-buffer-window recon-buf))
+ (kill-buffer recon-buf)
+ (set-window-buffer (selected-window) buf)))))
(defun ledger-reconcile-quit-cleanup ()
"Cleanup all hooks established by reconcile mode."
(interactive)
(let ((buf ledger-buf))
- (with-current-buffer buf
- (remove-hook 'after-save-hook 'ledger-reconcile-refresh-after-save t)
- (if ledger-fold-on-reconcile
- (ledger-occur-quit-buffer buf)))))
+ (if buf
+ (with-current-buffer buf
+ (remove-hook 'after-save-hook 'ledger-reconcile-refresh-after-save t)
+ (if ledger-fold-on-reconcile
+ (ledger-occur-quit-buffer buf))))))
(defun ledger-marker-where-xact-is (emacs-xact posting)
"Find the position of the EMACS-XACT in the `ledger-buf'.