Add highlighting in the report window if the line is mapped to a file

This commit is contained in:
Craig Earls 2013-02-14 11:40:08 -07:00
parent 30dc7e349d
commit 67201ee850
2 changed files with 24 additions and 15 deletions

View file

@ -86,6 +86,11 @@
"Default face for pending (!) transactions in the reconcile window" "Default face for pending (!) transactions in the reconcile window"
:group 'ledger-faces) :group 'ledger-faces)
(defface ledger-font-report-clickable-face
`((t :foreground "#cb4b16" :weight normal ))
"Default face for pending (!) transactions in the reconcile window"
:group 'ledger-faces)
(defvar ledger-font-lock-keywords (defvar ledger-font-lock-keywords
'(("^[0-9]+[-/.=][-/.=0-9]+\\s-\\!\\s-+\\(([^)]+)\\s-+\\)?\\([^*].+?\\)\\(\\( ;\\| ;\\|$\\)\\)" 2 'ledger-font-pending-face) '(("^[0-9]+[-/.=][-/.=0-9]+\\s-\\!\\s-+\\(([^)]+)\\s-+\\)?\\([^*].+?\\)\\(\\( ;\\| ;\\|$\\)\\)" 2 'ledger-font-pending-face)

View file

@ -165,7 +165,8 @@ used to generate the buffer, navigating the buffer, etc."
(defun ledger-report-name-exists (name) (defun ledger-report-name-exists (name)
"Check to see if the given report name exists. "Check to see if the given report name exists.
If name exists, returns the object naming the report, otherwise returns nil." If name exists, returns the object naming the report,
otherwise returns nil."
(unless (string-empty-p name) (unless (string-empty-p name)
(car (assoc name ledger-reports)))) (car (assoc name ledger-reports))))
@ -186,9 +187,10 @@ If name exists, returns the object naming the report, otherwise returns nil."
(defun ledger-report-ledger-file-format-specifier () (defun ledger-report-ledger-file-format-specifier ()
"Substitute the full path to master or current ledger file "Substitute the full path to master or current ledger file
The master file name is determined by the ledger-master-file buffer-local The master file name is determined by the ledger-master-file
variable which can be set using file variables. If it is set, it is used, buffer-local variable which can be set using file variables.
otherwise the current buffer file is used." If it is set, it is used, otherwise the current buffer file is
used."
(ledger-master-file)) (ledger-master-file))
;; General helper functions ;; General helper functions
@ -301,6 +303,8 @@ the default."
(widen) (widen)
(ledger-goto-line line) (ledger-goto-line line)
(point-marker)))))) (point-marker))))))
(add-text-properties (line-beginning-position) (line-end-position)
(list 'face 'ledger-font-report-clickable-face))
(end-of-line)))) (end-of-line))))
(goto-char data-pos))) (goto-char data-pos)))