diff options
author | Jesse Alama <alama@stanford.edu> | 2009-02-21 17:42:39 -0800 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-24 16:12:18 -0400 |
commit | 119d86d31bc18100b52dc4707eb4f5afa88d71f5 (patch) | |
tree | a57080e8d7e8a0f6ceb79b32be92ba5fcb187e6b /lisp | |
parent | ace68028f485311eb592d013be88304ca9bc67a0 (diff) | |
download | fork-ledger-119d86d31bc18100b52dc4707eb4f5afa88d71f5.tar.gz fork-ledger-119d86d31bc18100b52dc4707eb4f5afa88d71f5.tar.bz2 fork-ledger-119d86d31bc18100b52dc4707eb4f5afa88d71f5.zip |
Make ledger-report buffers non-editable.
* lisp/ledger.el: Make ledger-report buffers non-editable.
Intuitively, a ledger-report buffer is a report -- the result of
applying a function to your ledger data. Thus, the buffers created by
ledger-reports aren't editable text; to "change" the ledger-report
buffer, change the ledger data from which the report is derived.
This commit alters ledger-report and ledger-report-redo.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ledger.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/ledger.el b/lisp/ledger.el index 0b04c0aa..6636e744 100644 --- a/lisp/ledger.el +++ b/lisp/ledger.el @@ -858,7 +858,9 @@ used to generate the buffer, navigating the buffer, etc." (set (make-local-variable 'ledger-report-name) report-name) (set (make-local-variable 'ledger-original-window-cfg) wcfg) (ledger-do-report (ledger-report-cmd report-name edit)) - (shrink-window-if-larger-than-buffer)))) + (shrink-window-if-larger-than-buffer) + (set-buffer-modified-p nil) + (setq buffer-read-only t)))) (defun string-empty-p (s) "Check for the empty string." @@ -979,8 +981,10 @@ the default." "Redo the report in the current ledger report buffer." (interactive) (ledger-report-goto) + (setq buffer-read-only nil) (erase-buffer) - (ledger-do-report ledger-report-cmd)) + (ledger-do-report ledger-report-cmd) + (setq buffer-read-only nil)) (defun ledger-report-quit () "Quit the ledger report buffer by burying it." |