From 9892878ca1b1218877537963bbf7a4ea1a8fed45 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sat, 2 Jan 2016 12:09:54 +0100 Subject: [misc] Update year in copyright notice to 2016 [ci skip] --- lisp/ledger-commodities.el | 2 +- lisp/ledger-complete.el | 2 +- lisp/ledger-context.el | 2 +- lisp/ledger-exec.el | 2 +- lisp/ledger-fonts.el | 2 +- lisp/ledger-init.el | 2 +- lisp/ledger-mode.el | 2 +- lisp/ledger-occur.el | 2 +- lisp/ledger-post.el | 2 +- lisp/ledger-reconcile.el | 2 +- lisp/ledger-regex.el | 2 +- lisp/ledger-report.el | 2 +- lisp/ledger-sort.el | 2 +- lisp/ledger-state.el | 2 +- lisp/ledger-test.el | 2 +- lisp/ledger-texi.el | 2 +- lisp/ledger-xact.el | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) (limited to 'lisp') 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 26de84fc..9eff6bc6 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 2ee56e7b..810657a3 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 326266b7..a6a7dd86 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..5286d784 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. -- cgit v1.2.3 From 0c448cde2f02e7ae2e59a049c206136cb83484e7 Mon Sep 17 00:00:00 2001 From: Daniele Nicolodi Date: Fri, 8 Jan 2016 21:36:34 +0100 Subject: Fix highlight of the transaction under point Extend the highlighting of the last line in the transaction to the right margin of the buffer. Do not highlight empty lines. --- lisp/ledger-xact.el | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'lisp') diff --git a/lisp/ledger-xact.el b/lisp/ledger-xact.el index 5286d784..dad5ff5b 100644 --- a/lisp/ledger-xact.el +++ b/lisp/ledger-xact.el @@ -44,20 +44,23 @@ (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))) + (if (> (- e b) 1) + (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." -- cgit v1.2.3 From 9cb5bc0f4aa4f3e3d97aba5255d66f0c1b89d387 Mon Sep 17 00:00:00 2001 From: Daniele Nicolodi Date: Fri, 8 Jan 2016 23:44:23 +0100 Subject: Fix highlight of the transaction under point When a transaction is being added the previous one is highlighted. Solve the problem checking that the highlighted region contains the point. --- lisp/ledger-xact.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/ledger-xact.el b/lisp/ledger-xact.el index dad5ff5b..795df86a 100644 --- a/lisp/ledger-xact.el +++ b/lisp/ledger-xact.el @@ -57,10 +57,12 @@ (setq ledger-xact-highlight-overlay (ledger-highlight-make-overlay))) (let ((exts (ledger-navigate-find-element-extents (point)))) (let ((b (car exts)) - (e (cadr exts))) - (if (> (- e b) 1) - (move-overlay ledger-xact-highlight-overlay b (+ 1 e)) - (move-overlay ledger-xact-highlight-overlay 1 1)))))) + (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." -- cgit v1.2.3