Another fonitification fix. and clean up a stray reference to function removed.
This commit is contained in:
parent
eba603293b
commit
f981ec7884
2 changed files with 14 additions and 22 deletions
|
|
@ -86,19 +86,19 @@ Fontify the first line of an xact"
|
||||||
(ledger-fontify-set-face (list cur-point (point)) 'ledger-font-posting-date-face)
|
(ledger-fontify-set-face (list cur-point (point)) 'ledger-font-posting-date-face)
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(re-search-forward ledger-xact-after-date-regex)
|
(re-search-forward ledger-xact-after-date-regex)
|
||||||
(save-match-data (setq state (ledger-state-from-string (match-string 1)))
|
(save-match-data (setq state (ledger-state-from-string (match-string 1))))
|
||||||
(ledger-fontify-set-face (list (match-beginning 1) (match-end 3))
|
(ledger-fontify-set-face (list (match-beginning 1) (match-end 3))
|
||||||
(cond ((eq state 'pending)
|
(cond ((eq state 'pending)
|
||||||
'ledger-font-payee-pending-face)
|
'ledger-font-payee-pending-face)
|
||||||
((eq state 'cleared)
|
((eq state 'cleared)
|
||||||
'ledger-font-payee-cleared-face)
|
'ledger-font-payee-cleared-face)
|
||||||
(t
|
(t
|
||||||
'ledger-font-payee-uncleared-face))))
|
'ledger-font-payee-uncleared-face)))
|
||||||
(ledger-fontify-set-face (list (match-beginning 4)
|
(ledger-fontify-set-face (list (match-beginning 4)
|
||||||
(match-end 4)) 'ledger-font-comment-face)))
|
(match-end 4)) 'ledger-font-comment-face)))
|
||||||
|
|
||||||
(defun ledger-fontify-posting (pos)
|
(defun ledger-fontify-posting (pos)
|
||||||
"FOntify the posting at POS."
|
"Fontify the posting at POS."
|
||||||
(let* ((state nil)
|
(let* ((state nil)
|
||||||
(end-of-line-comment nil)
|
(end-of-line-comment nil)
|
||||||
(end (progn (end-of-line)
|
(end (progn (end-of-line)
|
||||||
|
|
@ -107,17 +107,10 @@ Fontify the first line of an xact"
|
||||||
(point))))
|
(point))))
|
||||||
|
|
||||||
;; Look for a posting status flag
|
;; Look for a posting status flag
|
||||||
(save-match-data ;; must use save-match-data to shadow the search
|
(set-match-data nil 'reseat)
|
||||||
;; results. If there is no status flag then the
|
(re-search-forward " \\([*!]\\) " end t)
|
||||||
;; search below will fail and NOT clear the match
|
(if (match-string 1)
|
||||||
;; data. So if the previous line did have a
|
(setq state (ledger-state-from-string (match-string 1))))
|
||||||
;; status flag it is still sitting in the match
|
|
||||||
;; data, causing the current line to be fontified
|
|
||||||
;; like the previous line. Don't ask how long
|
|
||||||
;; that took to figure out
|
|
||||||
(re-search-forward " \\([*!]\\) " end t)
|
|
||||||
(if (match-string 1)
|
|
||||||
(setq state (ledger-state-from-string (match-string 1)))))
|
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(re-search-forward "[[:graph:]]\\([ \t][ \t]\\)" end 'end) ;; find the end of the account, or end of line
|
(re-search-forward "[[:graph:]]\\([ \t][ \t]\\)" end 'end) ;; find the end of the account, or end of line
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -289,8 +289,7 @@ date descriptor."
|
||||||
(with-current-buffer schedule-buf
|
(with-current-buffer schedule-buf
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(dolist (candidate candidates)
|
(dolist (candidate candidates)
|
||||||
(if (not (ledger-schedule-already-entered candidate ledger-buf))
|
(insert (format-time-string date-format (car candidate) ) " " (cadr candidate) "\n"))
|
||||||
(insert (format-time-string date-format (car candidate) ) " " (cadr candidate) "\n")))
|
|
||||||
(ledger-mode))
|
(ledger-mode))
|
||||||
(length candidates)))
|
(length candidates)))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue