diff options
author | Craig Earls <enderw88@gmail.com> | 2016-01-11 19:34:32 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2016-01-11 19:34:32 -0700 |
commit | 443b12921e1adb86ef9abc6ad380d12570e31f27 (patch) | |
tree | 12fcc92081534da9f49f19619c607484b7d124de /lisp | |
parent | d24be7446dc77cbdd80db6a105ad3b7a8fd919aa (diff) | |
parent | d50ac1722f9450d4963dbd044d555d31b3c44ed2 (diff) | |
download | fork-ledger-443b12921e1adb86ef9abc6ad380d12570e31f27.tar.gz fork-ledger-443b12921e1adb86ef9abc6ad380d12570e31f27.tar.bz2 fork-ledger-443b12921e1adb86ef9abc6ad380d12570e31f27.zip |
Merge branch 'fix-warnings' of https://github.com/ecraven/ledger into ecraven-fix-warning
# Conflicts:
# lisp/ledger-occur.el
# lisp/ledger-report.el
# lisp/ledger-schedule.el
# lisp/ledger-sort.el
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ledger-commodities.el | 4 | ||||
-rw-r--r-- | lisp/ledger-complete.el | 4 | ||||
-rw-r--r-- | lisp/ledger-exec.el | 2 | ||||
-rw-r--r-- | lisp/ledger-occur.el | 5 | ||||
-rw-r--r-- | lisp/ledger-post.el | 2 | ||||
-rw-r--r-- | lisp/ledger-reconcile.el | 16 | ||||
-rw-r--r-- | lisp/ledger-report.el | 15 | ||||
-rw-r--r-- | lisp/ledger-schedule.el | 17 | ||||
-rw-r--r-- | lisp/ledger-sort.el | 14 | ||||
-rw-r--r-- | lisp/ledger-state.el | 4 | ||||
-rw-r--r-- | lisp/ledger-texi.el | 2 | ||||
-rw-r--r-- | lisp/ledger-xact.el | 9 |
12 files changed, 71 insertions, 23 deletions
diff --git a/lisp/ledger-commodities.el b/lisp/ledger-commodities.el index b5244bdb..a6f2fdda 100644 --- a/lisp/ledger-commodities.el +++ b/lisp/ledger-commodities.el @@ -28,6 +28,10 @@ (require 'ledger-regex) +;; These keep the byte-compiler from warning about them, but have no other +;; effect: +(defvar ledger-environment-alist) + (defcustom ledger-reconcile-default-commodity "$" "The default commodity for use in target calculations in ledger reconcile." :type 'string diff --git a/lisp/ledger-complete.el b/lisp/ledger-complete.el index 28b6b37a..5a4011b9 100644 --- a/lisp/ledger-complete.el +++ b/lisp/ledger-complete.el @@ -28,6 +28,10 @@ ;;; Code: +(declare-function ledger-thing-at-point "ledger-context" nil) +(declare-function ledger-add-transaction "ledger-xact" (transaction-text &optional insert-at-point)) +(declare-function between "ledger-schedule" (val low high)) + (defun ledger-parse-arguments () "Parse whitespace separated arguments in the current region." ;; this is more complex than it appears to need, so that it can work diff --git a/lisp/ledger-exec.el b/lisp/ledger-exec.el index 4ba9134d..5440e085 100644 --- a/lisp/ledger-exec.el +++ b/lisp/ledger-exec.el @@ -25,6 +25,8 @@ ;;; Code: +(defvar ledger-buf) + (defconst ledger-version-needed "3.0.0" "The version of ledger executable needed for interactive features.") diff --git a/lisp/ledger-occur.el b/lisp/ledger-occur.el index efdb246a..0df2f1a9 100644 --- a/lisp/ledger-occur.el +++ b/lisp/ledger-occur.el @@ -29,8 +29,9 @@ ;;; Code: -(eval-when-compile - (require 'cl)) +;; TODO: replace this with (require 'cl-lib) +(with-no-warnings + (require 'cl)) (require 'ledger-navigate) (defconst ledger-occur-overlay-property-name 'ledger-occur-custom-buffer-grep) diff --git a/lisp/ledger-post.el b/lisp/ledger-post.el index ef0370b4..973f2260 100644 --- a/lisp/ledger-post.el +++ b/lisp/ledger-post.el @@ -27,6 +27,8 @@ ;;; Code: +(declare-function ledger-navigate-find-xact-extents "ledger-navigate" (pos)) + (defgroup ledger-post nil "Options for controlling how Ledger-mode deals with postings and completion" :group 'ledger) diff --git a/lisp/ledger-reconcile.el b/lisp/ledger-reconcile.el index 68019c13..7ac8f2c4 100644 --- a/lisp/ledger-reconcile.el +++ b/lisp/ledger-reconcile.el @@ -34,7 +34,21 @@ (defvar ledger-bufs nil) (defvar ledger-acct nil) (defvar ledger-target nil) - +(defvar ledger-clear-whole-transactions) +(declare-function ledger-exec-ledger "ledger-exec" (input-buffer &optional output-buffer &rest args)) +(declare-function ledger-split-commodity-string "ledger-commodities" (str)) +(declare-function ledger-commodity-to-string "ledger-commodities" (c1)) +(declare-function -commodity "ledger-commodities" (c1 c2)) +(declare-function ledger-navigate-to-line "ledger-navigate" (line-number)) +(declare-function ledger-toggle-current "ledger-state" (&optional style)) +(declare-function ledger-insert-effective-date "ledger-mode" (&optional date)) +(declare-function ledger-add-transaction "ledger-xact" (transaction-text &optional insert-at-point)) +(declare-function ledger-delete-current-transaction "ledger-xact" (pos)) +(declare-function ledger-highlight-xact-under-point "ledger-xact" nil) +(declare-function ledger-occur-mode "ledger-occur") +(declare-function ledger-read-account-with-prompt "ledger-mode" (prompt)) +(declare-function ledger-occur "ledger-occur" (regex)) +(declare-function ledger-read-commodity-string "ledger-commodities" (prompt)) (defgroup ledger-reconcile nil "Options for Ledger-mode reconciliation" :group 'ledger) diff --git a/lisp/ledger-report.el b/lisp/ledger-report.el index 8b6b1c9d..83c287eb 100644 --- a/lisp/ledger-report.el +++ b/lisp/ledger-report.el @@ -25,9 +25,14 @@ ;;; Code: +(declare-function ledger-read-string-with-default "ledger-mode" (prompt default)) +(declare-function ledger-xact-payee "ledger-xact" nil) +(declare-function ledger-read-account-with-prompt "ledger-mode" (prompt)) +(declare-function ledger-navigate-to-line "ledger-navigate" (line-number)) + (require 'easymenu) -(eval-when-compile - (require 'cl)) + +(defvar ledger-buf) (defgroup ledger-report nil "Customization option for the Report buffer" @@ -149,13 +154,13 @@ text that should replace the format specifier." "A mode for viewing ledger reports.") (defun ledger-report-tagname-format-specifier () - "Return a valid meta-data tag name" + "Return a valid meta-data tag name." ;; It is intended completion should be available on existing account ;; names, but it remains to be implemented. (ledger-read-string-with-default "Tag Name: " nil)) (defun ledger-report-tagvalue-format-specifier () - "Return a valid meta-data tag name" + "Return a valid meta-data tag name." ;; It is intended completion should be available on existing account ;; names, but it remains to be implemented. (ledger-read-string-with-default "Tag Value: " nil)) @@ -418,8 +423,8 @@ Optional EDIT the command." (customize-variable 'ledger-reports)) (defun ledger-report-edit-report () + "Edit the current report command in the mini buffer and re-run the report." (interactive) - "Edit the current report command in the mini buffer and re-run the report" (setq ledger-report-cmd (ledger-report-read-command ledger-report-cmd)) (ledger-report-redo)) diff --git a/lisp/ledger-schedule.el b/lisp/ledger-schedule.el index 723fa2b3..ae08ad36 100644 --- a/lisp/ledger-schedule.el +++ b/lisp/ledger-schedule.el @@ -30,10 +30,11 @@ ;; function slot of the symbol VARNAME. Then use VARNAME as the ;; function without have to use funcall. + (require 'ledger-init) -(eval-when-compile - (require 'cl)) +(require 'cl-macs) +(declare-function ledger-mode "ledger-mode") ;;; Code: (defgroup ledger-schedule nil @@ -101,15 +102,15 @@ COUNT 0) means EVERY day-of-week (eg. every Saturday)" (cond ((zerop count) ;; Return true if day-of-week matches `(eq (nth 6 (decode-time date)) ,day-of-week)) ((> count 0) ;; Positive count - (let ((decoded (gensym))) + (let ((decoded (cl-gensym))) `(let ((,decoded (decode-time date))) (and (eq (nth 6 ,decoded) ,day-of-week) (between (nth 3 ,decoded) ,(* (1- count) 7) ,(* count 7)))))) ((< count 0) - (let ((days-in-month (gensym)) - (decoded (gensym))) + (let ((days-in-month (cl-gensym)) + (decoded (cl-gensym))) `(let* ((,decoded (decode-time date)) (,days-in-month (ledger-schedule-days-in-month (nth 4 ,decoded) @@ -134,9 +135,9 @@ For example every second Friday, regardless of month." (defun ledger-schedule-constrain-date-range (month1 day1 month2 day2) "Return a form of DATE that is true if DATE falls between MONTH1 DAY1 and MONTH2 DAY2." - (let ((decoded (gensym)) - (target-month (gensym)) - (target-day (gensym))) + (let ((decoded (cl-gensym)) + (target-month (cl-gensym)) + (target-day (cl-gensym))) `(let* ((,decoded (decode-time date)) (,target-month (nth 4 decoded)) (,target-day (nth 3 decoded))) diff --git a/lisp/ledger-sort.el b/lisp/ledger-sort.el index 4306a6ca..6ed82830 100644 --- a/lisp/ledger-sort.el +++ b/lisp/ledger-sort.el @@ -25,20 +25,22 @@ ;; ;;; Code: - +(defvar ledger-payee-any-status-regex) +(declare-function ledger-navigate-find-xact-extents "ledger-navigate" (pos)) +(declare-function ledger-navigate-next-xact "ledger-navigate" nil) (defun ledger-sort-find-start () - "Find the beginning of a sort region" + "Find the beginning of a sort region." (if (re-search-forward ";.*Ledger-mode:.*Start sort" nil t) (match-end 0))) (defun ledger-sort-find-end () - "Find the end of a sort region" + "Find the end of a sort region." (if (re-search-forward ";.*Ledger-mode:.*End sort" nil t) (match-end 0))) (defun ledger-sort-insert-start-mark () - "Insert a marker to start a sort region" + "Insert a marker to start a sort region." (interactive) (save-excursion (goto-char (point-min)) @@ -48,7 +50,7 @@ (insert "\n; Ledger-mode: Start sort\n\n")) (defun ledger-sort-insert-end-mark () - "Insert a marker to end a sort region" + "Insert a marker to end a sort region." (interactive) (save-excursion (goto-char (point-min)) @@ -58,7 +60,7 @@ (insert "\n; Ledger-mode: End sort\n\n")) (defun ledger-sort-startkey () - "Return the actual date so the sort-subr doesn't sort onthe entire first line." + "Return the actual date so the sort subroutine doesn't sort on the entire first line." (buffer-substring-no-properties (point) (+ 10 (point)))) (defun ledger-sort-region (beg end) diff --git a/lisp/ledger-state.el b/lisp/ledger-state.el index 61a9375e..561df095 100644 --- a/lisp/ledger-state.el +++ b/lisp/ledger-state.el @@ -24,6 +24,8 @@ ;; Utilities for dealing with transaction and posting status. ;;; Code: +(declare-function ledger-navigate-find-xact-extents "ledger-navigate" (pos)) +(declare-function ledger-thing-at-point "ledger-context" ()) (defcustom ledger-clear-whole-transactions nil "If non-nil, clear whole transactions, not individual postings." @@ -67,7 +69,7 @@ (defun ledger-state-from-string (state-string) - "Get state from STATE-CHAR." + "Get state from STATE-STRING." (when state-string (cond ((string-match "\\!" state-string) 'pending) diff --git a/lisp/ledger-texi.el b/lisp/ledger-texi.el index 0ceef477..5bf8d9a2 100644 --- a/lisp/ledger-texi.el +++ b/lisp/ledger-texi.el @@ -18,6 +18,8 @@ ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ;; MA 02110-1301 USA. +;;; Code: +(defvar ledger-binary-path) (defgroup ledger-texi nil "Options for working on Ledger texi documentation" diff --git a/lisp/ledger-xact.el b/lisp/ledger-xact.el index 795df86a..f3721e9e 100644 --- a/lisp/ledger-xact.el +++ b/lisp/ledger-xact.el @@ -28,6 +28,14 @@ (require 'eshell) (require 'ledger-regex) (require 'ledger-navigate) + +(defvar ledger-year) +(defvar ledger-month) +(declare-function ledger-read-date "ledger-mode" (prompt)) +(declare-function ledger-next-amount "ledger-post" (&optional end)) +(declare-function ledger-exec-ledger "ledger-exec" (input-buffer &optional output-buffer &rest args)) +(declare-function ledger-post-align-postings "ledger-post" (&optional beg end)) + ;; TODO: This file depends on code in ledger-mode.el, which depends on this. (defcustom ledger-highlight-xact-under-point t @@ -123,6 +131,7 @@ MOMENT is an encoded date" (forward-line)))) (defun ledger-year-and-month () + "Return the current year and month, separated by / (or -, depending on LEDGER-USE-ISO-DATES)." (let ((sep (if ledger-use-iso-dates "-" "/"))) |