diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2020-08-05 12:25:45 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2020-08-05 12:25:45 -0400 |
commit | ae7693ca78272d3dc577d71e55d7f9c2eed9e695 (patch) | |
tree | 6912242153f0e22b8cf899544f02269fc93d15dd | |
parent | 05beb9f354ed1f4600b18d88954a485536b3f8f9 (diff) |
Adjust copyright lines; silence compiler warnings
* .gitignore: New file.
* rt-liberation-gnus.el (rt-liber-gnus-with-ticket-buffer): Move before use.
* rt-liberation-report.el: Require `rt-liberation` since it needs one
of its macros.
* rt-liberation-rest.el: Silence some compiler warnings.
(rt-liber-rest-handle-response): Use the arg instead of dynamic scoping.
* rt-liberation.el (rt-liber-reduce, rt-liber-create-tickets-string):
Fix CL's `reduce` to cl-lib's `cl-reduce`.
(rt-liber-ticket-base-retriever-parser-f): Remove stray silent backslash.
Fix CL's `copy-seq` to builtin `copy-sequence`.
(rt-liber-sort-ticket-list): Fix CL's `copy-seq` to builtin `copy-sequence`.
(rt-liber-command-set-status-deleted): Fix typo.
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | maint.el | 2 | ||||
-rw-r--r-- | rt-liberation-gnus.el | 14 | ||||
-rw-r--r-- | rt-liberation-multi.el | 2 | ||||
-rw-r--r-- | rt-liberation-report.el | 7 | ||||
-rw-r--r-- | rt-liberation-rest.el | 14 | ||||
-rw-r--r-- | rt-liberation-storage.el | 2 | ||||
-rw-r--r-- | rt-liberation-update.el | 2 | ||||
-rw-r--r-- | rt-liberation.el | 33 |
9 files changed, 43 insertions, 36 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..afeeed2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.elc +rt-liberation-autoloads.el +rt-liberation-pkg.el @@ -1,2 +1,4 @@ +;; Copyright (C) 2020 Free Software Foundation, Inc. +;; FIXME: Remove this file (add-to-list 'load-path ".") diff --git a/rt-liberation-gnus.el b/rt-liberation-gnus.el index 3622a82..eb0b262 100644 --- a/rt-liberation-gnus.el +++ b/rt-liberation-gnus.el @@ -1,6 +1,6 @@ ;;; rt-liberation-gnus.el --- Gnus integration for rt-liberation -;; Copyright (C) 2009, 2012, 2014 Free Software Foundation +;; Copyright (C) 2009-2014 Free Software Foundation, Inc. ;; ;; Authors: Yoni Rabkin <yrk@gnu.org> ;; @@ -115,6 +115,12 @@ OPTIONS association list of options. (save-excursion (insert message-text)))) +(defmacro rt-liber-gnus-with-ticket-buffer (&rest body) + `(progn + (when (not (boundp 'rt-liber-ticket-local)) + (error "rt-liberation ticket view buffer not present")) + ,@body)) + (defun rt-liber-gnus-content-to-string () "Return the current content section as a string" (rt-liber-gnus-with-ticket-buffer @@ -143,12 +149,6 @@ OPTIONS association list of options. (setq text (buffer-substring (point-min) (point-max)))) text)))) -(defmacro rt-liber-gnus-with-ticket-buffer (&rest body) - `(progn - (when (not (boundp 'rt-liber-ticket-local)) - (error "rt-liberation ticket view buffer not present")) - ,@body)) - (defun rt-liber-gnus-compose-reply-to-requestor () (interactive) (rt-liber-gnus-with-ticket-buffer diff --git a/rt-liberation-multi.el b/rt-liberation-multi.el index 1b2d275..8e4665a 100644 --- a/rt-liberation-multi.el +++ b/rt-liberation-multi.el @@ -1,6 +1,6 @@ ;;; rt-liberation-multi.el --- Emacs interface to RT -;; Copyright (C) 2010, 2014 Free Software Foundation +;; Copyright (C) 2010, 2014 Free Software Foundation, Inc. ;; ;; Authors: Yoni Rabkin <yrk@gnu.org> ;; diff --git a/rt-liberation-report.el b/rt-liberation-report.el index a6b7e4e..11d20c2 100644 --- a/rt-liberation-report.el +++ b/rt-liberation-report.el @@ -1,6 +1,6 @@ ;;; rt-liberation-report.el --- Emacs interface to RT -;; Copyright (C) 2015 Free Software Foundation +;; Copyright (C) 2015 Free Software Foundation, Inc. ;; ;; Authors: Yoni Rabkin <yrk@gnu.org> ;; @@ -33,6 +33,7 @@ ;;; Code: (require 'rt-liberation-rest) +(require 'rt-liberation) (defvar rt-liber-report-csv-header '("date" "tickets resolved") @@ -124,8 +125,8 @@ return `nil'." (rt-liber-report-get-interval rt-queue start-date end-date))) by-date by-owner - by-date-out - by-owner-out + ;; by-date-out + ;; by-owner-out total) (when (not tickets) (error (concat "no tickets in interval between " diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index d9df8d9..7782665 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -1,6 +1,6 @@ ;;; rt-liberation-rest.el --- Interface to the RT REST API -;; Copyright (C) 2014, 2015 Free Software Foundation +;; Copyright (C) 2014-2015 Free Software Foundation, Inc. ;; ;; Authors: Yoni Rabkin <yrk@gnu.org> ;; @@ -33,7 +33,9 @@ (require 'url) (require 'url-util) - +;; (require 'rt-liberation) ; FIXME: Circular dependency +(declare-function rt-liber-parse-answer "rt-liberation" (answer-string parser-f)) +(declare-function rt-liber-ticket-base-retriever-parser-f "rt-liberation" ()) (defvar rt-liber-rest-debug-buffer-name "*rt-liber-rest debug log*" "Buffer name of debug capture.") @@ -81,7 +83,7 @@ "format=i" "&" "orderby=+Created"))) -(defun rt-liber-rest-show-string (scheme url ticket-id-list username password query) +(defun rt-liber-rest-show-string (scheme url ticket-id-list username password _query) "Return the ticket show string." (let ((user (url-encode-url username)) (pass (url-encode-url password))) @@ -168,11 +170,11 @@ "Parse the HTTP header from the server." (let ((http-ok-regexp "^HTTP.*200 OK$") (rt-ok-regexp "^rt/.*200 ok$")) - (condition-case excep + (condition-case nil (progn (re-search-forward http-ok-regexp (point-max)) (re-search-forward rt-ok-regexp (point-max))) - (error "bad HTTP response from server")))) + (error "bad HTTP response from server")))) ;FIXME: Unused string! (defun rt-liber-rest-ticketsql-runner-parser-f () "Parser function for a textual list of tickets." @@ -242,7 +244,7 @@ (defun rt-liber-rest-handle-response (buffer) "Handle the response provided in BUFFER." - (with-current-buffer response-buffer + (with-current-buffer buffer (rt-liber-rest-write-debug (buffer-string)))) (defun rt-liber-rest-edit-runner (ticket-id field value) diff --git a/rt-liberation-storage.el b/rt-liberation-storage.el index 3018430..df82ce1 100644 --- a/rt-liberation-storage.el +++ b/rt-liberation-storage.el @@ -1,6 +1,6 @@ ;;; rt-liberation-storage.el --- Storage backend for rt-liberation -;; Copyright (C) 2010 Free Software Foundation +;; Copyright (C) 2010 Free Software Foundation, Inc. ;; ;; Author: Yoni Rabkin <yrk@gnu.org> ;; diff --git a/rt-liberation-update.el b/rt-liberation-update.el index 903a84a..bdd0f75 100644 --- a/rt-liberation-update.el +++ b/rt-liberation-update.el @@ -1,6 +1,6 @@ ;;; rt-liberation-update.el --- check updated tickets -;; Copyright (C) 2009 Free Software Foundation +;; Copyright (C) 2009 Free Software Foundation, Inc. ;; ;; Authors: Yoni Rabkin <yrk@gnu.org> ;; diff --git a/rt-liberation.el b/rt-liberation.el index b6345ba..c1a7e76 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1,7 +1,6 @@ ;;; rt-liberation.el --- Emacs interface to RT -;; Copyright (C) 2008, 2009, 2010, 2011, 2014, 2015, 2020 Free -;; Software Foundation +;; Copyright (C) 2008-2020 Free Software Foundation, Inc. ;; Author: Yoni Rabkin <yrk@gnu.org> ;; Authors: Aaron S. Hawley <aaron.s.hawley@gmail.com>, John Sullivan <johnsu01@wjsullivan.net> @@ -262,7 +261,7 @@ This variable is made buffer local for the ticket history") (defun rt-liber-reduce (op seq) "Reduce-OP with SEQ to a string of \"s0 op s1 op s2..\"." (if seq - (reduce + (cl-reduce #'(lambda (a b) (format "%s %s %s" a op b)) seq) @@ -384,14 +383,14 @@ AFTER date after predicate." (re-search-forward "^id:" (point-max) t)) (while (and continue (re-search-forward - "^\\(\\([\.{} #[:alpha:]]+\\): \\(.*\\)\\)$\\|^--$" + "^\\(\\([.{} #[:alpha:]]+\\): \\(.*\\)\\)$\\|^--$" (point-max) t)) (if (string= (match-string-no-properties 0) "--") (setq continue nil) (push (cons (match-string-no-properties 2) (match-string-no-properties 3)) ticketbase))) - (push (copy-seq ticketbase) ticketbase-list) + (push (copy-sequence ticketbase) ticketbase-list) (setq ticketbase nil continue t)) ticketbase-list)) @@ -405,7 +404,7 @@ AFTER date after predicate." (concat "ticket/" (if (= (length ticket-list) 1) (format "%s" (car ticket-list)) - (reduce + (cl-reduce #'(lambda (a b) (format "%s,%s" a b)) ticket-list))) @@ -546,9 +545,9 @@ AFTER date after predicate." (make-local-variable 'font-lock-defaults) '((rt-liber-viewer-font-lock-keywords))) (set (make-local-variable 'revert-buffer-function) - 'rt-liber-refresh-ticket-history) + #'rt-liber-refresh-ticket-history) (set (make-local-variable 'buffer-stale-function) - (lambda (&optional noconfirm) 'slow)) + (lambda (&optional _noconfirm) 'slow)) (when rt-liber-jump-to-latest (rt-liber-jump-to-latest-correspondence)) (run-hooks 'rt-liber-viewer-hook)) @@ -579,7 +578,7 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (setq buffer-read-only t))) (switch-to-buffer new-ticket-buffer))) -(defun rt-liber-refresh-ticket-history (&optional ignore-auto noconfirm) +(defun rt-liber-refresh-ticket-history (&optional _ignore-auto _noconfirm) (interactive) (if rt-liber-ticket-local (rt-liber-display-ticket-history rt-liber-ticket-local @@ -785,7 +784,7 @@ The ticket's priority is compared to the variable (when (< 0 filtered-count) (insert (format "%d tickets not shown (filtered)" filtered-count)))))) -(defun rt-liber-browser-refresh (&optional ignore-auto noconfirm) +(defun rt-liber-browser-refresh (&optional _ignore-auto noconfirm) (interactive) (if rt-liber-query (when (or rt-liber-browser-do-refresh @@ -895,7 +894,7 @@ If POINT is nil then called on (point)." (defun rt-liber-sort-ticket-list (ticket-list sort-f) "Return a copy of TICKET-LIST sorted by SORT-F." - (let ((seq (copy-seq ticket-list))) + (let ((seq (copy-sequence ticket-list))) (sort seq sort-f))) (defun rt-liber-sort-by-owner (ticket-list) @@ -921,7 +920,7 @@ If POINT is nil then called on (point)." ;; See the fine manual for example code. -(defun rt-liber-default-filter-f (ticket) +(defun rt-liber-default-filter-f (_ticket) "The default filtering function for the ticket browser This function is really a placeholder for user custom functions, @@ -1012,7 +1011,7 @@ Examples: NEW if non-nil create additional browser buffer. If NEW is a string then that will be the name of the new buffer." (interactive "Mquery: ") - (condition-case excep + (condition-case nil (rt-liber-browser-startup (rt-liber-rest-run-show-base-query (rt-liber-rest-run-ls-query query)) @@ -1032,7 +1031,7 @@ returned as no associated text properties." (or ticket-redraw-f rt-liber-custom-ticket-redraw-function)) (out "")) - (condition-case excep + (condition-case nil (with-temp-buffer (rt-liber-ticketlist-browser-redraw (rt-liber-rest-run-show-base-query @@ -1080,9 +1079,9 @@ returned as no associated text properties." "Major Mode for browsing RT tickets. \\{rt-liber-browser-mode-map}" (set (make-local-variable 'revert-buffer-function) - 'rt-liber-browser-refresh) + #'rt-liber-browser-refresh) (set (make-local-variable 'buffer-stale-function) - (lambda (&optional noconfirm) 'slow)) + (lambda (&optional _noconfirm) 'slow)) (run-hooks 'rt-liber-browser-hook)) (defun rt-liber-setup-browser-name (new) @@ -1184,7 +1183,7 @@ returned as no associated text properties." (rt-liber-rest-command-set id (rt-liber-get-field-string 'status) - (rt-liber-com mand-get-status-string 'deleted))) + (rt-liber-command-get-status-string 'deleted))) (defun rt-liber-command-set-status-new (id) "Set the status of ticket ID to `new'." |