summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2016-01-11 19:24:02 -0700
committerCraig Earls <enderw88@gmail.com>2016-01-11 19:24:02 -0700
commitd24be7446dc77cbdd80db6a105ad3b7a8fd919aa (patch)
treef4e3084e04c4e481ef59954e341e5f316d1648c4 /lisp
parentf709109417f2cbafe210dc41d5e9e98e6e9f5de0 (diff)
parentb5b70625d59305d0f3af3a9baad3931aba43df47 (diff)
downloadfork-ledger-d24be7446dc77cbdd80db6a105ad3b7a8fd919aa.tar.gz
fork-ledger-d24be7446dc77cbdd80db6a105ad3b7a8fd919aa.tar.bz2
fork-ledger-d24be7446dc77cbdd80db6a105ad3b7a8fd919aa.zip
Merge commit 'b5b70625d59305d0f3af3a9baad3931aba43df47' into next
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ledger-commodities.el2
-rw-r--r--lisp/ledger-complete.el2
-rw-r--r--lisp/ledger-context.el2
-rw-r--r--lisp/ledger-exec.el2
-rw-r--r--lisp/ledger-fonts.el2
-rw-r--r--lisp/ledger-init.el2
-rw-r--r--lisp/ledger-mode.el2
-rw-r--r--lisp/ledger-occur.el2
-rw-r--r--lisp/ledger-post.el2
-rw-r--r--lisp/ledger-reconcile.el2
-rw-r--r--lisp/ledger-regex.el2
-rw-r--r--lisp/ledger-report.el2
-rw-r--r--lisp/ledger-sort.el2
-rw-r--r--lisp/ledger-state.el2
-rw-r--r--lisp/ledger-test.el2
-rw-r--r--lisp/ledger-texi.el2
-rw-r--r--lisp/ledger-xact.el31
17 files changed, 34 insertions, 29 deletions
diff --git a/lisp/ledger-commodities.el b/lisp/ledger-commodities.el
index 48fb78f7..b5244bdb 100644
--- a/lisp/ledger-commodities.el
+++ b/lisp/ledger-commodities.el
@@ -1,6 +1,6 @@
;;; ledger-commodities.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-complete.el b/lisp/ledger-complete.el
index 2345fd02..28b6b37a 100644
--- a/lisp/ledger-complete.el
+++ b/lisp/ledger-complete.el
@@ -1,6 +1,6 @@
;;; ledger-complete.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-context.el b/lisp/ledger-context.el
index 629d51a5..fb5f4c10 100644
--- a/lisp/ledger-context.el
+++ b/lisp/ledger-context.el
@@ -1,6 +1,6 @@
;;; ledger-context.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-exec.el b/lisp/ledger-exec.el
index 05bca776..4ba9134d 100644
--- a/lisp/ledger-exec.el
+++ b/lisp/ledger-exec.el
@@ -1,6 +1,6 @@
;;; ledger-exec.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-fonts.el b/lisp/ledger-fonts.el
index 8bdecdb3..60450e20 100644
--- a/lisp/ledger-fonts.el
+++ b/lisp/ledger-fonts.el
@@ -1,6 +1,6 @@
;;; ledger-fonts.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-init.el b/lisp/ledger-init.el
index 04d5f656..0141d2e7 100644
--- a/lisp/ledger-init.el
+++ b/lisp/ledger-init.el
@@ -1,6 +1,6 @@
;;; ledger-init.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el
index 2d02b887..7e30c350 100644
--- a/lisp/ledger-mode.el
+++ b/lisp/ledger-mode.el
@@ -1,6 +1,6 @@
;;; ledger-mode.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-occur.el b/lisp/ledger-occur.el
index 892b5e15..efdb246a 100644
--- a/lisp/ledger-occur.el
+++ b/lisp/ledger-occur.el
@@ -1,6 +1,6 @@
;;; ledger-occur.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-post.el b/lisp/ledger-post.el
index f4727342..ef0370b4 100644
--- a/lisp/ledger-post.el
+++ b/lisp/ledger-post.el
@@ -1,6 +1,6 @@
;;; ledger-post.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-reconcile.el b/lisp/ledger-reconcile.el
index 8c190aba..68019c13 100644
--- a/lisp/ledger-reconcile.el
+++ b/lisp/ledger-reconcile.el
@@ -1,6 +1,6 @@
;;; ledger-reconcile.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-regex.el b/lisp/ledger-regex.el
index 6ced0223..83c59feb 100644
--- a/lisp/ledger-regex.el
+++ b/lisp/ledger-regex.el
@@ -1,6 +1,6 @@
;;; ledger-regex.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-report.el b/lisp/ledger-report.el
index e10e9672..8b6b1c9d 100644
--- a/lisp/ledger-report.el
+++ b/lisp/ledger-report.el
@@ -1,6 +1,6 @@
;;; ledger-report.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-sort.el b/lisp/ledger-sort.el
index 23e93dc9..4306a6ca 100644
--- a/lisp/ledger-sort.el
+++ b/lisp/ledger-sort.el
@@ -1,6 +1,6 @@
;;; ledger-xact.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-state.el b/lisp/ledger-state.el
index 73e3c72c..61a9375e 100644
--- a/lisp/ledger-state.el
+++ b/lisp/ledger-state.el
@@ -1,6 +1,6 @@
;;; ledger-state.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-test.el b/lisp/ledger-test.el
index da120f63..26811bb3 100644
--- a/lisp/ledger-test.el
+++ b/lisp/ledger-test.el
@@ -1,6 +1,6 @@
;;; ledger-test.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-texi.el b/lisp/ledger-texi.el
index afaf0df7..0ceef477 100644
--- a/lisp/ledger-texi.el
+++ b/lisp/ledger-texi.el
@@ -1,6 +1,6 @@
;;; ledger-texi.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
diff --git a/lisp/ledger-xact.el b/lisp/ledger-xact.el
index 513f8f26..795df86a 100644
--- a/lisp/ledger-xact.el
+++ b/lisp/ledger-xact.el
@@ -1,6 +1,6 @@
;;; ledger-xact.el --- Helper code for use with the "ledger" command-line tool
-;; Copyright (C) 2003-2015 John Wiegley (johnw AT gnu DOT org)
+;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
;; This file is not part of GNU Emacs.
@@ -44,20 +44,25 @@
(defvar ledger-xact-highlight-overlay (list))
(make-variable-buffer-local 'ledger-xact-highlight-overlay)
+(defun ledger-highlight-make-overlay ()
+ (let ((ovl (make-overlay 1 1)))
+ (overlay-put ovl 'face 'ledger-font-xact-highlight-face)
+ (overlay-put ovl 'priority '(nil . 99))
+ ovl))
+
(defun ledger-highlight-xact-under-point ()
"Move the highlight overlay to the current transaction."
- (if ledger-highlight-xact-under-point
- (let ((exts (ledger-navigate-find-element-extents (point)))
- (ovl ledger-xact-highlight-overlay))
- (if (not ledger-xact-highlight-overlay)
- (setq ovl
- (setq ledger-xact-highlight-overlay
- (make-overlay (car exts)
- (cadr exts)
- (current-buffer) t nil)))
- (move-overlay ovl (car exts) (cadr exts)))
- (overlay-put ovl 'face 'ledger-font-xact-highlight-face)
- (overlay-put ovl 'priority '(nil . 99)))))
+ (when ledger-highlight-xact-under-point
+ (unless ledger-xact-highlight-overlay
+ (setq ledger-xact-highlight-overlay (ledger-highlight-make-overlay)))
+ (let ((exts (ledger-navigate-find-element-extents (point))))
+ (let ((b (car exts))
+ (e (cadr exts))
+ (p (point)))
+ (if (and (> (- e b) 1) ; not an empty line
+ (<= p e) (>= p b)) ; point is within the boundaries
+ (move-overlay ledger-xact-highlight-overlay b (+ 1 e))
+ (move-overlay ledger-xact-highlight-overlay 1 1))))))
(defun ledger-xact-payee ()
"Return the payee of the transaction containing point or nil."