summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-03-18 10:50:11 -0700
committerCraig Earls <enderw88@gmail.com>2013-03-18 10:50:11 -0700
commitea72ac29eadad36d2b9e37a168127cff76f2880a (patch)
treecdb19f810a3ad0d8ef9d52d8584baa29e9aa5b21
parent431d7e5b25f7e2997494ace7a0be78492c5d688b (diff)
downloadfork-ledger-ea72ac29eadad36d2b9e37a168127cff76f2880a.tar.gz
fork-ledger-ea72ac29eadad36d2b9e37a168127cff76f2880a.tar.bz2
fork-ledger-ea72ac29eadad36d2b9e37a168127cff76f2880a.zip
Enh918 Have occur mode searches stored in mini buffer history
-rw-r--r--lisp/ldg-occur.el5
-rw-r--r--lisp/ldg-report.el4
-rw-r--r--lisp/ldg-xact.el7
3 files changed, 8 insertions, 8 deletions
diff --git a/lisp/ldg-occur.el b/lisp/ldg-occur.el
index 8b56d12c..35ca7f3d 100644
--- a/lisp/ldg-occur.el
+++ b/lisp/ldg-occur.el
@@ -49,7 +49,7 @@
(defvar ledger-occur-history nil
"History of previously searched expressions for the prompt.")
-(make-variable-buffer-local 'ledger-occur-history)
+;;(make-variable-buffer-local 'ledger-occur-history)
(defvar ledger-occur-last-match nil
"Last match found.")
@@ -95,8 +95,7 @@ When REGEX is nil, unhide everything, and remove higlight"
(if ledger-occur-mode
(list nil)
(list (read-string (concat "Regexp<" (ledger-occur-prompt)
- ">: ") "" 'ledger-occur-history ))))
- (if (string-equal "" regex) (setq regex (ledger-occur-prompt)))
+ ">: ") nil 'ledger-occur-history (ledger-occur-prompt)))))
(ledger-occur-mode regex (current-buffer)))
(defun ledger-occur-prompt ()
diff --git a/lisp/ldg-report.el b/lisp/ldg-report.el
index 8d91d9d4..8e642a61 100644
--- a/lisp/ldg-report.el
+++ b/lisp/ldg-report.el
@@ -73,7 +73,7 @@ text that should replace the format specifier."
(defvar ledger-report-cmd-prompt-history nil)
(defvar ledger-original-window-cfg nil)
(defvar ledger-report-saved nil)
-
+(defvar ledger-minibuffer-history nil)
(defvar ledger-report-mode-abbrev-table)
(defun ledger-report-reverse-lines ()
@@ -236,7 +236,7 @@ used to generate the buffer, navigating the buffer, etc."
(if default
(concat " (" default "): ")
": "))))
- (read-string default-prompt nil nil default)))
+ (read-string default-prompt nil 'ledger-minibuffer-history default)))
(defun ledger-report-payee-format-specifier ()
"Substitute a payee name.
diff --git a/lisp/ldg-xact.el b/lisp/ldg-xact.el
index ecd87127..3e4cec4b 100644
--- a/lisp/ldg-xact.el
+++ b/lisp/ldg-xact.el
@@ -99,9 +99,10 @@ within the transaction."
(ignore (goto-char here))))))
(defun ledger-copy-transaction-at-point (date)
- "Ask for a new DATE and copy the transaction under point to that date. Leave point on the first amount."(interactive (list
- (read-string "Copy to date: "
- (concat ledger-year "/" ledger-month "/"))))
+ "Ask for a new DATE and copy the transaction under point to that date. Leave point on the first amount."
+ (interactive (list
+ (read-string "Copy to date: "
+ (concat ledger-year "/" ledger-month "/") 'ledger-minibuffer-history)))
(let* ((here (point))
(extents (ledger-find-xact-extents (point)))
(transaction (buffer-substring (car extents) (cadr extents)))