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.
This commit is contained in:
parent
cf6a23b2fe
commit
d3964b66d5
1 changed files with 20 additions and 19 deletions
|
|
@ -128,31 +128,32 @@ When REGEX is nil, unhide everything, and remove higlight"
|
||||||
prompt))
|
prompt))
|
||||||
|
|
||||||
(defun ledger-occur-create-folded-overlays(buffer-matches)
|
(defun ledger-occur-create-folded-overlays(buffer-matches)
|
||||||
(let ((overlays
|
(if buffer-matches
|
||||||
(let ((prev-end (point-min))
|
(let ((overlays
|
||||||
(temp (point-max)))
|
(let ((prev-end (point-min))
|
||||||
(mapcar (lambda (match)
|
(temp (point-max)))
|
||||||
(progn
|
(mapcar (lambda (match)
|
||||||
(setq temp prev-end) ;need a swap so that the
|
(progn
|
||||||
|
(setq temp prev-end) ;need a swap so that the
|
||||||
;last form in the lambda
|
;last form in the lambda
|
||||||
;is the (make-overlay)
|
;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
|
;that we skip
|
||||||
;the empty
|
;the empty
|
||||||
;line after
|
;line after
|
||||||
;the xact
|
;the xact
|
||||||
(make-overlay
|
(make-overlay
|
||||||
temp
|
temp
|
||||||
(car match)
|
(car match)
|
||||||
(current-buffer) t nil)))
|
(current-buffer) t nil)))
|
||||||
buffer-matches))))
|
buffer-matches))))
|
||||||
(mapcar (lambda (ovl)
|
(mapcar (lambda (ovl)
|
||||||
(overlay-put ovl ledger-occur-overlay-property-name t)
|
(overlay-put ovl ledger-occur-overlay-property-name t)
|
||||||
(overlay-put ovl 'invisible t)
|
(overlay-put ovl 'invisible t)
|
||||||
(overlay-put ovl 'intangible t))
|
(overlay-put ovl 'intangible t))
|
||||||
(push (make-overlay (cadr (car(last buffer-matches)))
|
(push (make-overlay (cadr (car(last buffer-matches)))
|
||||||
(point-max)
|
(point-max)
|
||||||
(current-buffer) t nil) overlays))))
|
(current-buffer) t nil) overlays)))))
|
||||||
|
|
||||||
|
|
||||||
(defun ledger-occur-create-xact-overlays (ovl-bounds)
|
(defun ledger-occur-create-xact-overlays (ovl-bounds)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue