summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorSteve Purcell <steve@sanityinc.com>2014-12-09 19:31:17 +0000
committerSteve Purcell <steve@sanityinc.com>2014-12-09 19:38:00 +0000
commit233313fb17269d39864e6bb217b2c2520f4e957d (patch)
treecf03d03323145f1a8790d104b3eb284f8ca35c7f /lisp
parent7579057bc0e9b2f501059abcbb369acaa21ab361 (diff)
downloadfork-ledger-233313fb17269d39864e6bb217b2c2520f4e957d.tar.gz
fork-ledger-233313fb17269d39864e6bb217b2c2520f4e957d.tar.bz2
fork-ledger-233313fb17269d39864e6bb217b2c2520f4e957d.zip
[emacs] Fix byte compilation warnings
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ledger-context.el4
-rw-r--r--lisp/ledger-fontify.el9
-rw-r--r--lisp/ledger-mode.el1
-rw-r--r--lisp/ledger-navigate.el49
4 files changed, 39 insertions, 24 deletions
diff --git a/lisp/ledger-context.el b/lisp/ledger-context.el
index 7b10c552..dd393789 100644
--- a/lisp/ledger-context.el
+++ b/lisp/ledger-context.el
@@ -44,9 +44,11 @@
(defconst ledger-payee-string "\\(.*\\)")
(defun ledger-get-regex-str (name)
+ "Get the ledger regex of type NAME."
(symbol-value (intern (concat "ledger-" (symbol-name name) "-string"))))
(defun ledger-line-regex (elements)
+ "Get a regex to match ELEMENTS on a single line."
(concat (apply 'concat (mapcar 'ledger-get-regex-str elements)) "[ \t]*$"))
(defmacro ledger-single-line-config (&rest elements)
@@ -195,4 +197,4 @@ specified line, returns nil."
(provide 'ledger-context)
-;;; ledger-report.el ends here
+;;; ledger-context.el ends here
diff --git a/lisp/ledger-fontify.el b/lisp/ledger-fontify.el
index ea873d91..d307208f 100644
--- a/lisp/ledger-fontify.el
+++ b/lisp/ledger-fontify.el
@@ -28,7 +28,9 @@
;;; Code:
-(provide 'ledger-fontify)
+(require 'ledger-navigate)
+(require 'ledger-regex)
+(require 'ledger-state)
(defcustom ledger-fontify-xact-state-overrides nil
"If t the highlight entire xact with state."
@@ -50,7 +52,7 @@
(ledger-navigate-next-xact-or-directive))))
(defun ledger-fontify-xact-at (position)
- "Fontify the xact at POS."
+ "Fontify the xact at POSITION."
(interactive "d")
(save-excursion
(goto-char position)
@@ -191,4 +193,7 @@ Fontify the first line of an xact"
"Set the text in EXTENTS to FACE."
(put-text-property (car extents) (cadr extents) 'face face))
+
+(provide 'ledger-fontify)
+
;;; ledger-fontify.el ends here
diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el
index b0c88720..ac75ea3c 100644
--- a/lisp/ledger-mode.el
+++ b/lisp/ledger-mode.el
@@ -27,6 +27,7 @@
;;; Code:
(require 'ledger-regex)
+(require 'cus-edit)
(require 'esh-util)
(require 'esh-arg)
(require 'easymenu)
diff --git a/lisp/ledger-navigate.el b/lisp/ledger-navigate.el
index 5afcb50d..904faf8c 100644
--- a/lisp/ledger-navigate.el
+++ b/lisp/ledger-navigate.el
@@ -23,26 +23,27 @@
;;; Commentary:
;;
+;;; Code:
-(provide 'ledger-navigate)
+(require 'ledger-regex)
+(require 'ledger-context)
(defun ledger-navigate-next-xact ()
- "Move point to beginning of next xact."
- ;; make sure we actually move to the next xact, even if we are the
- ;; beginning of one now.
- (if (looking-at ledger-payee-any-status-regex)
- (forward-line))
- (if (re-search-forward ledger-payee-any-status-regex nil t)
- (goto-char (match-beginning 0))
- (goto-char (point-max))))
+ "Move point to beginning of next xact."
+ ;; make sure we actually move to the next xact, even if we are the
+ ;; beginning of one now.
+ (if (looking-at ledger-payee-any-status-regex)
+ (forward-line))
+ (if (re-search-forward ledger-payee-any-status-regex nil t)
+ (goto-char (match-beginning 0))
+ (goto-char (point-max))))
(defun ledger-navigate-start-xact-or-directive-p ()
- "return t if at the beginning of an empty line or line
-beginning with whitespace"
+ "Return t if at the beginning of an empty or all-whitespace line."
(not (looking-at "[ \t]\\|\\(^$\\)")))
(defun ledger-navigate-next-xact-or-directive ()
- "move to the beginning of the next xact or directive"
+ "Move to the beginning of the next xact or directive."
(interactive)
(beginning-of-line)
(if (ledger-navigate-start-xact-or-directive-p) ; if we are the start of an xact, move forward to the next xact
@@ -64,7 +65,7 @@ beginning with whitespace"
(re-search-backward "^[[:graph:]]" nil t)))
(defun ledger-navigate-beginning-of-xact ()
- "Move point to the beginning of the current xact"
+ "Move point to the beginning of the current xact."
(interactive)
;; need to start at the beginning of a line incase we are in the first line of an xact already.
(beginning-of-line)
@@ -97,6 +98,7 @@ Requires empty line separating xacts."
(ledger-navigate-end-of-xact))))
(defun ledger-navigate-find-directive-extents (pos)
+ "Return the extents of the directive at POS."
(goto-char pos)
(let ((begin (progn (beginning-of-line)
(point)))
@@ -126,6 +128,7 @@ Requires empty line separating xacts."
(list begin end)))
(defun ledger-navigate-block-comment (pos)
+ "Move past the block comment at POS, and return its extents."
(interactive "d")
(goto-char pos)
(let ((begin (progn (beginning-of-line)
@@ -150,12 +153,16 @@ Requires empty line separating xacts."
(defun ledger-navigate-find-element-extents (pos)
- "return list containing beginning and end of the entity surrounding point"
- (interactive "d")
- (save-excursion
- (goto-char pos)
- (beginning-of-line)
- (if (looking-at "[ =~0-9]")
- (ledger-navigate-find-xact-extents pos)
- (ledger-navigate-find-directive-extents pos))))
+ "Return list containing beginning and end of the entity surrounding POS."
+ (interactive "d")
+ (save-excursion
+ (goto-char pos)
+ (beginning-of-line)
+ (if (looking-at "[ =~0-9]")
+ (ledger-navigate-find-xact-extents pos)
+ (ledger-navigate-find-directive-extents pos))))
+
+
+(provide 'ledger-navigate)
+
;;; ledger-navigate.el ends here