summaryrefslogtreecommitdiff
path: root/lisp/ldg-occur.el
diff options
context:
space:
mode:
authorRémi Vanicat <vanicat@debian.org>2013-02-09 11:33:33 +0100
committerRémi Vanicat <vanicat@debian.org>2013-02-09 11:33:58 +0100
commitd3964b66d556557b16053aa781220d298dc60d3a (patch)
tree474c1c305921fd57d3cce70fab94103778907903 /lisp/ldg-occur.el
parentcf6a23b2fe27e67536bd389737ed0e3379c2ae14 (diff)
downloadfork-ledger-d3964b66d556557b16053aa781220d298dc60d3a.tar.gz
fork-ledger-d3964b66d556557b16053aa781220d298dc60d3a.tar.bz2
fork-ledger-d3964b66d556557b16053aa781220d298dc60d3a.zip
In ledger-occur, hide nothing if there is no match
This could cause error when reconciling transaction that are included. Some message should be shown to explain why nothing happen when interactively call ledger-occur.
Diffstat (limited to 'lisp/ldg-occur.el')
-rw-r--r--lisp/ldg-occur.el39
1 files changed, 20 insertions, 19 deletions
diff --git a/lisp/ldg-occur.el b/lisp/ldg-occur.el
index 5a7c8ed7..e830f339 100644
--- a/lisp/ldg-occur.el
+++ b/lisp/ldg-occur.el
@@ -128,31 +128,32 @@ When REGEX is nil, unhide everything, and remove higlight"
prompt))
(defun ledger-occur-create-folded-overlays(buffer-matches)
- (let ((overlays
- (let ((prev-end (point-min))
- (temp (point-max)))
- (mapcar (lambda (match)
- (progn
- (setq temp prev-end) ;need a swap so that the
+ (if buffer-matches
+ (let ((overlays
+ (let ((prev-end (point-min))
+ (temp (point-max)))
+ (mapcar (lambda (match)
+ (progn
+ (setq temp prev-end) ;need a swap so that the
;last form in the lambda
;is the (make-overlay)
- (setq prev-end (1+ (cadr match))) ;add 1 so
+ (setq prev-end (1+ (cadr match))) ;add 1 so
;that we skip
;the empty
;line after
;the xact
- (make-overlay
- temp
- (car match)
- (current-buffer) t nil)))
- buffer-matches))))
- (mapcar (lambda (ovl)
- (overlay-put ovl ledger-occur-overlay-property-name t)
- (overlay-put ovl 'invisible t)
- (overlay-put ovl 'intangible t))
- (push (make-overlay (cadr (car(last buffer-matches)))
- (point-max)
- (current-buffer) t nil) overlays))))
+ (make-overlay
+ temp
+ (car match)
+ (current-buffer) t nil)))
+ buffer-matches))))
+ (mapcar (lambda (ovl)
+ (overlay-put ovl ledger-occur-overlay-property-name t)
+ (overlay-put ovl 'invisible t)
+ (overlay-put ovl 'intangible t))
+ (push (make-overlay (cadr (car(last buffer-matches)))
+ (point-max)
+ (current-buffer) t nil) overlays)))))
(defun ledger-occur-create-xact-overlays (ovl-bounds)