From 2e9b1f39ddf3c8b45aee7090fe23d85fa643d218 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 3 Aug 2020 17:00:32 -0400 Subject: * rt-liberation.el: remove old cli code --- rt-liberation.el | 88 -------------------------------------------------------- 1 file changed, 88 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index b6345ba..aa48cea 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -396,21 +396,6 @@ AFTER date after predicate." continue t)) ticketbase-list)) -;; accept the output of `rt-liber-ticketsql-runner-parser-f' and -;; return a string suitable for an RT "show" query -(defun rt-liber-create-tickets-string (idsublist) - "Create a RT CLI ticket \"show\" string from IDSUBLIST." - (let ((ticket-list (mapcar #'(lambda (e) (car e)) idsublist))) - (if ticket-list - (concat "ticket/" - (if (= (length ticket-list) 1) - (format "%s" (car ticket-list)) - (reduce - #'(lambda (a b) - (format "%s,%s" a b)) - ticket-list))) - (signal 'rt-liber-no-result-from-query-error nil)))) - ;;; -------------------------------------------------------- ;;; Ticket utilities @@ -929,79 +914,6 @@ and as such always return t." t) -;;; -------------------------------------------------------- -;;; Version comparison functions -;;; -------------------------------------------------------- - -;; rt-liber-version-<: string * string -> t-or-nil -(defun rt-liber-version-< (vnum1 vnum2) - "Test whehther version number VNUM1 is less than VNUM2. -Arguments must be strings Lisp objects, and not numbers. - -Examples: - (rt-liber-version-< \"1.01\" \"1.11\") - => t - - (rt-liber-version-< \"1.1\" \"1.0.1\") - => nil" - (rt-liber-version-<- (rt-liber-version-value - (rt-liber-version-read vnum1)) - (rt-liber-version-value - (rt-liber-version-read vnum2)))) - -;; rt-liber-version-read: string -> list string -(defun rt-liber-version-read (str) - "Tokenize version number STR whenever the syntax class changes. - - Example: - \"1.043.0-1_=+\" \ -==> (\"1\" \".\" \"043\" \".\" \"0\" \"-\" \"1\" \"_=+\")" - (let ((tokens nil) - (start 0) - (re (mapconcat 'identity '("[[:digit:]]+" "[[:punct:]]+") "\\|"))) - (while (and (string-match re (substring str start)) - (> (length str) start)) - (setq tokens (cons (match-string 0 (substring str start)) tokens)) - (setq start (+ start (match-end 0)))) - (if (< start (length str)) - (error "Unknown character: %s" (substring str start (1+ start)))) - (reverse tokens))) - -;; rt-liber-version-value: list string -> list number -(defun rt-liber-version-value (tokens) - "Convert list of TOKENS to a comparable number list." - (mapcar #'(lambda (tk) - (if (string-match "^0+$" tk) - 1 - (if (string-match "^[[:digit:]]+$" tk) - (if (string-match "^0+" tk) - (1+ (* (string-to-number tk) - (expt 10 - (- (length - (match-string 0 tk)))))) - (1+ (string-to-number tk))) - (if (string-match "^[[:punct:]]+$" tk) - 0 - ;; else (string-match "[^[:digit:][:punct:]]" tk) - -1)))) - tokens)) - -;; rt-liber-version-<-: list number -> t-or-nil -(defun rt-liber-version-<- (vals1 vals2) - "Test whether version representation VALS1 is less than VALS2." - (if (and (null vals1) (null vals2)) - nil - (if (null vals2) - nil - (if (null vals1) - t - (if (= (car vals1) (car vals2)) - (rt-liber-version-<- (cdr vals1) (cdr vals2)) - (if (< (car vals1) (car vals2)) - t - nil)))))) - - ;;; -------------------------------------------------------- ;;; Entry points ;;; -------------------------------------------------------- -- cgit v1.2.3 From b2f3f57061e8e1c6222a9ec064f663fcae1dfa59 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 3 Aug 2020 18:43:15 -0400 Subject: * doc/rt-liberation.texinfo: update documentation --- doc/rt-liberation.texinfo | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/rt-liberation.texinfo b/doc/rt-liberation.texinfo index f5fa128..e3f87fe 100644 --- a/doc/rt-liberation.texinfo +++ b/doc/rt-liberation.texinfo @@ -14,7 +14,7 @@ @copying - @copyright{} 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation + @copyright{} 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software Foundation @quotation Permission is granted to copy, distribute and/or modify this document @@ -140,12 +140,10 @@ Tell GNU/Emacs to load the package with: (require 'rt-liberation) @end lisp -Tell rt-liberation where to find the RT server's REST interface and -which version of RT the server is running: +Tell rt-liberation where to find the RT server's REST interface: @lisp -(setq rt-liber-rest-url "rt.example.org" - rt-liber-rt-version "4.2.4") +(setq rt-liber-rest-url "rt.example.org") @end lisp rt-liberation can issue a command to ``take'' a ticket (that is, -- cgit v1.2.3 From d6441dcee7cfca2541764e654393dfb2b73378aa Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 3 Aug 2020 18:43:21 -0400 Subject: * rt-liberation-report.el: fix error --- rt-liberation-report.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rt-liberation-report.el b/rt-liberation-report.el index a6b7e4e..07b83ee 100644 --- a/rt-liberation-report.el +++ b/rt-liberation-report.el @@ -32,8 +32,10 @@ ;;; Code: +(require 'rt-liberation) (require 'rt-liberation-rest) + (defvar rt-liber-report-csv-header '("date" "tickets resolved") "Headers for comma separated value output.") -- cgit v1.2.3 From 1995685feded34f0c70a8b6916fe593249602332 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 3 Aug 2020 18:47:18 -0400 Subject: * rt-liberation-rest.el: fix undefined variable --- rt-liberation-rest.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index d9df8d9..9b18974 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -20,9 +20,7 @@ ;; License along with this program; if not, write to the Free ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ;; MA 02111-1307, USA. -;; -;; Note: Licensed under GPLv2+ and not GPLv3+ in order to be -;; compatible with the license of RT. + ;;; History: ;; @@ -56,6 +54,9 @@ (defvar rt-liber-rest-verbose-p t "If non-nil, be verbose about what's happening.") +(defvar rt-liber-rest-response-buffer nil + "Buffer for manipulating server responses.") + (defun rt-liber-rest-write-debug (str) "Write to debug buffer." @@ -242,7 +243,7 @@ (defun rt-liber-rest-handle-response (buffer) "Handle the response provided in BUFFER." - (with-current-buffer response-buffer + (with-current-buffer rt-liber-rest-response-buffer (rt-liber-rest-write-debug (buffer-string)))) (defun rt-liber-rest-edit-runner (ticket-id field value) @@ -256,8 +257,8 @@ (rt-liber-rest-write-debug (concat request-data "\n")) (let ((url-request-method "POST") (url-request-data request-data) - response-buffer) - (setq response-buffer + rt-liber-rest-response-buffer) + (setq rt-liber-rest-response-buffer (url-retrieve-synchronously (rt-liber-rest-command-edit-string rt-liber-rest-scheme @@ -265,7 +266,7 @@ ticket-id rt-liber-rest-username rt-liber-rest-password))) - (rt-liber-rest-handle-response response-buffer))) + (rt-liber-rest-handle-response rt-liber-rest-response-buffer))) (message "edit command ended at %s" (current-time-string))) (defun rt-liber-rest-command-set (id field status) -- cgit v1.2.3 From 965be87719ab40ef57e8f37fda85c5851bd92e6f Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 3 Aug 2020 18:54:17 -0400 Subject: fix broken dependencies --- rt-liberation-rest.el | 38 -------------------------------------- rt-liberation.el | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 38 deletions(-) diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index 9b18974..0b52211 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -175,24 +175,6 @@ (re-search-forward rt-ok-regexp (point-max))) (error "bad HTTP response from server")))) -(defun rt-liber-rest-ticketsql-runner-parser-f () - "Parser function for a textual list of tickets." - (let (idsub-list) - (rt-liber-rest-parse-http-header) - (while (re-search-forward "ticket/\\([0-9].+\\)" (point-max) t) - ;; the output should be compatible with the input to - ;; `rt-liber-create-tickets-string' - (push (list (match-string-no-properties 1) - ".") - idsub-list)) - idsub-list)) - -(defun rt-liber-rest-run-ls-query (query) - "Run an \"ls\" type query against the server with QUERY." - (rt-liber-parse-answer - (rt-liber-rest-query-runner "ls" query) - 'rt-liber-rest-ticketsql-runner-parser-f)) - (defun rt-liber-rest-show-process (response) "Process and return the show query response." (when (not (stringp response)) @@ -227,20 +209,6 @@ (message "done retrieving %d tickets" l))) (buffer-substring (point-min) (point-max)))) -(defun rt-liber-rest-run-show-base-query (idsublist) - "Run \"show\" type query against the server with IDSUBLIST." - (rt-liber-parse-answer - (rt-liber-rest-show-query-runner idsublist) - #'rt-liber-ticket-base-retriever-parser-f)) - -(defun rt-liber-rest-run-ticket-history-base-query (ticket-id) - "Run history query against server for TICKET-ID." - (rt-liber-parse-answer - (rt-liber-rest-query-runner "history" ticket-id) - #'(lambda () - (rt-liber-rest-parse-http-header) - (buffer-substring (point) (point-max))))) - (defun rt-liber-rest-handle-response (buffer) "Handle the response provided in BUFFER." (with-current-buffer rt-liber-rest-response-buffer @@ -269,12 +237,6 @@ (rt-liber-rest-handle-response rt-liber-rest-response-buffer))) (message "edit command ended at %s" (current-time-string))) -(defun rt-liber-rest-command-set (id field status) - "Set ticket ID status to be STATUS." - (rt-liber-parse-answer - (rt-liber-rest-edit-runner id field status) - 'rt-liber-command-runner-parser-f)) - (provide 'rt-liberation-rest) diff --git a/rt-liberation.el b/rt-liberation.el index aa48cea..ddd6900 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -396,6 +396,42 @@ AFTER date after predicate." continue t)) ticketbase-list)) +(defun rt-liber-rest-ticketsql-runner-parser-f () + "Parser function for a textual list of tickets." + (let (idsub-list) + (rt-liber-rest-parse-http-header) + (while (re-search-forward "ticket/\\([0-9].+\\)" (point-max) t) + (push (list (match-string-no-properties 1) + ".") + idsub-list)) + idsub-list)) + +(defun rt-liber-rest-run-ls-query (query) + "Run an \"ls\" type query against the server with QUERY." + (rt-liber-parse-answer + (rt-liber-rest-query-runner "ls" query) + 'rt-liber-rest-ticketsql-runner-parser-f)) + +(defun rt-liber-rest-run-show-base-query (idsublist) + "Run \"show\" type query against the server with IDSUBLIST." + (rt-liber-parse-answer + (rt-liber-rest-show-query-runner idsublist) + #'rt-liber-ticket-base-retriever-parser-f)) + +(defun rt-liber-rest-run-ticket-history-base-query (ticket-id) + "Run history query against server for TICKET-ID." + (rt-liber-parse-answer + (rt-liber-rest-query-runner "history" ticket-id) + #'(lambda () + (rt-liber-rest-parse-http-header) + (buffer-substring (point) (point-max))))) + +(defun rt-liber-rest-command-set (id field status) + "Set ticket ID status to be STATUS." + (rt-liber-parse-answer + (rt-liber-rest-edit-runner id field status) + 'rt-liber-command-runner-parser-f)) + ;;; -------------------------------------------------------- ;;; Ticket utilities -- cgit v1.2.3 From 61dda6f75fe4be6c87e3c17d89b3dc5541324514 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 3 Aug 2020 18:56:42 -0400 Subject: * rt-liberation.el: remove unused code --- rt-liberation.el | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index ddd6900..9fba245 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1117,12 +1117,6 @@ returned as no associated text properties." status-symbol rt-liber-status-dictionary)) -(defun rt-liber-command-get-custom-field-string (custom-field-symbol) - "Return value associated with key CUSTOM-FIELD-SYMBOL." - (rt-liber-command-get-dictionary-value - custom-field-symbol - rt-liber-custom-field-dictionary)) - (defun rt-liber-command-runner-parser-f () "Display command return status from the server to the user." (message (buffer-string))) @@ -1132,7 +1126,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'." -- cgit v1.2.3 From 72692050373b3bc7fee16307711dfc31236d5a0c Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 3 Aug 2020 21:59:58 -0400 Subject: * rt-liberation.el: remove cl and cl-lib requirement --- rt-liberation.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 9fba245..9dd4550 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -42,7 +42,7 @@ (require 'browse-url) (require 'time-date) -(require 'cl-lib) +(require 'seq) (require 'rt-liberation-rest) @@ -262,10 +262,11 @@ 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 + (seq-reduce #'(lambda (a b) (format "%s %s %s" a op b)) - seq) + (cdr seq) + (car seq)) "")) (defun rt-liber-make-interval (pred before after) @@ -391,7 +392,7 @@ AFTER date after predicate." (push (cons (match-string-no-properties 2) (match-string-no-properties 3)) ticketbase))) - (push (copy-seq ticketbase) ticketbase-list) + (push (copy-tree ticketbase) ticketbase-list) (setq ticketbase nil continue t)) ticketbase-list)) @@ -916,7 +917,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-tree ticket-list))) (sort seq sort-f))) (defun rt-liber-sort-by-owner (ticket-list) -- cgit v1.2.3 From 203ec6a369bdd96e1114b65f6ae532d4de9bb338 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 3 Aug 2020 22:05:14 -0400 Subject: * rt-liberation-gnus.el: avoid compiler warning Macros need to be defined before functions. --- rt-liberation-gnus.el | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/rt-liberation-gnus.el b/rt-liberation-gnus.el index 3622a82..012ad24 100644 --- a/rt-liberation-gnus.el +++ b/rt-liberation-gnus.el @@ -21,12 +21,21 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ;; MA 02111-1307, USA. + ;;; Installation: ;; ;; For installation instructions and detailed help please see the ;; wonderful rt-liberation manual located in the "doc/" directory of ;; the rt-liberation distribution. + +;; Code: + +(require 'rt-liberation) +(require 'nnir) +(require 'gnus-msg) + + (defgroup rt-liber-gnus nil "*Gnus integration for rt-liberation." :prefix "rt-liber-gnus-" @@ -65,15 +74,17 @@ line of an email. For example: \\[company.com #\\([0-9].+?\\)\\]" :type 'string :group 'rt-liber-gnus) -(require 'rt-liberation) -(require 'nnir) -(require 'gnus-msg) - - (defvar rt-liber-gnus-p nil "Non-nil when rt-liberation-gnus is composing a Gnus buffer.") +(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 (addr ticket-alist options) "Create a Gnus *mail* buffer for the RT email interface. ADDR email address. @@ -143,12 +154,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 -- cgit v1.2.3 From 0fc4737bd6fee2b621eb21963e693b2be99831da Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 3 Aug 2020 23:20:00 -0400 Subject: documentation fixes --- doc/gpl.texi | 1 + doc/rt-liberation.texinfo | 35 +---------------------------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/doc/gpl.texi b/doc/gpl.texi index dc22d67..48d43f9 100644 --- a/doc/gpl.texi +++ b/doc/gpl.texi @@ -1,4 +1,5 @@ @node Copying, The GNU FDL, Local Storage, Top +@chapter The GNU General Public License. @c The GNU General Public License. @center Version 3, 29 June 2007 diff --git a/doc/rt-liberation.texinfo b/doc/rt-liberation.texinfo index e3f87fe..8b63fc0 100644 --- a/doc/rt-liberation.texinfo +++ b/doc/rt-liberation.texinfo @@ -18,7 +18,7 @@ @quotation Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 or +under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free @@ -97,8 +97,6 @@ Ticket Browser - - @c -------------------------------------------------- @node Introduction @@ -117,8 +115,6 @@ the resulting tickets, viewing the tickets' contents and performing operations on the tickets. - - @c -------------------------------------------------- @node Installation @@ -182,8 +178,6 @@ TicketSQL language. - - @c -------------------------------------------------- @node Query Compiler @@ -204,8 +198,6 @@ number of TicketSQL tokens. - - @c -------------------------------------------------- @node Query Language @@ -285,8 +277,6 @@ in function calls: @end lisp - - @c -------------------------------------------------- @node Ticket Browser @@ -422,8 +412,6 @@ Set the numerical priority level of the ticket at point. - - @c -------------------------------------------------- @node Ticket Browser Display @@ -490,8 +478,6 @@ considered high priority if its value is strictly higher than @var{rt-liber-browser-priority-cutoff} - - @c -------------------------------------------------- @node Ticket Browser Sorting @@ -633,8 +619,6 @@ buffers will be created displaying the query results and named - - @c -------------------------------------------------- @node Ticket Viewer @@ -752,8 +736,6 @@ Display the associated ticket in the ticket browser. - - @c -------------------------------------------------- @node Gnus Integration @@ -822,8 +804,6 @@ the Viewer will be able to call into it, @xref{Ticket Viewer}. - - @c -------------------------------------------------- @node Tracking Updates @@ -859,8 +839,6 @@ time-stamp so that the next invocation will produce the same result. @end defun - - @c -------------------------------------------------- @node Batch Operations @@ -906,9 +884,6 @@ Set the status of all the marked tickets to ``is-spam'' and delete. @end defun - - - @c -------------------------------------------------- @node Local Storage @@ -958,8 +933,6 @@ can be extended to associate any arbitrary data with any ticket. - - @c -------------------------------------------------- @node Concept Index @@ -967,8 +940,6 @@ can be extended to associate any arbitrary data with any ticket. @printindex cp - - @c -------------------------------------------------- @node Function Index @@ -976,8 +947,6 @@ can be extended to associate any arbitrary data with any ticket. @printindex fn - - @c -------------------------------------------------- @node Variable Index @@ -985,8 +954,6 @@ can be extended to associate any arbitrary data with any ticket. @printindex vr - - @c -------------------------------------------------- @node Keybinding Index -- cgit v1.2.3 From 84ce235f133459dd06c2d1a0a1c6e0d90f5770f1 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 5 Aug 2020 17:22:31 -0400 Subject: Syncronize with Stefan's changes --- doc/gpl.texi | 1 - doc/rt-liberation.texinfo | 43 ++++++++++-- maint.el | 2 + rt-liberation-gnus.el | 29 ++++----- rt-liberation-multi.el | 2 +- rt-liberation-report.el | 9 ++- rt-liberation-rest.el | 65 +++++++++++++++---- rt-liberation-storage.el | 2 +- rt-liberation-update.el | 2 +- rt-liberation.el | 162 +++++++++++++++++++++++++++++++--------------- 10 files changed, 221 insertions(+), 96 deletions(-) diff --git a/doc/gpl.texi b/doc/gpl.texi index 48d43f9..dc22d67 100644 --- a/doc/gpl.texi +++ b/doc/gpl.texi @@ -1,5 +1,4 @@ @node Copying, The GNU FDL, Local Storage, Top -@chapter The GNU General Public License. @c The GNU General Public License. @center Version 3, 29 June 2007 diff --git a/doc/rt-liberation.texinfo b/doc/rt-liberation.texinfo index 8b63fc0..f5fa128 100644 --- a/doc/rt-liberation.texinfo +++ b/doc/rt-liberation.texinfo @@ -14,11 +14,11 @@ @copying - @copyright{} 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software Foundation + @copyright{} 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation @quotation Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or +under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free @@ -97,6 +97,8 @@ Ticket Browser + + @c -------------------------------------------------- @node Introduction @@ -115,6 +117,8 @@ the resulting tickets, viewing the tickets' contents and performing operations on the tickets. + + @c -------------------------------------------------- @node Installation @@ -136,10 +140,12 @@ Tell GNU/Emacs to load the package with: (require 'rt-liberation) @end lisp -Tell rt-liberation where to find the RT server's REST interface: +Tell rt-liberation where to find the RT server's REST interface and +which version of RT the server is running: @lisp -(setq rt-liber-rest-url "rt.example.org") +(setq rt-liber-rest-url "rt.example.org" + rt-liber-rt-version "4.2.4") @end lisp rt-liberation can issue a command to ``take'' a ticket (that is, @@ -178,6 +184,8 @@ TicketSQL language. + + @c -------------------------------------------------- @node Query Compiler @@ -198,6 +206,8 @@ number of TicketSQL tokens. + + @c -------------------------------------------------- @node Query Language @@ -277,6 +287,8 @@ in function calls: @end lisp + + @c -------------------------------------------------- @node Ticket Browser @@ -412,6 +424,8 @@ Set the numerical priority level of the ticket at point. + + @c -------------------------------------------------- @node Ticket Browser Display @@ -478,6 +492,8 @@ considered high priority if its value is strictly higher than @var{rt-liber-browser-priority-cutoff} + + @c -------------------------------------------------- @node Ticket Browser Sorting @@ -619,6 +635,8 @@ buffers will be created displaying the query results and named + + @c -------------------------------------------------- @node Ticket Viewer @@ -736,6 +754,8 @@ Display the associated ticket in the ticket browser. + + @c -------------------------------------------------- @node Gnus Integration @@ -804,6 +824,8 @@ the Viewer will be able to call into it, @xref{Ticket Viewer}. + + @c -------------------------------------------------- @node Tracking Updates @@ -839,6 +861,8 @@ time-stamp so that the next invocation will produce the same result. @end defun + + @c -------------------------------------------------- @node Batch Operations @@ -884,6 +908,9 @@ Set the status of all the marked tickets to ``is-spam'' and delete. @end defun + + + @c -------------------------------------------------- @node Local Storage @@ -933,6 +960,8 @@ can be extended to associate any arbitrary data with any ticket. + + @c -------------------------------------------------- @node Concept Index @@ -940,6 +969,8 @@ can be extended to associate any arbitrary data with any ticket. @printindex cp + + @c -------------------------------------------------- @node Function Index @@ -947,6 +978,8 @@ can be extended to associate any arbitrary data with any ticket. @printindex fn + + @c -------------------------------------------------- @node Variable Index @@ -954,6 +987,8 @@ can be extended to associate any arbitrary data with any ticket. @printindex vr + + @c -------------------------------------------------- @node Keybinding Index diff --git a/maint.el b/maint.el index b89538e..4b1d978 100644 --- a/maint.el +++ b/maint.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 012ad24..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 ;; @@ -21,21 +21,12 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ;; MA 02111-1307, USA. - ;;; Installation: ;; ;; For installation instructions and detailed help please see the ;; wonderful rt-liberation manual located in the "doc/" directory of ;; the rt-liberation distribution. - -;; Code: - -(require 'rt-liberation) -(require 'nnir) -(require 'gnus-msg) - - (defgroup rt-liber-gnus nil "*Gnus integration for rt-liberation." :prefix "rt-liber-gnus-" @@ -74,15 +65,13 @@ line of an email. For example: \\[company.com #\\([0-9].+?\\)\\]" :type 'string :group 'rt-liber-gnus) -(defvar rt-liber-gnus-p nil - "Non-nil when rt-liberation-gnus is composing a Gnus buffer.") +(require 'rt-liberation) +(require 'nnir) +(require 'gnus-msg) -(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)) +(defvar rt-liber-gnus-p nil + "Non-nil when rt-liberation-gnus is composing a Gnus buffer.") (defun rt-liber-gnus-compose (addr ticket-alist options) @@ -126,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 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 ;; diff --git a/rt-liberation-report.el b/rt-liberation-report.el index 07b83ee..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 ;; @@ -32,9 +32,8 @@ ;;; Code: -(require 'rt-liberation) (require 'rt-liberation-rest) - +(require 'rt-liberation) (defvar rt-liber-report-csv-header '("date" "tickets resolved") @@ -126,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 0b52211..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 ;; @@ -20,7 +20,9 @@ ;; License along with this program; if not, write to the Free ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ;; MA 02111-1307, USA. - +;; +;; Note: Licensed under GPLv2+ and not GPLv3+ in order to be +;; compatible with the license of RT. ;;; History: ;; @@ -31,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.") @@ -54,9 +58,6 @@ (defvar rt-liber-rest-verbose-p t "If non-nil, be verbose about what's happening.") -(defvar rt-liber-rest-response-buffer nil - "Buffer for manipulating server responses.") - (defun rt-liber-rest-write-debug (str) "Write to debug buffer." @@ -82,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))) @@ -169,11 +170,29 @@ "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." + (let (idsub-list) + (rt-liber-rest-parse-http-header) + (while (re-search-forward "ticket/\\([0-9].+\\)" (point-max) t) + ;; the output should be compatible with the input to + ;; `rt-liber-create-tickets-string' + (push (list (match-string-no-properties 1) + ".") + idsub-list)) + idsub-list)) + +(defun rt-liber-rest-run-ls-query (query) + "Run an \"ls\" type query against the server with QUERY." + (rt-liber-parse-answer + (rt-liber-rest-query-runner "ls" query) + 'rt-liber-rest-ticketsql-runner-parser-f)) (defun rt-liber-rest-show-process (response) "Process and return the show query response." @@ -209,9 +228,23 @@ (message "done retrieving %d tickets" l))) (buffer-substring (point-min) (point-max)))) +(defun rt-liber-rest-run-show-base-query (idsublist) + "Run \"show\" type query against the server with IDSUBLIST." + (rt-liber-parse-answer + (rt-liber-rest-show-query-runner idsublist) + #'rt-liber-ticket-base-retriever-parser-f)) + +(defun rt-liber-rest-run-ticket-history-base-query (ticket-id) + "Run history query against server for TICKET-ID." + (rt-liber-parse-answer + (rt-liber-rest-query-runner "history" ticket-id) + #'(lambda () + (rt-liber-rest-parse-http-header) + (buffer-substring (point) (point-max))))) + (defun rt-liber-rest-handle-response (buffer) "Handle the response provided in BUFFER." - (with-current-buffer rt-liber-rest-response-buffer + (with-current-buffer buffer (rt-liber-rest-write-debug (buffer-string)))) (defun rt-liber-rest-edit-runner (ticket-id field value) @@ -225,8 +258,8 @@ (rt-liber-rest-write-debug (concat request-data "\n")) (let ((url-request-method "POST") (url-request-data request-data) - rt-liber-rest-response-buffer) - (setq rt-liber-rest-response-buffer + response-buffer) + (setq response-buffer (url-retrieve-synchronously (rt-liber-rest-command-edit-string rt-liber-rest-scheme @@ -234,9 +267,15 @@ ticket-id rt-liber-rest-username rt-liber-rest-password))) - (rt-liber-rest-handle-response rt-liber-rest-response-buffer))) + (rt-liber-rest-handle-response response-buffer))) (message "edit command ended at %s" (current-time-string))) +(defun rt-liber-rest-command-set (id field status) + "Set ticket ID status to be STATUS." + (rt-liber-parse-answer + (rt-liber-rest-edit-runner id field status) + 'rt-liber-command-runner-parser-f)) + (provide 'rt-liberation-rest) 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 ;; 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 ;; diff --git a/rt-liberation.el b/rt-liberation.el index 9dd4550..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 ;; Authors: Aaron S. Hawley , John Sullivan @@ -42,7 +41,7 @@ (require 'browse-url) (require 'time-date) -(require 'seq) +(require 'cl-lib) (require 'rt-liberation-rest) @@ -262,11 +261,10 @@ 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 - (seq-reduce + (cl-reduce #'(lambda (a b) (format "%s %s %s" a op b)) - (cdr seq) - (car seq)) + seq) "")) (defun rt-liber-make-interval (pred before after) @@ -385,53 +383,32 @@ 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-tree ticketbase) ticketbase-list) + (push (copy-sequence ticketbase) ticketbase-list) (setq ticketbase nil continue t)) ticketbase-list)) -(defun rt-liber-rest-ticketsql-runner-parser-f () - "Parser function for a textual list of tickets." - (let (idsub-list) - (rt-liber-rest-parse-http-header) - (while (re-search-forward "ticket/\\([0-9].+\\)" (point-max) t) - (push (list (match-string-no-properties 1) - ".") - idsub-list)) - idsub-list)) - -(defun rt-liber-rest-run-ls-query (query) - "Run an \"ls\" type query against the server with QUERY." - (rt-liber-parse-answer - (rt-liber-rest-query-runner "ls" query) - 'rt-liber-rest-ticketsql-runner-parser-f)) - -(defun rt-liber-rest-run-show-base-query (idsublist) - "Run \"show\" type query against the server with IDSUBLIST." - (rt-liber-parse-answer - (rt-liber-rest-show-query-runner idsublist) - #'rt-liber-ticket-base-retriever-parser-f)) - -(defun rt-liber-rest-run-ticket-history-base-query (ticket-id) - "Run history query against server for TICKET-ID." - (rt-liber-parse-answer - (rt-liber-rest-query-runner "history" ticket-id) - #'(lambda () - (rt-liber-rest-parse-http-header) - (buffer-substring (point) (point-max))))) - -(defun rt-liber-rest-command-set (id field status) - "Set ticket ID status to be STATUS." - (rt-liber-parse-answer - (rt-liber-rest-edit-runner id field status) - 'rt-liber-command-runner-parser-f)) +;; accept the output of `rt-liber-ticketsql-runner-parser-f' and +;; return a string suitable for an RT "show" query +(defun rt-liber-create-tickets-string (idsublist) + "Create a RT CLI ticket \"show\" string from IDSUBLIST." + (let ((ticket-list (mapcar #'(lambda (e) (car e)) idsublist))) + (if ticket-list + (concat "ticket/" + (if (= (length ticket-list) 1) + (format "%s" (car ticket-list)) + (cl-reduce + #'(lambda (a b) + (format "%s,%s" a b)) + ticket-list))) + (signal 'rt-liber-no-result-from-query-error nil)))) ;;; -------------------------------------------------------- @@ -568,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)) @@ -601,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 @@ -807,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 @@ -917,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-tree ticket-list))) + (let ((seq (copy-sequence ticket-list))) (sort seq sort-f))) (defun rt-liber-sort-by-owner (ticket-list) @@ -943,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, @@ -951,6 +928,79 @@ and as such always return t." t) +;;; -------------------------------------------------------- +;;; Version comparison functions +;;; -------------------------------------------------------- + +;; rt-liber-version-<: string * string -> t-or-nil +(defun rt-liber-version-< (vnum1 vnum2) + "Test whehther version number VNUM1 is less than VNUM2. +Arguments must be strings Lisp objects, and not numbers. + +Examples: + (rt-liber-version-< \"1.01\" \"1.11\") + => t + + (rt-liber-version-< \"1.1\" \"1.0.1\") + => nil" + (rt-liber-version-<- (rt-liber-version-value + (rt-liber-version-read vnum1)) + (rt-liber-version-value + (rt-liber-version-read vnum2)))) + +;; rt-liber-version-read: string -> list string +(defun rt-liber-version-read (str) + "Tokenize version number STR whenever the syntax class changes. + + Example: + \"1.043.0-1_=+\" \ +==> (\"1\" \".\" \"043\" \".\" \"0\" \"-\" \"1\" \"_=+\")" + (let ((tokens nil) + (start 0) + (re (mapconcat 'identity '("[[:digit:]]+" "[[:punct:]]+") "\\|"))) + (while (and (string-match re (substring str start)) + (> (length str) start)) + (setq tokens (cons (match-string 0 (substring str start)) tokens)) + (setq start (+ start (match-end 0)))) + (if (< start (length str)) + (error "Unknown character: %s" (substring str start (1+ start)))) + (reverse tokens))) + +;; rt-liber-version-value: list string -> list number +(defun rt-liber-version-value (tokens) + "Convert list of TOKENS to a comparable number list." + (mapcar #'(lambda (tk) + (if (string-match "^0+$" tk) + 1 + (if (string-match "^[[:digit:]]+$" tk) + (if (string-match "^0+" tk) + (1+ (* (string-to-number tk) + (expt 10 + (- (length + (match-string 0 tk)))))) + (1+ (string-to-number tk))) + (if (string-match "^[[:punct:]]+$" tk) + 0 + ;; else (string-match "[^[:digit:][:punct:]]" tk) + -1)))) + tokens)) + +;; rt-liber-version-<-: list number -> t-or-nil +(defun rt-liber-version-<- (vals1 vals2) + "Test whether version representation VALS1 is less than VALS2." + (if (and (null vals1) (null vals2)) + nil + (if (null vals2) + nil + (if (null vals1) + t + (if (= (car vals1) (car vals2)) + (rt-liber-version-<- (cdr vals1) (cdr vals2)) + (if (< (car vals1) (car vals2)) + t + nil)))))) + + ;;; -------------------------------------------------------- ;;; Entry points ;;; -------------------------------------------------------- @@ -961,7 +1011,7 @@ and as such always return t." 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)) @@ -981,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 @@ -1029,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) @@ -1118,6 +1168,12 @@ returned as no associated text properties." status-symbol rt-liber-status-dictionary)) +(defun rt-liber-command-get-custom-field-string (custom-field-symbol) + "Return value associated with key CUSTOM-FIELD-SYMBOL." + (rt-liber-command-get-dictionary-value + custom-field-symbol + rt-liber-custom-field-dictionary)) + (defun rt-liber-command-runner-parser-f () "Display command return status from the server to the user." (message (buffer-string))) -- cgit v1.2.3 From 1000e895314ca234a26e05db40824f968f6d3ad4 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 7 Aug 2020 11:56:52 -0400 Subject: * doc/rt-liberation.texinfo: update manual --- doc/rt-liberation.texinfo | 100 +++++++--------------------------------------- 1 file changed, 14 insertions(+), 86 deletions(-) diff --git a/doc/rt-liberation.texinfo b/doc/rt-liberation.texinfo index f5fa128..111cfb8 100644 --- a/doc/rt-liberation.texinfo +++ b/doc/rt-liberation.texinfo @@ -14,11 +14,11 @@ @copying - @copyright{} 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation + @copyright{} 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 or +under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free @@ -96,14 +96,9 @@ Ticket Browser @end ifnottex - - - @c -------------------------------------------------- - @node Introduction @chapter Introduction - @cindex introduction rt-liberation is a GNU/Emacs package for working with the Request @@ -117,35 +112,32 @@ the resulting tickets, viewing the tickets' contents and performing operations on the tickets. - - @c -------------------------------------------------- - @node Installation @chapter Installation - @cindex installation -rt-liberation can be configured in the ~/.emacs file. +rt-liberation is available via GNU ELPA. -Place rt-liberation in the load path: +If you install rt-liberation manually instead you'll need to tell +Emacs where to find it, and tell Emacs to load the package: @lisp (add-to-list 'load-path "/PATH/TO/rt-liberation/") @end lisp -Tell GNU/Emacs to load the package with: - @lisp (require 'rt-liberation) @end lisp -Tell rt-liberation where to find the RT server's REST interface and -which version of RT the server is running: + +rt-liberation needs to be configured in your ~/.emacs, an ~/.rt-liber +file, or similar. + +Tell rt-liberation where to find the RT server's REST interface: @lisp -(setq rt-liber-rest-url "rt.example.org" - rt-liber-rt-version "4.2.4") +(setq rt-liber-rest-url "rt.example.org") @end lisp rt-liberation can issue a command to ``take'' a ticket (that is, @@ -164,10 +156,8 @@ that to work the base URL needs to be set in @c -------------------------------------------------- - @node Queries @chapter Queries - @cindex queries A typical RT server is meant to manage a large amount of tickets. Much @@ -183,14 +173,9 @@ TicketSQL language. @end menu - - - @c -------------------------------------------------- - @node Query Compiler @section Query Compiler - @cindex query compiler In order to browse and view tickets a list of needs to be requested @@ -205,14 +190,9 @@ symbolic expressions into TicketSQL. The query compiler supports a number of TicketSQL tokens. - - - @c -------------------------------------------------- - @node Query Language @section Query Language - @cindex query language rt-liberation's Sexp-based query language covers a portion of the @@ -287,13 +267,9 @@ in function calls: @end lisp - - @c -------------------------------------------------- - @node Ticket Browser @chapter Ticket Browser - @cindex ticket browser The ticket browser is a special buffer which provides a convenient @@ -423,14 +399,9 @@ Set the numerical priority level of the ticket at point. @end menu - - - @c -------------------------------------------------- - @node Ticket Browser Display @section Ticket Browser Display - @cindex ticket browser display function The ticket browser displays the tickets in the browser by calling @@ -492,13 +463,9 @@ considered high priority if its value is strictly higher than @var{rt-liber-browser-priority-cutoff} - - @c -------------------------------------------------- - @node Ticket Browser Sorting @section Ticket Browser Sorting - @cindex ticket browser sorting The tickets in the browser are displayed by default in reverse @@ -550,11 +517,10 @@ signaled). @end defun -@c ------------------------------------------------------------------- +@c ------------------------------------------------------------------- @node Ticket Browser Filtering @section Ticket Browser Filtering - @cindex ticket browser filtering filter The Ticket Browser can also filter out (that is, not display) certain @@ -594,12 +560,10 @@ Then we assign that function to be our default filtering function: 'rt-liber-browser-deleted-filter) @end lisp -@c ------------------------------------------------------------------- - +@c ------------------------------------------------------------------- @node Multiple Ticket Browsers @section Multiple Ticket Browsers - @cindex ticket browser multiple buffer It is sometimes useful to rename the ticket browser buffer to @@ -634,14 +598,9 @@ buffers will be created displaying the query results and named @end lisp - - - @c -------------------------------------------------- - @node Ticket Viewer @chapter Ticket Viewer - @cindex ticket viewer The ticket viewer is an interface for viewing the contents of a @@ -753,14 +712,9 @@ Display the associated ticket in the ticket browser. @end table - - - @c -------------------------------------------------- - @node Gnus Integration @chapter Gnus Integration - @cindex Gnus Integration The file @file{rt-liberation-gnus.el} implements integration with Gnus @@ -823,14 +777,9 @@ Once rt-liberation-gnus is loaded and customized the key-bindings in the Viewer will be able to call into it, @xref{Ticket Viewer}. - - - @c -------------------------------------------------- - @node Tracking Updates @chapter Tracking Updates - @cindex Tracking Updates The functions in @file{rt-liberation-update.el} help keep up with @@ -861,13 +810,9 @@ time-stamp so that the next invocation will produce the same result. @end defun - - @c -------------------------------------------------- - @node Batch Operations @chapter Batch Operations - @cindex Batch Operations The extension @file{rt-liberation-multi.el} implements performing @@ -908,14 +853,9 @@ Set the status of all the marked tickets to ``is-spam'' and delete. @end defun - - - @c -------------------------------------------------- - @node Local Storage @chapter Local Storage - @cindex Local Storage @file{rt-liberation-storage.el} implements associating arbitrary @@ -954,43 +894,31 @@ text with tickets but is not limited to text. The same implementation can be extended to associate any arbitrary data with any ticket. +@c -------------------------------------------------- @c including the relevant licenses @include gpl.texi @include fdl.texi - - - @c -------------------------------------------------- - @node Concept Index @unnumbered Concept Index @printindex cp - - @c -------------------------------------------------- - @node Function Index @unnumbered Function Index @printindex fn - - @c -------------------------------------------------- - @node Variable Index @unnumbered Variable Index @printindex vr - - @c -------------------------------------------------- - @node Keybinding Index @unnumbered Keybinding Index @printindex ky -- cgit v1.2.3 From 0be03c519f12157a735f3b1c518f00da74c7e1cb Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 7 Aug 2020 11:57:41 -0400 Subject: * doc/gpl.texi: fix compilation warning --- doc/gpl.texi | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/gpl.texi b/doc/gpl.texi index dc22d67..48d43f9 100644 --- a/doc/gpl.texi +++ b/doc/gpl.texi @@ -1,4 +1,5 @@ @node Copying, The GNU FDL, Local Storage, Top +@chapter The GNU General Public License. @c The GNU General Public License. @center Version 3, 29 June 2007 -- cgit v1.2.3 From 05176e8b9171d8e1fb8bbb6fbb71523890b6d576 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 7 Aug 2020 13:15:01 -0400 Subject: * rt-liberation.el: version bump --- rt-liberation.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rt-liberation.el b/rt-liberation.el index c1a7e76..3f6133f 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -5,7 +5,7 @@ ;; Author: Yoni Rabkin ;; Authors: Aaron S. Hawley , John Sullivan ;; Maintainer: Yoni Rabkin -;; Version: 1.00 +;; Version: 1.01 ;; Keywords: rt, tickets ;; Package-Type: multi ;; url: http://www.nongnu.org/rtliber/ -- cgit v1.2.3 From 4e4cb0625df373243a4bc4262934b2e541c4dd04 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 7 Aug 2020 13:38:04 -0400 Subject: add manual to ELPA --- dir | 18 + rt-liberation.info | 2042 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2060 insertions(+) create mode 100644 dir create mode 100644 rt-liberation.info diff --git a/dir b/dir new file mode 100644 index 0000000..cdd36a0 --- /dev/null +++ b/dir @@ -0,0 +1,18 @@ +This is the file .../info/dir, which contains the +topmost node of the Info hierarchy, called (dir)Top. +The first time you invoke Info you start off looking at this node. + +File: dir, Node: Top This is the top of the INFO tree + + This (the Directory node) gives a menu of major topics. + Typing "q" exits, "?" lists all Info commands, "d" returns here, + "h" gives a primer for first-timers, + "mEmacs" visits the Emacs manual, etc. + + In Emacs, you can click mouse button 2 on a menu item or cross reference + to select it. + +* Menu: + +Emacs +* rt-liberation: (rt-liber). rt-liberation diff --git a/rt-liberation.info b/rt-liberation.info new file mode 100644 index 0000000..025c27c --- /dev/null +++ b/rt-liberation.info @@ -0,0 +1,2042 @@ +This is rt-liberation.info, produced by makeinfo version 6.1 from +rt-liberation.texinfo. + +(C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software +Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, and + no Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". +INFO-DIR-SECTION Emacs +START-INFO-DIR-ENTRY +* rt-liberation: (rt-liber). rt-liberation +END-INFO-DIR-ENTRY + + +File: rt-liberation.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) + +The rt-liberation Manual +************************ + +This is the Manual for the rt-liberation system + + (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software +Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, and + no Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". + +* Menu: + +* Introduction:: Introduction to rt-liberation. +* Installation:: Setup rt-liberation to work on the system. + +Using rt-liberation +* Queries:: Retrieve particular tickets from the server. +* Ticket Browser:: Browse the query results. +* Ticket Viewer:: Interface to query results. + +Extensions +* Gnus Integration:: Sending email to the RT server via Gnus. +* Tracking Updates:: Keeping up to date with ticket changes. +* Batch Operations:: Performing operations on batches of tickets. +* Local Storage:: Associate arbitrary data with tickets. + +Copying and license +* Copying:: The GNU General Public License gives you + permission to redistribute rt-liberation + on certain terms; it also explains that + there is no warranty. + +* The GNU FDL:: The license for this documentation. + +Indices +* Concept Index:: +* Function Index:: +* Variable Index:: +* Keybinding Index:: + + -- The Detailed Node Listing -- + +Queries + +* Query Compiler:: Compiling Emacs Lisp to TicketSQL. +* Query Language:: A description of the Sexp-based language. + +Ticket Browser + +* Ticket Browser Display:: How tickets are displayed in the browser. +* Ticket Browser Sorting:: How tickets are sorted in the browser. +* Ticket Browser Filtering:: How to filter tickets out of the browser. +* Multiple Ticket Browsers:: More than one ticket browser buffer. + + + +File: rt-liberation.info, Node: Introduction, Next: Installation, Up: Top + +1 Introduction +************** + +rt-liberation is a GNU/Emacs package for working with the Request +Tracker (henceforth abbreviated as just "RT") software from Best +Practical Solutions. RT has an interactive Web interface, a command +line interface (the "RT CLI"), and a REST interface. rt-liberation uses +the RT REST interface to communicate with the RT server. + + rt-liberation allows sending search queries to the RT server, +browsing the resulting tickets, viewing the tickets' contents and +performing operations on the tickets. + + +File: rt-liberation.info, Node: Installation, Next: Queries, Prev: Introduction, Up: Top + +2 Installation +************** + +rt-liberation is available via GNU ELPA. + + If you install rt-liberation manually instead you'll need to tell +Emacs where to find it, and tell Emacs to load the package: + + (add-to-list 'load-path "/PATH/TO/rt-liberation/") + + (require 'rt-liberation) + + rt-liberation needs to be configured in your ~/.emacs, an ~/.rt-liber +file, or similar. + + Tell rt-liberation where to find the RT server's REST interface: + + (setq rt-liber-rest-url "rt.example.org") + + rt-liberation can issue a command to "take" a ticket (that is, assign +it to yourself). For this the variable RT-LIBER-USERNAME must be set: + + (setq rt-liber-username "someuser") + + rt-liberation can also launch a Web browser to visit a ticket. For +that to work the base URL needs to be set in RT-LIBER-BASE-URL. For +example: + + (setq rt-liber-base-url "https://rt.foo.org/") + + +File: rt-liberation.info, Node: Queries, Next: Ticket Browser, Prev: Installation, Up: Top + +3 Queries +********* + +A typical RT server is meant to manage a large amount of tickets. Much +more that would be convenient to view all at once. Instead queries are +used to view only a subset of the tickets on the server. + + rt-liberation has its own Sexp-based query language which maps to +RT's TicketSQL language. + +* Menu: + +* Query Compiler:: Compiling Emacs Lisp to TicketSQL. +* Query Language:: A description of the Sexp-based language. + + +File: rt-liberation.info, Node: Query Compiler, Next: Query Language, Up: Queries + +3.1 Query Compiler +================== + +In order to browse and view tickets a list of needs to be requested from +the RT server. Typically the tickets answer some kind of criteria, for +example "tickets no older than a week owned by me which have \"foobar\" +in their subject line". In RT these criteria are formulated with +"TicketSQL" queries; a structured query language specific to RT. + + rt-liberation provides a query compiler function to compile Emacs +Lisp symbolic expressions into TicketSQL. The query compiler supports a +number of TicketSQL tokens. + + +File: rt-liberation.info, Node: Query Language, Prev: Query Compiler, Up: Queries + +3.2 Query Language +================== + +rt-liberation's Sexp-based query language covers a portion of the +TicketSQL language. Here are some of the supported TicketSQL tokens: +Boolean tokens as a means of combining query subsections: "and", "or", +"not". LIKE attribute tokens: "subject", "content". + + For example here is a query with both Boolean and LIKE tokens: + + (rt-liber-compile-query + (and (queue "bugs") + (content "gnu"))) + + ==> "Queue = 'bugs' AND Content LIKE 'gnu'" + + We can also express negation (note that the compiler produces "!=" +and "NOT LIKE" for negation depending on the context): + + (rt-liber-compile-query + (and (queue "bugs") + (not (owner "Nobody")) + (not (content "sprigz")) + (status "new"))) + + ==> "Queue = 'licensing' AND Owner != 'Nobody' \ + AND Content NOT LIKE 'sprigz' AND Status = 'new'" + + Attribute tokens which match an attribute to a specific field such +as: "owner", "status" and "queue". Temporal tokens which limit the +search results to tickets within a certain time interval: "created" and +"lastupdated". Note that temporal keywords such as "created" always +accept two arguments: BEFORE and AFTER. When either BEFORE or AFTER +aren't needed, use NIL instead. + + One of the advantages of being able to express the TicketSQL queries +as Emacs Lisp is to be able to express queries using Emacs Lisp +functions. + + Here is a slightly more involved example to illustrate: + + (rt-liber-compile-query + (and (queue "bugs") + (owner "me@myaddress.com") + (status "open") + (lastupdated nil + (format-time-string + "%Y-%m-%d" + (seconds-to-time + (- (time-to-seconds (current-time)) + (* 60 60 24 7))))))) + + ==> "Queue = 'bugs' AND Owner = 'me@myaddress.com' AND Status = 'open' AND LastUpdated > '2009-03-30'" + + Here is an example of how the ticket browser and compiler can be used +in function calls: + + (defun rt-liber-display-ticket (ticket-id) + "Display ticket with TICKET-ID in the ticket-browser." + (interactive "MTicket ID: ") + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "complaints") + (id ticket-id))))) + + +File: rt-liberation.info, Node: Ticket Browser, Next: Ticket Viewer, Prev: Queries, Up: Top + +4 Ticket Browser +**************** + +The ticket browser is a special buffer which provides a convenient +interface to the results of a server query. The ticket browser can be +started by invoking: (rt-liber-browse-query QUERY), where QUERY is a +TicketSQL query. The TicketSQL query can be entered manually as a +string or as the return value of the query compiler. + + -- Function: rt-liber-browse-query QUERY &optional NEW + Runs QUERY against the server and launches the browser. + + If NEW is non-nil then the query results will be displayed in a new + buffer, otherwise the query results will override the contents of + the existing ticket browser buffer. If NEW is a string then that + will be the name of the new buffer. + + The TicketSQL query can be the return value of the query compiler. +For example: + + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "bugs") + (content "gnu"))) + + Since the return value of the query compiler is just a TicketSQL +string, the following is equivalent: + + (rt-liber-browse-query "Queue = 'bugs' AND Content LIKE 'gnu'") + + The ticket browser defines a number of commands: + +'q' + Bury the ticket browser buffer. + +'n' + Move point to the next ticket. + +'p' + Move point to the previous ticket. + +'RET' + Visit the ticket at point in the *Note Ticket Viewer::. + +'g' + Refresh the contents of the browser buffer. + +'G' + Refresh the contents of the browser buffer. Return point to the + current ticket after the refresh (if possible). + +'s' + Mark the ticket as spam. + +'S' + Delete marked tickets as spam (requires rt-liberation-multi + package). + +'a' + Assign the ticket to a user. + +'r' + Mark the ticket as "resolved". + +'o' + Mark the ticket as "open". + +'t' + Assign the ticket at point to RT-LIBER-USERNAME. + +'SPC' + Scroll the text of the ticket browser upward. + +'DEL' + Scroll the text of the ticket browser downward. + +'m' + Move the ticket to a different queue. + +'P' + Set the numerical priority level of the ticket at point. + +* Menu: + +* Ticket Browser Display:: How tickets are displayed in the browser. +* Ticket Browser Sorting:: How tickets are sorted in the browser. +* Ticket Browser Filtering:: How to filter tickets out of the browser. +* Multiple Ticket Browsers:: More than one ticket browser buffer. + + +File: rt-liberation.info, Node: Ticket Browser Display, Next: Ticket Browser Sorting, Up: Ticket Browser + +4.1 Ticket Browser Display +========================== + +The ticket browser displays the tickets in the browser by calling +"rt-liber-ticketlist-browser-redraw-f" which can be changed and +customized. Any implementation of +"rt-liber-ticketlist-browser-redraw-f" must leave point at the end of +the ticket text. + + The ticket data itself can be displayed using rt-liberation ticket +format string %-sequences: + +%i + ID number of the ticket in the RT database. +%s + Subject line. +%c + Ticket creation time. The format to display the time is specified + in the variable RT-LIBER-BROWSER-TIME-FORMAT-STRING. +%S + Ticket status ("open", "new" etc.) +%r + Whether the ticket is resolved. +%R + Requestor/s +%C + Creator of the ticket. +%o + Owner of the ticket. +%q + The queue originating the ticket. +%p + The numerical priority of the ticket + + Here is an example implementation of +"rt-liber-ticketlist-browser-redraw-f" showing the use of the +%-sequences. Note the use of text properties to add color to ticket +text. The use of text properties as opposed to font-locking is meant to +ease customization because otherwise any change in ticket display would +break the font-locking regular expressions. + + (defun rt-liber-ticketlist-browser-redraw-f (ticket) + "Display TICKET." + (insert (rt-liber-format "[%c] %i" ticket)) + (add-text-properties (point-at-bol) + (point-at-eol) + '(face rt-liber-ticket-face)) + (newline) + (insert (rt-liber-format " [%S] %s" ticket)) + (newline) + (insert (rt-liber-format " %o <== %R" ticket))) + + The function "rt-liber-high-priority-p" can be used to apply a +different face or text to a ticket if it is high priority. A ticket is +considered high priority if its value is strictly higher than +RT-LIBER-BROWSER-PRIORITY-CUTOFF + + +File: rt-liberation.info, Node: Ticket Browser Sorting, Next: Ticket Browser Filtering, Prev: Ticket Browser Display, Up: Ticket Browser + +4.2 Ticket Browser Sorting +========================== + +The tickets in the browser are displayed by default in reverse +chronological order. Ticket sorting is done by a call to +"rt-liber-browser-default-sorting-function". + + Other sorting orders can be used by binding +"rt-liber-browser-default-sorting-function" to a different function. To +ease writing such functions rt-liberation provides two predicate +functions to perform comparisons between ticket objects: + + -- Function: rt-liber-lex-lessthan-p a b field + Return true if A is lexicographically less than B in FIELD. + + Here is an example of sorting tickets lexicographically by owner + name using "rt-liber-lex-lessthan-p" (note that you can feed + "rt-liber-lex-lessthan-p" a date/time string and it will sort it + just fine except that it wouldn't make any sense): + + (defun rt-liber-sort-by-owner (ticket-list) + "Sort TICKET-LIST lexicographically by owner." + (rt-liber-sort-ticket-list + ticket-list + #'(lambda (a b) + (rt-liber-lex-lessthan-p a b "Owner")))) + + -- Function: rt-liber-time-lessthan-p a b field + Return t if A is chronologically less than B in FIELD. + + Here is an example of sorting tickets lexicographically by owner + name using "rt-liber-time-lessthan-p" (note that feeding + "rt-liber-time-lessthan-p" anything but a date/time string, in this + case "Created" contains a date, will result in an error being + signaled). + + (defun rt-liber-sort-by-time-created (ticket-list) + "Sort TICKET-LIST in reverse chronological order." + (reverse + (rt-liber-sort-ticket-list + ticket-list + #'(lambda (a b) + (rt-liber-time-lessthan-p a b "Created"))))) + + +File: rt-liberation.info, Node: Ticket Browser Filtering, Next: Multiple Ticket Browsers, Prev: Ticket Browser Sorting, Up: Ticket Browser + +4.3 Ticket Browser Filtering +============================ + +The Ticket Browser can also filter out (that is, not display) certain +tickets based on particular criteria. This probably shouldn't be used +instead of a properly formed RT query, but when used in conjunction with +correctly formulated queries it becomes a powerful tool. + + During ticket display processing the Ticket Browser will call the +function pointed to by RT-LIBER-BROWSER-DEFAULT-FILTER-FUNCTION on each +ticket, passing the function the ticket alist as a single argument. The +function is set by default to "rt-liber-default-filter-f", which is a +function which will display all tickets and filter none. + + If any tickets are filtered, the Ticket Browser will display the +filtered ticket count at the bottom ticket listing. + + Here is a simple example of how to filter out all of the tickets +which have a status of "deleted". + + First we define a custom filter function. Note how it accepts a +single argument, which is the ticket alist, and returns nil if the +ticket is to be filtered. + + (defun rt-liber-browser-deleted-filter (ticket) + (not + (and ticket + (string= (cdr (assoc "Status" ticket)) + "deleted")))) + + Then we assign that function to be our default filtering function: + + (setq rt-liber-browser-default-filter-function + 'rt-liber-browser-deleted-filter) + + +File: rt-liberation.info, Node: Multiple Ticket Browsers, Prev: Ticket Browser Filtering, Up: Ticket Browser + +4.4 Multiple Ticket Browsers +============================ + +It is sometimes useful to rename the ticket browser buffer to something +more informative than the default RT-LIBER-BROWSER-BUFFER-NAME, +especially if there are multiple ticket browsers. + + Changing a ticket browser's name can be done normally with +'rename-buffer', but it is also possible to name the ticket browser when +it is created. In the following example two ticket browser buffers will +be created displaying the query results and named "*updated by +supervisor*" and "*new tickets*" respectively: + + (defun rt-liber-daily-rounds () + (interactive) + + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "complaints") + (owner "lem.e.tweakit") + (status "open") + (lastupdatedby "molly.manager"))) + "*updated by supervisor*") + + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "complaints") + (owner "Nobody") + (status "new"))) + "*new tickets*")) + + +File: rt-liberation.info, Node: Ticket Viewer, Next: Gnus Integration, Prev: Ticket Browser, Up: Top + +5 Ticket Viewer +*************** + +The ticket viewer is an interface for viewing the contents of a ticket. +It provides font-locking to make reading the contents easier via +RT-LIBER-VIEWER-FONT-LOCK-KEYWORDS and a number of key-bindings. + + The ticket viewer provides key-bindings to help compose emails to +send to the RT email interface. The key-bindings for composing email +described below are generic, what actually happens when you invoke them +depends on the email-backend system you have installed into +rt-liberation. 'rt-liberation-gnus.el' provides integration with Gnus, +*Note Gnus Integration::. + + Setting RT-LIBER-JUMP-TO-LATEST to 't' will cause the viewer to +automatically scroll to the latest comment in a ticket when that ticket +is visited. By default RT-LIBER-JUMP-TO-LATEST is set to 'nil'. + + When in the ticket viewer buffer, invoking +"rt-liber-viewer-take-ticket" will "take" the ticket. + +'q' + Bury the ticket viewer buffer. + +'n' + Move point to the next section in ticket. + +'N' + Move point to the newest correspondence section, if any. + +'p' + Move point to the previous section in ticket. + +'V' + Visit the current ticket in a Web browser. + +'m' + Compose an answer to the current ticket. + +'M' + Compose an answer to the current ticket. The content section + around point will be inserted into the email body and commented + out. + +'t' + Compose a provisional answer to the current ticket. + +'T' + Compose a provisional answer to the current ticket. The content + section around point will be inserted into the email body and + commented out. + +'F' + Compose an answer to the current ticket. The content section + around point will be inserted into the email body verbatim. + +'c' + Compose a comment for the current ticket. + +'C' + Comment on the ticket using the current context + +'g' + Refresh and redisplay the current ticket. + +'SPC' + Scroll text of ticket viewer upward. + +'DEL' + Scroll text of ticket viewer downward. + +'h' + Display the associated ticket in the ticket browser. + + +File: rt-liberation.info, Node: Gnus Integration, Next: Tracking Updates, Prev: Ticket Viewer, Up: Top + +6 Gnus Integration +****************** + +The file 'rt-liberation-gnus.el' implements integration with Gnus for +composing emails. To enable the feature, 'require' it after loading +rt-liberation: + + (require 'rt-liberation-gnus) + + In order for rt-liberation-gnus to be useful a few variables need to +be specialized. The following is example code which sets these +variables. Below is a thorough description of those variables. + + (setq rt-liber-gnus-comment-address "our-rtserver-comment@ourserver.org" + rt-liber-gnus-address "our-rtserver@ourserver.org" + rt-liber-gnus-subject-name "ourserver.org") + + -- User Option: rt-liber-gnus-address + RT-LIBER-GNUS-ADDRESS is the email address which is configured in + the RT server email interface for sending a response to the + ticket's requestor. + -- User Option: rt-liber-gnus-comment-address + RT-LIBER-GNUS-COMMENT-ADDRESS is the email address which is + configured in the RT server email interface for adding a comment + under the ticket in question. + -- User Option: rt-liber-gnus-subject-name + RT-LIBER-GNUS-SUBJECT-NAME is a string, typically included at the + beginning of the square brackets in the subject. The string is a + part of the subject line which helps the RT server recognize the + email. + + Gnus posting styles controlled by GNUS-POSTING-STYLES can be +customized for rt-liberation-gnus by using the variable RT-LIBER-GNUS-P, +which is only non-nil when rt-liberation-gnus launches a Gnus message +buffer. + + Here is example code which uses RT-LIBER-GNUS-P to override the +signature in the default posting style with one special to +rt-liberation. Headers can be added and removed in a similar manner. + + (setq gnus-posting-styles + '((".*" + (name "Lemm E. Hackitt") + (address "Lemm@hack.it") + (signature-file "~/sig.txt") + ("X-Ethics" "Use GNU")) + (rt-liber-gnus-p + (signature-file "~/rt-liber-sig.txt")))) + + Once rt-liberation-gnus is loaded and customized the key-bindings in +the Viewer will be able to call into it, *Note Ticket Viewer::. + + +File: rt-liberation.info, Node: Tracking Updates, Next: Batch Operations, Prev: Gnus Integration, Up: Top + +7 Tracking Updates +****************** + +The functions in 'rt-liberation-update.el' help keep up with updates to +the ticket database. To enable the feature, 'require' it after loading +rt-liberation: + + (require 'rt-liberation-update) + + Then set RT-LIBER-UPDATE-DEFAULT-QUEUE to be the name of the queue to +watch for updates. For example: + + (setq rt-liber-update-default-queue "complaints") + + -- Function: rt-liber-update &optional no-update + 'rt-liber-update' is an interactive function which runs a query + against the RT server asking for the tickets which have been + updated since the time 'rt-liber-update' was last run (each time it + runs, it leaves a time-stamp). If no time-stamp is found, for + instance when you run 'rt-liber-update' for the first time, today's + date is used. + + With the NO-UPDATE prefix, 'rt-liber-update' will not update the + time-stamp so that the next invocation will produce the same + result. + + +File: rt-liberation.info, Node: Batch Operations, Next: Local Storage, Prev: Tracking Updates, Up: Top + +8 Batch Operations +****************** + +The extension 'rt-liberation-multi.el' implements performing batch +operations on groups of tickets. It works in two stages: First mark an +arbitrary number of tickets within the same buffer then call a batch +operation function on them. The batch operation functions work the same +way as function which work on single tickets only that they iterate +through all of the marked tickets. + + To enable batch operations first load 'rt-liberation-multi.el': + + (require 'rt-liberation-storage) + +'M' + Mark the ticket at point for future action. If the ticket at point + is already marked then unmark it. + + -- Function: rt-liber-multi-set-status-open + Set the status of all the marked tickets to "open". + + -- Function: rt-liber-multi-set-status-resolved + Set the status of all the marked tickets to "resolved. + + -- Function: rt-liber-multi-assign name + Assign all of the marked tickets to NAME. + + -- Function: rt-liber-multi-flag-as-spam-and-delete + Set the status of all the marked tickets to "is-spam" and delete. + + +File: rt-liberation.info, Node: Local Storage, Next: Copying, Prev: Batch Operations, Up: Top + +9 Local Storage +*************** + +'rt-liberation-storage.el' implements associating arbitrary ancillary +data with tickets. The data is stored locally and is not sent to the RT +server. + + To enable local storage first load 'rt-liberation-storage.el': + + (require 'rt-liberation-storage) + + Then enable the display of ancillary data with: + + (setq rt-liber-anc-p t) + + The associated data is edited and displayed in the ticket browser +with the following command key: + +'A' + Associate text with the ticket at point. You will be prompted to + enter a string of text. + + Once text is associated with a ticket it will be displayed alongside +that ticket in the ticket browser. This particular feature lends itself +to creating private annotations about tickets. + + The implementation distributed with rt-liberation allows associating +text with tickets but is not limited to text. The same implementation +can be extended to associate any arbitrary data with any ticket. + + +File: rt-liberation.info, Node: Copying, Next: The GNU FDL, Prev: Local Storage, Up: Top + +10 The GNU General Public License. +********************************** + + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + +Preamble +======== + +The GNU General Public License is a free, copyleft license for software +and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS +==================== + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public + License. + + "Copyright" also means copyright-like laws that apply to other + kinds of works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the + work in a fashion requiring copyright permission, other than the + making of an exact copy. The resulting work is called a "modified + version" of the earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work + based on the Program. + + To "propagate" a work means to do anything with it that, without + permission, would make you directly or secondarily liable for + infringement under applicable copyright law, except executing it on + a computer or modifying a private copy. Propagation includes + copying, distribution (with or without modification), making + available to the public, and in some countries other activities as + well. + + To "convey" a work means any kind of propagation that enables other + parties to make or receive copies. Mere interaction with a user + through a computer network, with no transfer of a copy, is not + conveying. + + An interactive user interface displays "Appropriate Legal Notices" + to the extent that it includes a convenient and prominently visible + feature that (1) displays an appropriate copyright notice, and (2) + tells the user that there is no warranty for the work (except to + the extent that warranties are provided), that licensees may convey + the work under this License, and how to view a copy of this + License. If the interface presents a list of user commands or + options, such as a menu, a prominent item in the list meets this + criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any non-source + form of a work. + + A "Standard Interface" means an interface that either is an + official standard defined by a recognized standards body, or, in + the case of interfaces specified for a particular programming + language, one that is widely used among developers working in that + language. + + The "System Libraries" of an executable work include anything, + other than the work as a whole, that (a) is included in the normal + form of packaging a Major Component, but which is not part of that + Major Component, and (b) serves only to enable use of the work with + that Major Component, or to implement a Standard Interface for + which an implementation is available to the public in source code + form. A "Major Component", in this context, means a major + essential component (kernel, window system, and so on) of the + specific operating system (if any) on which the executable work + runs, or a compiler used to produce the work, or an object code + interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all + the source code needed to generate, install, and (for an executable + work) run the object code and to modify the work, including scripts + to control those activities. However, it does not include the + work's System Libraries, or general-purpose tools or generally + available free programs which are used unmodified in performing + those activities but which are not part of the work. For example, + Corresponding Source includes interface definition files associated + with source files for the work, and the source code for shared + libraries and dynamically linked subprograms that the work is + specifically designed to require, such as by intimate data + communication or control flow between those subprograms and other + parts of the work. + + The Corresponding Source need not include anything that users can + regenerate automatically from other parts of the Corresponding + Source. + + The Corresponding Source for a work in source code form is that + same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of + copyright on the Program, and are irrevocable provided the stated + conditions are met. This License explicitly affirms your unlimited + permission to run the unmodified Program. The output from running + a covered work is covered by this License only if the output, given + its content, constitutes a covered work. This License acknowledges + your rights of fair use or other equivalent, as provided by + copyright law. + + You may make, run and propagate covered works that you do not + convey, without conditions so long as your license otherwise + remains in force. You may convey covered works to others for the + sole purpose of having them make modifications exclusively for you, + or provide you with facilities for running those works, provided + that you comply with the terms of this License in conveying all + material for which you do not control copyright. Those thus making + or running the covered works for you must do so exclusively on your + behalf, under your direction and control, on terms that prohibit + them from making any copies of your copyrighted material outside + their relationship with you. + + Conveying under any other circumstances is permitted solely under + the conditions stated below. Sublicensing is not allowed; section + 10 makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological + measure under any applicable law fulfilling obligations under + article 11 of the WIPO copyright treaty adopted on 20 December + 1996, or similar laws prohibiting or restricting circumvention of + such measures. + + When you convey a covered work, you waive any legal power to forbid + circumvention of technological measures to the extent such + circumvention is effected by exercising rights under this License + with respect to the covered work, and you disclaim any intention to + limit operation or modification of the work as a means of + enforcing, against the work's users, your or third parties' legal + rights to forbid circumvention of technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice; + keep intact all notices stating that this License and any + non-permissive terms added in accord with section 7 apply to the + code; keep intact all notices of the absence of any warranty; and + give all recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, + and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to + produce it from the Program, in the form of source code under the + terms of section 4, provided that you also meet all of these + conditions: + + a. The work must carry prominent notices stating that you + modified it, and giving a relevant date. + + b. The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in + section 4 to "keep intact all notices". + + c. You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable + section 7 additional terms, to the whole of the work, and all + its parts, regardless of how they are packaged. This License + gives no permission to license the work in any other way, but + it does not invalidate such permission if you have separately + received it. + + d. If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has + interactive interfaces that do not display Appropriate Legal + Notices, your work need not make them do so. + + A compilation of a covered work with other separate and independent + works, which are not by their nature extensions of the covered + work, and which are not combined with it such as to form a larger + program, in or on a volume of a storage or distribution medium, is + called an "aggregate" if the compilation and its resulting + copyright are not used to limit the access or legal rights of the + compilation's users beyond what the individual works permit. + Inclusion of a covered work in an aggregate does not cause this + License to apply to the other parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms + of sections 4 and 5, provided that you also convey the + machine-readable Corresponding Source under the terms of this + License, in one of these ways: + + a. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that + product model, to give anyone who possesses the object code + either (1) a copy of the Corresponding Source for all the + software in the product that is covered by this License, on a + durable physical medium customarily used for software + interchange, for a price no more than your reasonable cost of + physically performing this conveying of source, or (2) access + to copy the Corresponding Source from a network server at no + charge. + + c. Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, + and only if you received the object code with such an offer, + in accord with subsection 6b. + + d. Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to + the Corresponding Source in the same way through the same + place at no further charge. You need not require recipients + to copy the Corresponding Source along with the object code. + If the place to copy the object code is a network server, the + Corresponding Source may be on a different server (operated by + you or a third party) that supports equivalent copying + facilities, provided you maintain clear directions next to the + object code saying where to find the Corresponding Source. + Regardless of what server hosts the Corresponding Source, you + remain obligated to ensure that it is available for as long as + needed to satisfy these requirements. + + e. Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the + general public at no charge under subsection 6d. + + A separable portion of the object code, whose source code is + excluded from the Corresponding Source as a System Library, need + not be included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means + any tangible personal property which is normally used for personal, + family, or household purposes, or (2) anything designed or sold for + incorporation into a dwelling. In determining whether a product is + a consumer product, doubtful cases shall be resolved in favor of + coverage. For a particular product received by a particular user, + "normally used" refers to a typical or common use of that class of + product, regardless of the status of the particular user or of the + way in which the particular user actually uses, or expects or is + expected to use, the product. A product is a consumer product + regardless of whether the product has substantial commercial, + industrial or non-consumer uses, unless such uses represent the + only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, + procedures, authorization keys, or other information required to + install and execute modified versions of a covered work in that + User Product from a modified version of its Corresponding Source. + The information must suffice to ensure that the continued + functioning of the modified object code is in no case prevented or + interfered with solely because modification has been made. + + If you convey an object code work under this section in, or with, + or specifically for use in, a User Product, and the conveying + occurs as part of a transaction in which the right of possession + and use of the User Product is transferred to the recipient in + perpetuity or for a fixed term (regardless of how the transaction + is characterized), the Corresponding Source conveyed under this + section must be accompanied by the Installation Information. But + this requirement does not apply if neither you nor any third party + retains the ability to install modified object code on the User + Product (for example, the work has been installed in ROM). + + The requirement to provide Installation Information does not + include a requirement to continue to provide support service, + warranty, or updates for a work that has been modified or installed + by the recipient, or for the User Product in which it has been + modified or installed. Access to a network may be denied when the + modification itself materially and adversely affects the operation + of the network or violates the rules and protocols for + communication across the network. + + Corresponding Source conveyed, and Installation Information + provided, in accord with this section must be in a format that is + publicly documented (and with an implementation available to the + public in source code form), and must require no special password + or key for unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of + this License by making exceptions from one or more of its + conditions. Additional permissions that are applicable to the + entire Program shall be treated as though they were included in + this License, to the extent that they are valid under applicable + law. If additional permissions apply only to part of the Program, + that part may be used separately under those permissions, but the + entire Program remains governed by this License without regard to + the additional permissions. + + When you convey a copy of a covered work, you may at your option + remove any additional permissions from that copy, or from any part + of it. (Additional permissions may be written to require their own + removal in certain cases when you modify the work.) You may place + additional permissions on material, added by you to a covered work, + for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material + you add to a covered work, you may (if authorized by the copyright + holders of that material) supplement the terms of this License with + terms: + + a. Disclaiming warranty or limiting liability differently from + the terms of sections 15 and 16 of this License; or + + b. Requiring preservation of specified reasonable legal notices + or author attributions in that material or in the Appropriate + Legal Notices displayed by works containing it; or + + c. Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked + in reasonable ways as different from the original version; or + + d. Limiting the use for publicity purposes of names of licensors + or authors of the material; or + + e. Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f. Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified + versions of it) with contractual assumptions of liability to + the recipient, for any liability that these contractual + assumptions directly impose on those licensors and authors. + + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as + you received it, or any part of it, contains a notice stating that + it is governed by this License along with a term that is a further + restriction, you may remove that term. If a license document + contains a further restriction but permits relicensing or conveying + under this License, you may add to a covered work material governed + by the terms of that license document, provided that the further + restriction does not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you + must place, in the relevant source files, a statement of the + additional terms that apply to those files, or a notice indicating + where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in + the form of a separately written license, or stated as exceptions; + the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly + provided under this License. Any attempt otherwise to propagate or + modify it is void, and will automatically terminate your rights + under this License (including any patent licenses granted under the + third paragraph of section 11). + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, you do not qualify to receive new licenses + for the same material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or + run a copy of the Program. Ancillary propagation of a covered work + occurring solely as a consequence of using peer-to-peer + transmission to receive a copy likewise does not require + acceptance. However, nothing other than this License grants you + permission to propagate or modify any covered work. These actions + infringe copyright if you do not accept this License. Therefore, + by modifying or propagating a covered work, you indicate your + acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically + receives a license from the original licensors, to run, modify and + propagate that work, subject to this License. You are not + responsible for enforcing compliance by third parties with this + License. + + An "entity transaction" is a transaction transferring control of an + organization, or substantially all assets of one, or subdividing an + organization, or merging organizations. If propagation of a + covered work results from an entity transaction, each party to that + transaction who receives a copy of the work also receives whatever + licenses to the work the party's predecessor in interest had or + could give under the previous paragraph, plus a right to possession + of the Corresponding Source of the work from the predecessor in + interest, if the predecessor has it or can get it with reasonable + efforts. + + You may not impose any further restrictions on the exercise of the + rights granted or affirmed under this License. For example, you + may not impose a license fee, royalty, or other charge for exercise + of rights granted under this License, and you may not initiate + litigation (including a cross-claim or counterclaim in a lawsuit) + alleging that any patent claim is infringed by making, using, + selling, offering for sale, or importing the Program or any portion + of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this + License of the Program or a work on which the Program is based. + The work thus licensed is called the contributor's "contributor + version". + + A contributor's "essential patent claims" are all patent claims + owned or controlled by the contributor, whether already acquired or + hereafter acquired, that would be infringed by some manner, + permitted by this License, of making, using, or selling its + contributor version, but do not include claims that would be + infringed only as a consequence of further modification of the + contributor version. For purposes of this definition, "control" + includes the right to grant patent sublicenses in a manner + consistent with the requirements of this License. + + Each contributor grants you a non-exclusive, worldwide, + royalty-free patent license under the contributor's essential + patent claims, to make, use, sell, offer for sale, import and + otherwise run, modify and propagate the contents of its contributor + version. + + In the following three paragraphs, a "patent license" is any + express agreement or commitment, however denominated, not to + enforce a patent (such as an express permission to practice a + patent or covenant not to sue for patent infringement). To "grant" + such a patent license to a party means to make such an agreement or + commitment not to enforce a patent against the party. + + If you convey a covered work, knowingly relying on a patent + license, and the Corresponding Source of the work is not available + for anyone to copy, free of charge and under the terms of this + License, through a publicly available network server or other + readily accessible means, then you must either (1) cause the + Corresponding Source to be so available, or (2) arrange to deprive + yourself of the benefit of the patent license for this particular + work, or (3) arrange, in a manner consistent with the requirements + of this License, to extend the patent license to downstream + recipients. "Knowingly relying" means you have actual knowledge + that, but for the patent license, your conveying the covered work + in a country, or your recipient's use of the covered work in a + country, would infringe one or more identifiable patents in that + country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or + arrangement, you convey, or propagate by procuring conveyance of, a + covered work, and grant a patent license to some of the parties + receiving the covered work authorizing them to use, propagate, + modify or convey a specific copy of the covered work, then the + patent license you grant is automatically extended to all + recipients of the covered work and works based on it. + + A patent license is "discriminatory" if it does not include within + the scope of its coverage, prohibits the exercise of, or is + conditioned on the non-exercise of one or more of the rights that + are specifically granted under this License. You may not convey a + covered work if you are a party to an arrangement with a third + party that is in the business of distributing software, under which + you make payment to the third party based on the extent of your + activity of conveying the work, and under which the third party + grants, to any of the parties who would receive the covered work + from you, a discriminatory patent license (a) in connection with + copies of the covered work conveyed by you (or copies made from + those copies), or (b) primarily for and in connection with specific + products or compilations that contain the covered work, unless you + entered into that arrangement, or that patent license was granted, + prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting + any implied license or other defenses to infringement that may + otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement + or otherwise) that contradict the conditions of this License, they + do not excuse you from the conditions of this License. If you + cannot convey a covered work so as to satisfy simultaneously your + obligations under this License and any other pertinent obligations, + then as a consequence you may not convey it at all. For example, + if you agree to terms that obligate you to collect a royalty for + further conveying from those to whom you convey the Program, the + only way you could satisfy both those terms and this License would + be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have + permission to link or combine any covered work with a work licensed + under version 3 of the GNU Affero General Public License into a + single combined work, and to convey the resulting work. The terms + of this License will continue to apply to the part which is the + covered work, but the special requirements of the GNU Affero + General Public License, section 13, concerning interaction through + a network will apply to the combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new + versions of the GNU General Public License from time to time. Such + new versions will be similar in spirit to the present version, but + may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies that a certain numbered version of the GNU + General Public License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that numbered version or of any later version published by the Free + Software Foundation. If the Program does not specify a version + number of the GNU General Public License, you may choose any + version ever published by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future + versions of the GNU General Public License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Program. + + Later license versions may give you additional or different + permissions. However, no additional obligations are imposed on any + author or copyright holder as a result of your choosing to follow a + later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE + COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE + RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL + NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES + AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR + DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA + BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD + PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF + THE POSSIBILITY OF SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided + above cannot be given local legal effect according to their terms, + reviewing courts shall apply local law that most closely + approximates an absolute waiver of all civil liability in + connection with the Program, unless a warranty or assumption of + liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS +=========================== + +How to Apply These Terms to Your New Programs +============================================= + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Also add information on how to contact you by electronic and paper +mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + PROGRAM Copyright (C) YEAR NAME OF AUTHOR + This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type 'show c' for details. + + The hypothetical commands 'show w' and 'show c' should show the +appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an "about box". + + You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU GPL, see . + + The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. But first, +please read . + + +File: rt-liberation.info, Node: The GNU FDL, Next: Concept Index, Prev: Copying, Up: Top + +11 GNU Free Documentation License +********************************* + + Version 1.2, November 2002 + + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses terminated + so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. + +11.1 ADDENDUM: How to use this License for your documents +========================================================= + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: rt-liberation.info, Node: Concept Index, Next: Function Index, Prev: The GNU FDL, Up: Top + +Concept Index +************* + +[index] +* Menu: + +* Batch Operations: Batch Operations. (line 6) +* FDL, GNU Free Documentation License: The GNU FDL. (line 6) +* Gnus Integration: Gnus Integration. (line 6) +* installation: Installation. (line 6) +* introduction: Introduction. (line 6) +* Local Storage: Local Storage. (line 6) +* queries: Queries. (line 6) +* query compiler: Query Compiler. (line 6) +* query language: Query Language. (line 6) +* ticket browser: Ticket Browser. (line 6) +* ticket browser display function: Ticket Browser Display. + (line 6) +* ticket browser filtering filter: Ticket Browser Filtering. + (line 6) +* ticket browser multiple buffer: Multiple Ticket Browsers. + (line 6) +* ticket browser sorting: Ticket Browser Sorting. + (line 6) +* ticket viewer: Ticket Viewer. (line 6) +* Tracking Updates: Tracking Updates. (line 6) + + +File: rt-liberation.info, Node: Function Index, Next: Variable Index, Prev: Concept Index, Up: Top + +Function Index +************** + +[index] +* Menu: + +* revert-buffer: Ticket Browser. (line 48) +* revert-buffer <1>: Ticket Viewer. (line 66) +* rt-liber-browse-query: Ticket Browser. (line 12) +* rt-liber-browser-ancillary-text: Local Storage. (line 22) +* rt-liber-browser-assign: Ticket Browser. (line 62) +* rt-liber-browser-mark-as-spam: Ticket Browser. (line 55) +* rt-liber-browser-mode-quit: Ticket Browser. (line 36) +* rt-liber-browser-move: Ticket Browser. (line 80) +* rt-liber-browser-open: Ticket Browser. (line 68) +* rt-liber-browser-prioritize: Ticket Browser. (line 83) +* rt-liber-browser-refresh-and-return: Ticket Browser. (line 51) +* rt-liber-browser-resolve: Ticket Browser. (line 65) +* rt-liber-browser-take-ticket-at-point: Ticket Browser. (line 71) +* rt-liber-display-ticket-at-point: Ticket Browser. (line 45) +* rt-liber-jump-to-latest-correspondence: Ticket Viewer. (line 31) +* rt-liber-lex-lessthan-p: Ticket Browser Sorting. + (line 15) +* rt-liber-mark-ticket-at-point: Batch Operations. (line 18) +* rt-liber-multi-assign: Batch Operations. (line 27) +* rt-liber-multi-delete-spam: Ticket Browser. (line 58) +* rt-liber-multi-flag-as-spam-and-delete: Batch Operations. (line 30) +* rt-liber-multi-set-status-open: Batch Operations. (line 21) +* rt-liber-multi-set-status-resolved: Batch Operations. (line 24) +* rt-liber-next-section-in-viewer: Ticket Viewer. (line 28) +* rt-liber-next-ticket-in-browser: Ticket Browser. (line 39) +* rt-liber-previous-section-in-viewer: Ticket Viewer. (line 34) +* rt-liber-previous-ticket-in-browser: Ticket Browser. (line 42) +* rt-liber-time-lessthan-p: Ticket Browser Sorting. + (line 30) +* rt-liber-update: Tracking Updates. (line 17) +* rt-liber-viewer-answer: Ticket Viewer. (line 40) +* rt-liber-viewer-answer-provisionally: Ticket Viewer. (line 48) +* rt-liber-viewer-answer-provisionally-this: Ticket Viewer. (line 51) +* rt-liber-viewer-answer-this: Ticket Viewer. (line 43) +* rt-liber-viewer-answer-verbatim-this: Ticket Viewer. (line 56) +* rt-liber-viewer-comment: Ticket Viewer. (line 60) +* rt-liber-viewer-comment-this: Ticket Viewer. (line 63) +* rt-liber-viewer-mode-quit: Ticket Viewer. (line 25) +* rt-liber-viewer-show-ticket-browser: Ticket Viewer. (line 75) +* rt-liber-viewer-visit-in-browser: Ticket Viewer. (line 37) +* scroll-down: Ticket Browser. (line 77) +* scroll-down <1>: Ticket Viewer. (line 72) +* scroll-up: Ticket Browser. (line 74) +* scroll-up <1>: Ticket Viewer. (line 69) + + +File: rt-liberation.info, Node: Variable Index, Next: Keybinding Index, Prev: Function Index, Up: Top + +Variable Index +************** + +[index] +* Menu: + +* rt-liber-gnus-address: Gnus Integration. (line 20) +* rt-liber-gnus-comment-address: Gnus Integration. (line 24) +* rt-liber-gnus-subject-name: Gnus Integration. (line 28) + + +File: rt-liberation.info, Node: Keybinding Index, Prev: Variable Index, Up: Top + +Keybinding Index +**************** + +[index] +* Menu: + +* a (ticket browser): Ticket Browser. (line 62) +* A (ticket browser): Local Storage. (line 22) +* c (ticket viewer): Ticket Viewer. (line 60) +* C (ticket viewer): Ticket Viewer. (line 63) +* DEL (ticket browser): Ticket Browser. (line 77) +* DEL (ticket viewer): Ticket Viewer. (line 72) +* F (ticket viewer): Ticket Viewer. (line 56) +* g (ticket browser): Ticket Browser. (line 48) +* G (ticket browser): Ticket Browser. (line 51) +* g (ticket viewer): Ticket Viewer. (line 66) +* h (ticket viewer): Ticket Viewer. (line 75) +* m (ticket browser): Ticket Browser. (line 80) +* M (ticket browser): Batch Operations. (line 18) +* m (ticket viewer): Ticket Viewer. (line 40) +* M (ticket viewer): Ticket Viewer. (line 43) +* n (ticket browser): Ticket Browser. (line 39) +* n (ticket viewer): Ticket Viewer. (line 28) +* N (ticket viewer): Ticket Viewer. (line 31) +* o (ticket browser): Ticket Browser. (line 68) +* p (ticket browser): Ticket Browser. (line 42) +* P (ticket browser): Ticket Browser. (line 83) +* p (ticket viewer): Ticket Viewer. (line 34) +* q (ticket browser): Ticket Browser. (line 36) +* q (ticket viewer): Ticket Viewer. (line 25) +* r (ticket browser): Ticket Browser. (line 65) +* RET (ticket browser): Ticket Browser. (line 45) +* s (ticket browser): Ticket Browser. (line 55) +* S (ticket browser): Ticket Browser. (line 58) +* SPC (ticket browser): Ticket Browser. (line 74) +* SPC (ticket viewer): Ticket Viewer. (line 69) +* t (ticket browser): Ticket Browser. (line 71) +* t (ticket viewer): Ticket Viewer. (line 48) +* t (ticket viewer) <1>: Ticket Viewer. (line 51) +* V (ticket viewer): Ticket Viewer. (line 37) + + + +Tag Table: +Node: Top689 +Node: Introduction2970 +Node: Installation3582 +Node: Queries4566 +Node: Query Compiler5133 +Node: Query Language5779 +Node: Ticket Browser8223 +Node: Ticket Browser Display10700 +Node: Ticket Browser Sorting12696 +Node: Ticket Browser Filtering14651 +Node: Multiple Ticket Browsers16199 +Node: Ticket Viewer17373 +Node: Gnus Integration19550 +Node: Tracking Updates21843 +Node: Batch Operations22925 +Node: Local Storage24110 +Node: Copying25193 +Node: The GNU FDL62747 +Node: Concept Index85144 +Node: Function Index86730 +Node: Variable Index90085 +Node: Keybinding Index90466 + +End Tag Table -- cgit v1.2.3 From f7a290c15c0f67ff59454c376c0228fae8df2e68 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 7 Aug 2020 13:38:16 -0400 Subject: * doc/developer-release.txt: new file --- doc/developer-release.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/developer-release.txt diff --git a/doc/developer-release.txt b/doc/developer-release.txt new file mode 100644 index 0000000..e976f0b --- /dev/null +++ b/doc/developer-release.txt @@ -0,0 +1,18 @@ +-*- outline -*- + +* Notes for preparing a release for rt-liberation + + +** Version +In order for the ELPA system to trigger a release the version number +in the comment header of rt-liberation.el must be incremented. + + +** Info +After each manual update the info file needs to be copied into the +root of the project so that ELPA can pick it up. + + +** ELPA +Updates to the Savannah repository that have been tested can be pushed +to the ELPA repository at externals/rt-liberation. -- cgit v1.2.3 From ed929f51cba59b04885938aa19f01a31f80aa52e Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 7 Aug 2020 13:38:33 -0400 Subject: integrate changes post-ELPA synchronization --- rt-liberation-rest.el | 46 +----------------- rt-liberation.el | 132 ++++++++++++++------------------------------------ 2 files changed, 39 insertions(+), 139 deletions(-) diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index 7782665..99f6ce9 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -20,9 +20,7 @@ ;; License along with this program; if not, write to the Free ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ;; MA 02111-1307, USA. -;; -;; Note: Licensed under GPLv2+ and not GPLv3+ in order to be -;; compatible with the license of RT. + ;;; History: ;; @@ -33,9 +31,7 @@ (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.") @@ -176,24 +172,6 @@ (re-search-forward rt-ok-regexp (point-max))) (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." - (let (idsub-list) - (rt-liber-rest-parse-http-header) - (while (re-search-forward "ticket/\\([0-9].+\\)" (point-max) t) - ;; the output should be compatible with the input to - ;; `rt-liber-create-tickets-string' - (push (list (match-string-no-properties 1) - ".") - idsub-list)) - idsub-list)) - -(defun rt-liber-rest-run-ls-query (query) - "Run an \"ls\" type query against the server with QUERY." - (rt-liber-parse-answer - (rt-liber-rest-query-runner "ls" query) - 'rt-liber-rest-ticketsql-runner-parser-f)) - (defun rt-liber-rest-show-process (response) "Process and return the show query response." (when (not (stringp response)) @@ -228,20 +206,6 @@ (message "done retrieving %d tickets" l))) (buffer-substring (point-min) (point-max)))) -(defun rt-liber-rest-run-show-base-query (idsublist) - "Run \"show\" type query against the server with IDSUBLIST." - (rt-liber-parse-answer - (rt-liber-rest-show-query-runner idsublist) - #'rt-liber-ticket-base-retriever-parser-f)) - -(defun rt-liber-rest-run-ticket-history-base-query (ticket-id) - "Run history query against server for TICKET-ID." - (rt-liber-parse-answer - (rt-liber-rest-query-runner "history" ticket-id) - #'(lambda () - (rt-liber-rest-parse-http-header) - (buffer-substring (point) (point-max))))) - (defun rt-liber-rest-handle-response (buffer) "Handle the response provided in BUFFER." (with-current-buffer buffer @@ -270,12 +234,6 @@ (rt-liber-rest-handle-response response-buffer))) (message "edit command ended at %s" (current-time-string))) -(defun rt-liber-rest-command-set (id field status) - "Set ticket ID status to be STATUS." - (rt-liber-parse-answer - (rt-liber-rest-edit-runner id field status) - 'rt-liber-command-runner-parser-f)) - (provide 'rt-liberation-rest) diff --git a/rt-liberation.el b/rt-liberation.el index 3f6133f..6649bb0 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -395,20 +395,41 @@ AFTER date after predicate." continue t)) ticketbase-list)) -;; accept the output of `rt-liber-ticketsql-runner-parser-f' and -;; return a string suitable for an RT "show" query -(defun rt-liber-create-tickets-string (idsublist) - "Create a RT CLI ticket \"show\" string from IDSUBLIST." - (let ((ticket-list (mapcar #'(lambda (e) (car e)) idsublist))) - (if ticket-list - (concat "ticket/" - (if (= (length ticket-list) 1) - (format "%s" (car ticket-list)) - (cl-reduce - #'(lambda (a b) - (format "%s,%s" a b)) - ticket-list))) - (signal 'rt-liber-no-result-from-query-error nil)))) +(defun rt-liber-rest-ticketsql-runner-parser-f () + "Parser function for a textual list of tickets." + (let (idsub-list) + (rt-liber-rest-parse-http-header) + (while (re-search-forward "ticket/\\([0-9].+\\)" (point-max) t) + (push (list (match-string-no-properties 1) + ".") + idsub-list)) + idsub-list)) + +(defun rt-liber-rest-run-ls-query (query) + "Run an \"ls\" type query against the server with QUERY." + (rt-liber-parse-answer + (rt-liber-rest-query-runner "ls" query) + 'rt-liber-rest-ticketsql-runner-parser-f)) + +(defun rt-liber-rest-run-show-base-query (idsublist) + "Run \"show\" type query against the server with IDSUBLIST." + (rt-liber-parse-answer + (rt-liber-rest-show-query-runner idsublist) + #'rt-liber-ticket-base-retriever-parser-f)) + +(defun rt-liber-rest-run-ticket-history-base-query (ticket-id) + "Run history query against server for TICKET-ID." + (rt-liber-parse-answer + (rt-liber-rest-query-runner "history" ticket-id) + #'(lambda () + (rt-liber-rest-parse-http-header) + (buffer-substring (point) (point-max))))) + +(defun rt-liber-rest-command-set (id field status) + "Set ticket ID status to be STATUS." + (rt-liber-parse-answer + (rt-liber-rest-edit-runner id field status) + 'rt-liber-command-runner-parser-f)) ;;; -------------------------------------------------------- @@ -538,7 +559,7 @@ AFTER date after predicate." "Key map for ticket viewer.") (define-derived-mode rt-liber-viewer-mode nil - "RT Liberation Viewer" + "RT Liberation Viewer" "Major Mode for viewing RT tickets. \\{rt-liber-viewer-mode-map}" (set @@ -928,79 +949,6 @@ and as such always return t." t) -;;; -------------------------------------------------------- -;;; Version comparison functions -;;; -------------------------------------------------------- - -;; rt-liber-version-<: string * string -> t-or-nil -(defun rt-liber-version-< (vnum1 vnum2) - "Test whehther version number VNUM1 is less than VNUM2. -Arguments must be strings Lisp objects, and not numbers. - -Examples: - (rt-liber-version-< \"1.01\" \"1.11\") - => t - - (rt-liber-version-< \"1.1\" \"1.0.1\") - => nil" - (rt-liber-version-<- (rt-liber-version-value - (rt-liber-version-read vnum1)) - (rt-liber-version-value - (rt-liber-version-read vnum2)))) - -;; rt-liber-version-read: string -> list string -(defun rt-liber-version-read (str) - "Tokenize version number STR whenever the syntax class changes. - - Example: - \"1.043.0-1_=+\" \ -==> (\"1\" \".\" \"043\" \".\" \"0\" \"-\" \"1\" \"_=+\")" - (let ((tokens nil) - (start 0) - (re (mapconcat 'identity '("[[:digit:]]+" "[[:punct:]]+") "\\|"))) - (while (and (string-match re (substring str start)) - (> (length str) start)) - (setq tokens (cons (match-string 0 (substring str start)) tokens)) - (setq start (+ start (match-end 0)))) - (if (< start (length str)) - (error "Unknown character: %s" (substring str start (1+ start)))) - (reverse tokens))) - -;; rt-liber-version-value: list string -> list number -(defun rt-liber-version-value (tokens) - "Convert list of TOKENS to a comparable number list." - (mapcar #'(lambda (tk) - (if (string-match "^0+$" tk) - 1 - (if (string-match "^[[:digit:]]+$" tk) - (if (string-match "^0+" tk) - (1+ (* (string-to-number tk) - (expt 10 - (- (length - (match-string 0 tk)))))) - (1+ (string-to-number tk))) - (if (string-match "^[[:punct:]]+$" tk) - 0 - ;; else (string-match "[^[:digit:][:punct:]]" tk) - -1)))) - tokens)) - -;; rt-liber-version-<-: list number -> t-or-nil -(defun rt-liber-version-<- (vals1 vals2) - "Test whether version representation VALS1 is less than VALS2." - (if (and (null vals1) (null vals2)) - nil - (if (null vals2) - nil - (if (null vals1) - t - (if (= (car vals1) (car vals2)) - (rt-liber-version-<- (cdr vals1) (cdr vals2)) - (if (< (car vals1) (car vals2)) - t - nil)))))) - - ;;; -------------------------------------------------------- ;;; Entry points ;;; -------------------------------------------------------- @@ -1075,7 +1023,7 @@ returned as no associated text properties." "Key map for ticket browser.") (define-derived-mode rt-liber-browser-mode nil - "RT Liberation Browser" + "RT Liberation Browser" "Major Mode for browsing RT tickets. \\{rt-liber-browser-mode-map}" (set (make-local-variable 'revert-buffer-function) @@ -1168,12 +1116,6 @@ returned as no associated text properties." status-symbol rt-liber-status-dictionary)) -(defun rt-liber-command-get-custom-field-string (custom-field-symbol) - "Return value associated with key CUSTOM-FIELD-SYMBOL." - (rt-liber-command-get-dictionary-value - custom-field-symbol - rt-liber-custom-field-dictionary)) - (defun rt-liber-command-runner-parser-f () "Display command return status from the server to the user." (message (buffer-string))) -- cgit v1.2.3 From 564825356cf752c942ade08ca066fb61259abfc7 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 10 Aug 2020 10:46:37 -0400 Subject: fix info listing problem --- doc/rt-liberation.texinfo | 2 +- rt-liberation.info | 46 +++++++++++++++++++++++----------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/doc/rt-liberation.texinfo b/doc/rt-liberation.texinfo index 111cfb8..6840a39 100644 --- a/doc/rt-liberation.texinfo +++ b/doc/rt-liberation.texinfo @@ -9,7 +9,7 @@ @dircategory Emacs @direntry -* rt-liberation: (rt-liber). rt-liberation +* rt-liberation: (rt-liberation). Emacs Interface to Request Tracker @end direntry diff --git a/rt-liberation.info b/rt-liberation.info index 025c27c..29153a6 100644 --- a/rt-liberation.info +++ b/rt-liberation.info @@ -12,7 +12,7 @@ Foundation, Inc. section entitled "GNU Free Documentation License". INFO-DIR-SECTION Emacs START-INFO-DIR-ENTRY -* rt-liberation: (rt-liber). rt-liberation +* rt-liberation: (rt-liberation). Emacs Interface to Request Tracker END-INFO-DIR-ENTRY  @@ -2016,27 +2016,27 @@ Keybinding Index  Tag Table: -Node: Top689 -Node: Introduction2970 -Node: Installation3582 -Node: Queries4566 -Node: Query Compiler5133 -Node: Query Language5779 -Node: Ticket Browser8223 -Node: Ticket Browser Display10700 -Node: Ticket Browser Sorting12696 -Node: Ticket Browser Filtering14651 -Node: Multiple Ticket Browsers16199 -Node: Ticket Viewer17373 -Node: Gnus Integration19550 -Node: Tracking Updates21843 -Node: Batch Operations22925 -Node: Local Storage24110 -Node: Copying25193 -Node: The GNU FDL62747 -Node: Concept Index85144 -Node: Function Index86730 -Node: Variable Index90085 -Node: Keybinding Index90466 +Node: Top715 +Node: Introduction2996 +Node: Installation3608 +Node: Queries4592 +Node: Query Compiler5159 +Node: Query Language5805 +Node: Ticket Browser8249 +Node: Ticket Browser Display10726 +Node: Ticket Browser Sorting12722 +Node: Ticket Browser Filtering14677 +Node: Multiple Ticket Browsers16225 +Node: Ticket Viewer17399 +Node: Gnus Integration19576 +Node: Tracking Updates21869 +Node: Batch Operations22951 +Node: Local Storage24136 +Node: Copying25219 +Node: The GNU FDL62773 +Node: Concept Index85170 +Node: Function Index86756 +Node: Variable Index90111 +Node: Keybinding Index90492  End Tag Table -- cgit v1.2.3 From 133559f869ac7faea68a2d48273b0347a3b316a2 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 10 Aug 2020 17:28:20 -0400 Subject: * dir: fix info listing issues take 2 --- dir | 3 ++- doc/rt-liberation.texinfo | 2 +- rt-liberation.info | 46 +++++++++++++++++++++++----------------------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/dir b/dir index cdd36a0..f15bdba 100644 --- a/dir +++ b/dir @@ -15,4 +15,5 @@ File: dir, Node: Top This is the top of the INFO tree * Menu: Emacs -* rt-liberation: (rt-liber). rt-liberation +* rt-liberation: (rt-liberation). + Emacs Interface to RT diff --git a/doc/rt-liberation.texinfo b/doc/rt-liberation.texinfo index 6840a39..9ffa110 100644 --- a/doc/rt-liberation.texinfo +++ b/doc/rt-liberation.texinfo @@ -9,7 +9,7 @@ @dircategory Emacs @direntry -* rt-liberation: (rt-liberation). Emacs Interface to Request Tracker +* rt-liberation: (rt-liberation). Emacs Interface to RT @end direntry diff --git a/rt-liberation.info b/rt-liberation.info index 29153a6..0f3b847 100644 --- a/rt-liberation.info +++ b/rt-liberation.info @@ -12,7 +12,7 @@ Foundation, Inc. section entitled "GNU Free Documentation License". INFO-DIR-SECTION Emacs START-INFO-DIR-ENTRY -* rt-liberation: (rt-liberation). Emacs Interface to Request Tracker +* rt-liberation: (rt-liberation). Emacs Interface to RT END-INFO-DIR-ENTRY  @@ -2016,27 +2016,27 @@ Keybinding Index  Tag Table: -Node: Top715 -Node: Introduction2996 -Node: Installation3608 -Node: Queries4592 -Node: Query Compiler5159 -Node: Query Language5805 -Node: Ticket Browser8249 -Node: Ticket Browser Display10726 -Node: Ticket Browser Sorting12722 -Node: Ticket Browser Filtering14677 -Node: Multiple Ticket Browsers16225 -Node: Ticket Viewer17399 -Node: Gnus Integration19576 -Node: Tracking Updates21869 -Node: Batch Operations22951 -Node: Local Storage24136 -Node: Copying25219 -Node: The GNU FDL62773 -Node: Concept Index85170 -Node: Function Index86756 -Node: Variable Index90111 -Node: Keybinding Index90492 +Node: Top698 +Node: Introduction2979 +Node: Installation3591 +Node: Queries4575 +Node: Query Compiler5142 +Node: Query Language5788 +Node: Ticket Browser8232 +Node: Ticket Browser Display10709 +Node: Ticket Browser Sorting12705 +Node: Ticket Browser Filtering14660 +Node: Multiple Ticket Browsers16208 +Node: Ticket Viewer17382 +Node: Gnus Integration19559 +Node: Tracking Updates21852 +Node: Batch Operations22934 +Node: Local Storage24119 +Node: Copying25202 +Node: The GNU FDL62756 +Node: Concept Index85153 +Node: Function Index86739 +Node: Variable Index90094 +Node: Keybinding Index90475  End Tag Table -- cgit v1.2.3 From 9902111423f393c4c0079feb4f51dfe425173b00 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Tue, 11 Aug 2020 08:52:29 -0400 Subject: * dir: shorten the name of the info file --- dir | 3 +- doc/Makefile | 2 +- doc/rt-liber.texinfo | 927 ++++++++++++++++++++ doc/rt-liberation.texinfo | 927 -------------------- rt-liber.info | 2042 +++++++++++++++++++++++++++++++++++++++++++++ rt-liberation.el | 2 +- rt-liberation.info | 2042 --------------------------------------------- 7 files changed, 2972 insertions(+), 2973 deletions(-) create mode 100644 doc/rt-liber.texinfo delete mode 100644 doc/rt-liberation.texinfo create mode 100644 rt-liber.info delete mode 100644 rt-liberation.info diff --git a/dir b/dir index f15bdba..184c057 100644 --- a/dir +++ b/dir @@ -15,5 +15,4 @@ File: dir, Node: Top This is the top of the INFO tree * Menu: Emacs -* rt-liberation: (rt-liberation). - Emacs Interface to RT +* rt-liberation: (rt-liber). Emacs Interface to RT diff --git a/doc/Makefile b/doc/Makefile index dd20ede..a9d6a96 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,7 +1,7 @@ # Don't delete if make is interrupted .PRECIOUS: %.info %.html -all: rt-liberation.info +all: rt-liber.info %.info: %.texinfo makeinfo --no-split $< diff --git a/doc/rt-liber.texinfo b/doc/rt-liber.texinfo new file mode 100644 index 0000000..b8cb1f5 --- /dev/null +++ b/doc/rt-liber.texinfo @@ -0,0 +1,927 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename rt-liber.info +@settitle The rt-liberation Manual +@c %**end of header + +@c History: This manual was started on the 6th of April 2009. Yoni +@c Rabkin (yrk@gnu.org) is the primary author. + +@dircategory Emacs +@direntry +* rt-liberation: (rt-liber). Emacs Interface to RT +@end direntry + + +@copying + @copyright{} 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A +copy of the license is included in the section entitled ``GNU Free +Documentation License''. +@end quotation +@end copying + + +@c For printed material +@titlepage +@title The rt-liberation Manual +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage +@contents +@c END For printed material + + +@ifnottex +@node Top, Introduction, (dir), (dir) +@top The rt-liberation Manual + +This is the Manual for the rt-liberation system + +@insertcopying + +@menu +* Introduction:: Introduction to rt-liberation. +* Installation:: Setup rt-liberation to work on the system. + +Using rt-liberation +* Queries:: Retrieve particular tickets from the server. +* Ticket Browser:: Browse the query results. +* Ticket Viewer:: Interface to query results. + +Extensions +* Gnus Integration:: Sending email to the RT server via Gnus. +* Tracking Updates:: Keeping up to date with ticket changes. +* Batch Operations:: Performing operations on batches of tickets. +* Local Storage:: Associate arbitrary data with tickets. + +Copying and license +* Copying:: The GNU General Public License gives you + permission to redistribute rt-liberation + on certain terms; it also explains that + there is no warranty. + +* The GNU FDL:: The license for this documentation. + +Indices +* Concept Index:: +* Function Index:: +* Variable Index:: +* Keybinding Index:: + +@detailmenu + --- The Detailed Node Listing --- + +Queries + +* Query Compiler:: Compiling Emacs Lisp to TicketSQL. +* Query Language:: A description of the Sexp-based language. + +Ticket Browser + +* Ticket Browser Display:: How tickets are displayed in the browser. +* Ticket Browser Sorting:: How tickets are sorted in the browser. +* Ticket Browser Filtering:: How to filter tickets out of the browser. +* Multiple Ticket Browsers:: More than one ticket browser buffer. + +@end detailmenu +@end menu + +@end ifnottex + + +@c -------------------------------------------------- +@node Introduction +@chapter Introduction +@cindex introduction + +rt-liberation is a GNU/Emacs package for working with the Request +Tracker (henceforth abbreviated as just ``RT'') software from Best +Practical Solutions. RT has an interactive Web interface, a command +line interface (the ``RT CLI''), and a REST interface. rt-liberation +uses the RT REST interface to communicate with the RT server. + +rt-liberation allows sending search queries to the RT server, browsing +the resulting tickets, viewing the tickets' contents and performing +operations on the tickets. + + +@c -------------------------------------------------- +@node Installation +@chapter Installation +@cindex installation + +rt-liberation is available via GNU ELPA. + +If you install rt-liberation manually instead you'll need to tell +Emacs where to find it, and tell Emacs to load the package: + +@lisp +(add-to-list 'load-path "/PATH/TO/rt-liberation/") +@end lisp + +@lisp +(require 'rt-liberation) +@end lisp + + +rt-liberation needs to be configured in your ~/.emacs, an ~/.rt-liber +file, or similar. + +Tell rt-liberation where to find the RT server's REST interface: + +@lisp +(setq rt-liber-rest-url "rt.example.org") +@end lisp + +rt-liberation can issue a command to ``take'' a ticket (that is, +assign it to yourself). For this the variable @var{rt-liber-username} +must be set: + +@lisp +(setq rt-liber-username "someuser") +@end lisp + +rt-liberation can also launch a Web browser to visit a ticket. For +that to work the base URL needs to be set in +@var{rt-liber-base-url}. For example: + +(setq rt-liber-base-url "https://rt.foo.org/") + + +@c -------------------------------------------------- +@node Queries +@chapter Queries +@cindex queries + +A typical RT server is meant to manage a large amount of tickets. Much +more that would be convenient to view all at once. Instead queries are +used to view only a subset of the tickets on the server. + +rt-liberation has its own Sexp-based query language which maps to RT's +TicketSQL language. + +@menu +* Query Compiler:: Compiling Emacs Lisp to TicketSQL. +* Query Language:: A description of the Sexp-based language. +@end menu + + +@c -------------------------------------------------- +@node Query Compiler +@section Query Compiler +@cindex query compiler + +In order to browse and view tickets a list of needs to be requested +from the RT server. Typically the tickets answer some kind of +criteria, for example ``tickets no older than a week owned by me which +have \``foobar\'' in their subject line''. In RT these criteria are +formulated with ``TicketSQL'' queries; a structured query language +specific to RT. + +rt-liberation provides a query compiler function to compile Emacs Lisp +symbolic expressions into TicketSQL. The query compiler supports a +number of TicketSQL tokens. + + +@c -------------------------------------------------- +@node Query Language +@section Query Language +@cindex query language + +rt-liberation's Sexp-based query language covers a portion of the +TicketSQL language. Here are some of the supported TicketSQL tokens: +Boolean tokens as a means of combining query subsections: ``and'', ``or'', +``not''. LIKE attribute tokens: ``subject'', ``content''. + +For example here is a query with both Boolean and LIKE tokens: + +@lisp +(rt-liber-compile-query + (and (queue "bugs") + (content "gnu"))) + +==> "Queue = 'bugs' AND Content LIKE 'gnu'" +@end lisp + +We can also express negation (note that the compiler produces "!=" and +"NOT LIKE" for negation depending on the context): + +@lisp +(rt-liber-compile-query + (and (queue "bugs") + (not (owner "Nobody")) + (not (content "sprigz")) + (status "new"))) + +==> "Queue = 'licensing' AND Owner != 'Nobody' \ + AND Content NOT LIKE 'sprigz' AND Status = 'new'" +@end lisp + +Attribute tokens which match an attribute to a specific field such as: +``owner'', ``status'' and ``queue''. Temporal tokens which limit the search +results to tickets within a certain time interval: ``created'' and +``lastupdated''. Note that temporal keywords such as ``created'' always +accept two arguments: BEFORE and AFTER. When either BEFORE or AFTER +aren't needed, use NIL instead. + +One of the advantages of being able to express the TicketSQL queries +as Emacs Lisp is to be able to express queries using Emacs Lisp +functions. + +Here is a slightly more involved example to illustrate: + +@lisp +(rt-liber-compile-query + (and (queue "bugs") + (owner "me@@myaddress.com") + (status "open") + (lastupdated nil + (format-time-string + "%Y-%m-%d" + (seconds-to-time + (- (time-to-seconds (current-time)) + (* 60 60 24 7))))))) + +==> "Queue = 'bugs' AND Owner = 'me@@myaddress.com' AND Status = 'open' AND LastUpdated > '2009-03-30'" +@end lisp + + +Here is an example of how the ticket browser and compiler can be used +in function calls: + +@lisp +(defun rt-liber-display-ticket (ticket-id) + "Display ticket with TICKET-ID in the ticket-browser." + (interactive "MTicket ID: ") + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "complaints") + (id ticket-id))))) +@end lisp + + +@c -------------------------------------------------- +@node Ticket Browser +@chapter Ticket Browser +@cindex ticket browser + +The ticket browser is a special buffer which provides a convenient +interface to the results of a server query. The ticket browser can be +started by invoking: (rt-liber-browse-query QUERY), where QUERY is a +TicketSQL query. The TicketSQL query can be entered manually as a +string or as the return value of the query compiler. + +@deffn Function rt-liber-browse-query QUERY &optional NEW +Runs QUERY against the server and launches the browser. + +If NEW is non-nil then the query results will be displayed in a new +buffer, otherwise the query results will override the contents of the +existing ticket browser buffer. If NEW is a string then that will be +the name of the new buffer. +@end deffn + +The TicketSQL query can be the return value of the query compiler. For +example: + +@lisp +(rt-liber-browse-query + (rt-liber-compile-query + (and (queue "bugs") + (content "gnu"))) +@end lisp + + +Since the return value of the query compiler is just a TicketSQL +string, the following is equivalent: + +@lisp +(rt-liber-browse-query "Queue = 'bugs' AND Content LIKE 'gnu'") +@end lisp + +The ticket browser defines a number of commands: + +@table @kbd +@item q +@kindex q (ticket browser) +@findex rt-liber-browser-mode-quit +Bury the ticket browser buffer. + +@item n +@kindex n (ticket browser) +@findex rt-liber-next-ticket-in-browser +Move point to the next ticket. + +@item p +@kindex p (ticket browser) +@findex rt-liber-previous-ticket-in-browser +Move point to the previous ticket. + +@item RET +@kindex RET (ticket browser) +@findex rt-liber-display-ticket-at-point +Visit the ticket at point in the @xref{Ticket Viewer}. + +@item g +@kindex g (ticket browser) +@findex revert-buffer +Refresh the contents of the browser buffer. + +@item G +@kindex G (ticket browser) +@findex rt-liber-browser-refresh-and-return +Refresh the contents of the browser buffer. Return point to the +current ticket after the refresh (if possible). + +@item s +@kindex s (ticket browser) +@findex rt-liber-browser-mark-as-spam +Mark the ticket as spam. + +@item S +@kindex S (ticket browser) +@findex rt-liber-multi-delete-spam +Delete marked tickets as spam (requires rt-liberation-multi package). + +@item a +@kindex a (ticket browser) +@findex rt-liber-browser-assign +Assign the ticket to a user. + +@item r +@kindex r (ticket browser) +@findex rt-liber-browser-resolve +Mark the ticket as ``resolved''. + +@item o +@kindex o (ticket browser) +@findex rt-liber-browser-open +Mark the ticket as ``open''. + +@item t +@kindex t (ticket browser) +@findex rt-liber-browser-take-ticket-at-point +Assign the ticket at point to @var{rt-liber-username}. + +@item SPC +@kindex SPC (ticket browser) +@findex scroll-up +Scroll the text of the ticket browser upward. + +@item DEL +@kindex DEL (ticket browser) +@findex scroll-down +Scroll the text of the ticket browser downward. + +@item m +@kindex m (ticket browser) +@findex rt-liber-browser-move +Move the ticket to a different queue. + +@item P +@kindex P (ticket browser) +@findex rt-liber-browser-prioritize +Set the numerical priority level of the ticket at point. + +@end table + +@menu +* Ticket Browser Display:: How tickets are displayed in the browser. +* Ticket Browser Sorting:: How tickets are sorted in the browser. +* Ticket Browser Filtering:: How to filter tickets out of the browser. +* Multiple Ticket Browsers:: More than one ticket browser buffer. +@end menu + + +@c -------------------------------------------------- +@node Ticket Browser Display +@section Ticket Browser Display +@cindex ticket browser display function + +The ticket browser displays the tickets in the browser by calling +@dfn{rt-liber-ticketlist-browser-redraw-f} which can be changed and +customized. Any implementation of +@dfn{rt-liber-ticketlist-browser-redraw-f} must leave point at the end +of the ticket text. + +The ticket data itself can be displayed using rt-liberation ticket +format string %-sequences: + +@table @asis +@item %i +ID number of the ticket in the RT database. +@item %s +Subject line. +@item %c +Ticket creation time. The format to display the time is specified in +the variable @var{rt-liber-browser-time-format-string}. +@item %S +Ticket status (``open'', ``new'' etc.) +@item %r +Whether the ticket is resolved. +@item %R +Requestor/s +@item %C +Creator of the ticket. +@item %o +Owner of the ticket. +@item %q +The queue originating the ticket. +@item %p +The numerical priority of the ticket +@end table + +Here is an example implementation of +@dfn{rt-liber-ticketlist-browser-redraw-f} showing the use of the +%-sequences. Note the use of text properties to add color to ticket +text. The use of text properties as opposed to font-locking is meant +to ease customization because otherwise any change in ticket display +would break the font-locking regular expressions. + +@lisp +(defun rt-liber-ticketlist-browser-redraw-f (ticket) + "Display TICKET." + (insert (rt-liber-format "[%c] %i" ticket)) + (add-text-properties (point-at-bol) + (point-at-eol) + '(face rt-liber-ticket-face)) + (newline) + (insert (rt-liber-format " [%S] %s" ticket)) + (newline) + (insert (rt-liber-format " %o <== %R" ticket))) +@end lisp + +The function @dfn{rt-liber-high-priority-p} can be used to apply a +different face or text to a ticket if it is high priority. A ticket is +considered high priority if its value is strictly higher than +@var{rt-liber-browser-priority-cutoff} + + +@c -------------------------------------------------- +@node Ticket Browser Sorting +@section Ticket Browser Sorting +@cindex ticket browser sorting + +The tickets in the browser are displayed by default in reverse +chronological order. Ticket sorting is done by a call to +@dfn{rt-liber-browser-default-sorting-function}. + +Other sorting orders can be used by binding +@dfn{rt-liber-browser-default-sorting-function} to a different +function. To ease writing such functions rt-liberation provides two +predicate functions to perform comparisons between ticket objects: + +@defun rt-liber-lex-lessthan-p a b field +Return true if A is lexicographically less than B in FIELD. + +Here is an example of sorting tickets lexicographically by owner name +using @dfn{rt-liber-lex-lessthan-p} (note that you can feed +@dfn{rt-liber-lex-lessthan-p} a date/time string and it will sort it +just fine except that it wouldn't make any sense): + +@lisp +(defun rt-liber-sort-by-owner (ticket-list) + "Sort TICKET-LIST lexicographically by owner." + (rt-liber-sort-ticket-list + ticket-list + #'(lambda (a b) + (rt-liber-lex-lessthan-p a b "Owner")))) +@end lisp + +@end defun + +@defun rt-liber-time-lessthan-p a b field +Return t if A is chronologically less than B in FIELD. + +Here is an example of sorting tickets lexicographically by owner name +using @dfn{rt-liber-time-lessthan-p} (note that feeding +@dfn{rt-liber-time-lessthan-p} anything but a date/time string, in +this case ``Created'' contains a date, will result in an error being +signaled). + +@lisp +(defun rt-liber-sort-by-time-created (ticket-list) + "Sort TICKET-LIST in reverse chronological order." + (reverse + (rt-liber-sort-ticket-list + ticket-list + #'(lambda (a b) + (rt-liber-time-lessthan-p a b "Created"))))) +@end lisp + +@end defun + + +@c ------------------------------------------------------------------- +@node Ticket Browser Filtering +@section Ticket Browser Filtering +@cindex ticket browser filtering filter + +The Ticket Browser can also filter out (that is, not display) certain +tickets based on particular criteria. This probably shouldn't be used +instead of a properly formed RT query, but when used in conjunction +with correctly formulated queries it becomes a powerful tool. + +During ticket display processing the Ticket Browser will call the +function pointed to by @var{rt-liber-browser-default-filter-function} +on each ticket, passing the function the ticket alist as a single +argument. The function is set by default to +@dfn{rt-liber-default-filter-f}, which is a function which will +display all tickets and filter none. + +If any tickets are filtered, the Ticket Browser will display the +filtered ticket count at the bottom ticket listing. + +Here is a simple example of how to filter out all of the tickets which +have a status of ``deleted''. + +First we define a custom filter function. Note how it accepts a single +argument, which is the ticket alist, and returns nil if the ticket is +to be filtered. + +@lisp +(defun rt-liber-browser-deleted-filter (ticket) + (not + (and ticket + (string= (cdr (assoc "Status" ticket)) + "deleted")))) +@end lisp + +Then we assign that function to be our default filtering function: + +@lisp +(setq rt-liber-browser-default-filter-function + 'rt-liber-browser-deleted-filter) +@end lisp + + +@c ------------------------------------------------------------------- +@node Multiple Ticket Browsers +@section Multiple Ticket Browsers +@cindex ticket browser multiple buffer + +It is sometimes useful to rename the ticket browser buffer to +something more informative than the default +@var{rt-liber-browser-buffer-name}, especially if there are multiple +ticket browsers. + +Changing a ticket browser's name can be done normally with +`rename-buffer', but it is also possible to name the ticket browser +when it is created. In the following example two ticket browser +buffers will be created displaying the query results and named +``*updated by supervisor*'' and ``*new tickets*'' respectively: + +@lisp +(defun rt-liber-daily-rounds () + (interactive) + + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "complaints") + (owner "lem.e.tweakit") + (status "open") + (lastupdatedby "molly.manager"))) + "*updated by supervisor*") + + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "complaints") + (owner "Nobody") + (status "new"))) + "*new tickets*")) +@end lisp + + +@c -------------------------------------------------- +@node Ticket Viewer +@chapter Ticket Viewer +@cindex ticket viewer + +The ticket viewer is an interface for viewing the contents of a +ticket. It provides font-locking to make reading the contents easier +via @var{rt-liber-viewer-font-lock-keywords} and a number of +key-bindings. + +The ticket viewer provides key-bindings to help compose emails to send +to the RT email interface. The key-bindings for composing email +described below are generic, what actually happens when you invoke +them depends on the email-backend system you have installed into +rt-liberation. @file{rt-liberation-gnus.el} provides integration with +Gnus, @xref{Gnus Integration}. + +Setting @var{rt-liber-jump-to-latest} to `t' will cause the viewer to +automatically scroll to the latest comment in a ticket when that +ticket is visited. By default @var{rt-liber-jump-to-latest} is set to +`nil'. + +When in the ticket viewer buffer, invoking +@dfn{rt-liber-viewer-take-ticket} will ``take'' the ticket. + +@table @kbd + +@item q +@kindex q (ticket viewer) +@findex rt-liber-viewer-mode-quit +Bury the ticket viewer buffer. + +@item n +@kindex n (ticket viewer) +@findex rt-liber-next-section-in-viewer +Move point to the next section in ticket. + +@item N +@kindex N (ticket viewer) +@findex rt-liber-jump-to-latest-correspondence +Move point to the newest correspondence section, if any. + +@item p +@kindex p (ticket viewer) +@findex rt-liber-previous-section-in-viewer +Move point to the previous section in ticket. + +@item V +@kindex V (ticket viewer) +@findex rt-liber-viewer-visit-in-browser +Visit the current ticket in a Web browser. + +@item m +@kindex m (ticket viewer) +@findex rt-liber-viewer-answer +Compose an answer to the current ticket. + +@item M +@kindex M (ticket viewer) +@findex rt-liber-viewer-answer-this +Compose an answer to the current ticket. The content section around +point will be inserted into the email body and commented out. + +@item t +@kindex t (ticket viewer) +@findex rt-liber-viewer-answer-provisionally +Compose a provisional answer to the current ticket. + +@item T +@kindex t (ticket viewer) +@findex rt-liber-viewer-answer-provisionally-this +Compose a provisional answer to the current ticket. The content +section around point will be inserted into the email body and +commented out. + +@item F +@kindex F (ticket viewer) +@findex rt-liber-viewer-answer-verbatim-this +Compose an answer to the current ticket. The content section around +point will be inserted into the email body verbatim. + +@item c +@kindex c (ticket viewer) +@findex rt-liber-viewer-comment +Compose a comment for the current ticket. + +@item C +@kindex C (ticket viewer) +@findex rt-liber-viewer-comment-this +Comment on the ticket using the current context + +@item g +@kindex g (ticket viewer) +@findex revert-buffer +Refresh and redisplay the current ticket. + +@item SPC +@kindex SPC (ticket viewer) +@findex scroll-up +Scroll text of ticket viewer upward. + +@item DEL +@kindex DEL (ticket viewer) +@findex scroll-down +Scroll text of ticket viewer downward. + +@item h +@kindex h (ticket viewer) +@findex rt-liber-viewer-show-ticket-browser +Display the associated ticket in the ticket browser. + +@end table + + +@c -------------------------------------------------- +@node Gnus Integration +@chapter Gnus Integration +@cindex Gnus Integration + +The file @file{rt-liberation-gnus.el} implements integration with Gnus +for composing emails. To enable the feature, `require' it after +loading rt-liberation: + +@lisp +(require 'rt-liberation-gnus) +@end lisp + +In order for rt-liberation-gnus to be useful a few variables need to +be specialized. The following is example code which sets these +variables. Below is a thorough description of those variables. + +@lisp +(setq rt-liber-gnus-comment-address "our-rtserver-comment@@ourserver.org" + rt-liber-gnus-address "our-rtserver@@ourserver.org" + rt-liber-gnus-subject-name "ourserver.org") +@end lisp + +@defopt rt-liber-gnus-address +@var{rt-liber-gnus-address} is the email address which is configured +in the RT server email interface for sending a response to the +ticket's requestor. +@end defopt +@defopt rt-liber-gnus-comment-address +@var{rt-liber-gnus-comment-address} is the email address which is +configured in the RT server email interface for adding a comment under +the ticket in question. +@end defopt +@defopt rt-liber-gnus-subject-name +@var{rt-liber-gnus-subject-name} is a string, typically included at +the beginning of the square brackets in the subject. The string is a +part of the subject line which helps the RT server recognize the +email. +@end defopt + +Gnus posting styles controlled by @var{gnus-posting-styles} can be +customized for rt-liberation-gnus by using the variable +@var{rt-liber-gnus-p}, which is only non-nil when rt-liberation-gnus +launches a Gnus message buffer. + +Here is example code which uses @var{rt-liber-gnus-p} to override the +signature in the default posting style with one special to +rt-liberation. Headers can be added and removed in a similar manner. + +@lisp +(setq gnus-posting-styles + '((".*" + (name "Lemm E. Hackitt") + (address "Lemm@@hack.it") + (signature-file "~/sig.txt") + ("X-Ethics" "Use GNU")) + (rt-liber-gnus-p + (signature-file "~/rt-liber-sig.txt")))) +@end lisp + + +Once rt-liberation-gnus is loaded and customized the key-bindings in +the Viewer will be able to call into it, @xref{Ticket Viewer}. + + +@c -------------------------------------------------- +@node Tracking Updates +@chapter Tracking Updates +@cindex Tracking Updates + +The functions in @file{rt-liberation-update.el} help keep up with +updates to the ticket database. To enable the feature, `require' it +after loading rt-liberation: + +@lisp +(require 'rt-liberation-update) +@end lisp + +Then set @var{rt-liber-update-default-queue} to be the name of the +queue to watch for updates. For example: + +@lisp +(setq rt-liber-update-default-queue "complaints") +@end lisp + +@defun rt-liber-update &optional no-update +@code{rt-liber-update} is an interactive function which runs a query +against the RT server asking for the tickets which have been updated +since the time @code{rt-liber-update} was last run (each time it runs, +it leaves a time-stamp). If no time-stamp is found, for instance when +you run @code{rt-liber-update} for the first time, today's date is +used. + +With the NO-UPDATE prefix, @code{rt-liber-update} will not update the +time-stamp so that the next invocation will produce the same result. +@end defun + + +@c -------------------------------------------------- +@node Batch Operations +@chapter Batch Operations +@cindex Batch Operations + +The extension @file{rt-liberation-multi.el} implements performing +batch operations on groups of tickets. It works in two stages: First +mark an arbitrary number of tickets within the same buffer then call a +batch operation function on them. The batch operation functions work +the same way as function which work on single tickets only that they +iterate through all of the marked tickets. + +To enable batch operations first load @file{rt-liberation-multi.el}: + +@lisp +(require 'rt-liberation-storage) +@end lisp + +@table @kbd +@item M +@kindex M (ticket browser) +@findex rt-liber-mark-ticket-at-point +Mark the ticket at point for future action. If the ticket at point is +already marked then unmark it. +@end table + +@defun rt-liber-multi-set-status-open +Set the status of all the marked tickets to ``open''. +@end defun + +@defun rt-liber-multi-set-status-resolved +Set the status of all the marked tickets to ``resolved. +@end defun + +@defun rt-liber-multi-assign name +Assign all of the marked tickets to NAME. +@end defun + +@defun rt-liber-multi-flag-as-spam-and-delete +Set the status of all the marked tickets to ``is-spam'' and delete. +@end defun + + +@c -------------------------------------------------- +@node Local Storage +@chapter Local Storage +@cindex Local Storage + +@file{rt-liberation-storage.el} implements associating arbitrary +ancillary data with tickets. The data is stored locally and is not +sent to the RT server. + +To enable local storage first load @file{rt-liberation-storage.el}: + +@lisp +(require 'rt-liberation-storage) +@end lisp + +Then enable the display of ancillary data with: + +@lisp +(setq rt-liber-anc-p t) +@end lisp + +The associated data is edited and displayed in the ticket browser with +the following command key: + +@table @kbd +@item A +@kindex A (ticket browser) +@findex rt-liber-browser-ancillary-text +Associate text with the ticket at point. You will be prompted to enter +a string of text. +@end table + +Once text is associated with a ticket it will be displayed alongside +that ticket in the ticket browser. This particular feature lends +itself to creating private annotations about tickets. + +The implementation distributed with rt-liberation allows associating +text with tickets but is not limited to text. The same implementation +can be extended to associate any arbitrary data with any ticket. + + +@c -------------------------------------------------- +@c including the relevant licenses +@include gpl.texi +@include fdl.texi + + +@c -------------------------------------------------- +@node Concept Index +@unnumbered Concept Index +@printindex cp + + +@c -------------------------------------------------- +@node Function Index +@unnumbered Function Index +@printindex fn + + +@c -------------------------------------------------- +@node Variable Index +@unnumbered Variable Index +@printindex vr + + +@c -------------------------------------------------- +@node Keybinding Index +@unnumbered Keybinding Index +@printindex ky + + +@bye diff --git a/doc/rt-liberation.texinfo b/doc/rt-liberation.texinfo deleted file mode 100644 index 9ffa110..0000000 --- a/doc/rt-liberation.texinfo +++ /dev/null @@ -1,927 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@c %**start of header -@setfilename rt-liberation.info -@settitle The rt-liberation Manual -@c %**end of header - -@c History: This manual was started on the 6th of April 2009. Yoni -@c Rabkin (yrk@gnu.org) is the primary author. - -@dircategory Emacs -@direntry -* rt-liberation: (rt-liberation). Emacs Interface to RT -@end direntry - - -@copying - @copyright{} 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A -copy of the license is included in the section entitled ``GNU Free -Documentation License''. -@end quotation -@end copying - - -@c For printed material -@titlepage -@title The rt-liberation Manual -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage -@contents -@c END For printed material - - -@ifnottex -@node Top, Introduction, (dir), (dir) -@top The rt-liberation Manual - -This is the Manual for the rt-liberation system - -@insertcopying - -@menu -* Introduction:: Introduction to rt-liberation. -* Installation:: Setup rt-liberation to work on the system. - -Using rt-liberation -* Queries:: Retrieve particular tickets from the server. -* Ticket Browser:: Browse the query results. -* Ticket Viewer:: Interface to query results. - -Extensions -* Gnus Integration:: Sending email to the RT server via Gnus. -* Tracking Updates:: Keeping up to date with ticket changes. -* Batch Operations:: Performing operations on batches of tickets. -* Local Storage:: Associate arbitrary data with tickets. - -Copying and license -* Copying:: The GNU General Public License gives you - permission to redistribute rt-liberation - on certain terms; it also explains that - there is no warranty. - -* The GNU FDL:: The license for this documentation. - -Indices -* Concept Index:: -* Function Index:: -* Variable Index:: -* Keybinding Index:: - -@detailmenu - --- The Detailed Node Listing --- - -Queries - -* Query Compiler:: Compiling Emacs Lisp to TicketSQL. -* Query Language:: A description of the Sexp-based language. - -Ticket Browser - -* Ticket Browser Display:: How tickets are displayed in the browser. -* Ticket Browser Sorting:: How tickets are sorted in the browser. -* Ticket Browser Filtering:: How to filter tickets out of the browser. -* Multiple Ticket Browsers:: More than one ticket browser buffer. - -@end detailmenu -@end menu - -@end ifnottex - - -@c -------------------------------------------------- -@node Introduction -@chapter Introduction -@cindex introduction - -rt-liberation is a GNU/Emacs package for working with the Request -Tracker (henceforth abbreviated as just ``RT'') software from Best -Practical Solutions. RT has an interactive Web interface, a command -line interface (the ``RT CLI''), and a REST interface. rt-liberation -uses the RT REST interface to communicate with the RT server. - -rt-liberation allows sending search queries to the RT server, browsing -the resulting tickets, viewing the tickets' contents and performing -operations on the tickets. - - -@c -------------------------------------------------- -@node Installation -@chapter Installation -@cindex installation - -rt-liberation is available via GNU ELPA. - -If you install rt-liberation manually instead you'll need to tell -Emacs where to find it, and tell Emacs to load the package: - -@lisp -(add-to-list 'load-path "/PATH/TO/rt-liberation/") -@end lisp - -@lisp -(require 'rt-liberation) -@end lisp - - -rt-liberation needs to be configured in your ~/.emacs, an ~/.rt-liber -file, or similar. - -Tell rt-liberation where to find the RT server's REST interface: - -@lisp -(setq rt-liber-rest-url "rt.example.org") -@end lisp - -rt-liberation can issue a command to ``take'' a ticket (that is, -assign it to yourself). For this the variable @var{rt-liber-username} -must be set: - -@lisp -(setq rt-liber-username "someuser") -@end lisp - -rt-liberation can also launch a Web browser to visit a ticket. For -that to work the base URL needs to be set in -@var{rt-liber-base-url}. For example: - -(setq rt-liber-base-url "https://rt.foo.org/") - - -@c -------------------------------------------------- -@node Queries -@chapter Queries -@cindex queries - -A typical RT server is meant to manage a large amount of tickets. Much -more that would be convenient to view all at once. Instead queries are -used to view only a subset of the tickets on the server. - -rt-liberation has its own Sexp-based query language which maps to RT's -TicketSQL language. - -@menu -* Query Compiler:: Compiling Emacs Lisp to TicketSQL. -* Query Language:: A description of the Sexp-based language. -@end menu - - -@c -------------------------------------------------- -@node Query Compiler -@section Query Compiler -@cindex query compiler - -In order to browse and view tickets a list of needs to be requested -from the RT server. Typically the tickets answer some kind of -criteria, for example ``tickets no older than a week owned by me which -have \``foobar\'' in their subject line''. In RT these criteria are -formulated with ``TicketSQL'' queries; a structured query language -specific to RT. - -rt-liberation provides a query compiler function to compile Emacs Lisp -symbolic expressions into TicketSQL. The query compiler supports a -number of TicketSQL tokens. - - -@c -------------------------------------------------- -@node Query Language -@section Query Language -@cindex query language - -rt-liberation's Sexp-based query language covers a portion of the -TicketSQL language. Here are some of the supported TicketSQL tokens: -Boolean tokens as a means of combining query subsections: ``and'', ``or'', -``not''. LIKE attribute tokens: ``subject'', ``content''. - -For example here is a query with both Boolean and LIKE tokens: - -@lisp -(rt-liber-compile-query - (and (queue "bugs") - (content "gnu"))) - -==> "Queue = 'bugs' AND Content LIKE 'gnu'" -@end lisp - -We can also express negation (note that the compiler produces "!=" and -"NOT LIKE" for negation depending on the context): - -@lisp -(rt-liber-compile-query - (and (queue "bugs") - (not (owner "Nobody")) - (not (content "sprigz")) - (status "new"))) - -==> "Queue = 'licensing' AND Owner != 'Nobody' \ - AND Content NOT LIKE 'sprigz' AND Status = 'new'" -@end lisp - -Attribute tokens which match an attribute to a specific field such as: -``owner'', ``status'' and ``queue''. Temporal tokens which limit the search -results to tickets within a certain time interval: ``created'' and -``lastupdated''. Note that temporal keywords such as ``created'' always -accept two arguments: BEFORE and AFTER. When either BEFORE or AFTER -aren't needed, use NIL instead. - -One of the advantages of being able to express the TicketSQL queries -as Emacs Lisp is to be able to express queries using Emacs Lisp -functions. - -Here is a slightly more involved example to illustrate: - -@lisp -(rt-liber-compile-query - (and (queue "bugs") - (owner "me@@myaddress.com") - (status "open") - (lastupdated nil - (format-time-string - "%Y-%m-%d" - (seconds-to-time - (- (time-to-seconds (current-time)) - (* 60 60 24 7))))))) - -==> "Queue = 'bugs' AND Owner = 'me@@myaddress.com' AND Status = 'open' AND LastUpdated > '2009-03-30'" -@end lisp - - -Here is an example of how the ticket browser and compiler can be used -in function calls: - -@lisp -(defun rt-liber-display-ticket (ticket-id) - "Display ticket with TICKET-ID in the ticket-browser." - (interactive "MTicket ID: ") - (rt-liber-browse-query - (rt-liber-compile-query - (and (queue "complaints") - (id ticket-id))))) -@end lisp - - -@c -------------------------------------------------- -@node Ticket Browser -@chapter Ticket Browser -@cindex ticket browser - -The ticket browser is a special buffer which provides a convenient -interface to the results of a server query. The ticket browser can be -started by invoking: (rt-liber-browse-query QUERY), where QUERY is a -TicketSQL query. The TicketSQL query can be entered manually as a -string or as the return value of the query compiler. - -@deffn Function rt-liber-browse-query QUERY &optional NEW -Runs QUERY against the server and launches the browser. - -If NEW is non-nil then the query results will be displayed in a new -buffer, otherwise the query results will override the contents of the -existing ticket browser buffer. If NEW is a string then that will be -the name of the new buffer. -@end deffn - -The TicketSQL query can be the return value of the query compiler. For -example: - -@lisp -(rt-liber-browse-query - (rt-liber-compile-query - (and (queue "bugs") - (content "gnu"))) -@end lisp - - -Since the return value of the query compiler is just a TicketSQL -string, the following is equivalent: - -@lisp -(rt-liber-browse-query "Queue = 'bugs' AND Content LIKE 'gnu'") -@end lisp - -The ticket browser defines a number of commands: - -@table @kbd -@item q -@kindex q (ticket browser) -@findex rt-liber-browser-mode-quit -Bury the ticket browser buffer. - -@item n -@kindex n (ticket browser) -@findex rt-liber-next-ticket-in-browser -Move point to the next ticket. - -@item p -@kindex p (ticket browser) -@findex rt-liber-previous-ticket-in-browser -Move point to the previous ticket. - -@item RET -@kindex RET (ticket browser) -@findex rt-liber-display-ticket-at-point -Visit the ticket at point in the @xref{Ticket Viewer}. - -@item g -@kindex g (ticket browser) -@findex revert-buffer -Refresh the contents of the browser buffer. - -@item G -@kindex G (ticket browser) -@findex rt-liber-browser-refresh-and-return -Refresh the contents of the browser buffer. Return point to the -current ticket after the refresh (if possible). - -@item s -@kindex s (ticket browser) -@findex rt-liber-browser-mark-as-spam -Mark the ticket as spam. - -@item S -@kindex S (ticket browser) -@findex rt-liber-multi-delete-spam -Delete marked tickets as spam (requires rt-liberation-multi package). - -@item a -@kindex a (ticket browser) -@findex rt-liber-browser-assign -Assign the ticket to a user. - -@item r -@kindex r (ticket browser) -@findex rt-liber-browser-resolve -Mark the ticket as ``resolved''. - -@item o -@kindex o (ticket browser) -@findex rt-liber-browser-open -Mark the ticket as ``open''. - -@item t -@kindex t (ticket browser) -@findex rt-liber-browser-take-ticket-at-point -Assign the ticket at point to @var{rt-liber-username}. - -@item SPC -@kindex SPC (ticket browser) -@findex scroll-up -Scroll the text of the ticket browser upward. - -@item DEL -@kindex DEL (ticket browser) -@findex scroll-down -Scroll the text of the ticket browser downward. - -@item m -@kindex m (ticket browser) -@findex rt-liber-browser-move -Move the ticket to a different queue. - -@item P -@kindex P (ticket browser) -@findex rt-liber-browser-prioritize -Set the numerical priority level of the ticket at point. - -@end table - -@menu -* Ticket Browser Display:: How tickets are displayed in the browser. -* Ticket Browser Sorting:: How tickets are sorted in the browser. -* Ticket Browser Filtering:: How to filter tickets out of the browser. -* Multiple Ticket Browsers:: More than one ticket browser buffer. -@end menu - - -@c -------------------------------------------------- -@node Ticket Browser Display -@section Ticket Browser Display -@cindex ticket browser display function - -The ticket browser displays the tickets in the browser by calling -@dfn{rt-liber-ticketlist-browser-redraw-f} which can be changed and -customized. Any implementation of -@dfn{rt-liber-ticketlist-browser-redraw-f} must leave point at the end -of the ticket text. - -The ticket data itself can be displayed using rt-liberation ticket -format string %-sequences: - -@table @asis -@item %i -ID number of the ticket in the RT database. -@item %s -Subject line. -@item %c -Ticket creation time. The format to display the time is specified in -the variable @var{rt-liber-browser-time-format-string}. -@item %S -Ticket status (``open'', ``new'' etc.) -@item %r -Whether the ticket is resolved. -@item %R -Requestor/s -@item %C -Creator of the ticket. -@item %o -Owner of the ticket. -@item %q -The queue originating the ticket. -@item %p -The numerical priority of the ticket -@end table - -Here is an example implementation of -@dfn{rt-liber-ticketlist-browser-redraw-f} showing the use of the -%-sequences. Note the use of text properties to add color to ticket -text. The use of text properties as opposed to font-locking is meant -to ease customization because otherwise any change in ticket display -would break the font-locking regular expressions. - -@lisp -(defun rt-liber-ticketlist-browser-redraw-f (ticket) - "Display TICKET." - (insert (rt-liber-format "[%c] %i" ticket)) - (add-text-properties (point-at-bol) - (point-at-eol) - '(face rt-liber-ticket-face)) - (newline) - (insert (rt-liber-format " [%S] %s" ticket)) - (newline) - (insert (rt-liber-format " %o <== %R" ticket))) -@end lisp - -The function @dfn{rt-liber-high-priority-p} can be used to apply a -different face or text to a ticket if it is high priority. A ticket is -considered high priority if its value is strictly higher than -@var{rt-liber-browser-priority-cutoff} - - -@c -------------------------------------------------- -@node Ticket Browser Sorting -@section Ticket Browser Sorting -@cindex ticket browser sorting - -The tickets in the browser are displayed by default in reverse -chronological order. Ticket sorting is done by a call to -@dfn{rt-liber-browser-default-sorting-function}. - -Other sorting orders can be used by binding -@dfn{rt-liber-browser-default-sorting-function} to a different -function. To ease writing such functions rt-liberation provides two -predicate functions to perform comparisons between ticket objects: - -@defun rt-liber-lex-lessthan-p a b field -Return true if A is lexicographically less than B in FIELD. - -Here is an example of sorting tickets lexicographically by owner name -using @dfn{rt-liber-lex-lessthan-p} (note that you can feed -@dfn{rt-liber-lex-lessthan-p} a date/time string and it will sort it -just fine except that it wouldn't make any sense): - -@lisp -(defun rt-liber-sort-by-owner (ticket-list) - "Sort TICKET-LIST lexicographically by owner." - (rt-liber-sort-ticket-list - ticket-list - #'(lambda (a b) - (rt-liber-lex-lessthan-p a b "Owner")))) -@end lisp - -@end defun - -@defun rt-liber-time-lessthan-p a b field -Return t if A is chronologically less than B in FIELD. - -Here is an example of sorting tickets lexicographically by owner name -using @dfn{rt-liber-time-lessthan-p} (note that feeding -@dfn{rt-liber-time-lessthan-p} anything but a date/time string, in -this case ``Created'' contains a date, will result in an error being -signaled). - -@lisp -(defun rt-liber-sort-by-time-created (ticket-list) - "Sort TICKET-LIST in reverse chronological order." - (reverse - (rt-liber-sort-ticket-list - ticket-list - #'(lambda (a b) - (rt-liber-time-lessthan-p a b "Created"))))) -@end lisp - -@end defun - - -@c ------------------------------------------------------------------- -@node Ticket Browser Filtering -@section Ticket Browser Filtering -@cindex ticket browser filtering filter - -The Ticket Browser can also filter out (that is, not display) certain -tickets based on particular criteria. This probably shouldn't be used -instead of a properly formed RT query, but when used in conjunction -with correctly formulated queries it becomes a powerful tool. - -During ticket display processing the Ticket Browser will call the -function pointed to by @var{rt-liber-browser-default-filter-function} -on each ticket, passing the function the ticket alist as a single -argument. The function is set by default to -@dfn{rt-liber-default-filter-f}, which is a function which will -display all tickets and filter none. - -If any tickets are filtered, the Ticket Browser will display the -filtered ticket count at the bottom ticket listing. - -Here is a simple example of how to filter out all of the tickets which -have a status of ``deleted''. - -First we define a custom filter function. Note how it accepts a single -argument, which is the ticket alist, and returns nil if the ticket is -to be filtered. - -@lisp -(defun rt-liber-browser-deleted-filter (ticket) - (not - (and ticket - (string= (cdr (assoc "Status" ticket)) - "deleted")))) -@end lisp - -Then we assign that function to be our default filtering function: - -@lisp -(setq rt-liber-browser-default-filter-function - 'rt-liber-browser-deleted-filter) -@end lisp - - -@c ------------------------------------------------------------------- -@node Multiple Ticket Browsers -@section Multiple Ticket Browsers -@cindex ticket browser multiple buffer - -It is sometimes useful to rename the ticket browser buffer to -something more informative than the default -@var{rt-liber-browser-buffer-name}, especially if there are multiple -ticket browsers. - -Changing a ticket browser's name can be done normally with -`rename-buffer', but it is also possible to name the ticket browser -when it is created. In the following example two ticket browser -buffers will be created displaying the query results and named -``*updated by supervisor*'' and ``*new tickets*'' respectively: - -@lisp -(defun rt-liber-daily-rounds () - (interactive) - - (rt-liber-browse-query - (rt-liber-compile-query - (and (queue "complaints") - (owner "lem.e.tweakit") - (status "open") - (lastupdatedby "molly.manager"))) - "*updated by supervisor*") - - (rt-liber-browse-query - (rt-liber-compile-query - (and (queue "complaints") - (owner "Nobody") - (status "new"))) - "*new tickets*")) -@end lisp - - -@c -------------------------------------------------- -@node Ticket Viewer -@chapter Ticket Viewer -@cindex ticket viewer - -The ticket viewer is an interface for viewing the contents of a -ticket. It provides font-locking to make reading the contents easier -via @var{rt-liber-viewer-font-lock-keywords} and a number of -key-bindings. - -The ticket viewer provides key-bindings to help compose emails to send -to the RT email interface. The key-bindings for composing email -described below are generic, what actually happens when you invoke -them depends on the email-backend system you have installed into -rt-liberation. @file{rt-liberation-gnus.el} provides integration with -Gnus, @xref{Gnus Integration}. - -Setting @var{rt-liber-jump-to-latest} to `t' will cause the viewer to -automatically scroll to the latest comment in a ticket when that -ticket is visited. By default @var{rt-liber-jump-to-latest} is set to -`nil'. - -When in the ticket viewer buffer, invoking -@dfn{rt-liber-viewer-take-ticket} will ``take'' the ticket. - -@table @kbd - -@item q -@kindex q (ticket viewer) -@findex rt-liber-viewer-mode-quit -Bury the ticket viewer buffer. - -@item n -@kindex n (ticket viewer) -@findex rt-liber-next-section-in-viewer -Move point to the next section in ticket. - -@item N -@kindex N (ticket viewer) -@findex rt-liber-jump-to-latest-correspondence -Move point to the newest correspondence section, if any. - -@item p -@kindex p (ticket viewer) -@findex rt-liber-previous-section-in-viewer -Move point to the previous section in ticket. - -@item V -@kindex V (ticket viewer) -@findex rt-liber-viewer-visit-in-browser -Visit the current ticket in a Web browser. - -@item m -@kindex m (ticket viewer) -@findex rt-liber-viewer-answer -Compose an answer to the current ticket. - -@item M -@kindex M (ticket viewer) -@findex rt-liber-viewer-answer-this -Compose an answer to the current ticket. The content section around -point will be inserted into the email body and commented out. - -@item t -@kindex t (ticket viewer) -@findex rt-liber-viewer-answer-provisionally -Compose a provisional answer to the current ticket. - -@item T -@kindex t (ticket viewer) -@findex rt-liber-viewer-answer-provisionally-this -Compose a provisional answer to the current ticket. The content -section around point will be inserted into the email body and -commented out. - -@item F -@kindex F (ticket viewer) -@findex rt-liber-viewer-answer-verbatim-this -Compose an answer to the current ticket. The content section around -point will be inserted into the email body verbatim. - -@item c -@kindex c (ticket viewer) -@findex rt-liber-viewer-comment -Compose a comment for the current ticket. - -@item C -@kindex C (ticket viewer) -@findex rt-liber-viewer-comment-this -Comment on the ticket using the current context - -@item g -@kindex g (ticket viewer) -@findex revert-buffer -Refresh and redisplay the current ticket. - -@item SPC -@kindex SPC (ticket viewer) -@findex scroll-up -Scroll text of ticket viewer upward. - -@item DEL -@kindex DEL (ticket viewer) -@findex scroll-down -Scroll text of ticket viewer downward. - -@item h -@kindex h (ticket viewer) -@findex rt-liber-viewer-show-ticket-browser -Display the associated ticket in the ticket browser. - -@end table - - -@c -------------------------------------------------- -@node Gnus Integration -@chapter Gnus Integration -@cindex Gnus Integration - -The file @file{rt-liberation-gnus.el} implements integration with Gnus -for composing emails. To enable the feature, `require' it after -loading rt-liberation: - -@lisp -(require 'rt-liberation-gnus) -@end lisp - -In order for rt-liberation-gnus to be useful a few variables need to -be specialized. The following is example code which sets these -variables. Below is a thorough description of those variables. - -@lisp -(setq rt-liber-gnus-comment-address "our-rtserver-comment@@ourserver.org" - rt-liber-gnus-address "our-rtserver@@ourserver.org" - rt-liber-gnus-subject-name "ourserver.org") -@end lisp - -@defopt rt-liber-gnus-address -@var{rt-liber-gnus-address} is the email address which is configured -in the RT server email interface for sending a response to the -ticket's requestor. -@end defopt -@defopt rt-liber-gnus-comment-address -@var{rt-liber-gnus-comment-address} is the email address which is -configured in the RT server email interface for adding a comment under -the ticket in question. -@end defopt -@defopt rt-liber-gnus-subject-name -@var{rt-liber-gnus-subject-name} is a string, typically included at -the beginning of the square brackets in the subject. The string is a -part of the subject line which helps the RT server recognize the -email. -@end defopt - -Gnus posting styles controlled by @var{gnus-posting-styles} can be -customized for rt-liberation-gnus by using the variable -@var{rt-liber-gnus-p}, which is only non-nil when rt-liberation-gnus -launches a Gnus message buffer. - -Here is example code which uses @var{rt-liber-gnus-p} to override the -signature in the default posting style with one special to -rt-liberation. Headers can be added and removed in a similar manner. - -@lisp -(setq gnus-posting-styles - '((".*" - (name "Lemm E. Hackitt") - (address "Lemm@@hack.it") - (signature-file "~/sig.txt") - ("X-Ethics" "Use GNU")) - (rt-liber-gnus-p - (signature-file "~/rt-liber-sig.txt")))) -@end lisp - - -Once rt-liberation-gnus is loaded and customized the key-bindings in -the Viewer will be able to call into it, @xref{Ticket Viewer}. - - -@c -------------------------------------------------- -@node Tracking Updates -@chapter Tracking Updates -@cindex Tracking Updates - -The functions in @file{rt-liberation-update.el} help keep up with -updates to the ticket database. To enable the feature, `require' it -after loading rt-liberation: - -@lisp -(require 'rt-liberation-update) -@end lisp - -Then set @var{rt-liber-update-default-queue} to be the name of the -queue to watch for updates. For example: - -@lisp -(setq rt-liber-update-default-queue "complaints") -@end lisp - -@defun rt-liber-update &optional no-update -@code{rt-liber-update} is an interactive function which runs a query -against the RT server asking for the tickets which have been updated -since the time @code{rt-liber-update} was last run (each time it runs, -it leaves a time-stamp). If no time-stamp is found, for instance when -you run @code{rt-liber-update} for the first time, today's date is -used. - -With the NO-UPDATE prefix, @code{rt-liber-update} will not update the -time-stamp so that the next invocation will produce the same result. -@end defun - - -@c -------------------------------------------------- -@node Batch Operations -@chapter Batch Operations -@cindex Batch Operations - -The extension @file{rt-liberation-multi.el} implements performing -batch operations on groups of tickets. It works in two stages: First -mark an arbitrary number of tickets within the same buffer then call a -batch operation function on them. The batch operation functions work -the same way as function which work on single tickets only that they -iterate through all of the marked tickets. - -To enable batch operations first load @file{rt-liberation-multi.el}: - -@lisp -(require 'rt-liberation-storage) -@end lisp - -@table @kbd -@item M -@kindex M (ticket browser) -@findex rt-liber-mark-ticket-at-point -Mark the ticket at point for future action. If the ticket at point is -already marked then unmark it. -@end table - -@defun rt-liber-multi-set-status-open -Set the status of all the marked tickets to ``open''. -@end defun - -@defun rt-liber-multi-set-status-resolved -Set the status of all the marked tickets to ``resolved. -@end defun - -@defun rt-liber-multi-assign name -Assign all of the marked tickets to NAME. -@end defun - -@defun rt-liber-multi-flag-as-spam-and-delete -Set the status of all the marked tickets to ``is-spam'' and delete. -@end defun - - -@c -------------------------------------------------- -@node Local Storage -@chapter Local Storage -@cindex Local Storage - -@file{rt-liberation-storage.el} implements associating arbitrary -ancillary data with tickets. The data is stored locally and is not -sent to the RT server. - -To enable local storage first load @file{rt-liberation-storage.el}: - -@lisp -(require 'rt-liberation-storage) -@end lisp - -Then enable the display of ancillary data with: - -@lisp -(setq rt-liber-anc-p t) -@end lisp - -The associated data is edited and displayed in the ticket browser with -the following command key: - -@table @kbd -@item A -@kindex A (ticket browser) -@findex rt-liber-browser-ancillary-text -Associate text with the ticket at point. You will be prompted to enter -a string of text. -@end table - -Once text is associated with a ticket it will be displayed alongside -that ticket in the ticket browser. This particular feature lends -itself to creating private annotations about tickets. - -The implementation distributed with rt-liberation allows associating -text with tickets but is not limited to text. The same implementation -can be extended to associate any arbitrary data with any ticket. - - -@c -------------------------------------------------- -@c including the relevant licenses -@include gpl.texi -@include fdl.texi - - -@c -------------------------------------------------- -@node Concept Index -@unnumbered Concept Index -@printindex cp - - -@c -------------------------------------------------- -@node Function Index -@unnumbered Function Index -@printindex fn - - -@c -------------------------------------------------- -@node Variable Index -@unnumbered Variable Index -@printindex vr - - -@c -------------------------------------------------- -@node Keybinding Index -@unnumbered Keybinding Index -@printindex ky - - -@bye diff --git a/rt-liber.info b/rt-liber.info new file mode 100644 index 0000000..f712b66 --- /dev/null +++ b/rt-liber.info @@ -0,0 +1,2042 @@ +This is rt-liber.info, produced by makeinfo version 6.1 from +rt-liber.texinfo. + +(C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software +Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, and + no Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". +INFO-DIR-SECTION Emacs +START-INFO-DIR-ENTRY +* rt-liberation: (rt-liber). Emacs Interface to RT +END-INFO-DIR-ENTRY + + +File: rt-liber.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) + +The rt-liberation Manual +************************ + +This is the Manual for the rt-liberation system + + (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software +Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, and + no Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". + +* Menu: + +* Introduction:: Introduction to rt-liberation. +* Installation:: Setup rt-liberation to work on the system. + +Using rt-liberation +* Queries:: Retrieve particular tickets from the server. +* Ticket Browser:: Browse the query results. +* Ticket Viewer:: Interface to query results. + +Extensions +* Gnus Integration:: Sending email to the RT server via Gnus. +* Tracking Updates:: Keeping up to date with ticket changes. +* Batch Operations:: Performing operations on batches of tickets. +* Local Storage:: Associate arbitrary data with tickets. + +Copying and license +* Copying:: The GNU General Public License gives you + permission to redistribute rt-liberation + on certain terms; it also explains that + there is no warranty. + +* The GNU FDL:: The license for this documentation. + +Indices +* Concept Index:: +* Function Index:: +* Variable Index:: +* Keybinding Index:: + + -- The Detailed Node Listing -- + +Queries + +* Query Compiler:: Compiling Emacs Lisp to TicketSQL. +* Query Language:: A description of the Sexp-based language. + +Ticket Browser + +* Ticket Browser Display:: How tickets are displayed in the browser. +* Ticket Browser Sorting:: How tickets are sorted in the browser. +* Ticket Browser Filtering:: How to filter tickets out of the browser. +* Multiple Ticket Browsers:: More than one ticket browser buffer. + + + +File: rt-liber.info, Node: Introduction, Next: Installation, Up: Top + +1 Introduction +************** + +rt-liberation is a GNU/Emacs package for working with the Request +Tracker (henceforth abbreviated as just "RT") software from Best +Practical Solutions. RT has an interactive Web interface, a command +line interface (the "RT CLI"), and a REST interface. rt-liberation uses +the RT REST interface to communicate with the RT server. + + rt-liberation allows sending search queries to the RT server, +browsing the resulting tickets, viewing the tickets' contents and +performing operations on the tickets. + + +File: rt-liber.info, Node: Installation, Next: Queries, Prev: Introduction, Up: Top + +2 Installation +************** + +rt-liberation is available via GNU ELPA. + + If you install rt-liberation manually instead you'll need to tell +Emacs where to find it, and tell Emacs to load the package: + + (add-to-list 'load-path "/PATH/TO/rt-liberation/") + + (require 'rt-liberation) + + rt-liberation needs to be configured in your ~/.emacs, an ~/.rt-liber +file, or similar. + + Tell rt-liberation where to find the RT server's REST interface: + + (setq rt-liber-rest-url "rt.example.org") + + rt-liberation can issue a command to "take" a ticket (that is, assign +it to yourself). For this the variable RT-LIBER-USERNAME must be set: + + (setq rt-liber-username "someuser") + + rt-liberation can also launch a Web browser to visit a ticket. For +that to work the base URL needs to be set in RT-LIBER-BASE-URL. For +example: + + (setq rt-liber-base-url "https://rt.foo.org/") + + +File: rt-liber.info, Node: Queries, Next: Ticket Browser, Prev: Installation, Up: Top + +3 Queries +********* + +A typical RT server is meant to manage a large amount of tickets. Much +more that would be convenient to view all at once. Instead queries are +used to view only a subset of the tickets on the server. + + rt-liberation has its own Sexp-based query language which maps to +RT's TicketSQL language. + +* Menu: + +* Query Compiler:: Compiling Emacs Lisp to TicketSQL. +* Query Language:: A description of the Sexp-based language. + + +File: rt-liber.info, Node: Query Compiler, Next: Query Language, Up: Queries + +3.1 Query Compiler +================== + +In order to browse and view tickets a list of needs to be requested from +the RT server. Typically the tickets answer some kind of criteria, for +example "tickets no older than a week owned by me which have \"foobar\" +in their subject line". In RT these criteria are formulated with +"TicketSQL" queries; a structured query language specific to RT. + + rt-liberation provides a query compiler function to compile Emacs +Lisp symbolic expressions into TicketSQL. The query compiler supports a +number of TicketSQL tokens. + + +File: rt-liber.info, Node: Query Language, Prev: Query Compiler, Up: Queries + +3.2 Query Language +================== + +rt-liberation's Sexp-based query language covers a portion of the +TicketSQL language. Here are some of the supported TicketSQL tokens: +Boolean tokens as a means of combining query subsections: "and", "or", +"not". LIKE attribute tokens: "subject", "content". + + For example here is a query with both Boolean and LIKE tokens: + + (rt-liber-compile-query + (and (queue "bugs") + (content "gnu"))) + + ==> "Queue = 'bugs' AND Content LIKE 'gnu'" + + We can also express negation (note that the compiler produces "!=" +and "NOT LIKE" for negation depending on the context): + + (rt-liber-compile-query + (and (queue "bugs") + (not (owner "Nobody")) + (not (content "sprigz")) + (status "new"))) + + ==> "Queue = 'licensing' AND Owner != 'Nobody' \ + AND Content NOT LIKE 'sprigz' AND Status = 'new'" + + Attribute tokens which match an attribute to a specific field such +as: "owner", "status" and "queue". Temporal tokens which limit the +search results to tickets within a certain time interval: "created" and +"lastupdated". Note that temporal keywords such as "created" always +accept two arguments: BEFORE and AFTER. When either BEFORE or AFTER +aren't needed, use NIL instead. + + One of the advantages of being able to express the TicketSQL queries +as Emacs Lisp is to be able to express queries using Emacs Lisp +functions. + + Here is a slightly more involved example to illustrate: + + (rt-liber-compile-query + (and (queue "bugs") + (owner "me@myaddress.com") + (status "open") + (lastupdated nil + (format-time-string + "%Y-%m-%d" + (seconds-to-time + (- (time-to-seconds (current-time)) + (* 60 60 24 7))))))) + + ==> "Queue = 'bugs' AND Owner = 'me@myaddress.com' AND Status = 'open' AND LastUpdated > '2009-03-30'" + + Here is an example of how the ticket browser and compiler can be used +in function calls: + + (defun rt-liber-display-ticket (ticket-id) + "Display ticket with TICKET-ID in the ticket-browser." + (interactive "MTicket ID: ") + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "complaints") + (id ticket-id))))) + + +File: rt-liber.info, Node: Ticket Browser, Next: Ticket Viewer, Prev: Queries, Up: Top + +4 Ticket Browser +**************** + +The ticket browser is a special buffer which provides a convenient +interface to the results of a server query. The ticket browser can be +started by invoking: (rt-liber-browse-query QUERY), where QUERY is a +TicketSQL query. The TicketSQL query can be entered manually as a +string or as the return value of the query compiler. + + -- Function: rt-liber-browse-query QUERY &optional NEW + Runs QUERY against the server and launches the browser. + + If NEW is non-nil then the query results will be displayed in a new + buffer, otherwise the query results will override the contents of + the existing ticket browser buffer. If NEW is a string then that + will be the name of the new buffer. + + The TicketSQL query can be the return value of the query compiler. +For example: + + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "bugs") + (content "gnu"))) + + Since the return value of the query compiler is just a TicketSQL +string, the following is equivalent: + + (rt-liber-browse-query "Queue = 'bugs' AND Content LIKE 'gnu'") + + The ticket browser defines a number of commands: + +'q' + Bury the ticket browser buffer. + +'n' + Move point to the next ticket. + +'p' + Move point to the previous ticket. + +'RET' + Visit the ticket at point in the *Note Ticket Viewer::. + +'g' + Refresh the contents of the browser buffer. + +'G' + Refresh the contents of the browser buffer. Return point to the + current ticket after the refresh (if possible). + +'s' + Mark the ticket as spam. + +'S' + Delete marked tickets as spam (requires rt-liberation-multi + package). + +'a' + Assign the ticket to a user. + +'r' + Mark the ticket as "resolved". + +'o' + Mark the ticket as "open". + +'t' + Assign the ticket at point to RT-LIBER-USERNAME. + +'SPC' + Scroll the text of the ticket browser upward. + +'DEL' + Scroll the text of the ticket browser downward. + +'m' + Move the ticket to a different queue. + +'P' + Set the numerical priority level of the ticket at point. + +* Menu: + +* Ticket Browser Display:: How tickets are displayed in the browser. +* Ticket Browser Sorting:: How tickets are sorted in the browser. +* Ticket Browser Filtering:: How to filter tickets out of the browser. +* Multiple Ticket Browsers:: More than one ticket browser buffer. + + +File: rt-liber.info, Node: Ticket Browser Display, Next: Ticket Browser Sorting, Up: Ticket Browser + +4.1 Ticket Browser Display +========================== + +The ticket browser displays the tickets in the browser by calling +"rt-liber-ticketlist-browser-redraw-f" which can be changed and +customized. Any implementation of +"rt-liber-ticketlist-browser-redraw-f" must leave point at the end of +the ticket text. + + The ticket data itself can be displayed using rt-liberation ticket +format string %-sequences: + +%i + ID number of the ticket in the RT database. +%s + Subject line. +%c + Ticket creation time. The format to display the time is specified + in the variable RT-LIBER-BROWSER-TIME-FORMAT-STRING. +%S + Ticket status ("open", "new" etc.) +%r + Whether the ticket is resolved. +%R + Requestor/s +%C + Creator of the ticket. +%o + Owner of the ticket. +%q + The queue originating the ticket. +%p + The numerical priority of the ticket + + Here is an example implementation of +"rt-liber-ticketlist-browser-redraw-f" showing the use of the +%-sequences. Note the use of text properties to add color to ticket +text. The use of text properties as opposed to font-locking is meant to +ease customization because otherwise any change in ticket display would +break the font-locking regular expressions. + + (defun rt-liber-ticketlist-browser-redraw-f (ticket) + "Display TICKET." + (insert (rt-liber-format "[%c] %i" ticket)) + (add-text-properties (point-at-bol) + (point-at-eol) + '(face rt-liber-ticket-face)) + (newline) + (insert (rt-liber-format " [%S] %s" ticket)) + (newline) + (insert (rt-liber-format " %o <== %R" ticket))) + + The function "rt-liber-high-priority-p" can be used to apply a +different face or text to a ticket if it is high priority. A ticket is +considered high priority if its value is strictly higher than +RT-LIBER-BROWSER-PRIORITY-CUTOFF + + +File: rt-liber.info, Node: Ticket Browser Sorting, Next: Ticket Browser Filtering, Prev: Ticket Browser Display, Up: Ticket Browser + +4.2 Ticket Browser Sorting +========================== + +The tickets in the browser are displayed by default in reverse +chronological order. Ticket sorting is done by a call to +"rt-liber-browser-default-sorting-function". + + Other sorting orders can be used by binding +"rt-liber-browser-default-sorting-function" to a different function. To +ease writing such functions rt-liberation provides two predicate +functions to perform comparisons between ticket objects: + + -- Function: rt-liber-lex-lessthan-p a b field + Return true if A is lexicographically less than B in FIELD. + + Here is an example of sorting tickets lexicographically by owner + name using "rt-liber-lex-lessthan-p" (note that you can feed + "rt-liber-lex-lessthan-p" a date/time string and it will sort it + just fine except that it wouldn't make any sense): + + (defun rt-liber-sort-by-owner (ticket-list) + "Sort TICKET-LIST lexicographically by owner." + (rt-liber-sort-ticket-list + ticket-list + #'(lambda (a b) + (rt-liber-lex-lessthan-p a b "Owner")))) + + -- Function: rt-liber-time-lessthan-p a b field + Return t if A is chronologically less than B in FIELD. + + Here is an example of sorting tickets lexicographically by owner + name using "rt-liber-time-lessthan-p" (note that feeding + "rt-liber-time-lessthan-p" anything but a date/time string, in this + case "Created" contains a date, will result in an error being + signaled). + + (defun rt-liber-sort-by-time-created (ticket-list) + "Sort TICKET-LIST in reverse chronological order." + (reverse + (rt-liber-sort-ticket-list + ticket-list + #'(lambda (a b) + (rt-liber-time-lessthan-p a b "Created"))))) + + +File: rt-liber.info, Node: Ticket Browser Filtering, Next: Multiple Ticket Browsers, Prev: Ticket Browser Sorting, Up: Ticket Browser + +4.3 Ticket Browser Filtering +============================ + +The Ticket Browser can also filter out (that is, not display) certain +tickets based on particular criteria. This probably shouldn't be used +instead of a properly formed RT query, but when used in conjunction with +correctly formulated queries it becomes a powerful tool. + + During ticket display processing the Ticket Browser will call the +function pointed to by RT-LIBER-BROWSER-DEFAULT-FILTER-FUNCTION on each +ticket, passing the function the ticket alist as a single argument. The +function is set by default to "rt-liber-default-filter-f", which is a +function which will display all tickets and filter none. + + If any tickets are filtered, the Ticket Browser will display the +filtered ticket count at the bottom ticket listing. + + Here is a simple example of how to filter out all of the tickets +which have a status of "deleted". + + First we define a custom filter function. Note how it accepts a +single argument, which is the ticket alist, and returns nil if the +ticket is to be filtered. + + (defun rt-liber-browser-deleted-filter (ticket) + (not + (and ticket + (string= (cdr (assoc "Status" ticket)) + "deleted")))) + + Then we assign that function to be our default filtering function: + + (setq rt-liber-browser-default-filter-function + 'rt-liber-browser-deleted-filter) + + +File: rt-liber.info, Node: Multiple Ticket Browsers, Prev: Ticket Browser Filtering, Up: Ticket Browser + +4.4 Multiple Ticket Browsers +============================ + +It is sometimes useful to rename the ticket browser buffer to something +more informative than the default RT-LIBER-BROWSER-BUFFER-NAME, +especially if there are multiple ticket browsers. + + Changing a ticket browser's name can be done normally with +'rename-buffer', but it is also possible to name the ticket browser when +it is created. In the following example two ticket browser buffers will +be created displaying the query results and named "*updated by +supervisor*" and "*new tickets*" respectively: + + (defun rt-liber-daily-rounds () + (interactive) + + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "complaints") + (owner "lem.e.tweakit") + (status "open") + (lastupdatedby "molly.manager"))) + "*updated by supervisor*") + + (rt-liber-browse-query + (rt-liber-compile-query + (and (queue "complaints") + (owner "Nobody") + (status "new"))) + "*new tickets*")) + + +File: rt-liber.info, Node: Ticket Viewer, Next: Gnus Integration, Prev: Ticket Browser, Up: Top + +5 Ticket Viewer +*************** + +The ticket viewer is an interface for viewing the contents of a ticket. +It provides font-locking to make reading the contents easier via +RT-LIBER-VIEWER-FONT-LOCK-KEYWORDS and a number of key-bindings. + + The ticket viewer provides key-bindings to help compose emails to +send to the RT email interface. The key-bindings for composing email +described below are generic, what actually happens when you invoke them +depends on the email-backend system you have installed into +rt-liberation. 'rt-liberation-gnus.el' provides integration with Gnus, +*Note Gnus Integration::. + + Setting RT-LIBER-JUMP-TO-LATEST to 't' will cause the viewer to +automatically scroll to the latest comment in a ticket when that ticket +is visited. By default RT-LIBER-JUMP-TO-LATEST is set to 'nil'. + + When in the ticket viewer buffer, invoking +"rt-liber-viewer-take-ticket" will "take" the ticket. + +'q' + Bury the ticket viewer buffer. + +'n' + Move point to the next section in ticket. + +'N' + Move point to the newest correspondence section, if any. + +'p' + Move point to the previous section in ticket. + +'V' + Visit the current ticket in a Web browser. + +'m' + Compose an answer to the current ticket. + +'M' + Compose an answer to the current ticket. The content section + around point will be inserted into the email body and commented + out. + +'t' + Compose a provisional answer to the current ticket. + +'T' + Compose a provisional answer to the current ticket. The content + section around point will be inserted into the email body and + commented out. + +'F' + Compose an answer to the current ticket. The content section + around point will be inserted into the email body verbatim. + +'c' + Compose a comment for the current ticket. + +'C' + Comment on the ticket using the current context + +'g' + Refresh and redisplay the current ticket. + +'SPC' + Scroll text of ticket viewer upward. + +'DEL' + Scroll text of ticket viewer downward. + +'h' + Display the associated ticket in the ticket browser. + + +File: rt-liber.info, Node: Gnus Integration, Next: Tracking Updates, Prev: Ticket Viewer, Up: Top + +6 Gnus Integration +****************** + +The file 'rt-liberation-gnus.el' implements integration with Gnus for +composing emails. To enable the feature, 'require' it after loading +rt-liberation: + + (require 'rt-liberation-gnus) + + In order for rt-liberation-gnus to be useful a few variables need to +be specialized. The following is example code which sets these +variables. Below is a thorough description of those variables. + + (setq rt-liber-gnus-comment-address "our-rtserver-comment@ourserver.org" + rt-liber-gnus-address "our-rtserver@ourserver.org" + rt-liber-gnus-subject-name "ourserver.org") + + -- User Option: rt-liber-gnus-address + RT-LIBER-GNUS-ADDRESS is the email address which is configured in + the RT server email interface for sending a response to the + ticket's requestor. + -- User Option: rt-liber-gnus-comment-address + RT-LIBER-GNUS-COMMENT-ADDRESS is the email address which is + configured in the RT server email interface for adding a comment + under the ticket in question. + -- User Option: rt-liber-gnus-subject-name + RT-LIBER-GNUS-SUBJECT-NAME is a string, typically included at the + beginning of the square brackets in the subject. The string is a + part of the subject line which helps the RT server recognize the + email. + + Gnus posting styles controlled by GNUS-POSTING-STYLES can be +customized for rt-liberation-gnus by using the variable RT-LIBER-GNUS-P, +which is only non-nil when rt-liberation-gnus launches a Gnus message +buffer. + + Here is example code which uses RT-LIBER-GNUS-P to override the +signature in the default posting style with one special to +rt-liberation. Headers can be added and removed in a similar manner. + + (setq gnus-posting-styles + '((".*" + (name "Lemm E. Hackitt") + (address "Lemm@hack.it") + (signature-file "~/sig.txt") + ("X-Ethics" "Use GNU")) + (rt-liber-gnus-p + (signature-file "~/rt-liber-sig.txt")))) + + Once rt-liberation-gnus is loaded and customized the key-bindings in +the Viewer will be able to call into it, *Note Ticket Viewer::. + + +File: rt-liber.info, Node: Tracking Updates, Next: Batch Operations, Prev: Gnus Integration, Up: Top + +7 Tracking Updates +****************** + +The functions in 'rt-liberation-update.el' help keep up with updates to +the ticket database. To enable the feature, 'require' it after loading +rt-liberation: + + (require 'rt-liberation-update) + + Then set RT-LIBER-UPDATE-DEFAULT-QUEUE to be the name of the queue to +watch for updates. For example: + + (setq rt-liber-update-default-queue "complaints") + + -- Function: rt-liber-update &optional no-update + 'rt-liber-update' is an interactive function which runs a query + against the RT server asking for the tickets which have been + updated since the time 'rt-liber-update' was last run (each time it + runs, it leaves a time-stamp). If no time-stamp is found, for + instance when you run 'rt-liber-update' for the first time, today's + date is used. + + With the NO-UPDATE prefix, 'rt-liber-update' will not update the + time-stamp so that the next invocation will produce the same + result. + + +File: rt-liber.info, Node: Batch Operations, Next: Local Storage, Prev: Tracking Updates, Up: Top + +8 Batch Operations +****************** + +The extension 'rt-liberation-multi.el' implements performing batch +operations on groups of tickets. It works in two stages: First mark an +arbitrary number of tickets within the same buffer then call a batch +operation function on them. The batch operation functions work the same +way as function which work on single tickets only that they iterate +through all of the marked tickets. + + To enable batch operations first load 'rt-liberation-multi.el': + + (require 'rt-liberation-storage) + +'M' + Mark the ticket at point for future action. If the ticket at point + is already marked then unmark it. + + -- Function: rt-liber-multi-set-status-open + Set the status of all the marked tickets to "open". + + -- Function: rt-liber-multi-set-status-resolved + Set the status of all the marked tickets to "resolved. + + -- Function: rt-liber-multi-assign name + Assign all of the marked tickets to NAME. + + -- Function: rt-liber-multi-flag-as-spam-and-delete + Set the status of all the marked tickets to "is-spam" and delete. + + +File: rt-liber.info, Node: Local Storage, Next: Copying, Prev: Batch Operations, Up: Top + +9 Local Storage +*************** + +'rt-liberation-storage.el' implements associating arbitrary ancillary +data with tickets. The data is stored locally and is not sent to the RT +server. + + To enable local storage first load 'rt-liberation-storage.el': + + (require 'rt-liberation-storage) + + Then enable the display of ancillary data with: + + (setq rt-liber-anc-p t) + + The associated data is edited and displayed in the ticket browser +with the following command key: + +'A' + Associate text with the ticket at point. You will be prompted to + enter a string of text. + + Once text is associated with a ticket it will be displayed alongside +that ticket in the ticket browser. This particular feature lends itself +to creating private annotations about tickets. + + The implementation distributed with rt-liberation allows associating +text with tickets but is not limited to text. The same implementation +can be extended to associate any arbitrary data with any ticket. + + +File: rt-liber.info, Node: Copying, Next: The GNU FDL, Prev: Local Storage, Up: Top + +10 The GNU General Public License. +********************************** + + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + +Preamble +======== + +The GNU General Public License is a free, copyleft license for software +and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS +==================== + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public + License. + + "Copyright" also means copyright-like laws that apply to other + kinds of works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the + work in a fashion requiring copyright permission, other than the + making of an exact copy. The resulting work is called a "modified + version" of the earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work + based on the Program. + + To "propagate" a work means to do anything with it that, without + permission, would make you directly or secondarily liable for + infringement under applicable copyright law, except executing it on + a computer or modifying a private copy. Propagation includes + copying, distribution (with or without modification), making + available to the public, and in some countries other activities as + well. + + To "convey" a work means any kind of propagation that enables other + parties to make or receive copies. Mere interaction with a user + through a computer network, with no transfer of a copy, is not + conveying. + + An interactive user interface displays "Appropriate Legal Notices" + to the extent that it includes a convenient and prominently visible + feature that (1) displays an appropriate copyright notice, and (2) + tells the user that there is no warranty for the work (except to + the extent that warranties are provided), that licensees may convey + the work under this License, and how to view a copy of this + License. If the interface presents a list of user commands or + options, such as a menu, a prominent item in the list meets this + criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any non-source + form of a work. + + A "Standard Interface" means an interface that either is an + official standard defined by a recognized standards body, or, in + the case of interfaces specified for a particular programming + language, one that is widely used among developers working in that + language. + + The "System Libraries" of an executable work include anything, + other than the work as a whole, that (a) is included in the normal + form of packaging a Major Component, but which is not part of that + Major Component, and (b) serves only to enable use of the work with + that Major Component, or to implement a Standard Interface for + which an implementation is available to the public in source code + form. A "Major Component", in this context, means a major + essential component (kernel, window system, and so on) of the + specific operating system (if any) on which the executable work + runs, or a compiler used to produce the work, or an object code + interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all + the source code needed to generate, install, and (for an executable + work) run the object code and to modify the work, including scripts + to control those activities. However, it does not include the + work's System Libraries, or general-purpose tools or generally + available free programs which are used unmodified in performing + those activities but which are not part of the work. For example, + Corresponding Source includes interface definition files associated + with source files for the work, and the source code for shared + libraries and dynamically linked subprograms that the work is + specifically designed to require, such as by intimate data + communication or control flow between those subprograms and other + parts of the work. + + The Corresponding Source need not include anything that users can + regenerate automatically from other parts of the Corresponding + Source. + + The Corresponding Source for a work in source code form is that + same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of + copyright on the Program, and are irrevocable provided the stated + conditions are met. This License explicitly affirms your unlimited + permission to run the unmodified Program. The output from running + a covered work is covered by this License only if the output, given + its content, constitutes a covered work. This License acknowledges + your rights of fair use or other equivalent, as provided by + copyright law. + + You may make, run and propagate covered works that you do not + convey, without conditions so long as your license otherwise + remains in force. You may convey covered works to others for the + sole purpose of having them make modifications exclusively for you, + or provide you with facilities for running those works, provided + that you comply with the terms of this License in conveying all + material for which you do not control copyright. Those thus making + or running the covered works for you must do so exclusively on your + behalf, under your direction and control, on terms that prohibit + them from making any copies of your copyrighted material outside + their relationship with you. + + Conveying under any other circumstances is permitted solely under + the conditions stated below. Sublicensing is not allowed; section + 10 makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological + measure under any applicable law fulfilling obligations under + article 11 of the WIPO copyright treaty adopted on 20 December + 1996, or similar laws prohibiting or restricting circumvention of + such measures. + + When you convey a covered work, you waive any legal power to forbid + circumvention of technological measures to the extent such + circumvention is effected by exercising rights under this License + with respect to the covered work, and you disclaim any intention to + limit operation or modification of the work as a means of + enforcing, against the work's users, your or third parties' legal + rights to forbid circumvention of technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice; + keep intact all notices stating that this License and any + non-permissive terms added in accord with section 7 apply to the + code; keep intact all notices of the absence of any warranty; and + give all recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, + and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to + produce it from the Program, in the form of source code under the + terms of section 4, provided that you also meet all of these + conditions: + + a. The work must carry prominent notices stating that you + modified it, and giving a relevant date. + + b. The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in + section 4 to "keep intact all notices". + + c. You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable + section 7 additional terms, to the whole of the work, and all + its parts, regardless of how they are packaged. This License + gives no permission to license the work in any other way, but + it does not invalidate such permission if you have separately + received it. + + d. If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has + interactive interfaces that do not display Appropriate Legal + Notices, your work need not make them do so. + + A compilation of a covered work with other separate and independent + works, which are not by their nature extensions of the covered + work, and which are not combined with it such as to form a larger + program, in or on a volume of a storage or distribution medium, is + called an "aggregate" if the compilation and its resulting + copyright are not used to limit the access or legal rights of the + compilation's users beyond what the individual works permit. + Inclusion of a covered work in an aggregate does not cause this + License to apply to the other parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms + of sections 4 and 5, provided that you also convey the + machine-readable Corresponding Source under the terms of this + License, in one of these ways: + + a. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that + product model, to give anyone who possesses the object code + either (1) a copy of the Corresponding Source for all the + software in the product that is covered by this License, on a + durable physical medium customarily used for software + interchange, for a price no more than your reasonable cost of + physically performing this conveying of source, or (2) access + to copy the Corresponding Source from a network server at no + charge. + + c. Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, + and only if you received the object code with such an offer, + in accord with subsection 6b. + + d. Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to + the Corresponding Source in the same way through the same + place at no further charge. You need not require recipients + to copy the Corresponding Source along with the object code. + If the place to copy the object code is a network server, the + Corresponding Source may be on a different server (operated by + you or a third party) that supports equivalent copying + facilities, provided you maintain clear directions next to the + object code saying where to find the Corresponding Source. + Regardless of what server hosts the Corresponding Source, you + remain obligated to ensure that it is available for as long as + needed to satisfy these requirements. + + e. Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the + general public at no charge under subsection 6d. + + A separable portion of the object code, whose source code is + excluded from the Corresponding Source as a System Library, need + not be included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means + any tangible personal property which is normally used for personal, + family, or household purposes, or (2) anything designed or sold for + incorporation into a dwelling. In determining whether a product is + a consumer product, doubtful cases shall be resolved in favor of + coverage. For a particular product received by a particular user, + "normally used" refers to a typical or common use of that class of + product, regardless of the status of the particular user or of the + way in which the particular user actually uses, or expects or is + expected to use, the product. A product is a consumer product + regardless of whether the product has substantial commercial, + industrial or non-consumer uses, unless such uses represent the + only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, + procedures, authorization keys, or other information required to + install and execute modified versions of a covered work in that + User Product from a modified version of its Corresponding Source. + The information must suffice to ensure that the continued + functioning of the modified object code is in no case prevented or + interfered with solely because modification has been made. + + If you convey an object code work under this section in, or with, + or specifically for use in, a User Product, and the conveying + occurs as part of a transaction in which the right of possession + and use of the User Product is transferred to the recipient in + perpetuity or for a fixed term (regardless of how the transaction + is characterized), the Corresponding Source conveyed under this + section must be accompanied by the Installation Information. But + this requirement does not apply if neither you nor any third party + retains the ability to install modified object code on the User + Product (for example, the work has been installed in ROM). + + The requirement to provide Installation Information does not + include a requirement to continue to provide support service, + warranty, or updates for a work that has been modified or installed + by the recipient, or for the User Product in which it has been + modified or installed. Access to a network may be denied when the + modification itself materially and adversely affects the operation + of the network or violates the rules and protocols for + communication across the network. + + Corresponding Source conveyed, and Installation Information + provided, in accord with this section must be in a format that is + publicly documented (and with an implementation available to the + public in source code form), and must require no special password + or key for unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of + this License by making exceptions from one or more of its + conditions. Additional permissions that are applicable to the + entire Program shall be treated as though they were included in + this License, to the extent that they are valid under applicable + law. If additional permissions apply only to part of the Program, + that part may be used separately under those permissions, but the + entire Program remains governed by this License without regard to + the additional permissions. + + When you convey a copy of a covered work, you may at your option + remove any additional permissions from that copy, or from any part + of it. (Additional permissions may be written to require their own + removal in certain cases when you modify the work.) You may place + additional permissions on material, added by you to a covered work, + for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material + you add to a covered work, you may (if authorized by the copyright + holders of that material) supplement the terms of this License with + terms: + + a. Disclaiming warranty or limiting liability differently from + the terms of sections 15 and 16 of this License; or + + b. Requiring preservation of specified reasonable legal notices + or author attributions in that material or in the Appropriate + Legal Notices displayed by works containing it; or + + c. Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked + in reasonable ways as different from the original version; or + + d. Limiting the use for publicity purposes of names of licensors + or authors of the material; or + + e. Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f. Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified + versions of it) with contractual assumptions of liability to + the recipient, for any liability that these contractual + assumptions directly impose on those licensors and authors. + + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as + you received it, or any part of it, contains a notice stating that + it is governed by this License along with a term that is a further + restriction, you may remove that term. If a license document + contains a further restriction but permits relicensing or conveying + under this License, you may add to a covered work material governed + by the terms of that license document, provided that the further + restriction does not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you + must place, in the relevant source files, a statement of the + additional terms that apply to those files, or a notice indicating + where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in + the form of a separately written license, or stated as exceptions; + the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly + provided under this License. Any attempt otherwise to propagate or + modify it is void, and will automatically terminate your rights + under this License (including any patent licenses granted under the + third paragraph of section 11). + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, you do not qualify to receive new licenses + for the same material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or + run a copy of the Program. Ancillary propagation of a covered work + occurring solely as a consequence of using peer-to-peer + transmission to receive a copy likewise does not require + acceptance. However, nothing other than this License grants you + permission to propagate or modify any covered work. These actions + infringe copyright if you do not accept this License. Therefore, + by modifying or propagating a covered work, you indicate your + acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically + receives a license from the original licensors, to run, modify and + propagate that work, subject to this License. You are not + responsible for enforcing compliance by third parties with this + License. + + An "entity transaction" is a transaction transferring control of an + organization, or substantially all assets of one, or subdividing an + organization, or merging organizations. If propagation of a + covered work results from an entity transaction, each party to that + transaction who receives a copy of the work also receives whatever + licenses to the work the party's predecessor in interest had or + could give under the previous paragraph, plus a right to possession + of the Corresponding Source of the work from the predecessor in + interest, if the predecessor has it or can get it with reasonable + efforts. + + You may not impose any further restrictions on the exercise of the + rights granted or affirmed under this License. For example, you + may not impose a license fee, royalty, or other charge for exercise + of rights granted under this License, and you may not initiate + litigation (including a cross-claim or counterclaim in a lawsuit) + alleging that any patent claim is infringed by making, using, + selling, offering for sale, or importing the Program or any portion + of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this + License of the Program or a work on which the Program is based. + The work thus licensed is called the contributor's "contributor + version". + + A contributor's "essential patent claims" are all patent claims + owned or controlled by the contributor, whether already acquired or + hereafter acquired, that would be infringed by some manner, + permitted by this License, of making, using, or selling its + contributor version, but do not include claims that would be + infringed only as a consequence of further modification of the + contributor version. For purposes of this definition, "control" + includes the right to grant patent sublicenses in a manner + consistent with the requirements of this License. + + Each contributor grants you a non-exclusive, worldwide, + royalty-free patent license under the contributor's essential + patent claims, to make, use, sell, offer for sale, import and + otherwise run, modify and propagate the contents of its contributor + version. + + In the following three paragraphs, a "patent license" is any + express agreement or commitment, however denominated, not to + enforce a patent (such as an express permission to practice a + patent or covenant not to sue for patent infringement). To "grant" + such a patent license to a party means to make such an agreement or + commitment not to enforce a patent against the party. + + If you convey a covered work, knowingly relying on a patent + license, and the Corresponding Source of the work is not available + for anyone to copy, free of charge and under the terms of this + License, through a publicly available network server or other + readily accessible means, then you must either (1) cause the + Corresponding Source to be so available, or (2) arrange to deprive + yourself of the benefit of the patent license for this particular + work, or (3) arrange, in a manner consistent with the requirements + of this License, to extend the patent license to downstream + recipients. "Knowingly relying" means you have actual knowledge + that, but for the patent license, your conveying the covered work + in a country, or your recipient's use of the covered work in a + country, would infringe one or more identifiable patents in that + country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or + arrangement, you convey, or propagate by procuring conveyance of, a + covered work, and grant a patent license to some of the parties + receiving the covered work authorizing them to use, propagate, + modify or convey a specific copy of the covered work, then the + patent license you grant is automatically extended to all + recipients of the covered work and works based on it. + + A patent license is "discriminatory" if it does not include within + the scope of its coverage, prohibits the exercise of, or is + conditioned on the non-exercise of one or more of the rights that + are specifically granted under this License. You may not convey a + covered work if you are a party to an arrangement with a third + party that is in the business of distributing software, under which + you make payment to the third party based on the extent of your + activity of conveying the work, and under which the third party + grants, to any of the parties who would receive the covered work + from you, a discriminatory patent license (a) in connection with + copies of the covered work conveyed by you (or copies made from + those copies), or (b) primarily for and in connection with specific + products or compilations that contain the covered work, unless you + entered into that arrangement, or that patent license was granted, + prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting + any implied license or other defenses to infringement that may + otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement + or otherwise) that contradict the conditions of this License, they + do not excuse you from the conditions of this License. If you + cannot convey a covered work so as to satisfy simultaneously your + obligations under this License and any other pertinent obligations, + then as a consequence you may not convey it at all. For example, + if you agree to terms that obligate you to collect a royalty for + further conveying from those to whom you convey the Program, the + only way you could satisfy both those terms and this License would + be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have + permission to link or combine any covered work with a work licensed + under version 3 of the GNU Affero General Public License into a + single combined work, and to convey the resulting work. The terms + of this License will continue to apply to the part which is the + covered work, but the special requirements of the GNU Affero + General Public License, section 13, concerning interaction through + a network will apply to the combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new + versions of the GNU General Public License from time to time. Such + new versions will be similar in spirit to the present version, but + may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies that a certain numbered version of the GNU + General Public License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that numbered version or of any later version published by the Free + Software Foundation. If the Program does not specify a version + number of the GNU General Public License, you may choose any + version ever published by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future + versions of the GNU General Public License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Program. + + Later license versions may give you additional or different + permissions. However, no additional obligations are imposed on any + author or copyright holder as a result of your choosing to follow a + later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE + COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE + RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL + NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES + AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR + DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA + BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD + PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF + THE POSSIBILITY OF SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided + above cannot be given local legal effect according to their terms, + reviewing courts shall apply local law that most closely + approximates an absolute waiver of all civil liability in + connection with the Program, unless a warranty or assumption of + liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS +=========================== + +How to Apply These Terms to Your New Programs +============================================= + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Also add information on how to contact you by electronic and paper +mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + PROGRAM Copyright (C) YEAR NAME OF AUTHOR + This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type 'show c' for details. + + The hypothetical commands 'show w' and 'show c' should show the +appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an "about box". + + You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU GPL, see . + + The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. But first, +please read . + + +File: rt-liber.info, Node: The GNU FDL, Next: Concept Index, Prev: Copying, Up: Top + +11 GNU Free Documentation License +********************************* + + Version 1.2, November 2002 + + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses terminated + so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. + +11.1 ADDENDUM: How to use this License for your documents +========================================================= + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: rt-liber.info, Node: Concept Index, Next: Function Index, Prev: The GNU FDL, Up: Top + +Concept Index +************* + +[index] +* Menu: + +* Batch Operations: Batch Operations. (line 6) +* FDL, GNU Free Documentation License: The GNU FDL. (line 6) +* Gnus Integration: Gnus Integration. (line 6) +* installation: Installation. (line 6) +* introduction: Introduction. (line 6) +* Local Storage: Local Storage. (line 6) +* queries: Queries. (line 6) +* query compiler: Query Compiler. (line 6) +* query language: Query Language. (line 6) +* ticket browser: Ticket Browser. (line 6) +* ticket browser display function: Ticket Browser Display. + (line 6) +* ticket browser filtering filter: Ticket Browser Filtering. + (line 6) +* ticket browser multiple buffer: Multiple Ticket Browsers. + (line 6) +* ticket browser sorting: Ticket Browser Sorting. + (line 6) +* ticket viewer: Ticket Viewer. (line 6) +* Tracking Updates: Tracking Updates. (line 6) + + +File: rt-liber.info, Node: Function Index, Next: Variable Index, Prev: Concept Index, Up: Top + +Function Index +************** + +[index] +* Menu: + +* revert-buffer: Ticket Browser. (line 48) +* revert-buffer <1>: Ticket Viewer. (line 66) +* rt-liber-browse-query: Ticket Browser. (line 12) +* rt-liber-browser-ancillary-text: Local Storage. (line 22) +* rt-liber-browser-assign: Ticket Browser. (line 62) +* rt-liber-browser-mark-as-spam: Ticket Browser. (line 55) +* rt-liber-browser-mode-quit: Ticket Browser. (line 36) +* rt-liber-browser-move: Ticket Browser. (line 80) +* rt-liber-browser-open: Ticket Browser. (line 68) +* rt-liber-browser-prioritize: Ticket Browser. (line 83) +* rt-liber-browser-refresh-and-return: Ticket Browser. (line 51) +* rt-liber-browser-resolve: Ticket Browser. (line 65) +* rt-liber-browser-take-ticket-at-point: Ticket Browser. (line 71) +* rt-liber-display-ticket-at-point: Ticket Browser. (line 45) +* rt-liber-jump-to-latest-correspondence: Ticket Viewer. (line 31) +* rt-liber-lex-lessthan-p: Ticket Browser Sorting. + (line 15) +* rt-liber-mark-ticket-at-point: Batch Operations. (line 18) +* rt-liber-multi-assign: Batch Operations. (line 27) +* rt-liber-multi-delete-spam: Ticket Browser. (line 58) +* rt-liber-multi-flag-as-spam-and-delete: Batch Operations. (line 30) +* rt-liber-multi-set-status-open: Batch Operations. (line 21) +* rt-liber-multi-set-status-resolved: Batch Operations. (line 24) +* rt-liber-next-section-in-viewer: Ticket Viewer. (line 28) +* rt-liber-next-ticket-in-browser: Ticket Browser. (line 39) +* rt-liber-previous-section-in-viewer: Ticket Viewer. (line 34) +* rt-liber-previous-ticket-in-browser: Ticket Browser. (line 42) +* rt-liber-time-lessthan-p: Ticket Browser Sorting. + (line 30) +* rt-liber-update: Tracking Updates. (line 17) +* rt-liber-viewer-answer: Ticket Viewer. (line 40) +* rt-liber-viewer-answer-provisionally: Ticket Viewer. (line 48) +* rt-liber-viewer-answer-provisionally-this: Ticket Viewer. (line 51) +* rt-liber-viewer-answer-this: Ticket Viewer. (line 43) +* rt-liber-viewer-answer-verbatim-this: Ticket Viewer. (line 56) +* rt-liber-viewer-comment: Ticket Viewer. (line 60) +* rt-liber-viewer-comment-this: Ticket Viewer. (line 63) +* rt-liber-viewer-mode-quit: Ticket Viewer. (line 25) +* rt-liber-viewer-show-ticket-browser: Ticket Viewer. (line 75) +* rt-liber-viewer-visit-in-browser: Ticket Viewer. (line 37) +* scroll-down: Ticket Browser. (line 77) +* scroll-down <1>: Ticket Viewer. (line 72) +* scroll-up: Ticket Browser. (line 74) +* scroll-up <1>: Ticket Viewer. (line 69) + + +File: rt-liber.info, Node: Variable Index, Next: Keybinding Index, Prev: Function Index, Up: Top + +Variable Index +************** + +[index] +* Menu: + +* rt-liber-gnus-address: Gnus Integration. (line 20) +* rt-liber-gnus-comment-address: Gnus Integration. (line 24) +* rt-liber-gnus-subject-name: Gnus Integration. (line 28) + + +File: rt-liber.info, Node: Keybinding Index, Prev: Variable Index, Up: Top + +Keybinding Index +**************** + +[index] +* Menu: + +* a (ticket browser): Ticket Browser. (line 62) +* A (ticket browser): Local Storage. (line 22) +* c (ticket viewer): Ticket Viewer. (line 60) +* C (ticket viewer): Ticket Viewer. (line 63) +* DEL (ticket browser): Ticket Browser. (line 77) +* DEL (ticket viewer): Ticket Viewer. (line 72) +* F (ticket viewer): Ticket Viewer. (line 56) +* g (ticket browser): Ticket Browser. (line 48) +* G (ticket browser): Ticket Browser. (line 51) +* g (ticket viewer): Ticket Viewer. (line 66) +* h (ticket viewer): Ticket Viewer. (line 75) +* m (ticket browser): Ticket Browser. (line 80) +* M (ticket browser): Batch Operations. (line 18) +* m (ticket viewer): Ticket Viewer. (line 40) +* M (ticket viewer): Ticket Viewer. (line 43) +* n (ticket browser): Ticket Browser. (line 39) +* n (ticket viewer): Ticket Viewer. (line 28) +* N (ticket viewer): Ticket Viewer. (line 31) +* o (ticket browser): Ticket Browser. (line 68) +* p (ticket browser): Ticket Browser. (line 42) +* P (ticket browser): Ticket Browser. (line 83) +* p (ticket viewer): Ticket Viewer. (line 34) +* q (ticket browser): Ticket Browser. (line 36) +* q (ticket viewer): Ticket Viewer. (line 25) +* r (ticket browser): Ticket Browser. (line 65) +* RET (ticket browser): Ticket Browser. (line 45) +* s (ticket browser): Ticket Browser. (line 55) +* S (ticket browser): Ticket Browser. (line 58) +* SPC (ticket browser): Ticket Browser. (line 74) +* SPC (ticket viewer): Ticket Viewer. (line 69) +* t (ticket browser): Ticket Browser. (line 71) +* t (ticket viewer): Ticket Viewer. (line 48) +* t (ticket viewer) <1>: Ticket Viewer. (line 51) +* V (ticket viewer): Ticket Viewer. (line 37) + + + +Tag Table: +Node: Top680 +Node: Introduction2956 +Node: Installation3563 +Node: Queries4542 +Node: Query Compiler5104 +Node: Query Language5745 +Node: Ticket Browser8184 +Node: Ticket Browser Display10656 +Node: Ticket Browser Sorting12647 +Node: Ticket Browser Filtering14597 +Node: Multiple Ticket Browsers16140 +Node: Ticket Viewer17309 +Node: Gnus Integration19481 +Node: Tracking Updates21769 +Node: Batch Operations22846 +Node: Local Storage24026 +Node: Copying25104 +Node: The GNU FDL62653 +Node: Concept Index85045 +Node: Function Index86626 +Node: Variable Index89976 +Node: Keybinding Index90352 + +End Tag Table diff --git a/rt-liberation.el b/rt-liberation.el index 6649bb0..f30e048 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -5,7 +5,7 @@ ;; Author: Yoni Rabkin ;; Authors: Aaron S. Hawley , John Sullivan ;; Maintainer: Yoni Rabkin -;; Version: 1.01 +;; Version: 1.31 ;; Keywords: rt, tickets ;; Package-Type: multi ;; url: http://www.nongnu.org/rtliber/ diff --git a/rt-liberation.info b/rt-liberation.info deleted file mode 100644 index 0f3b847..0000000 --- a/rt-liberation.info +++ /dev/null @@ -1,2042 +0,0 @@ -This is rt-liberation.info, produced by makeinfo version 6.1 from -rt-liberation.texinfo. - -(C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software -Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free Documentation License, - Version 1.2 or any later version published by the Free Software - Foundation; with no Invariant Sections, no Front-Cover Texts, and - no Back-Cover Texts. A copy of the license is included in the - section entitled "GNU Free Documentation License". -INFO-DIR-SECTION Emacs -START-INFO-DIR-ENTRY -* rt-liberation: (rt-liberation). Emacs Interface to RT -END-INFO-DIR-ENTRY - - -File: rt-liberation.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) - -The rt-liberation Manual -************************ - -This is the Manual for the rt-liberation system - - (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2020 Free Software -Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free Documentation License, - Version 1.2 or any later version published by the Free Software - Foundation; with no Invariant Sections, no Front-Cover Texts, and - no Back-Cover Texts. A copy of the license is included in the - section entitled "GNU Free Documentation License". - -* Menu: - -* Introduction:: Introduction to rt-liberation. -* Installation:: Setup rt-liberation to work on the system. - -Using rt-liberation -* Queries:: Retrieve particular tickets from the server. -* Ticket Browser:: Browse the query results. -* Ticket Viewer:: Interface to query results. - -Extensions -* Gnus Integration:: Sending email to the RT server via Gnus. -* Tracking Updates:: Keeping up to date with ticket changes. -* Batch Operations:: Performing operations on batches of tickets. -* Local Storage:: Associate arbitrary data with tickets. - -Copying and license -* Copying:: The GNU General Public License gives you - permission to redistribute rt-liberation - on certain terms; it also explains that - there is no warranty. - -* The GNU FDL:: The license for this documentation. - -Indices -* Concept Index:: -* Function Index:: -* Variable Index:: -* Keybinding Index:: - - -- The Detailed Node Listing -- - -Queries - -* Query Compiler:: Compiling Emacs Lisp to TicketSQL. -* Query Language:: A description of the Sexp-based language. - -Ticket Browser - -* Ticket Browser Display:: How tickets are displayed in the browser. -* Ticket Browser Sorting:: How tickets are sorted in the browser. -* Ticket Browser Filtering:: How to filter tickets out of the browser. -* Multiple Ticket Browsers:: More than one ticket browser buffer. - - - -File: rt-liberation.info, Node: Introduction, Next: Installation, Up: Top - -1 Introduction -************** - -rt-liberation is a GNU/Emacs package for working with the Request -Tracker (henceforth abbreviated as just "RT") software from Best -Practical Solutions. RT has an interactive Web interface, a command -line interface (the "RT CLI"), and a REST interface. rt-liberation uses -the RT REST interface to communicate with the RT server. - - rt-liberation allows sending search queries to the RT server, -browsing the resulting tickets, viewing the tickets' contents and -performing operations on the tickets. - - -File: rt-liberation.info, Node: Installation, Next: Queries, Prev: Introduction, Up: Top - -2 Installation -************** - -rt-liberation is available via GNU ELPA. - - If you install rt-liberation manually instead you'll need to tell -Emacs where to find it, and tell Emacs to load the package: - - (add-to-list 'load-path "/PATH/TO/rt-liberation/") - - (require 'rt-liberation) - - rt-liberation needs to be configured in your ~/.emacs, an ~/.rt-liber -file, or similar. - - Tell rt-liberation where to find the RT server's REST interface: - - (setq rt-liber-rest-url "rt.example.org") - - rt-liberation can issue a command to "take" a ticket (that is, assign -it to yourself). For this the variable RT-LIBER-USERNAME must be set: - - (setq rt-liber-username "someuser") - - rt-liberation can also launch a Web browser to visit a ticket. For -that to work the base URL needs to be set in RT-LIBER-BASE-URL. For -example: - - (setq rt-liber-base-url "https://rt.foo.org/") - - -File: rt-liberation.info, Node: Queries, Next: Ticket Browser, Prev: Installation, Up: Top - -3 Queries -********* - -A typical RT server is meant to manage a large amount of tickets. Much -more that would be convenient to view all at once. Instead queries are -used to view only a subset of the tickets on the server. - - rt-liberation has its own Sexp-based query language which maps to -RT's TicketSQL language. - -* Menu: - -* Query Compiler:: Compiling Emacs Lisp to TicketSQL. -* Query Language:: A description of the Sexp-based language. - - -File: rt-liberation.info, Node: Query Compiler, Next: Query Language, Up: Queries - -3.1 Query Compiler -================== - -In order to browse and view tickets a list of needs to be requested from -the RT server. Typically the tickets answer some kind of criteria, for -example "tickets no older than a week owned by me which have \"foobar\" -in their subject line". In RT these criteria are formulated with -"TicketSQL" queries; a structured query language specific to RT. - - rt-liberation provides a query compiler function to compile Emacs -Lisp symbolic expressions into TicketSQL. The query compiler supports a -number of TicketSQL tokens. - - -File: rt-liberation.info, Node: Query Language, Prev: Query Compiler, Up: Queries - -3.2 Query Language -================== - -rt-liberation's Sexp-based query language covers a portion of the -TicketSQL language. Here are some of the supported TicketSQL tokens: -Boolean tokens as a means of combining query subsections: "and", "or", -"not". LIKE attribute tokens: "subject", "content". - - For example here is a query with both Boolean and LIKE tokens: - - (rt-liber-compile-query - (and (queue "bugs") - (content "gnu"))) - - ==> "Queue = 'bugs' AND Content LIKE 'gnu'" - - We can also express negation (note that the compiler produces "!=" -and "NOT LIKE" for negation depending on the context): - - (rt-liber-compile-query - (and (queue "bugs") - (not (owner "Nobody")) - (not (content "sprigz")) - (status "new"))) - - ==> "Queue = 'licensing' AND Owner != 'Nobody' \ - AND Content NOT LIKE 'sprigz' AND Status = 'new'" - - Attribute tokens which match an attribute to a specific field such -as: "owner", "status" and "queue". Temporal tokens which limit the -search results to tickets within a certain time interval: "created" and -"lastupdated". Note that temporal keywords such as "created" always -accept two arguments: BEFORE and AFTER. When either BEFORE or AFTER -aren't needed, use NIL instead. - - One of the advantages of being able to express the TicketSQL queries -as Emacs Lisp is to be able to express queries using Emacs Lisp -functions. - - Here is a slightly more involved example to illustrate: - - (rt-liber-compile-query - (and (queue "bugs") - (owner "me@myaddress.com") - (status "open") - (lastupdated nil - (format-time-string - "%Y-%m-%d" - (seconds-to-time - (- (time-to-seconds (current-time)) - (* 60 60 24 7))))))) - - ==> "Queue = 'bugs' AND Owner = 'me@myaddress.com' AND Status = 'open' AND LastUpdated > '2009-03-30'" - - Here is an example of how the ticket browser and compiler can be used -in function calls: - - (defun rt-liber-display-ticket (ticket-id) - "Display ticket with TICKET-ID in the ticket-browser." - (interactive "MTicket ID: ") - (rt-liber-browse-query - (rt-liber-compile-query - (and (queue "complaints") - (id ticket-id))))) - - -File: rt-liberation.info, Node: Ticket Browser, Next: Ticket Viewer, Prev: Queries, Up: Top - -4 Ticket Browser -**************** - -The ticket browser is a special buffer which provides a convenient -interface to the results of a server query. The ticket browser can be -started by invoking: (rt-liber-browse-query QUERY), where QUERY is a -TicketSQL query. The TicketSQL query can be entered manually as a -string or as the return value of the query compiler. - - -- Function: rt-liber-browse-query QUERY &optional NEW - Runs QUERY against the server and launches the browser. - - If NEW is non-nil then the query results will be displayed in a new - buffer, otherwise the query results will override the contents of - the existing ticket browser buffer. If NEW is a string then that - will be the name of the new buffer. - - The TicketSQL query can be the return value of the query compiler. -For example: - - (rt-liber-browse-query - (rt-liber-compile-query - (and (queue "bugs") - (content "gnu"))) - - Since the return value of the query compiler is just a TicketSQL -string, the following is equivalent: - - (rt-liber-browse-query "Queue = 'bugs' AND Content LIKE 'gnu'") - - The ticket browser defines a number of commands: - -'q' - Bury the ticket browser buffer. - -'n' - Move point to the next ticket. - -'p' - Move point to the previous ticket. - -'RET' - Visit the ticket at point in the *Note Ticket Viewer::. - -'g' - Refresh the contents of the browser buffer. - -'G' - Refresh the contents of the browser buffer. Return point to the - current ticket after the refresh (if possible). - -'s' - Mark the ticket as spam. - -'S' - Delete marked tickets as spam (requires rt-liberation-multi - package). - -'a' - Assign the ticket to a user. - -'r' - Mark the ticket as "resolved". - -'o' - Mark the ticket as "open". - -'t' - Assign the ticket at point to RT-LIBER-USERNAME. - -'SPC' - Scroll the text of the ticket browser upward. - -'DEL' - Scroll the text of the ticket browser downward. - -'m' - Move the ticket to a different queue. - -'P' - Set the numerical priority level of the ticket at point. - -* Menu: - -* Ticket Browser Display:: How tickets are displayed in the browser. -* Ticket Browser Sorting:: How tickets are sorted in the browser. -* Ticket Browser Filtering:: How to filter tickets out of the browser. -* Multiple Ticket Browsers:: More than one ticket browser buffer. - - -File: rt-liberation.info, Node: Ticket Browser Display, Next: Ticket Browser Sorting, Up: Ticket Browser - -4.1 Ticket Browser Display -========================== - -The ticket browser displays the tickets in the browser by calling -"rt-liber-ticketlist-browser-redraw-f" which can be changed and -customized. Any implementation of -"rt-liber-ticketlist-browser-redraw-f" must leave point at the end of -the ticket text. - - The ticket data itself can be displayed using rt-liberation ticket -format string %-sequences: - -%i - ID number of the ticket in the RT database. -%s - Subject line. -%c - Ticket creation time. The format to display the time is specified - in the variable RT-LIBER-BROWSER-TIME-FORMAT-STRING. -%S - Ticket status ("open", "new" etc.) -%r - Whether the ticket is resolved. -%R - Requestor/s -%C - Creator of the ticket. -%o - Owner of the ticket. -%q - The queue originating the ticket. -%p - The numerical priority of the ticket - - Here is an example implementation of -"rt-liber-ticketlist-browser-redraw-f" showing the use of the -%-sequences. Note the use of text properties to add color to ticket -text. The use of text properties as opposed to font-locking is meant to -ease customization because otherwise any change in ticket display would -break the font-locking regular expressions. - - (defun rt-liber-ticketlist-browser-redraw-f (ticket) - "Display TICKET." - (insert (rt-liber-format "[%c] %i" ticket)) - (add-text-properties (point-at-bol) - (point-at-eol) - '(face rt-liber-ticket-face)) - (newline) - (insert (rt-liber-format " [%S] %s" ticket)) - (newline) - (insert (rt-liber-format " %o <== %R" ticket))) - - The function "rt-liber-high-priority-p" can be used to apply a -different face or text to a ticket if it is high priority. A ticket is -considered high priority if its value is strictly higher than -RT-LIBER-BROWSER-PRIORITY-CUTOFF - - -File: rt-liberation.info, Node: Ticket Browser Sorting, Next: Ticket Browser Filtering, Prev: Ticket Browser Display, Up: Ticket Browser - -4.2 Ticket Browser Sorting -========================== - -The tickets in the browser are displayed by default in reverse -chronological order. Ticket sorting is done by a call to -"rt-liber-browser-default-sorting-function". - - Other sorting orders can be used by binding -"rt-liber-browser-default-sorting-function" to a different function. To -ease writing such functions rt-liberation provides two predicate -functions to perform comparisons between ticket objects: - - -- Function: rt-liber-lex-lessthan-p a b field - Return true if A is lexicographically less than B in FIELD. - - Here is an example of sorting tickets lexicographically by owner - name using "rt-liber-lex-lessthan-p" (note that you can feed - "rt-liber-lex-lessthan-p" a date/time string and it will sort it - just fine except that it wouldn't make any sense): - - (defun rt-liber-sort-by-owner (ticket-list) - "Sort TICKET-LIST lexicographically by owner." - (rt-liber-sort-ticket-list - ticket-list - #'(lambda (a b) - (rt-liber-lex-lessthan-p a b "Owner")))) - - -- Function: rt-liber-time-lessthan-p a b field - Return t if A is chronologically less than B in FIELD. - - Here is an example of sorting tickets lexicographically by owner - name using "rt-liber-time-lessthan-p" (note that feeding - "rt-liber-time-lessthan-p" anything but a date/time string, in this - case "Created" contains a date, will result in an error being - signaled). - - (defun rt-liber-sort-by-time-created (ticket-list) - "Sort TICKET-LIST in reverse chronological order." - (reverse - (rt-liber-sort-ticket-list - ticket-list - #'(lambda (a b) - (rt-liber-time-lessthan-p a b "Created"))))) - - -File: rt-liberation.info, Node: Ticket Browser Filtering, Next: Multiple Ticket Browsers, Prev: Ticket Browser Sorting, Up: Ticket Browser - -4.3 Ticket Browser Filtering -============================ - -The Ticket Browser can also filter out (that is, not display) certain -tickets based on particular criteria. This probably shouldn't be used -instead of a properly formed RT query, but when used in conjunction with -correctly formulated queries it becomes a powerful tool. - - During ticket display processing the Ticket Browser will call the -function pointed to by RT-LIBER-BROWSER-DEFAULT-FILTER-FUNCTION on each -ticket, passing the function the ticket alist as a single argument. The -function is set by default to "rt-liber-default-filter-f", which is a -function which will display all tickets and filter none. - - If any tickets are filtered, the Ticket Browser will display the -filtered ticket count at the bottom ticket listing. - - Here is a simple example of how to filter out all of the tickets -which have a status of "deleted". - - First we define a custom filter function. Note how it accepts a -single argument, which is the ticket alist, and returns nil if the -ticket is to be filtered. - - (defun rt-liber-browser-deleted-filter (ticket) - (not - (and ticket - (string= (cdr (assoc "Status" ticket)) - "deleted")))) - - Then we assign that function to be our default filtering function: - - (setq rt-liber-browser-default-filter-function - 'rt-liber-browser-deleted-filter) - - -File: rt-liberation.info, Node: Multiple Ticket Browsers, Prev: Ticket Browser Filtering, Up: Ticket Browser - -4.4 Multiple Ticket Browsers -============================ - -It is sometimes useful to rename the ticket browser buffer to something -more informative than the default RT-LIBER-BROWSER-BUFFER-NAME, -especially if there are multiple ticket browsers. - - Changing a ticket browser's name can be done normally with -'rename-buffer', but it is also possible to name the ticket browser when -it is created. In the following example two ticket browser buffers will -be created displaying the query results and named "*updated by -supervisor*" and "*new tickets*" respectively: - - (defun rt-liber-daily-rounds () - (interactive) - - (rt-liber-browse-query - (rt-liber-compile-query - (and (queue "complaints") - (owner "lem.e.tweakit") - (status "open") - (lastupdatedby "molly.manager"))) - "*updated by supervisor*") - - (rt-liber-browse-query - (rt-liber-compile-query - (and (queue "complaints") - (owner "Nobody") - (status "new"))) - "*new tickets*")) - - -File: rt-liberation.info, Node: Ticket Viewer, Next: Gnus Integration, Prev: Ticket Browser, Up: Top - -5 Ticket Viewer -*************** - -The ticket viewer is an interface for viewing the contents of a ticket. -It provides font-locking to make reading the contents easier via -RT-LIBER-VIEWER-FONT-LOCK-KEYWORDS and a number of key-bindings. - - The ticket viewer provides key-bindings to help compose emails to -send to the RT email interface. The key-bindings for composing email -described below are generic, what actually happens when you invoke them -depends on the email-backend system you have installed into -rt-liberation. 'rt-liberation-gnus.el' provides integration with Gnus, -*Note Gnus Integration::. - - Setting RT-LIBER-JUMP-TO-LATEST to 't' will cause the viewer to -automatically scroll to the latest comment in a ticket when that ticket -is visited. By default RT-LIBER-JUMP-TO-LATEST is set to 'nil'. - - When in the ticket viewer buffer, invoking -"rt-liber-viewer-take-ticket" will "take" the ticket. - -'q' - Bury the ticket viewer buffer. - -'n' - Move point to the next section in ticket. - -'N' - Move point to the newest correspondence section, if any. - -'p' - Move point to the previous section in ticket. - -'V' - Visit the current ticket in a Web browser. - -'m' - Compose an answer to the current ticket. - -'M' - Compose an answer to the current ticket. The content section - around point will be inserted into the email body and commented - out. - -'t' - Compose a provisional answer to the current ticket. - -'T' - Compose a provisional answer to the current ticket. The content - section around point will be inserted into the email body and - commented out. - -'F' - Compose an answer to the current ticket. The content section - around point will be inserted into the email body verbatim. - -'c' - Compose a comment for the current ticket. - -'C' - Comment on the ticket using the current context - -'g' - Refresh and redisplay the current ticket. - -'SPC' - Scroll text of ticket viewer upward. - -'DEL' - Scroll text of ticket viewer downward. - -'h' - Display the associated ticket in the ticket browser. - - -File: rt-liberation.info, Node: Gnus Integration, Next: Tracking Updates, Prev: Ticket Viewer, Up: Top - -6 Gnus Integration -****************** - -The file 'rt-liberation-gnus.el' implements integration with Gnus for -composing emails. To enable the feature, 'require' it after loading -rt-liberation: - - (require 'rt-liberation-gnus) - - In order for rt-liberation-gnus to be useful a few variables need to -be specialized. The following is example code which sets these -variables. Below is a thorough description of those variables. - - (setq rt-liber-gnus-comment-address "our-rtserver-comment@ourserver.org" - rt-liber-gnus-address "our-rtserver@ourserver.org" - rt-liber-gnus-subject-name "ourserver.org") - - -- User Option: rt-liber-gnus-address - RT-LIBER-GNUS-ADDRESS is the email address which is configured in - the RT server email interface for sending a response to the - ticket's requestor. - -- User Option: rt-liber-gnus-comment-address - RT-LIBER-GNUS-COMMENT-ADDRESS is the email address which is - configured in the RT server email interface for adding a comment - under the ticket in question. - -- User Option: rt-liber-gnus-subject-name - RT-LIBER-GNUS-SUBJECT-NAME is a string, typically included at the - beginning of the square brackets in the subject. The string is a - part of the subject line which helps the RT server recognize the - email. - - Gnus posting styles controlled by GNUS-POSTING-STYLES can be -customized for rt-liberation-gnus by using the variable RT-LIBER-GNUS-P, -which is only non-nil when rt-liberation-gnus launches a Gnus message -buffer. - - Here is example code which uses RT-LIBER-GNUS-P to override the -signature in the default posting style with one special to -rt-liberation. Headers can be added and removed in a similar manner. - - (setq gnus-posting-styles - '((".*" - (name "Lemm E. Hackitt") - (address "Lemm@hack.it") - (signature-file "~/sig.txt") - ("X-Ethics" "Use GNU")) - (rt-liber-gnus-p - (signature-file "~/rt-liber-sig.txt")))) - - Once rt-liberation-gnus is loaded and customized the key-bindings in -the Viewer will be able to call into it, *Note Ticket Viewer::. - - -File: rt-liberation.info, Node: Tracking Updates, Next: Batch Operations, Prev: Gnus Integration, Up: Top - -7 Tracking Updates -****************** - -The functions in 'rt-liberation-update.el' help keep up with updates to -the ticket database. To enable the feature, 'require' it after loading -rt-liberation: - - (require 'rt-liberation-update) - - Then set RT-LIBER-UPDATE-DEFAULT-QUEUE to be the name of the queue to -watch for updates. For example: - - (setq rt-liber-update-default-queue "complaints") - - -- Function: rt-liber-update &optional no-update - 'rt-liber-update' is an interactive function which runs a query - against the RT server asking for the tickets which have been - updated since the time 'rt-liber-update' was last run (each time it - runs, it leaves a time-stamp). If no time-stamp is found, for - instance when you run 'rt-liber-update' for the first time, today's - date is used. - - With the NO-UPDATE prefix, 'rt-liber-update' will not update the - time-stamp so that the next invocation will produce the same - result. - - -File: rt-liberation.info, Node: Batch Operations, Next: Local Storage, Prev: Tracking Updates, Up: Top - -8 Batch Operations -****************** - -The extension 'rt-liberation-multi.el' implements performing batch -operations on groups of tickets. It works in two stages: First mark an -arbitrary number of tickets within the same buffer then call a batch -operation function on them. The batch operation functions work the same -way as function which work on single tickets only that they iterate -through all of the marked tickets. - - To enable batch operations first load 'rt-liberation-multi.el': - - (require 'rt-liberation-storage) - -'M' - Mark the ticket at point for future action. If the ticket at point - is already marked then unmark it. - - -- Function: rt-liber-multi-set-status-open - Set the status of all the marked tickets to "open". - - -- Function: rt-liber-multi-set-status-resolved - Set the status of all the marked tickets to "resolved. - - -- Function: rt-liber-multi-assign name - Assign all of the marked tickets to NAME. - - -- Function: rt-liber-multi-flag-as-spam-and-delete - Set the status of all the marked tickets to "is-spam" and delete. - - -File: rt-liberation.info, Node: Local Storage, Next: Copying, Prev: Batch Operations, Up: Top - -9 Local Storage -*************** - -'rt-liberation-storage.el' implements associating arbitrary ancillary -data with tickets. The data is stored locally and is not sent to the RT -server. - - To enable local storage first load 'rt-liberation-storage.el': - - (require 'rt-liberation-storage) - - Then enable the display of ancillary data with: - - (setq rt-liber-anc-p t) - - The associated data is edited and displayed in the ticket browser -with the following command key: - -'A' - Associate text with the ticket at point. You will be prompted to - enter a string of text. - - Once text is associated with a ticket it will be displayed alongside -that ticket in the ticket browser. This particular feature lends itself -to creating private annotations about tickets. - - The implementation distributed with rt-liberation allows associating -text with tickets but is not limited to text. The same implementation -can be extended to associate any arbitrary data with any ticket. - - -File: rt-liberation.info, Node: Copying, Next: The GNU FDL, Prev: Local Storage, Up: Top - -10 The GNU General Public License. -********************************** - - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - - Everyone is permitted to copy and distribute verbatim copies of this - license document, but changing it is not allowed. - -Preamble -======== - -The GNU General Public License is a free, copyleft license for software -and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - -TERMS AND CONDITIONS -==================== - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public - License. - - "Copyright" also means copyright-like laws that apply to other - kinds of works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this - License. Each licensee is addressed as "you". "Licensees" and - "recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the - work in a fashion requiring copyright permission, other than the - making of an exact copy. The resulting work is called a "modified - version" of the earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work - based on the Program. - - To "propagate" a work means to do anything with it that, without - permission, would make you directly or secondarily liable for - infringement under applicable copyright law, except executing it on - a computer or modifying a private copy. Propagation includes - copying, distribution (with or without modification), making - available to the public, and in some countries other activities as - well. - - To "convey" a work means any kind of propagation that enables other - parties to make or receive copies. Mere interaction with a user - through a computer network, with no transfer of a copy, is not - conveying. - - An interactive user interface displays "Appropriate Legal Notices" - to the extent that it includes a convenient and prominently visible - feature that (1) displays an appropriate copyright notice, and (2) - tells the user that there is no warranty for the work (except to - the extent that warranties are provided), that licensees may convey - the work under this License, and how to view a copy of this - License. If the interface presents a list of user commands or - options, such as a menu, a prominent item in the list meets this - criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work - for making modifications to it. "Object code" means any non-source - form of a work. - - A "Standard Interface" means an interface that either is an - official standard defined by a recognized standards body, or, in - the case of interfaces specified for a particular programming - language, one that is widely used among developers working in that - language. - - The "System Libraries" of an executable work include anything, - other than the work as a whole, that (a) is included in the normal - form of packaging a Major Component, but which is not part of that - Major Component, and (b) serves only to enable use of the work with - that Major Component, or to implement a Standard Interface for - which an implementation is available to the public in source code - form. A "Major Component", in this context, means a major - essential component (kernel, window system, and so on) of the - specific operating system (if any) on which the executable work - runs, or a compiler used to produce the work, or an object code - interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all - the source code needed to generate, install, and (for an executable - work) run the object code and to modify the work, including scripts - to control those activities. However, it does not include the - work's System Libraries, or general-purpose tools or generally - available free programs which are used unmodified in performing - those activities but which are not part of the work. For example, - Corresponding Source includes interface definition files associated - with source files for the work, and the source code for shared - libraries and dynamically linked subprograms that the work is - specifically designed to require, such as by intimate data - communication or control flow between those subprograms and other - parts of the work. - - The Corresponding Source need not include anything that users can - regenerate automatically from other parts of the Corresponding - Source. - - The Corresponding Source for a work in source code form is that - same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of - copyright on the Program, and are irrevocable provided the stated - conditions are met. This License explicitly affirms your unlimited - permission to run the unmodified Program. The output from running - a covered work is covered by this License only if the output, given - its content, constitutes a covered work. This License acknowledges - your rights of fair use or other equivalent, as provided by - copyright law. - - You may make, run and propagate covered works that you do not - convey, without conditions so long as your license otherwise - remains in force. You may convey covered works to others for the - sole purpose of having them make modifications exclusively for you, - or provide you with facilities for running those works, provided - that you comply with the terms of this License in conveying all - material for which you do not control copyright. Those thus making - or running the covered works for you must do so exclusively on your - behalf, under your direction and control, on terms that prohibit - them from making any copies of your copyrighted material outside - their relationship with you. - - Conveying under any other circumstances is permitted solely under - the conditions stated below. Sublicensing is not allowed; section - 10 makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological - measure under any applicable law fulfilling obligations under - article 11 of the WIPO copyright treaty adopted on 20 December - 1996, or similar laws prohibiting or restricting circumvention of - such measures. - - When you convey a covered work, you waive any legal power to forbid - circumvention of technological measures to the extent such - circumvention is effected by exercising rights under this License - with respect to the covered work, and you disclaim any intention to - limit operation or modification of the work as a means of - enforcing, against the work's users, your or third parties' legal - rights to forbid circumvention of technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you - receive it, in any medium, provided that you conspicuously and - appropriately publish on each copy an appropriate copyright notice; - keep intact all notices stating that this License and any - non-permissive terms added in accord with section 7 apply to the - code; keep intact all notices of the absence of any warranty; and - give all recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, - and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to - produce it from the Program, in the form of source code under the - terms of section 4, provided that you also meet all of these - conditions: - - a. The work must carry prominent notices stating that you - modified it, and giving a relevant date. - - b. The work must carry prominent notices stating that it is - released under this License and any conditions added under - section 7. This requirement modifies the requirement in - section 4 to "keep intact all notices". - - c. You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable - section 7 additional terms, to the whole of the work, and all - its parts, regardless of how they are packaged. This License - gives no permission to license the work in any other way, but - it does not invalidate such permission if you have separately - received it. - - d. If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has - interactive interfaces that do not display Appropriate Legal - Notices, your work need not make them do so. - - A compilation of a covered work with other separate and independent - works, which are not by their nature extensions of the covered - work, and which are not combined with it such as to form a larger - program, in or on a volume of a storage or distribution medium, is - called an "aggregate" if the compilation and its resulting - copyright are not used to limit the access or legal rights of the - compilation's users beyond what the individual works permit. - Inclusion of a covered work in an aggregate does not cause this - License to apply to the other parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms - of sections 4 and 5, provided that you also convey the - machine-readable Corresponding Source under the terms of this - License, in one of these ways: - - a. Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b. Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that - product model, to give anyone who possesses the object code - either (1) a copy of the Corresponding Source for all the - software in the product that is covered by this License, on a - durable physical medium customarily used for software - interchange, for a price no more than your reasonable cost of - physically performing this conveying of source, or (2) access - to copy the Corresponding Source from a network server at no - charge. - - c. Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, - and only if you received the object code with such an offer, - in accord with subsection 6b. - - d. Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to - the Corresponding Source in the same way through the same - place at no further charge. You need not require recipients - to copy the Corresponding Source along with the object code. - If the place to copy the object code is a network server, the - Corresponding Source may be on a different server (operated by - you or a third party) that supports equivalent copying - facilities, provided you maintain clear directions next to the - object code saying where to find the Corresponding Source. - Regardless of what server hosts the Corresponding Source, you - remain obligated to ensure that it is available for as long as - needed to satisfy these requirements. - - e. Convey the object code using peer-to-peer transmission, - provided you inform other peers where the object code and - Corresponding Source of the work are being offered to the - general public at no charge under subsection 6d. - - A separable portion of the object code, whose source code is - excluded from the Corresponding Source as a System Library, need - not be included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means - any tangible personal property which is normally used for personal, - family, or household purposes, or (2) anything designed or sold for - incorporation into a dwelling. In determining whether a product is - a consumer product, doubtful cases shall be resolved in favor of - coverage. For a particular product received by a particular user, - "normally used" refers to a typical or common use of that class of - product, regardless of the status of the particular user or of the - way in which the particular user actually uses, or expects or is - expected to use, the product. A product is a consumer product - regardless of whether the product has substantial commercial, - industrial or non-consumer uses, unless such uses represent the - only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, - procedures, authorization keys, or other information required to - install and execute modified versions of a covered work in that - User Product from a modified version of its Corresponding Source. - The information must suffice to ensure that the continued - functioning of the modified object code is in no case prevented or - interfered with solely because modification has been made. - - If you convey an object code work under this section in, or with, - or specifically for use in, a User Product, and the conveying - occurs as part of a transaction in which the right of possession - and use of the User Product is transferred to the recipient in - perpetuity or for a fixed term (regardless of how the transaction - is characterized), the Corresponding Source conveyed under this - section must be accompanied by the Installation Information. But - this requirement does not apply if neither you nor any third party - retains the ability to install modified object code on the User - Product (for example, the work has been installed in ROM). - - The requirement to provide Installation Information does not - include a requirement to continue to provide support service, - warranty, or updates for a work that has been modified or installed - by the recipient, or for the User Product in which it has been - modified or installed. Access to a network may be denied when the - modification itself materially and adversely affects the operation - of the network or violates the rules and protocols for - communication across the network. - - Corresponding Source conveyed, and Installation Information - provided, in accord with this section must be in a format that is - publicly documented (and with an implementation available to the - public in source code form), and must require no special password - or key for unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of - this License by making exceptions from one or more of its - conditions. Additional permissions that are applicable to the - entire Program shall be treated as though they were included in - this License, to the extent that they are valid under applicable - law. If additional permissions apply only to part of the Program, - that part may be used separately under those permissions, but the - entire Program remains governed by this License without regard to - the additional permissions. - - When you convey a copy of a covered work, you may at your option - remove any additional permissions from that copy, or from any part - of it. (Additional permissions may be written to require their own - removal in certain cases when you modify the work.) You may place - additional permissions on material, added by you to a covered work, - for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material - you add to a covered work, you may (if authorized by the copyright - holders of that material) supplement the terms of this License with - terms: - - a. Disclaiming warranty or limiting liability differently from - the terms of sections 15 and 16 of this License; or - - b. Requiring preservation of specified reasonable legal notices - or author attributions in that material or in the Appropriate - Legal Notices displayed by works containing it; or - - c. Prohibiting misrepresentation of the origin of that material, - or requiring that modified versions of such material be marked - in reasonable ways as different from the original version; or - - d. Limiting the use for publicity purposes of names of licensors - or authors of the material; or - - e. Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f. Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified - versions of it) with contractual assumptions of liability to - the recipient, for any liability that these contractual - assumptions directly impose on those licensors and authors. - - All other non-permissive additional terms are considered "further - restrictions" within the meaning of section 10. If the Program as - you received it, or any part of it, contains a notice stating that - it is governed by this License along with a term that is a further - restriction, you may remove that term. If a license document - contains a further restriction but permits relicensing or conveying - under this License, you may add to a covered work material governed - by the terms of that license document, provided that the further - restriction does not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you - must place, in the relevant source files, a statement of the - additional terms that apply to those files, or a notice indicating - where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in - the form of a separately written license, or stated as exceptions; - the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly - provided under this License. Any attempt otherwise to propagate or - modify it is void, and will automatically terminate your rights - under this License (including any patent licenses granted under the - third paragraph of section 11). - - However, if you cease all violation of this License, then your - license from a particular copyright holder is reinstated (a) - provisionally, unless and until the copyright holder explicitly and - finally terminates your license, and (b) permanently, if the - copyright holder fails to notify you of the violation by some - reasonable means prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is - reinstated permanently if the copyright holder notifies you of the - violation by some reasonable means, this is the first time you have - received notice of violation of this License (for any work) from - that copyright holder, and you cure the violation prior to 30 days - after your receipt of the notice. - - Termination of your rights under this section does not terminate - the licenses of parties who have received copies or rights from you - under this License. If your rights have been terminated and not - permanently reinstated, you do not qualify to receive new licenses - for the same material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or - run a copy of the Program. Ancillary propagation of a covered work - occurring solely as a consequence of using peer-to-peer - transmission to receive a copy likewise does not require - acceptance. However, nothing other than this License grants you - permission to propagate or modify any covered work. These actions - infringe copyright if you do not accept this License. Therefore, - by modifying or propagating a covered work, you indicate your - acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically - receives a license from the original licensors, to run, modify and - propagate that work, subject to this License. You are not - responsible for enforcing compliance by third parties with this - License. - - An "entity transaction" is a transaction transferring control of an - organization, or substantially all assets of one, or subdividing an - organization, or merging organizations. If propagation of a - covered work results from an entity transaction, each party to that - transaction who receives a copy of the work also receives whatever - licenses to the work the party's predecessor in interest had or - could give under the previous paragraph, plus a right to possession - of the Corresponding Source of the work from the predecessor in - interest, if the predecessor has it or can get it with reasonable - efforts. - - You may not impose any further restrictions on the exercise of the - rights granted or affirmed under this License. For example, you - may not impose a license fee, royalty, or other charge for exercise - of rights granted under this License, and you may not initiate - litigation (including a cross-claim or counterclaim in a lawsuit) - alleging that any patent claim is infringed by making, using, - selling, offering for sale, or importing the Program or any portion - of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this - License of the Program or a work on which the Program is based. - The work thus licensed is called the contributor's "contributor - version". - - A contributor's "essential patent claims" are all patent claims - owned or controlled by the contributor, whether already acquired or - hereafter acquired, that would be infringed by some manner, - permitted by this License, of making, using, or selling its - contributor version, but do not include claims that would be - infringed only as a consequence of further modification of the - contributor version. For purposes of this definition, "control" - includes the right to grant patent sublicenses in a manner - consistent with the requirements of this License. - - Each contributor grants you a non-exclusive, worldwide, - royalty-free patent license under the contributor's essential - patent claims, to make, use, sell, offer for sale, import and - otherwise run, modify and propagate the contents of its contributor - version. - - In the following three paragraphs, a "patent license" is any - express agreement or commitment, however denominated, not to - enforce a patent (such as an express permission to practice a - patent or covenant not to sue for patent infringement). To "grant" - such a patent license to a party means to make such an agreement or - commitment not to enforce a patent against the party. - - If you convey a covered work, knowingly relying on a patent - license, and the Corresponding Source of the work is not available - for anyone to copy, free of charge and under the terms of this - License, through a publicly available network server or other - readily accessible means, then you must either (1) cause the - Corresponding Source to be so available, or (2) arrange to deprive - yourself of the benefit of the patent license for this particular - work, or (3) arrange, in a manner consistent with the requirements - of this License, to extend the patent license to downstream - recipients. "Knowingly relying" means you have actual knowledge - that, but for the patent license, your conveying the covered work - in a country, or your recipient's use of the covered work in a - country, would infringe one or more identifiable patents in that - country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or - arrangement, you convey, or propagate by procuring conveyance of, a - covered work, and grant a patent license to some of the parties - receiving the covered work authorizing them to use, propagate, - modify or convey a specific copy of the covered work, then the - patent license you grant is automatically extended to all - recipients of the covered work and works based on it. - - A patent license is "discriminatory" if it does not include within - the scope of its coverage, prohibits the exercise of, or is - conditioned on the non-exercise of one or more of the rights that - are specifically granted under this License. You may not convey a - covered work if you are a party to an arrangement with a third - party that is in the business of distributing software, under which - you make payment to the third party based on the extent of your - activity of conveying the work, and under which the third party - grants, to any of the parties who would receive the covered work - from you, a discriminatory patent license (a) in connection with - copies of the covered work conveyed by you (or copies made from - those copies), or (b) primarily for and in connection with specific - products or compilations that contain the covered work, unless you - entered into that arrangement, or that patent license was granted, - prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting - any implied license or other defenses to infringement that may - otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement - or otherwise) that contradict the conditions of this License, they - do not excuse you from the conditions of this License. If you - cannot convey a covered work so as to satisfy simultaneously your - obligations under this License and any other pertinent obligations, - then as a consequence you may not convey it at all. For example, - if you agree to terms that obligate you to collect a royalty for - further conveying from those to whom you convey the Program, the - only way you could satisfy both those terms and this License would - be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have - permission to link or combine any covered work with a work licensed - under version 3 of the GNU Affero General Public License into a - single combined work, and to convey the resulting work. The terms - of this License will continue to apply to the part which is the - covered work, but the special requirements of the GNU Affero - General Public License, section 13, concerning interaction through - a network will apply to the combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new - versions of the GNU General Public License from time to time. Such - new versions will be similar in spirit to the present version, but - may differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the - Program specifies that a certain numbered version of the GNU - General Public License "or any later version" applies to it, you - have the option of following the terms and conditions either of - that numbered version or of any later version published by the Free - Software Foundation. If the Program does not specify a version - number of the GNU General Public License, you may choose any - version ever published by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future - versions of the GNU General Public License can be used, that - proxy's public statement of acceptance of a version permanently - authorizes you to choose that version for the Program. - - Later license versions may give you additional or different - permissions. However, no additional obligations are imposed on any - author or copyright holder as a result of your choosing to follow a - later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY - APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE - COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE - RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. - SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL - NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN - WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES - AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR - DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR - CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE - THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA - BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD - PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER - PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF - THE POSSIBILITY OF SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided - above cannot be given local legal effect according to their terms, - reviewing courts shall apply local law that most closely - approximates an absolute waiver of all civil liability in - connection with the Program, unless a warranty or assumption of - liability accompanies a copy of the Program in return for a fee. - -END OF TERMS AND CONDITIONS -=========================== - -How to Apply These Terms to Your New Programs -============================================= - -If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these -terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. - Copyright (C) YEAR NAME OF AUTHOR - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - Also add information on how to contact you by electronic and paper -mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - PROGRAM Copyright (C) YEAR NAME OF AUTHOR - This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type 'show c' for details. - - The hypothetical commands 'show w' and 'show c' should show the -appropriate parts of the General Public License. Of course, your -program's commands might be different; for a GUI interface, you would -use an "about box". - - You should also get your employer (if you work as a programmer) or -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. For more information on this, and how to apply and follow -the GNU GPL, see . - - The GNU General Public License does not permit incorporating your -program into proprietary programs. If your program is a subroutine -library, you may consider it more useful to permit linking proprietary -applications with the library. If this is what you want to do, use the -GNU Lesser General Public License instead of this License. But first, -please read . - - -File: rt-liberation.info, Node: The GNU FDL, Next: Concept Index, Prev: Copying, Up: Top - -11 GNU Free Documentation License -********************************* - - Version 1.2, November 2002 - - Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - 0. PREAMBLE - - The purpose of this License is to make a manual, textbook, or other - functional and useful document "free" in the sense of freedom: to - assure everyone the effective freedom to copy and redistribute it, - with or without modifying it, either commercially or - noncommercially. Secondarily, this License preserves for the - author and publisher a way to get credit for their work, while not - being considered responsible for modifications made by others. - - This License is a kind of "copyleft", which means that derivative - works of the document must themselves be free in the same sense. - It complements the GNU General Public License, which is a copyleft - license designed for free software. - - We have designed this License in order to use it for manuals for - free software, because free software needs free documentation: a - free program should come with manuals providing the same freedoms - that the software does. But this License is not limited to - software manuals; it can be used for any textual work, regardless - of subject matter or whether it is published as a printed book. We - recommend this License principally for works whose purpose is - instruction or reference. - - 1. APPLICABILITY AND DEFINITIONS - - This License applies to any manual or other work, in any medium, - that contains a notice placed by the copyright holder saying it can - be distributed under the terms of this License. Such a notice - grants a world-wide, royalty-free license, unlimited in duration, - to use that work under the conditions stated herein. The - "Document", below, refers to any such manual or work. Any member - of the public is a licensee, and is addressed as "you". You accept - the license if you copy, modify or distribute the work in a way - requiring permission under copyright law. - - A "Modified Version" of the Document means any work containing the - Document or a portion of it, either copied verbatim, or with - modifications and/or translated into another language. - - A "Secondary Section" is a named appendix or a front-matter section - of the Document that deals exclusively with the relationship of the - publishers or authors of the Document to the Document's overall - subject (or to related matters) and contains nothing that could - fall directly within that overall subject. (Thus, if the Document - is in part a textbook of mathematics, a Secondary Section may not - explain any mathematics.) The relationship could be a matter of - historical connection with the subject or with related matters, or - of legal, commercial, philosophical, ethical or political position - regarding them. - - The "Invariant Sections" are certain Secondary Sections whose - titles are designated, as being those of Invariant Sections, in the - notice that says that the Document is released under this License. - If a section does not fit the above definition of Secondary then it - is not allowed to be designated as Invariant. The Document may - contain zero Invariant Sections. If the Document does not identify - any Invariant Sections then there are none. - - The "Cover Texts" are certain short passages of text that are - listed, as Front-Cover Texts or Back-Cover Texts, in the notice - that says that the Document is released under this License. A - Front-Cover Text may be at most 5 words, and a Back-Cover Text may - be at most 25 words. - - A "Transparent" copy of the Document means a machine-readable copy, - represented in a format whose specification is available to the - general public, that is suitable for revising the document - straightforwardly with generic text editors or (for images composed - of pixels) generic paint programs or (for drawings) some widely - available drawing editor, and that is suitable for input to text - formatters or for automatic translation to a variety of formats - suitable for input to text formatters. A copy made in an otherwise - Transparent file format whose markup, or absence of markup, has - been arranged to thwart or discourage subsequent modification by - readers is not Transparent. An image format is not Transparent if - used for any substantial amount of text. A copy that is not - "Transparent" is called "Opaque". - - Examples of suitable formats for Transparent copies include plain - ASCII without markup, Texinfo input format, LaTeX input format, - SGML or XML using a publicly available DTD, and standard-conforming - simple HTML, PostScript or PDF designed for human modification. - Examples of transparent image formats include PNG, XCF and JPG. - Opaque formats include proprietary formats that can be read and - edited only by proprietary word processors, SGML or XML for which - the DTD and/or processing tools are not generally available, and - the machine-generated HTML, PostScript or PDF produced by some word - processors for output purposes only. - - The "Title Page" means, for a printed book, the title page itself, - plus such following pages as are needed to hold, legibly, the - material this License requires to appear in the title page. For - works in formats which do not have any title page as such, "Title - Page" means the text near the most prominent appearance of the - work's title, preceding the beginning of the body of the text. - - A section "Entitled XYZ" means a named subunit of the Document - whose title either is precisely XYZ or contains XYZ in parentheses - following text that translates XYZ in another language. (Here XYZ - stands for a specific section name mentioned below, such as - "Acknowledgements", "Dedications", "Endorsements", or "History".) - To "Preserve the Title" of such a section when you modify the - Document means that it remains a section "Entitled XYZ" according - to this definition. - - The Document may include Warranty Disclaimers next to the notice - which states that this License applies to the Document. These - Warranty Disclaimers are considered to be included by reference in - this License, but only as regards disclaiming warranties: any other - implication that these Warranty Disclaimers may have is void and - has no effect on the meaning of this License. - - 2. VERBATIM COPYING - - You may copy and distribute the Document in any medium, either - commercially or noncommercially, provided that this License, the - copyright notices, and the license notice saying this License - applies to the Document are reproduced in all copies, and that you - add no other conditions whatsoever to those of this License. You - may not use technical measures to obstruct or control the reading - or further copying of the copies you make or distribute. However, - you may accept compensation in exchange for copies. If you - distribute a large enough number of copies you must also follow the - conditions in section 3. - - You may also lend copies, under the same conditions stated above, - and you may publicly display copies. - - 3. COPYING IN QUANTITY - - If you publish printed copies (or copies in media that commonly - have printed covers) of the Document, numbering more than 100, and - the Document's license notice requires Cover Texts, you must - enclose the copies in covers that carry, clearly and legibly, all - these Cover Texts: Front-Cover Texts on the front cover, and - Back-Cover Texts on the back cover. Both covers must also clearly - and legibly identify you as the publisher of these copies. The - front cover must present the full title with all words of the title - equally prominent and visible. You may add other material on the - covers in addition. Copying with changes limited to the covers, as - long as they preserve the title of the Document and satisfy these - conditions, can be treated as verbatim copying in other respects. - - If the required texts for either cover are too voluminous to fit - legibly, you should put the first ones listed (as many as fit - reasonably) on the actual cover, and continue the rest onto - adjacent pages. - - If you publish or distribute Opaque copies of the Document - numbering more than 100, you must either include a machine-readable - Transparent copy along with each Opaque copy, or state in or with - each Opaque copy a computer-network location from which the general - network-using public has access to download using public-standard - network protocols a complete Transparent copy of the Document, free - of added material. If you use the latter option, you must take - reasonably prudent steps, when you begin distribution of Opaque - copies in quantity, to ensure that this Transparent copy will - remain thus accessible at the stated location until at least one - year after the last time you distribute an Opaque copy (directly or - through your agents or retailers) of that edition to the public. - - It is requested, but not required, that you contact the authors of - the Document well before redistributing any large number of copies, - to give them a chance to provide you with an updated version of the - Document. - - 4. MODIFICATIONS - - You may copy and distribute a Modified Version of the Document - under the conditions of sections 2 and 3 above, provided that you - release the Modified Version under precisely this License, with the - Modified Version filling the role of the Document, thus licensing - distribution and modification of the Modified Version to whoever - possesses a copy of it. In addition, you must do these things in - the Modified Version: - - A. Use in the Title Page (and on the covers, if any) a title - distinct from that of the Document, and from those of previous - versions (which should, if there were any, be listed in the - History section of the Document). You may use the same title - as a previous version if the original publisher of that - version gives permission. - - B. List on the Title Page, as authors, one or more persons or - entities responsible for authorship of the modifications in - the Modified Version, together with at least five of the - principal authors of the Document (all of its principal - authors, if it has fewer than five), unless they release you - from this requirement. - - C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. - - D. Preserve all the copyright notices of the Document. - - E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. - - F. Include, immediately after the copyright notices, a license - notice giving the public permission to use the Modified - Version under the terms of this License, in the form shown in - the Addendum below. - - G. Preserve in that license notice the full lists of Invariant - Sections and required Cover Texts given in the Document's - license notice. - - H. Include an unaltered copy of this License. - - I. Preserve the section Entitled "History", Preserve its Title, - and add to it an item stating at least the title, year, new - authors, and publisher of the Modified Version as given on the - Title Page. If there is no section Entitled "History" in the - Document, create one stating the title, year, authors, and - publisher of the Document as given on its Title Page, then add - an item describing the Modified Version as stated in the - previous sentence. - - J. Preserve the network location, if any, given in the Document - for public access to a Transparent copy of the Document, and - likewise the network locations given in the Document for - previous versions it was based on. These may be placed in the - "History" section. You may omit a network location for a work - that was published at least four years before the Document - itself, or if the original publisher of the version it refers - to gives permission. - - K. For any section Entitled "Acknowledgements" or "Dedications", - Preserve the Title of the section, and preserve in the section - all the substance and tone of each of the contributor - acknowledgements and/or dedications given therein. - - L. Preserve all the Invariant Sections of the Document, unaltered - in their text and in their titles. Section numbers or the - equivalent are not considered part of the section titles. - - M. Delete any section Entitled "Endorsements". Such a section - may not be included in the Modified Version. - - N. Do not retitle any existing section to be Entitled - "Endorsements" or to conflict in title with any Invariant - Section. - - O. Preserve any Warranty Disclaimers. - - If the Modified Version includes new front-matter sections or - appendices that qualify as Secondary Sections and contain no - material copied from the Document, you may at your option designate - some or all of these sections as invariant. To do this, add their - titles to the list of Invariant Sections in the Modified Version's - license notice. These titles must be distinct from any other - section titles. - - You may add a section Entitled "Endorsements", provided it contains - nothing but endorsements of your Modified Version by various - parties--for example, statements of peer review or that the text - has been approved by an organization as the authoritative - definition of a standard. - - You may add a passage of up to five words as a Front-Cover Text, - and a passage of up to 25 words as a Back-Cover Text, to the end of - the list of Cover Texts in the Modified Version. Only one passage - of Front-Cover Text and one of Back-Cover Text may be added by (or - through arrangements made by) any one entity. If the Document - already includes a cover text for the same cover, previously added - by you or by arrangement made by the same entity you are acting on - behalf of, you may not add another; but you may replace the old - one, on explicit permission from the previous publisher that added - the old one. - - The author(s) and publisher(s) of the Document do not by this - License give permission to use their names for publicity for or to - assert or imply endorsement of any Modified Version. - - 5. COMBINING DOCUMENTS - - You may combine the Document with other documents released under - this License, under the terms defined in section 4 above for - modified versions, provided that you include in the combination all - of the Invariant Sections of all of the original documents, - unmodified, and list them all as Invariant Sections of your - combined work in its license notice, and that you preserve all - their Warranty Disclaimers. - - The combined work need only contain one copy of this License, and - multiple identical Invariant Sections may be replaced with a single - copy. If there are multiple Invariant Sections with the same name - but different contents, make the title of each such section unique - by adding at the end of it, in parentheses, the name of the - original author or publisher of that section if known, or else a - unique number. Make the same adjustment to the section titles in - the list of Invariant Sections in the license notice of the - combined work. - - In the combination, you must combine any sections Entitled - "History" in the various original documents, forming one section - Entitled "History"; likewise combine any sections Entitled - "Acknowledgements", and any sections Entitled "Dedications". You - must delete all sections Entitled "Endorsements." - - 6. COLLECTIONS OF DOCUMENTS - - You may make a collection consisting of the Document and other - documents released under this License, and replace the individual - copies of this License in the various documents with a single copy - that is included in the collection, provided that you follow the - rules of this License for verbatim copying of each of the documents - in all other respects. - - You may extract a single document from such a collection, and - distribute it individually under this License, provided you insert - a copy of this License into the extracted document, and follow this - License in all other respects regarding verbatim copying of that - document. - - 7. AGGREGATION WITH INDEPENDENT WORKS - - A compilation of the Document or its derivatives with other - separate and independent documents or works, in or on a volume of a - storage or distribution medium, is called an "aggregate" if the - copyright resulting from the compilation is not used to limit the - legal rights of the compilation's users beyond what the individual - works permit. When the Document is included in an aggregate, this - License does not apply to the other works in the aggregate which - are not themselves derivative works of the Document. - - If the Cover Text requirement of section 3 is applicable to these - copies of the Document, then if the Document is less than one half - of the entire aggregate, the Document's Cover Texts may be placed - on covers that bracket the Document within the aggregate, or the - electronic equivalent of covers if the Document is in electronic - form. Otherwise they must appear on printed covers that bracket - the whole aggregate. - - 8. TRANSLATION - - Translation is considered a kind of modification, so you may - distribute translations of the Document under the terms of section - 4. Replacing Invariant Sections with translations requires special - permission from their copyright holders, but you may include - translations of some or all Invariant Sections in addition to the - original versions of these Invariant Sections. You may include a - translation of this License, and all the license notices in the - Document, and any Warranty Disclaimers, provided that you also - include the original English version of this License and the - original versions of those notices and disclaimers. In case of a - disagreement between the translation and the original version of - this License or a notice or disclaimer, the original version will - prevail. - - If a section in the Document is Entitled "Acknowledgements", - "Dedications", or "History", the requirement (section 4) to - Preserve its Title (section 1) will typically require changing the - actual title. - - 9. TERMINATION - - You may not copy, modify, sublicense, or distribute the Document - except as expressly provided for under this License. Any other - attempt to copy, modify, sublicense or distribute the Document is - void, and will automatically terminate your rights under this - License. However, parties who have received copies, or rights, - from you under this License will not have their licenses terminated - so long as such parties remain in full compliance. - - 10. FUTURE REVISIONS OF THIS LICENSE - - The Free Software Foundation may publish new, revised versions of - the GNU Free Documentation License from time to time. Such new - versions will be similar in spirit to the present version, but may - differ in detail to address new problems or concerns. See - . - - Each version of the License is given a distinguishing version - number. If the Document specifies that a particular numbered - version of this License "or any later version" applies to it, you - have the option of following the terms and conditions either of - that specified version or of any later version that has been - published (not as a draft) by the Free Software Foundation. If the - Document does not specify a version number of this License, you may - choose any version ever published (not as a draft) by the Free - Software Foundation. - -11.1 ADDENDUM: How to use this License for your documents -========================================================= - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and license -notices just after the title page: - - Copyright (C) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.2 - or any later version published by the Free Software Foundation; - with no Invariant Sections, no Front-Cover Texts, and no Back-Cover - Texts. A copy of the license is included in the section entitled ``GNU - Free Documentation License''. - - If you have Invariant Sections, Front-Cover Texts and Back-Cover -Texts, replace the "with...Texts." line with this: - - with the Invariant Sections being LIST THEIR TITLES, with - the Front-Cover Texts being LIST, and with the Back-Cover Texts - being LIST. - - If you have Invariant Sections without Cover Texts, or some other -combination of the three, merge those two alternatives to suit the -situation. - - If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of free -software license, such as the GNU General Public License, to permit -their use in free software. - - -File: rt-liberation.info, Node: Concept Index, Next: Function Index, Prev: The GNU FDL, Up: Top - -Concept Index -************* - -[index] -* Menu: - -* Batch Operations: Batch Operations. (line 6) -* FDL, GNU Free Documentation License: The GNU FDL. (line 6) -* Gnus Integration: Gnus Integration. (line 6) -* installation: Installation. (line 6) -* introduction: Introduction. (line 6) -* Local Storage: Local Storage. (line 6) -* queries: Queries. (line 6) -* query compiler: Query Compiler. (line 6) -* query language: Query Language. (line 6) -* ticket browser: Ticket Browser. (line 6) -* ticket browser display function: Ticket Browser Display. - (line 6) -* ticket browser filtering filter: Ticket Browser Filtering. - (line 6) -* ticket browser multiple buffer: Multiple Ticket Browsers. - (line 6) -* ticket browser sorting: Ticket Browser Sorting. - (line 6) -* ticket viewer: Ticket Viewer. (line 6) -* Tracking Updates: Tracking Updates. (line 6) - - -File: rt-liberation.info, Node: Function Index, Next: Variable Index, Prev: Concept Index, Up: Top - -Function Index -************** - -[index] -* Menu: - -* revert-buffer: Ticket Browser. (line 48) -* revert-buffer <1>: Ticket Viewer. (line 66) -* rt-liber-browse-query: Ticket Browser. (line 12) -* rt-liber-browser-ancillary-text: Local Storage. (line 22) -* rt-liber-browser-assign: Ticket Browser. (line 62) -* rt-liber-browser-mark-as-spam: Ticket Browser. (line 55) -* rt-liber-browser-mode-quit: Ticket Browser. (line 36) -* rt-liber-browser-move: Ticket Browser. (line 80) -* rt-liber-browser-open: Ticket Browser. (line 68) -* rt-liber-browser-prioritize: Ticket Browser. (line 83) -* rt-liber-browser-refresh-and-return: Ticket Browser. (line 51) -* rt-liber-browser-resolve: Ticket Browser. (line 65) -* rt-liber-browser-take-ticket-at-point: Ticket Browser. (line 71) -* rt-liber-display-ticket-at-point: Ticket Browser. (line 45) -* rt-liber-jump-to-latest-correspondence: Ticket Viewer. (line 31) -* rt-liber-lex-lessthan-p: Ticket Browser Sorting. - (line 15) -* rt-liber-mark-ticket-at-point: Batch Operations. (line 18) -* rt-liber-multi-assign: Batch Operations. (line 27) -* rt-liber-multi-delete-spam: Ticket Browser. (line 58) -* rt-liber-multi-flag-as-spam-and-delete: Batch Operations. (line 30) -* rt-liber-multi-set-status-open: Batch Operations. (line 21) -* rt-liber-multi-set-status-resolved: Batch Operations. (line 24) -* rt-liber-next-section-in-viewer: Ticket Viewer. (line 28) -* rt-liber-next-ticket-in-browser: Ticket Browser. (line 39) -* rt-liber-previous-section-in-viewer: Ticket Viewer. (line 34) -* rt-liber-previous-ticket-in-browser: Ticket Browser. (line 42) -* rt-liber-time-lessthan-p: Ticket Browser Sorting. - (line 30) -* rt-liber-update: Tracking Updates. (line 17) -* rt-liber-viewer-answer: Ticket Viewer. (line 40) -* rt-liber-viewer-answer-provisionally: Ticket Viewer. (line 48) -* rt-liber-viewer-answer-provisionally-this: Ticket Viewer. (line 51) -* rt-liber-viewer-answer-this: Ticket Viewer. (line 43) -* rt-liber-viewer-answer-verbatim-this: Ticket Viewer. (line 56) -* rt-liber-viewer-comment: Ticket Viewer. (line 60) -* rt-liber-viewer-comment-this: Ticket Viewer. (line 63) -* rt-liber-viewer-mode-quit: Ticket Viewer. (line 25) -* rt-liber-viewer-show-ticket-browser: Ticket Viewer. (line 75) -* rt-liber-viewer-visit-in-browser: Ticket Viewer. (line 37) -* scroll-down: Ticket Browser. (line 77) -* scroll-down <1>: Ticket Viewer. (line 72) -* scroll-up: Ticket Browser. (line 74) -* scroll-up <1>: Ticket Viewer. (line 69) - - -File: rt-liberation.info, Node: Variable Index, Next: Keybinding Index, Prev: Function Index, Up: Top - -Variable Index -************** - -[index] -* Menu: - -* rt-liber-gnus-address: Gnus Integration. (line 20) -* rt-liber-gnus-comment-address: Gnus Integration. (line 24) -* rt-liber-gnus-subject-name: Gnus Integration. (line 28) - - -File: rt-liberation.info, Node: Keybinding Index, Prev: Variable Index, Up: Top - -Keybinding Index -**************** - -[index] -* Menu: - -* a (ticket browser): Ticket Browser. (line 62) -* A (ticket browser): Local Storage. (line 22) -* c (ticket viewer): Ticket Viewer. (line 60) -* C (ticket viewer): Ticket Viewer. (line 63) -* DEL (ticket browser): Ticket Browser. (line 77) -* DEL (ticket viewer): Ticket Viewer. (line 72) -* F (ticket viewer): Ticket Viewer. (line 56) -* g (ticket browser): Ticket Browser. (line 48) -* G (ticket browser): Ticket Browser. (line 51) -* g (ticket viewer): Ticket Viewer. (line 66) -* h (ticket viewer): Ticket Viewer. (line 75) -* m (ticket browser): Ticket Browser. (line 80) -* M (ticket browser): Batch Operations. (line 18) -* m (ticket viewer): Ticket Viewer. (line 40) -* M (ticket viewer): Ticket Viewer. (line 43) -* n (ticket browser): Ticket Browser. (line 39) -* n (ticket viewer): Ticket Viewer. (line 28) -* N (ticket viewer): Ticket Viewer. (line 31) -* o (ticket browser): Ticket Browser. (line 68) -* p (ticket browser): Ticket Browser. (line 42) -* P (ticket browser): Ticket Browser. (line 83) -* p (ticket viewer): Ticket Viewer. (line 34) -* q (ticket browser): Ticket Browser. (line 36) -* q (ticket viewer): Ticket Viewer. (line 25) -* r (ticket browser): Ticket Browser. (line 65) -* RET (ticket browser): Ticket Browser. (line 45) -* s (ticket browser): Ticket Browser. (line 55) -* S (ticket browser): Ticket Browser. (line 58) -* SPC (ticket browser): Ticket Browser. (line 74) -* SPC (ticket viewer): Ticket Viewer. (line 69) -* t (ticket browser): Ticket Browser. (line 71) -* t (ticket viewer): Ticket Viewer. (line 48) -* t (ticket viewer) <1>: Ticket Viewer. (line 51) -* V (ticket viewer): Ticket Viewer. (line 37) - - - -Tag Table: -Node: Top698 -Node: Introduction2979 -Node: Installation3591 -Node: Queries4575 -Node: Query Compiler5142 -Node: Query Language5788 -Node: Ticket Browser8232 -Node: Ticket Browser Display10709 -Node: Ticket Browser Sorting12705 -Node: Ticket Browser Filtering14660 -Node: Multiple Ticket Browsers16208 -Node: Ticket Viewer17382 -Node: Gnus Integration19559 -Node: Tracking Updates21852 -Node: Batch Operations22934 -Node: Local Storage24119 -Node: Copying25202 -Node: The GNU FDL62756 -Node: Concept Index85153 -Node: Function Index86739 -Node: Variable Index90094 -Node: Keybinding Index90475 - -End Tag Table -- cgit v1.2.3 From 291a8e377fab357a99772f814c48075d0e06a028 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sun, 15 Nov 2020 21:01:23 -0500 Subject: move to other machine --- NEWS | 5 +++++ doc/developer-release.txt | 28 ++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 9a75035..312281f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +New in version 1.31 + + * + + New in version 1.0: * Upgrade to GPLv3 (with the kind permission of the people from diff --git a/doc/developer-release.txt b/doc/developer-release.txt index e976f0b..bab477d 100644 --- a/doc/developer-release.txt +++ b/doc/developer-release.txt @@ -1,13 +1,37 @@ -*- outline -*- -* Notes for preparing a release for rt-liberation +This is an outline of how to make a release for rt-liberation via GNU +ELPA. -** Version +* version In order for the ELPA system to trigger a release the version number in the comment header of rt-liberation.el must be incremented. +* NEWS +Update the NEWS file to tell all of the people the Good News. + + +* push +Push these updates to the git repo. + + +* tag +Tag the release with the ELPA version number: + + $ git tag -a 1.31 -m "1.31" + +Then push that tag to the VCS: + + $ git push --tags origin "1.31" + + +* documentation +Update the manual, compile it, and update the copy of the info file in +the root directory so that ELPA can install it. + + ** Info After each manual update the info file needs to be copied into the root of the project so that ELPA can pick it up. -- cgit v1.2.3 From 700d45e4b2259975012d7c2f258a04b7ab517e45 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sun, 15 Nov 2020 21:39:35 -0500 Subject: * doc/developer-release.txt: update documentation --- doc/developer-release.txt | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/doc/developer-release.txt b/doc/developer-release.txt index bab477d..78e68da 100644 --- a/doc/developer-release.txt +++ b/doc/developer-release.txt @@ -8,15 +8,16 @@ ELPA. In order for the ELPA system to trigger a release the version number in the comment header of rt-liberation.el must be incremented. - -* NEWS +* Good News Update the NEWS file to tell all of the people the Good News. +* documentation +Update the manual, compile it, and update the copy of the info file in +the root directory so that ELPA can install it. * push Push these updates to the git repo. - * tag Tag the release with the ELPA version number: @@ -24,19 +25,9 @@ Tag the release with the ELPA version number: Then push that tag to the VCS: - $ git push --tags origin "1.31" - - -* documentation -Update the manual, compile it, and update the copy of the info file in -the root directory so that ELPA can install it. - - -** Info -After each manual update the info file needs to be copied into the -root of the project so that ELPA can pick it up. + $ git push --tags origin "1.31" +* ELPA +Push the changes to externals/rt-liberation on elpa.git with: -** ELPA -Updates to the Savannah repository that have been tested can be pushed -to the ELPA repository at externals/rt-liberation. + $ git push elpa elpa:externals/rt-liberation -- cgit v1.2.3 From 7ddbe07b61cb7a9fd9dd80585f37f090a8d2b9b1 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sun, 15 Nov 2020 21:51:25 -0500 Subject: * NEWS: --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 312281f..9aa1677 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ New in version 1.31 - * + * Updated the manual and include in ELPA. New in version 1.0: -- cgit v1.2.3 From a9786cf58f20bb6eef95160ec807e171113da16f Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 16 Nov 2020 17:06:38 -0500 Subject: * NEWS: update --- NEWS | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 9aa1677..2490ea3 100644 --- a/NEWS +++ b/NEWS @@ -1,11 +1,13 @@ -New in version 1.31 +New in version ... - * Updated the manual and include in ELPA. + * Support getting REST credentials from auth-source. -New in version 1.0: +New in versions 1.0 to 1.31: * Upgrade to GPLv3 (with the kind permission of the people from Best Practical). * Remove the CLI interface. + + * Make sure the manual appears in ELPA. -- cgit v1.2.3 From 4097a1cb4131e97fa13c62f7c8704358d2215395 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 16 Nov 2020 17:22:01 -0500 Subject: * rt-liberation-rest.el: new function rt-liber-rest-auth This function checks for the REST credentials and if they are not there it tries to grab them from auth-source. --- rt-liberation-rest.el | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index 99f6ce9..6e3409d 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -45,10 +45,10 @@ (defvar rt-liber-rest-url "" "URL of RT installation.") -(defvar rt-liber-rest-username "" +(defvar rt-liber-rest-username nil "Username of RT account.") -(defvar rt-liber-rest-password "" +(defvar rt-liber-rest-password nil "Password of RT account.") (defvar rt-liber-rest-verbose-p t @@ -65,6 +65,19 @@ (goto-char (point-max)) (insert str)))) +(defun rt-liber-rest-auth () + "Try to get the REST credentials." + (if (and (stringp rt-liber-rest-username) + (stringp rt-liber-rest-password)) + t + (message "rt-liber: no REST credentials set, so attempting auth-source") + (let ((auth-source-found-p + (auth-source-search :host "rt-liberation" :require '(:user :secret) :create nil))) + (when (not auth-source-found-p) + (error "no auth-source found for login")) + (setq rt-liber-rest-password (funcall (plist-get (nth 0 auth-source-found-p) :secret)) + rt-liber-rest-username (plist-get (nth 0 auth-source-found-p) :user))))) + (defun rt-liber-rest-search-string (scheme url username password query) "Return the search query string." (let ((user (url-encode-url username)) @@ -124,11 +137,11 @@ str) (setq str (decode-coding-string - (with-current-buffer response - (buffer-substring-no-properties (point-min) - (point-max))) - 'utf-8)) - + (with-current-buffer response + (buffer-substring-no-properties (point-min) + (point-max))) + 'utf-8)) + (rt-liber-rest-write-debug (format "outgoing rest call -->\n%s\n<-- incoming\n%s\n" url str)) str))) @@ -138,6 +151,7 @@ (when (or (not (stringp op)) (not (stringp query-string))) (error "bad arguments")) + (rt-liber-rest-auth) (cond ((string= op "ls") (rt-liber-rest-call (rt-liber-rest-search-string rt-liber-rest-scheme @@ -215,6 +229,7 @@ "Run edit comment to set FIELD to VALUE." (message "started edit command at %s..." (current-time-string)) (message "ticket #%s, %s <- %s" ticket-id field value) + (rt-liber-rest-auth) (let ((request-data (format "content=%s: %s" (url-hexify-string field) -- cgit v1.2.3 From 6098e235bfecff3b21ae0c29d22a28a4ac34f282 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 16 Nov 2020 17:23:57 -0500 Subject: * rt-liberation-rest.el: add requirement --- rt-liberation-rest.el | 1 + 1 file changed, 1 insertion(+) diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index 6e3409d..fd66341 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -31,6 +31,7 @@ (require 'url) (require 'url-util) +(require 'auth-source) (defvar rt-liber-rest-debug-buffer-name "*rt-liber-rest debug log*" -- cgit v1.2.3 From a5d763421c819fbbc174215d25862b739fae3ee8 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 16 Nov 2020 18:17:08 -0500 Subject: * doc/developer-release.txt: add compile comment --- doc/developer-release.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/developer-release.txt b/doc/developer-release.txt index 78e68da..81b275e 100644 --- a/doc/developer-release.txt +++ b/doc/developer-release.txt @@ -3,6 +3,8 @@ This is an outline of how to make a release for rt-liberation via GNU ELPA. +* compile +Check for and correct compile-time errors and warnings. * version In order for the ELPA system to trigger a release the version number -- cgit v1.2.3 From f586e7dbdcc87f4086d54d755da7126f55dbb5af Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 16 Nov 2020 18:17:19 -0500 Subject: * doc/rt-liber.texinfo: update manual --- doc/rt-liber.texinfo | 25 +++++++++++++++++++--- rt-liber.info | 58 ++++++++++++++++++++++++++++++++-------------------- 2 files changed, 58 insertions(+), 25 deletions(-) diff --git a/doc/rt-liber.texinfo b/doc/rt-liber.texinfo index b8cb1f5..0436425 100644 --- a/doc/rt-liber.texinfo +++ b/doc/rt-liber.texinfo @@ -140,6 +140,25 @@ Tell rt-liberation where to find the RT server's REST interface: (setq rt-liber-rest-url "rt.example.org") @end lisp +In order to authenticate with the RT server instance you need to +provide credentials. rt-liberation looks for these in the variables +@var{rt-liber-rest-username} and @var{rt-liber-rest-password}. You can +set these directly: + +@lisp +(setq rt-liber-rest-username "someuser" + rt-liber-rest-password "somepassword") +@end lisp + +You can also leave these values unset (@code{nil}), in which case +rt-liberation will look for the credentials in a Netrc file via the +auth-source library (see: @xref{Top,,, auth, Emacs auth-source}), +under the machine name "rt-liberation": + +@example +machine rt-liberation login someuser password somepassword +@end example + rt-liberation can issue a command to ``take'' a ticket (that is, assign it to yourself). For this the variable @var{rt-liber-username} must be set: @@ -148,9 +167,9 @@ must be set: (setq rt-liber-username "someuser") @end lisp -rt-liberation can also launch a Web browser to visit a ticket. For -that to work the base URL needs to be set in -@var{rt-liber-base-url}. For example: +rt-liberation can launch a Web browser to visit a ticket. For that to +work the base URL needs to be set in @var{rt-liber-base-url}. For +example: (setq rt-liber-base-url "https://rt.foo.org/") diff --git a/rt-liber.info b/rt-liber.info index f712b66..d227b86 100644 --- a/rt-liber.info +++ b/rt-liber.info @@ -116,14 +116,28 @@ file, or similar. (setq rt-liber-rest-url "rt.example.org") + In order to authenticate with the RT server instance you need to +provide credentials. rt-liberation looks for these in the variables +RT-LIBER-REST-USERNAME and RT-LIBER-REST-PASSWORD. You can set these +directly: + + (setq rt-liber-rest-username "someuser" + rt-liber-rest-password "somepassword") + + You can also leave these values unset ('nil'), in which case +rt-liberation will look for the credentials in a Netrc file via the +auth-source library (see: *Note (auth)Top::), under the machine name +"rt-liberation": + + machine rt-liberation login someuser password somepassword + rt-liberation can issue a command to "take" a ticket (that is, assign it to yourself). For this the variable RT-LIBER-USERNAME must be set: (setq rt-liber-username "someuser") - rt-liberation can also launch a Web browser to visit a ticket. For -that to work the base URL needs to be set in RT-LIBER-BASE-URL. For -example: + rt-liberation can launch a Web browser to visit a ticket. For that +to work the base URL needs to be set in RT-LIBER-BASE-URL. For example: (setq rt-liber-base-url "https://rt.foo.org/") @@ -2019,24 +2033,24 @@ Tag Table: Node: Top680 Node: Introduction2956 Node: Installation3563 -Node: Queries4542 -Node: Query Compiler5104 -Node: Query Language5745 -Node: Ticket Browser8184 -Node: Ticket Browser Display10656 -Node: Ticket Browser Sorting12647 -Node: Ticket Browser Filtering14597 -Node: Multiple Ticket Browsers16140 -Node: Ticket Viewer17309 -Node: Gnus Integration19481 -Node: Tracking Updates21769 -Node: Batch Operations22846 -Node: Local Storage24026 -Node: Copying25104 -Node: The GNU FDL62653 -Node: Concept Index85045 -Node: Function Index86626 -Node: Variable Index89976 -Node: Keybinding Index90352 +Node: Queries5135 +Node: Query Compiler5697 +Node: Query Language6338 +Node: Ticket Browser8777 +Node: Ticket Browser Display11249 +Node: Ticket Browser Sorting13240 +Node: Ticket Browser Filtering15190 +Node: Multiple Ticket Browsers16733 +Node: Ticket Viewer17902 +Node: Gnus Integration20074 +Node: Tracking Updates22362 +Node: Batch Operations23439 +Node: Local Storage24619 +Node: Copying25697 +Node: The GNU FDL63246 +Node: Concept Index85638 +Node: Function Index87219 +Node: Variable Index90569 +Node: Keybinding Index90945  End Tag Table -- cgit v1.2.3 From 12d16aa7cccca1a25e7bcd7a41dc7d4755813a3b Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 16 Nov 2020 18:33:44 -0500 Subject: Add lexical binding declaration --- rt-liberation-gnus.el | 2 +- rt-liberation-multi.el | 2 +- rt-liberation-report.el | 2 +- rt-liberation-rest.el | 2 +- rt-liberation-storage.el | 2 +- rt-liberation-update.el | 2 +- rt-liberation.el | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rt-liberation-gnus.el b/rt-liberation-gnus.el index eb0b262..a2e5414 100644 --- a/rt-liberation-gnus.el +++ b/rt-liberation-gnus.el @@ -1,4 +1,4 @@ -;;; rt-liberation-gnus.el --- Gnus integration for rt-liberation +;;; rt-liberation-gnus.el --- Gnus integration for rt-liberation -*- lexical-binding: t; -*- ;; Copyright (C) 2009-2014 Free Software Foundation, Inc. ;; diff --git a/rt-liberation-multi.el b/rt-liberation-multi.el index 8e4665a..d4a8602 100644 --- a/rt-liberation-multi.el +++ b/rt-liberation-multi.el @@ -1,4 +1,4 @@ -;;; rt-liberation-multi.el --- Emacs interface to RT +;;; rt-liberation-multi.el --- Emacs interface to RT -*- lexical-binding: t; -*- ;; Copyright (C) 2010, 2014 Free Software Foundation, Inc. ;; diff --git a/rt-liberation-report.el b/rt-liberation-report.el index 11d20c2..a60ae5b 100644 --- a/rt-liberation-report.el +++ b/rt-liberation-report.el @@ -1,4 +1,4 @@ -;;; rt-liberation-report.el --- Emacs interface to RT +;;; rt-liberation-report.el --- Emacs interface to RT -*- lexical-binding: t; -*- ;; Copyright (C) 2015 Free Software Foundation, Inc. ;; diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index fd66341..e266e15 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -1,4 +1,4 @@ -;;; rt-liberation-rest.el --- Interface to the RT REST API +;;; rt-liberation-rest.el --- Interface to the RT REST API -*- lexical-binding: t; -*- ;; Copyright (C) 2014-2015 Free Software Foundation, Inc. ;; diff --git a/rt-liberation-storage.el b/rt-liberation-storage.el index df82ce1..f8e6884 100644 --- a/rt-liberation-storage.el +++ b/rt-liberation-storage.el @@ -1,4 +1,4 @@ -;;; rt-liberation-storage.el --- Storage backend for rt-liberation +;;; rt-liberation-storage.el --- Storage backend for rt-liberation -*- lexical-binding: t; -*- ;; Copyright (C) 2010 Free Software Foundation, Inc. ;; diff --git a/rt-liberation-update.el b/rt-liberation-update.el index bdd0f75..17ddba3 100644 --- a/rt-liberation-update.el +++ b/rt-liberation-update.el @@ -1,4 +1,4 @@ -;;; rt-liberation-update.el --- check updated tickets +;;; rt-liberation-update.el --- check updated tickets -*- lexical-binding: t; -*- ;; Copyright (C) 2009 Free Software Foundation, Inc. ;; diff --git a/rt-liberation.el b/rt-liberation.el index f30e048..086e14f 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1,4 +1,4 @@ -;;; rt-liberation.el --- Emacs interface to RT +;;; rt-liberation.el --- Emacs interface to RT -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From 0ee9eba3a41a1dfc5c79abf5df2439ba5e497030 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 16 Nov 2020 20:52:16 -0500 Subject: New file: rt-liberation-viewer Move the viewer code to its own file. --- rt-liberation-viewer.el | 251 ++++++++++++++++++++++++++++++++++++++++++++++++ rt-liberation.el | 228 ++----------------------------------------- 2 files changed, 257 insertions(+), 222 deletions(-) create mode 100644 rt-liberation-viewer.el diff --git a/rt-liberation-viewer.el b/rt-liberation-viewer.el new file mode 100644 index 0000000..e3b6309 --- /dev/null +++ b/rt-liberation-viewer.el @@ -0,0 +1,251 @@ +;;; rt-liberation-viewer.el --- Emacs interface to RT -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. +;; +;; Authors: Yoni Rabkin +;; +;; This file is a part of rt-liberation. +;; +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 3 of the +;; License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public +;; License along with this program; if not, write to the Free +;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +;; MA 02111-1307, USA. + + +;;; Comments: +;; By the end of 2020 is was clear that a more robust way of viewing +;; tickets was preferable. + + +;;; Code: +(require 'rt-liberation) + + +(defconst rt-liber-viewer-font-lock-keywords + (let ((header-regexp (regexp-opt '("id: " "Ticket: " "TimeTaken: " + "Type: " "Field: " "OldValue: " + "NewValue: " "Data: " + "Description: " "Created: " + "Creator: " "Attachments: ") t))) + (list + (list (concat "^" header-regexp ".*$") 0 + 'font-lock-comment-face))) + "Expressions to font-lock for RT ticket viewer.") + + +(defun rt-liber-jump-to-latest-correspondence () + "Move point to the newest correspondence section." + (interactive) + (let (latest-point) + (save-excursion + (goto-char (point-max)) + (when (re-search-backward rt-liber-correspondence-regexp + (point-min) t) + (setq latest-point (point)))) + (if latest-point + (progn + (goto-char latest-point) + (rt-liber-next-section-in-viewer)) + (message "no correspondence found")))) + +(defun rt-liber-viewer-visit-in-browser () + "Visit this ticket in the RT Web interface." + (interactive) + (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))) + (if id + (browse-url + (concat rt-liber-base-url "Ticket/Display.html?id=" id)) + (error "no ticket currently in view")))) + +(defun rt-liber-display-ticket-history (ticket-alist &optional assoc-browser) + "Display history for ticket. + +TICKET-ALIST alist of ticket data. +ASSOC-BROWSER if non-nil should be a ticket browser." + (let* ((ticket-id (rt-liber-ticket-id-only ticket-alist)) + (contents (rt-liber-rest-run-ticket-history-base-query ticket-id)) + (new-ticket-buffer (get-buffer-create + (concat "*RT Ticket #" ticket-id "*")))) + (with-current-buffer new-ticket-buffer + (let ((inhibit-read-only t)) + (erase-buffer) + (insert contents) + (goto-char (point-min)) + (rt-liber-viewer-mode) + (set + (make-local-variable 'rt-liber-ticket-local) + ticket-alist) + (when assoc-browser + (set + (make-local-variable 'rt-liber-assoc-browser) + assoc-browser)) + (set-buffer-modified-p nil) + (setq buffer-read-only t))) + (switch-to-buffer new-ticket-buffer))) + +(defun rt-liber-viewer-mode-quit () + "Bury the ticket viewer." + (interactive) + (bury-buffer)) + +(defun rt-liber-viewer-show-ticket-browser () + "Return to the ticket browser buffer." + (interactive) + (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))) + (if id + (let ((target-buffer + (if rt-liber-assoc-browser + (buffer-name rt-liber-assoc-browser) + (buffer-name rt-liber-browser-buffer-name)))) + (if target-buffer + (switch-to-buffer target-buffer) + (error "associated ticket browser buffer no longer exists")) + (rt-liber-browser-move-point-to-ticket id)) + (error "no ticket currently in view")))) + +(defun rt-liber-next-section-in-viewer () + "Move point to next section." + (interactive) + (forward-line 1) + (when (not (re-search-forward rt-liber-content-regexp (point-max) t)) + (message "no next section")) + (goto-char (point-at-bol))) + +(defun rt-liber-previous-section-in-viewer () + "Move point to previous section." + (interactive) + (forward-line -1) + (when (not (re-search-backward rt-liber-content-regexp (point-min) t)) + (message "no previous section")) + (goto-char (point-at-bol))) + +(defconst rt-liber-viewer-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "q") 'rt-liber-viewer-mode-quit) + (define-key map (kbd "n") 'rt-liber-next-section-in-viewer) + (define-key map (kbd "N") 'rt-liber-jump-to-latest-correspondence) + (define-key map (kbd "p") 'rt-liber-previous-section-in-viewer) + (define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser) + (define-key map (kbd "m") 'rt-liber-viewer-answer) + (define-key map (kbd "M") 'rt-liber-viewer-answer-this) + (define-key map (kbd "t") 'rt-liber-viewer-answer-provisionally) + (define-key map (kbd "T") 'rt-liber-viewer-answer-provisionally-this) + (define-key map (kbd "F") 'rt-liber-viewer-answer-verbatim-this) + (define-key map (kbd "c") 'rt-liber-viewer-comment) + (define-key map (kbd "C") 'rt-liber-viewer-comment-this) + (define-key map (kbd "g") 'revert-buffer) + (define-key map (kbd "SPC") 'scroll-up) + (define-key map (kbd "DEL") 'scroll-down) + (define-key map (kbd "h") 'rt-liber-viewer-show-ticket-browser) + map) + "Key map for ticket viewer.") + +(define-derived-mode rt-liber-viewer-mode nil + "RT Liberation Viewer" + "Major Mode for viewing RT tickets. +\\{rt-liber-viewer-mode-map}" + (set + (make-local-variable 'font-lock-defaults) + '((rt-liber-viewer-font-lock-keywords))) + (set (make-local-variable 'revert-buffer-function) + #'rt-liber-refresh-ticket-history) + (set (make-local-variable 'buffer-stale-function) + (lambda (&optional _noconfirm) 'slow)) + (when rt-liber-jump-to-latest + (rt-liber-jump-to-latest-correspondence)) + (run-hooks 'rt-liber-viewer-hook)) + +(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 + rt-liber-assoc-browser) + (error "not viewing a ticket"))) + +;; wrapper functions around specific functions provided by a backend + +(declare-function + rt-liber-gnus-compose-reply-to-requestor + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-reply-to-requestor-to-this + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-reply-to-requestor-verbatim-this + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-provisional + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-provisional-to-this + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-comment + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-comment-this + "rt-liberation-gnus.el") + +(defun rt-liber-viewer-answer () + "Answer the ticket." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-reply-to-requestor)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-answer-this () + "Answer the ticket using the current context." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-reply-to-requestor-to-this)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-answer-verbatim-this () + "Answer the ticket using the current context verbatim." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-reply-to-requestor-verbatim-this)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-answer-provisionally () + "Provisionally answer the ticket." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-provisional)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-answer-provisionally-this () + "Provisionally answer the ticket using the current context." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-provisional-to-this)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-comment () + "Comment on the ticket." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-comment)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-comment-this () + "Comment on the ticket using the current context." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-comment-this)) + (t (error "no function defined")))) + + +(provide 'rt-liberation-viewer) + +;;; rt-liberation-viewer.el ends here. diff --git a/rt-liberation.el b/rt-liberation.el index 086e14f..ef3c84f 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -45,6 +45,8 @@ (require 'rt-liberation-rest) +(declare-function rt-liber-display-ticket-history "rt-liberation-viewer.el" (ticket-alist &optional assoc-browser)) + (defgroup rt-liber nil "*rt-liberation, the Emacs interface to RT" @@ -163,17 +165,6 @@ function returns a truth value.") (t (:background "Black"))) "Face for high priority tickets in browser buffer.") -(defconst rt-liber-viewer-font-lock-keywords - (let ((header-regexp (regexp-opt '("id: " "Ticket: " "TimeTaken: " - "Type: " "Field: " "OldValue: " - "NewValue: " "Data: " - "Description: " "Created: " - "Creator: " "Attachments: ") t))) - (list - (list (concat "^" header-regexp ".*$") 0 - 'font-lock-comment-face))) - "Expressions to font-lock for RT ticket viewer.") - (defvar rt-liber-browser-do-refresh t "When t, run `rt-liber-browser-refresh' otherwise disable it.") @@ -445,26 +436,6 @@ AFTER date after predicate." (<= rt-liber-ticket-old-threshold (rt-liber-ticket-days-old ticket-alist))) - -;;; -------------------------------------------------------- -;;; Ticket viewer -;;; -------------------------------------------------------- - -(defun rt-liber-jump-to-latest-correspondence () - "Move point to the newest correspondence section." - (interactive) - (let (latest-point) - (save-excursion - (goto-char (point-max)) - (when (re-search-backward rt-liber-correspondence-regexp - (point-min) t) - (setq latest-point (point)))) - (if latest-point - (progn - (goto-char latest-point) - (rt-liber-next-section-in-viewer)) - (message "no correspondence found")))) - (defun rt-liber-ticket-id-only (ticket-alist) "Return numerical portion of ticket number from TICKET-ALIST." (if ticket-alist @@ -480,11 +451,6 @@ AFTER date after predicate." nil)) nil)) -(defun rt-liber-get-field-string (field-symbol) - (when (not field-symbol) - (error "null field symbol")) - (cdr (assoc field-symbol rt-liber-field-dictionary))) - (defun rt-liber-ticket-owner-only (ticket-alist) "Return the string value of the ticket owner." (when (not ticket-alist) @@ -492,192 +458,10 @@ AFTER date after predicate." (cdr (assoc (rt-liber-get-field-string 'owner) ticket-alist))) -(defun rt-liber-viewer-visit-in-browser () - "Visit this ticket in the RT Web interface." - (interactive) - (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))) - (if id - (browse-url - (concat rt-liber-base-url "Ticket/Display.html?id=" id)) - (error "no ticket currently in view")))) - -(defun rt-liber-viewer-mode-quit () - "Bury the ticket viewer." - (interactive) - (bury-buffer)) - -(defun rt-liber-viewer-show-ticket-browser () - "Return to the ticket browser buffer." - (interactive) - (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))) - (if id - (let ((target-buffer - (if rt-liber-assoc-browser - (buffer-name rt-liber-assoc-browser) - (buffer-name rt-liber-browser-buffer-name)))) - (if target-buffer - (switch-to-buffer target-buffer) - (error "associated ticket browser buffer no longer exists")) - (rt-liber-browser-move-point-to-ticket id)) - (error "no ticket currently in view")))) - -(defun rt-liber-next-section-in-viewer () - "Move point to next section." - (interactive) - (forward-line 1) - (when (not (re-search-forward rt-liber-content-regexp (point-max) t)) - (message "no next section")) - (goto-char (point-at-bol))) - -(defun rt-liber-previous-section-in-viewer () - "Move point to previous section." - (interactive) - (forward-line -1) - (when (not (re-search-backward rt-liber-content-regexp (point-min) t)) - (message "no previous section")) - (goto-char (point-at-bol))) - -(defconst rt-liber-viewer-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "q") 'rt-liber-viewer-mode-quit) - (define-key map (kbd "n") 'rt-liber-next-section-in-viewer) - (define-key map (kbd "N") 'rt-liber-jump-to-latest-correspondence) - (define-key map (kbd "p") 'rt-liber-previous-section-in-viewer) - (define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser) - (define-key map (kbd "m") 'rt-liber-viewer-answer) - (define-key map (kbd "M") 'rt-liber-viewer-answer-this) - (define-key map (kbd "t") 'rt-liber-viewer-answer-provisionally) - (define-key map (kbd "T") 'rt-liber-viewer-answer-provisionally-this) - (define-key map (kbd "F") 'rt-liber-viewer-answer-verbatim-this) - (define-key map (kbd "c") 'rt-liber-viewer-comment) - (define-key map (kbd "C") 'rt-liber-viewer-comment-this) - (define-key map (kbd "g") 'revert-buffer) - (define-key map (kbd "SPC") 'scroll-up) - (define-key map (kbd "DEL") 'scroll-down) - (define-key map (kbd "h") 'rt-liber-viewer-show-ticket-browser) - map) - "Key map for ticket viewer.") - -(define-derived-mode rt-liber-viewer-mode nil - "RT Liberation Viewer" - "Major Mode for viewing RT tickets. -\\{rt-liber-viewer-mode-map}" - (set - (make-local-variable 'font-lock-defaults) - '((rt-liber-viewer-font-lock-keywords))) - (set (make-local-variable 'revert-buffer-function) - #'rt-liber-refresh-ticket-history) - (set (make-local-variable 'buffer-stale-function) - (lambda (&optional _noconfirm) 'slow)) - (when rt-liber-jump-to-latest - (rt-liber-jump-to-latest-correspondence)) - (run-hooks 'rt-liber-viewer-hook)) - -(defun rt-liber-display-ticket-history (ticket-alist &optional assoc-browser) - "Display history for ticket. - -TICKET-ALIST alist of ticket data. -ASSOC-BROWSER if non-nil should be a ticket browser." - (let* ((ticket-id (rt-liber-ticket-id-only ticket-alist)) - (contents (rt-liber-rest-run-ticket-history-base-query ticket-id)) - (new-ticket-buffer (get-buffer-create - (concat "*RT Ticket #" ticket-id "*")))) - (with-current-buffer new-ticket-buffer - (let ((inhibit-read-only t)) - (erase-buffer) - (insert contents) - (goto-char (point-min)) - (rt-liber-viewer-mode) - (set - (make-local-variable 'rt-liber-ticket-local) - ticket-alist) - (when assoc-browser - (set - (make-local-variable 'rt-liber-assoc-browser) - assoc-browser)) - (set-buffer-modified-p nil) - (setq buffer-read-only t))) - (switch-to-buffer new-ticket-buffer))) - -(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 - rt-liber-assoc-browser) - (error "not viewing a ticket"))) - -;; wrapper functions around specific functions provided by a backend - -(declare-function - rt-liber-gnus-compose-reply-to-requestor - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-reply-to-requestor-to-this - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-reply-to-requestor-verbatim-this - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-provisional - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-provisional-to-this - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-comment - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-comment-this - "rt-liberation-gnus.el") - -(defun rt-liber-viewer-answer () - "Answer the ticket." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-reply-to-requestor)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-answer-this () - "Answer the ticket using the current context." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-reply-to-requestor-to-this)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-answer-verbatim-this () - "Answer the ticket using the current context verbatim." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-reply-to-requestor-verbatim-this)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-answer-provisionally () - "Provisionally answer the ticket." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-provisional)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-answer-provisionally-this () - "Provisionally answer the ticket using the current context." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-provisional-to-this)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-comment () - "Comment on the ticket." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-comment)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-comment-this () - "Comment on the ticket using the current context." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-comment-this)) - (t (error "no function defined")))) +(defun rt-liber-get-field-string (field-symbol) + (when (not field-symbol) + (error "null field symbol")) + (cdr (assoc field-symbol rt-liber-field-dictionary))) ;;; -------------------------------------------------------- -- cgit v1.2.3 From 237b11d4507ee8b1208cab40eddf9d2c6747a183 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 16 Nov 2020 22:33:26 -0500 Subject: * rt-liberation-viewer.el: reorganize --- rt-liberation-viewer.el | 69 ++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/rt-liberation-viewer.el b/rt-liberation-viewer.el index e3b6309..bc0e15d 100644 --- a/rt-liberation-viewer.el +++ b/rt-liberation-viewer.el @@ -36,37 +36,14 @@ "Type: " "Field: " "OldValue: " "NewValue: " "Data: " "Description: " "Created: " - "Creator: " "Attachments: ") t))) + "Creator: " "Attachments: ") + t))) (list (list (concat "^" header-regexp ".*$") 0 'font-lock-comment-face))) "Expressions to font-lock for RT ticket viewer.") -(defun rt-liber-jump-to-latest-correspondence () - "Move point to the newest correspondence section." - (interactive) - (let (latest-point) - (save-excursion - (goto-char (point-max)) - (when (re-search-backward rt-liber-correspondence-regexp - (point-min) t) - (setq latest-point (point)))) - (if latest-point - (progn - (goto-char latest-point) - (rt-liber-next-section-in-viewer)) - (message "no correspondence found")))) - -(defun rt-liber-viewer-visit-in-browser () - "Visit this ticket in the RT Web interface." - (interactive) - (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))) - (if id - (browse-url - (concat rt-liber-base-url "Ticket/Display.html?id=" id)) - (error "no ticket currently in view")))) - (defun rt-liber-display-ticket-history (ticket-alist &optional assoc-browser) "Display history for ticket. @@ -93,6 +70,34 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (setq buffer-read-only t))) (switch-to-buffer new-ticket-buffer))) + +;;; ------------------------------------------------------------------ +;;; viewer mode functions +;;; ------------------------------------------------------------------ +(defun rt-liber-jump-to-latest-correspondence () + "Move point to the newest correspondence section." + (interactive) + (let (latest-point) + (save-excursion + (goto-char (point-max)) + (when (re-search-backward rt-liber-correspondence-regexp + (point-min) t) + (setq latest-point (point)))) + (if latest-point + (progn + (goto-char latest-point) + (rt-liber-next-section-in-viewer)) + (message "no correspondence found")))) + +(defun rt-liber-viewer-visit-in-browser () + "Visit this ticket in the RT Web interface." + (interactive) + (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))) + (if id + (browse-url + (concat rt-liber-base-url "Ticket/Display.html?id=" id)) + (error "no ticket currently in view")))) + (defun rt-liber-viewer-mode-quit () "Bury the ticket viewer." (interactive) @@ -129,6 +134,13 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (message "no previous section")) (goto-char (point-at-bol))) +(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 + rt-liber-assoc-browser) + (error "not viewing a ticket"))) + (defconst rt-liber-viewer-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "q") 'rt-liber-viewer-mode-quit) @@ -165,15 +177,8 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (rt-liber-jump-to-latest-correspondence)) (run-hooks 'rt-liber-viewer-hook)) -(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 - rt-liber-assoc-browser) - (error "not viewing a ticket"))) ;; wrapper functions around specific functions provided by a backend - (declare-function rt-liber-gnus-compose-reply-to-requestor "rt-liberation-gnus.el") -- cgit v1.2.3 From 53e56b798c77ee4f244688490332d6a93d53be81 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Tue, 17 Nov 2020 13:22:17 -0500 Subject: * rt-liberation-viewer.el: history parse --- rt-liberation-viewer.el | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/rt-liberation-viewer.el b/rt-liberation-viewer.el index bc0e15d..359e600 100644 --- a/rt-liberation-viewer.el +++ b/rt-liberation-viewer.el @@ -43,6 +43,38 @@ 'font-lock-comment-face))) "Expressions to font-lock for RT ticket viewer.") +(defun rt-liber-viewer-reduce (section-list f acc) + "A Not Invented Here tail-recursive reduce function." + (cond ((null (cdr section-list)) acc) + (t (rt-liber-viewer-reduce (cdr section-list) + f + (append acc (list + (funcall f + (car section-list) + (cadr section-list)))))))) + +;; According to: +;; "https://rt-wiki.bestpractical.com/wiki/REST#Ticket_History" is of +;; the form: "# / (id//total)" +(defun rt-liber-viewer-parse-history (ticket-history) + "Parse the string TICKET-HISTORY." + (when (not (stringp ticket-history)) + (error "invalid ticket-history")) + (with-temp-buffer + (insert ticket-history) + (goto-char (point-min)) + ;; find history detail sections and procude a list of section + ;; (start . end) pairs + (let (section-point-list) + (while (re-search-forward "^# [0-9]+/[0-9]+ (id/[0-9]+/total)" (point-max) t) + (setq section-point-list (append section-point-list + (list (point))))) + (when (not section-point-list) + (error "no history detail sections found")) + (setq section-point-list (append section-point-list + (list (point-max))) + section-point-list (rt-liber-viewer-reduce section-point-list #'cons nil)) + section-point-list))) (defun rt-liber-display-ticket-history (ticket-alist &optional assoc-browser) "Display history for ticket. -- cgit v1.2.3 From 280fece769a9fd30e12e5823ab329e7d0e64d7c2 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Tue, 17 Nov 2020 17:32:36 -0500 Subject: * rt-liberation-viewer.el: section parsing --- rt-liberation-viewer.el | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/rt-liberation-viewer.el b/rt-liberation-viewer.el index 359e600..327e79f 100644 --- a/rt-liberation-viewer.el +++ b/rt-liberation-viewer.el @@ -31,6 +31,12 @@ (require 'rt-liberation) +(defvar rt-liber-viewer-section-header-regexp + "^# [0-9]+/[0-9]+ (id/[0-9]+/total)") + +(defvar rt-liber-viewer-section-field-regexp + "^\\(.+\\): \\(.+\\)$") + (defconst rt-liber-viewer-font-lock-keywords (let ((header-regexp (regexp-opt '("id: " "Ticket: " "TimeTaken: " "Type: " "Field: " "OldValue: " @@ -53,6 +59,25 @@ (car section-list) (cadr section-list)))))))) +(defun rt-liber-viewer-parse-section (start end) + (goto-char start) + (when (not (re-search-forward rt-liber-viewer-section-header-regexp + end t)) + (error "invalid section")) + (forward-line 2) + (let (section-field-alist + section-field-end) + (save-excursion + (setq section-field-end + (re-search-forward "\n\n" end nil))) + (while (looking-at rt-liber-viewer-section-field-regexp) + (setq section-field-alist + (append section-field-alist + `((,(match-string-no-properties 1) . + ,(match-string-no-properties 2))))) + (forward-line)) + ( + ;; According to: ;; "https://rt-wiki.bestpractical.com/wiki/REST#Ticket_History" is of ;; the form: "# / (id//total)" @@ -65,16 +90,24 @@ (goto-char (point-min)) ;; find history detail sections and procude a list of section ;; (start . end) pairs - (let (section-point-list) - (while (re-search-forward "^# [0-9]+/[0-9]+ (id/[0-9]+/total)" (point-max) t) + (let (section-point-list + section-list) + (while (re-search-forward rt-liber-viewer-section-header-regexp (point-max) t) (setq section-point-list (append section-point-list - (list (point))))) + (list (point-at-bol))))) (when (not section-point-list) (error "no history detail sections found")) (setq section-point-list (append section-point-list (list (point-max))) section-point-list (rt-liber-viewer-reduce section-point-list #'cons nil)) - section-point-list))) + ;; collect the sections + (setq section-list + (mapcar + (lambda (section-points) + (rt-liber-viewer-parse-section + (car section-points) + (cdr section-points))) + section-point-list))))) (defun rt-liber-display-ticket-history (ticket-alist &optional assoc-browser) "Display history for ticket. -- cgit v1.2.3 From ab6c820df3f529a44eb3a831b9a36d99c430dc33 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Tue, 17 Nov 2020 17:35:08 -0500 Subject: * rt-liberation-viewer.el: --- rt-liberation-viewer.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rt-liberation-viewer.el b/rt-liberation-viewer.el index 327e79f..32ea3ce 100644 --- a/rt-liberation-viewer.el +++ b/rt-liberation-viewer.el @@ -76,7 +76,7 @@ `((,(match-string-no-properties 1) . ,(match-string-no-properties 2))))) (forward-line)) - ( + section-field-alist)) ;; According to: ;; "https://rt-wiki.bestpractical.com/wiki/REST#Ticket_History" is of -- cgit v1.2.3 From 6defec33517e546664635ca5176d8620fb0a23d0 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Tue, 17 Nov 2020 17:55:13 -0500 Subject: * rt-liberation-viewer.el: --- rt-liberation-viewer.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rt-liberation-viewer.el b/rt-liberation-viewer.el index 32ea3ce..e1d499b 100644 --- a/rt-liberation-viewer.el +++ b/rt-liberation-viewer.el @@ -70,11 +70,12 @@ (save-excursion (setq section-field-end (re-search-forward "\n\n" end nil))) - (while (looking-at rt-liber-viewer-section-field-regexp) - (setq section-field-alist - (append section-field-alist - `((,(match-string-no-properties 1) . - ,(match-string-no-properties 2))))) + (while (not (looking-at "^\n")) + (when (looking-at rt-liber-viewer-section-field-regexp) + (setq section-field-alist + (append section-field-alist + `((,(match-string-no-properties 1) . + ,(match-string-no-properties 2)))))) (forward-line)) section-field-alist)) -- cgit v1.2.3 From bcbf368acd9156850334bc6085990a17c7065051 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 18 Nov 2020 16:26:21 -0500 Subject: * rt-liberation-viewer.el: content parsing The darn leading spaces are still there. --- rt-liberation-viewer.el | 61 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/rt-liberation-viewer.el b/rt-liberation-viewer.el index e1d499b..d48b9da 100644 --- a/rt-liberation-viewer.el +++ b/rt-liberation-viewer.el @@ -59,25 +59,55 @@ (car section-list) (cadr section-list)))))))) +;; According to: +;; "https://rt-wiki.bestpractical.com/wiki/REST#Ticket_History_Entry" +;; id: +;; Ticket: +;; TimeTaken: <...> +;; Type: <...> +;; Field: <...> +;; OldValue: <...> +;; NewValue: <...> +;; Data: <...> +;; Description: <...> + +;; Content: +;; +;; ... +;; + +;; Creator: <...> +;; Created: <...> +;; Attachments: <...> (defun rt-liber-viewer-parse-section (start end) (goto-char start) - (when (not (re-search-forward rt-liber-viewer-section-header-regexp - end t)) + (when (not (re-search-forward + rt-liber-viewer-section-header-regexp + end t)) (error "invalid section")) (forward-line 2) (let (section-field-alist - section-field-end) - (save-excursion - (setq section-field-end - (re-search-forward "\n\n" end nil))) - (while (not (looking-at "^\n")) - (when (looking-at rt-liber-viewer-section-field-regexp) - (setq section-field-alist - (append section-field-alist - `((,(match-string-no-properties 1) . - ,(match-string-no-properties 2)))))) - (forward-line)) - section-field-alist)) + (rt-field-list + '(id Ticket TimeTaken Type Field + OldValue NewValue Data Description + Creator Created))) + ;; definitely error out if any of this doesn't work + (setq section-field-alist + (mapcar + (lambda (field-symbol) + (re-search-forward (format "^%s:" (symbol-name field-symbol)) end nil) + (cons field-symbol (buffer-substring (1+ (point)) (point-at-eol)))) + rt-field-list)) + ;; content + (goto-char start) + (let ((content-start (re-search-forward "^Content: " end nil)) + (content-end (progn + (re-search-forward "^Creator: " end nil) + (point-at-bol)))) + (append section-field-alist + `(,(cons 'Content + (buffer-substring content-start + content-end))))))) ;; According to: ;; "https://rt-wiki.bestpractical.com/wiki/REST#Ticket_History" is of @@ -108,7 +138,8 @@ (rt-liber-viewer-parse-section (car section-points) (cdr section-points))) - section-point-list))))) + section-point-list)) + section-list))) (defun rt-liber-display-ticket-history (ticket-alist &optional assoc-browser) "Display history for ticket. -- cgit v1.2.3 From 45275d3be36e9fe8c78b402ef64c926be152f6aa Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 20 Nov 2020 12:32:05 -0500 Subject: splitting aside code for viewer2 --- rt-liberation-viewer.el | 94 +++++++++++++++++++++++++++++++++++++++++++------ rt-liberation.el | 8 +++++ 2 files changed, 91 insertions(+), 11 deletions(-) diff --git a/rt-liberation-viewer.el b/rt-liberation-viewer.el index d48b9da..c5a75c2 100644 --- a/rt-liberation-viewer.el +++ b/rt-liberation-viewer.el @@ -49,6 +49,36 @@ 'font-lock-comment-face))) "Expressions to font-lock for RT ticket viewer.") +(defun rt-liber-display-ticket-history (ticket-alist &optional assoc-browser) + "Display history for ticket. + +TICKET-ALIST alist of ticket data. +ASSOC-BROWSER if non-nil should be a ticket browser." + (let* ((ticket-id (rt-liber-ticket-id-only ticket-alist)) + (contents (rt-liber-rest-run-ticket-history-base-query ticket-id)) + (new-ticket-buffer (get-buffer-create + (concat "*RT Ticket #" ticket-id "*")))) + (with-current-buffer new-ticket-buffer + (let ((inhibit-read-only t)) + (erase-buffer) + (insert contents) + (goto-char (point-min)) + (rt-liber-viewer-mode) + (set + (make-local-variable 'rt-liber-ticket-local) + ticket-alist) + (when assoc-browser + (set + (make-local-variable 'rt-liber-assoc-browser) + assoc-browser)) + (set-buffer-modified-p nil) + (setq buffer-read-only t))) + (switch-to-buffer new-ticket-buffer))) + + +;;; ------------------------------------------------------------------ +;;; viewer2 mode functions +;;; ------------------------------------------------------------------ (defun rt-liber-viewer-reduce (section-list f acc) "A Not Invented Here tail-recursive reduce function." (cond ((null (cdr section-list)) acc) @@ -141,7 +171,15 @@ section-point-list)) section-list))) -(defun rt-liber-display-ticket-history (ticket-alist &optional assoc-browser) +(defconst rt-liber-viewer2-font-lock-keywords + (let ((header-regexp (regexp-opt '("id: ") + t))) + (list + (list (concat "^" header-regexp ".*$") 0 + 'font-lock-comment-face))) + "Expressions to font-lock for RT ticket viewer.") + +(defun rt-liber-viewer2-display-ticket-history (ticket-alist &optional assoc-browser) "Display history for ticket. TICKET-ALIST alist of ticket data. @@ -149,13 +187,13 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (let* ((ticket-id (rt-liber-ticket-id-only ticket-alist)) (contents (rt-liber-rest-run-ticket-history-base-query ticket-id)) (new-ticket-buffer (get-buffer-create - (concat "*RT Ticket #" ticket-id "*")))) + (concat "*RT (Viewer) Ticket #" ticket-id "*")))) (with-current-buffer new-ticket-buffer (let ((inhibit-read-only t)) (erase-buffer) - (insert contents) + (insert "watch this space for further development") (goto-char (point-min)) - (rt-liber-viewer-mode) + (rt-liber-viewer2-mode) (set (make-local-variable 'rt-liber-ticket-local) ticket-alist) @@ -167,6 +205,47 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (setq buffer-read-only t))) (switch-to-buffer new-ticket-buffer))) +(defun rt-liber-viewer2-refresh-ticket-history (&optional _ignore-auto _noconfirm) + (interactive) + (if rt-liber-ticket-local + (rt-liber-viewer2-display-ticket-history rt-liber-ticket-local + rt-liber-assoc-browser) + (error "not viewing a ticket"))) + +(defconst rt-liber-viewer2-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "q") 'rt-liber-viewer-mode-quit) + (define-key map (kbd "n") 'rt-liber-next-section-in-viewer) + (define-key map (kbd "N") 'rt-liber-jump-to-latest-correspondence) + (define-key map (kbd "p") 'rt-liber-previous-section-in-viewer) + (define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser) + (define-key map (kbd "m") 'rt-liber-viewer-answer) + (define-key map (kbd "M") 'rt-liber-viewer-answer-this) + (define-key map (kbd "t") 'rt-liber-viewer-answer-provisionally) + (define-key map (kbd "T") 'rt-liber-viewer-answer-provisionally-this) + (define-key map (kbd "F") 'rt-liber-viewer-answer-verbatim-this) + (define-key map (kbd "c") 'rt-liber-viewer-comment) + (define-key map (kbd "C") 'rt-liber-viewer-comment-this) + (define-key map (kbd "g") 'revert-buffer) + (define-key map (kbd "SPC") 'scroll-up) + (define-key map (kbd "DEL") 'scroll-down) + (define-key map (kbd "h") 'rt-liber-viewer-show-ticket-browser) + map) + "Key map for ticket viewer.") + +(define-derived-mode rt-liber-viewer2-mode nil + "RT Liberation Viewer" + "Major Mode for viewing RT tickets. +\\{rt-liber-viewer-mode-map}" + (set + (make-local-variable 'font-lock-defaults) + '((rt-liber-viewer2-font-lock-keywords))) + (set (make-local-variable 'revert-buffer-function) + #'rt-liber-viewer2-refresh-ticket-history) + (set (make-local-variable 'buffer-stale-function) + (lambda (&optional _noconfirm) 'slow)) + (run-hooks 'rt-liber-viewer-hook)) + ;;; ------------------------------------------------------------------ ;;; viewer mode functions @@ -231,13 +310,6 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (message "no previous section")) (goto-char (point-at-bol))) -(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 - rt-liber-assoc-browser) - (error "not viewing a ticket"))) - (defconst rt-liber-viewer-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "q") 'rt-liber-viewer-mode-quit) diff --git a/rt-liberation.el b/rt-liberation.el index ef3c84f..9fbcdf5 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -645,6 +645,14 @@ If POINT is nil then called on (point)." (let ((ticket-alist (get-text-property (point) 'rt-ticket))) (rt-liber-display-ticket-history ticket-alist (current-buffer)))) +;; remove after release START +(defun rt-liber-viewer2-display-ticket-at-point () + "Display the contents of the ticket at point." + (interactive) + (let ((ticket-alist (get-text-property (point) 'rt-ticket))) + (rt-liber-viewer2-display-ticket-history ticket-alist (current-buffer)))) +;; remove after release END + (defun rt-liber-browser-search (id) "Return point where ticket with ID is displayed or nil." (let ((p nil)) -- cgit v1.2.3 From ec9245dcfaffc686167aa298dc964ea2be3fa803 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 20 Nov 2020 16:56:29 -0500 Subject: * rt-liberation-viewer.el: start work on formatting --- rt-liberation-viewer.el | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/rt-liberation-viewer.el b/rt-liberation-viewer.el index c5a75c2..e07186d 100644 --- a/rt-liberation-viewer.el +++ b/rt-liberation-viewer.el @@ -171,6 +171,51 @@ ASSOC-BROWSER if non-nil should be a ticket browser." section-point-list)) section-list))) +(defun rt-liber-viewer2-format-content (content) + (with-temp-buffer + (insert content) + + ;; Convert the 9 leading whitespaces from RT's comment lines. + (goto-char (point-min)) + (insert " ") + (while (re-search-forward "^ " (point-max) t) + (replace-match " ")) + + (fill-region (point-min) + (point-max)) + + (buffer-substring (point-min) + (point-max)))) + +(defun rt-liber-viewer2-display-section (section) + (let ((ticket-id (alist-get 'Ticket section)) + (creator (alist-get 'Creator section)) + (date (alist-get 'Created section)) + (type (alist-get 'Type section)) + (content (alist-get 'Content section))) + (insert + (format "Ticket %s by %s on %s (-N- days ago) (%s)\n" + ticket-id + creator + date + type)) + (cond ((or (string= type "Status") + (string= type "CustomField") + ;; (string= type "EmailRecord") + (string= type "Set")) + 'nop-for-now) + (t (insert + (format "\n%s\n" + (rt-liber-viewer2-format-content content))))))) + +(defun rt-liber-viewer2-display-history (contents) + (let ((section-list (rt-liber-viewer-parse-history contents))) + (mapc + (lambda (section) + (rt-liber-viewer2-display-section section)) + section-list))) + +;; Before release: move this back to the top (defconst rt-liber-viewer2-font-lock-keywords (let ((header-regexp (regexp-opt '("id: ") t))) @@ -191,7 +236,7 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (with-current-buffer new-ticket-buffer (let ((inhibit-read-only t)) (erase-buffer) - (insert "watch this space for further development") + (rt-liber-viewer2-display-history contents) (goto-char (point-min)) (rt-liber-viewer2-mode) (set -- cgit v1.2.3 From fe585205b3fba238028a6682a8700224e5c4836c Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sun, 22 Nov 2020 16:43:33 -0500 Subject: * Makefile: neat --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 8f3e500..9005179 100644 --- a/Makefile +++ b/Makefile @@ -34,3 +34,5 @@ all: $(TARGET) clean: -rm -f *~ *.elc + +neat: all clean -- cgit v1.2.3 From 71f0e4c67eb174cab605139c73f9af23ae592445 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 23 Nov 2020 16:28:51 -0500 Subject: bring the code back Previous attempt didn't go well. --- rt-liberation-viewer.el | 470 ----------------------------------------------- rt-liberation.el | 475 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 451 insertions(+), 494 deletions(-) delete mode 100644 rt-liberation-viewer.el diff --git a/rt-liberation-viewer.el b/rt-liberation-viewer.el deleted file mode 100644 index e07186d..0000000 --- a/rt-liberation-viewer.el +++ /dev/null @@ -1,470 +0,0 @@ -;;; rt-liberation-viewer.el --- Emacs interface to RT -*- lexical-binding: t; -*- - -;; Copyright (C) 2020 Free Software Foundation, Inc. -;; -;; Authors: Yoni Rabkin -;; -;; This file is a part of rt-liberation. -;; -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 3 of the -;; License, or (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public -;; License along with this program; if not, write to the Free -;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;; MA 02111-1307, USA. - - -;;; Comments: -;; By the end of 2020 is was clear that a more robust way of viewing -;; tickets was preferable. - - -;;; Code: -(require 'rt-liberation) - - -(defvar rt-liber-viewer-section-header-regexp - "^# [0-9]+/[0-9]+ (id/[0-9]+/total)") - -(defvar rt-liber-viewer-section-field-regexp - "^\\(.+\\): \\(.+\\)$") - -(defconst rt-liber-viewer-font-lock-keywords - (let ((header-regexp (regexp-opt '("id: " "Ticket: " "TimeTaken: " - "Type: " "Field: " "OldValue: " - "NewValue: " "Data: " - "Description: " "Created: " - "Creator: " "Attachments: ") - t))) - (list - (list (concat "^" header-regexp ".*$") 0 - 'font-lock-comment-face))) - "Expressions to font-lock for RT ticket viewer.") - -(defun rt-liber-display-ticket-history (ticket-alist &optional assoc-browser) - "Display history for ticket. - -TICKET-ALIST alist of ticket data. -ASSOC-BROWSER if non-nil should be a ticket browser." - (let* ((ticket-id (rt-liber-ticket-id-only ticket-alist)) - (contents (rt-liber-rest-run-ticket-history-base-query ticket-id)) - (new-ticket-buffer (get-buffer-create - (concat "*RT Ticket #" ticket-id "*")))) - (with-current-buffer new-ticket-buffer - (let ((inhibit-read-only t)) - (erase-buffer) - (insert contents) - (goto-char (point-min)) - (rt-liber-viewer-mode) - (set - (make-local-variable 'rt-liber-ticket-local) - ticket-alist) - (when assoc-browser - (set - (make-local-variable 'rt-liber-assoc-browser) - assoc-browser)) - (set-buffer-modified-p nil) - (setq buffer-read-only t))) - (switch-to-buffer new-ticket-buffer))) - - -;;; ------------------------------------------------------------------ -;;; viewer2 mode functions -;;; ------------------------------------------------------------------ -(defun rt-liber-viewer-reduce (section-list f acc) - "A Not Invented Here tail-recursive reduce function." - (cond ((null (cdr section-list)) acc) - (t (rt-liber-viewer-reduce (cdr section-list) - f - (append acc (list - (funcall f - (car section-list) - (cadr section-list)))))))) - -;; According to: -;; "https://rt-wiki.bestpractical.com/wiki/REST#Ticket_History_Entry" -;; id: -;; Ticket: -;; TimeTaken: <...> -;; Type: <...> -;; Field: <...> -;; OldValue: <...> -;; NewValue: <...> -;; Data: <...> -;; Description: <...> - -;; Content: -;; -;; ... -;; - -;; Creator: <...> -;; Created: <...> -;; Attachments: <...> -(defun rt-liber-viewer-parse-section (start end) - (goto-char start) - (when (not (re-search-forward - rt-liber-viewer-section-header-regexp - end t)) - (error "invalid section")) - (forward-line 2) - (let (section-field-alist - (rt-field-list - '(id Ticket TimeTaken Type Field - OldValue NewValue Data Description - Creator Created))) - ;; definitely error out if any of this doesn't work - (setq section-field-alist - (mapcar - (lambda (field-symbol) - (re-search-forward (format "^%s:" (symbol-name field-symbol)) end nil) - (cons field-symbol (buffer-substring (1+ (point)) (point-at-eol)))) - rt-field-list)) - ;; content - (goto-char start) - (let ((content-start (re-search-forward "^Content: " end nil)) - (content-end (progn - (re-search-forward "^Creator: " end nil) - (point-at-bol)))) - (append section-field-alist - `(,(cons 'Content - (buffer-substring content-start - content-end))))))) - -;; According to: -;; "https://rt-wiki.bestpractical.com/wiki/REST#Ticket_History" is of -;; the form: "# / (id//total)" -(defun rt-liber-viewer-parse-history (ticket-history) - "Parse the string TICKET-HISTORY." - (when (not (stringp ticket-history)) - (error "invalid ticket-history")) - (with-temp-buffer - (insert ticket-history) - (goto-char (point-min)) - ;; find history detail sections and procude a list of section - ;; (start . end) pairs - (let (section-point-list - section-list) - (while (re-search-forward rt-liber-viewer-section-header-regexp (point-max) t) - (setq section-point-list (append section-point-list - (list (point-at-bol))))) - (when (not section-point-list) - (error "no history detail sections found")) - (setq section-point-list (append section-point-list - (list (point-max))) - section-point-list (rt-liber-viewer-reduce section-point-list #'cons nil)) - ;; collect the sections - (setq section-list - (mapcar - (lambda (section-points) - (rt-liber-viewer-parse-section - (car section-points) - (cdr section-points))) - section-point-list)) - section-list))) - -(defun rt-liber-viewer2-format-content (content) - (with-temp-buffer - (insert content) - - ;; Convert the 9 leading whitespaces from RT's comment lines. - (goto-char (point-min)) - (insert " ") - (while (re-search-forward "^ " (point-max) t) - (replace-match " ")) - - (fill-region (point-min) - (point-max)) - - (buffer-substring (point-min) - (point-max)))) - -(defun rt-liber-viewer2-display-section (section) - (let ((ticket-id (alist-get 'Ticket section)) - (creator (alist-get 'Creator section)) - (date (alist-get 'Created section)) - (type (alist-get 'Type section)) - (content (alist-get 'Content section))) - (insert - (format "Ticket %s by %s on %s (-N- days ago) (%s)\n" - ticket-id - creator - date - type)) - (cond ((or (string= type "Status") - (string= type "CustomField") - ;; (string= type "EmailRecord") - (string= type "Set")) - 'nop-for-now) - (t (insert - (format "\n%s\n" - (rt-liber-viewer2-format-content content))))))) - -(defun rt-liber-viewer2-display-history (contents) - (let ((section-list (rt-liber-viewer-parse-history contents))) - (mapc - (lambda (section) - (rt-liber-viewer2-display-section section)) - section-list))) - -;; Before release: move this back to the top -(defconst rt-liber-viewer2-font-lock-keywords - (let ((header-regexp (regexp-opt '("id: ") - t))) - (list - (list (concat "^" header-regexp ".*$") 0 - 'font-lock-comment-face))) - "Expressions to font-lock for RT ticket viewer.") - -(defun rt-liber-viewer2-display-ticket-history (ticket-alist &optional assoc-browser) - "Display history for ticket. - -TICKET-ALIST alist of ticket data. -ASSOC-BROWSER if non-nil should be a ticket browser." - (let* ((ticket-id (rt-liber-ticket-id-only ticket-alist)) - (contents (rt-liber-rest-run-ticket-history-base-query ticket-id)) - (new-ticket-buffer (get-buffer-create - (concat "*RT (Viewer) Ticket #" ticket-id "*")))) - (with-current-buffer new-ticket-buffer - (let ((inhibit-read-only t)) - (erase-buffer) - (rt-liber-viewer2-display-history contents) - (goto-char (point-min)) - (rt-liber-viewer2-mode) - (set - (make-local-variable 'rt-liber-ticket-local) - ticket-alist) - (when assoc-browser - (set - (make-local-variable 'rt-liber-assoc-browser) - assoc-browser)) - (set-buffer-modified-p nil) - (setq buffer-read-only t))) - (switch-to-buffer new-ticket-buffer))) - -(defun rt-liber-viewer2-refresh-ticket-history (&optional _ignore-auto _noconfirm) - (interactive) - (if rt-liber-ticket-local - (rt-liber-viewer2-display-ticket-history rt-liber-ticket-local - rt-liber-assoc-browser) - (error "not viewing a ticket"))) - -(defconst rt-liber-viewer2-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "q") 'rt-liber-viewer-mode-quit) - (define-key map (kbd "n") 'rt-liber-next-section-in-viewer) - (define-key map (kbd "N") 'rt-liber-jump-to-latest-correspondence) - (define-key map (kbd "p") 'rt-liber-previous-section-in-viewer) - (define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser) - (define-key map (kbd "m") 'rt-liber-viewer-answer) - (define-key map (kbd "M") 'rt-liber-viewer-answer-this) - (define-key map (kbd "t") 'rt-liber-viewer-answer-provisionally) - (define-key map (kbd "T") 'rt-liber-viewer-answer-provisionally-this) - (define-key map (kbd "F") 'rt-liber-viewer-answer-verbatim-this) - (define-key map (kbd "c") 'rt-liber-viewer-comment) - (define-key map (kbd "C") 'rt-liber-viewer-comment-this) - (define-key map (kbd "g") 'revert-buffer) - (define-key map (kbd "SPC") 'scroll-up) - (define-key map (kbd "DEL") 'scroll-down) - (define-key map (kbd "h") 'rt-liber-viewer-show-ticket-browser) - map) - "Key map for ticket viewer.") - -(define-derived-mode rt-liber-viewer2-mode nil - "RT Liberation Viewer" - "Major Mode for viewing RT tickets. -\\{rt-liber-viewer-mode-map}" - (set - (make-local-variable 'font-lock-defaults) - '((rt-liber-viewer2-font-lock-keywords))) - (set (make-local-variable 'revert-buffer-function) - #'rt-liber-viewer2-refresh-ticket-history) - (set (make-local-variable 'buffer-stale-function) - (lambda (&optional _noconfirm) 'slow)) - (run-hooks 'rt-liber-viewer-hook)) - - -;;; ------------------------------------------------------------------ -;;; viewer mode functions -;;; ------------------------------------------------------------------ -(defun rt-liber-jump-to-latest-correspondence () - "Move point to the newest correspondence section." - (interactive) - (let (latest-point) - (save-excursion - (goto-char (point-max)) - (when (re-search-backward rt-liber-correspondence-regexp - (point-min) t) - (setq latest-point (point)))) - (if latest-point - (progn - (goto-char latest-point) - (rt-liber-next-section-in-viewer)) - (message "no correspondence found")))) - -(defun rt-liber-viewer-visit-in-browser () - "Visit this ticket in the RT Web interface." - (interactive) - (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))) - (if id - (browse-url - (concat rt-liber-base-url "Ticket/Display.html?id=" id)) - (error "no ticket currently in view")))) - -(defun rt-liber-viewer-mode-quit () - "Bury the ticket viewer." - (interactive) - (bury-buffer)) - -(defun rt-liber-viewer-show-ticket-browser () - "Return to the ticket browser buffer." - (interactive) - (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))) - (if id - (let ((target-buffer - (if rt-liber-assoc-browser - (buffer-name rt-liber-assoc-browser) - (buffer-name rt-liber-browser-buffer-name)))) - (if target-buffer - (switch-to-buffer target-buffer) - (error "associated ticket browser buffer no longer exists")) - (rt-liber-browser-move-point-to-ticket id)) - (error "no ticket currently in view")))) - -(defun rt-liber-next-section-in-viewer () - "Move point to next section." - (interactive) - (forward-line 1) - (when (not (re-search-forward rt-liber-content-regexp (point-max) t)) - (message "no next section")) - (goto-char (point-at-bol))) - -(defun rt-liber-previous-section-in-viewer () - "Move point to previous section." - (interactive) - (forward-line -1) - (when (not (re-search-backward rt-liber-content-regexp (point-min) t)) - (message "no previous section")) - (goto-char (point-at-bol))) - -(defconst rt-liber-viewer-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "q") 'rt-liber-viewer-mode-quit) - (define-key map (kbd "n") 'rt-liber-next-section-in-viewer) - (define-key map (kbd "N") 'rt-liber-jump-to-latest-correspondence) - (define-key map (kbd "p") 'rt-liber-previous-section-in-viewer) - (define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser) - (define-key map (kbd "m") 'rt-liber-viewer-answer) - (define-key map (kbd "M") 'rt-liber-viewer-answer-this) - (define-key map (kbd "t") 'rt-liber-viewer-answer-provisionally) - (define-key map (kbd "T") 'rt-liber-viewer-answer-provisionally-this) - (define-key map (kbd "F") 'rt-liber-viewer-answer-verbatim-this) - (define-key map (kbd "c") 'rt-liber-viewer-comment) - (define-key map (kbd "C") 'rt-liber-viewer-comment-this) - (define-key map (kbd "g") 'revert-buffer) - (define-key map (kbd "SPC") 'scroll-up) - (define-key map (kbd "DEL") 'scroll-down) - (define-key map (kbd "h") 'rt-liber-viewer-show-ticket-browser) - map) - "Key map for ticket viewer.") - -(define-derived-mode rt-liber-viewer-mode nil - "RT Liberation Viewer" - "Major Mode for viewing RT tickets. -\\{rt-liber-viewer-mode-map}" - (set - (make-local-variable 'font-lock-defaults) - '((rt-liber-viewer-font-lock-keywords))) - (set (make-local-variable 'revert-buffer-function) - #'rt-liber-refresh-ticket-history) - (set (make-local-variable 'buffer-stale-function) - (lambda (&optional _noconfirm) 'slow)) - (when rt-liber-jump-to-latest - (rt-liber-jump-to-latest-correspondence)) - (run-hooks 'rt-liber-viewer-hook)) - - -;; wrapper functions around specific functions provided by a backend -(declare-function - rt-liber-gnus-compose-reply-to-requestor - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-reply-to-requestor-to-this - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-reply-to-requestor-verbatim-this - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-provisional - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-provisional-to-this - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-comment - "rt-liberation-gnus.el") -(declare-function - rt-liber-gnus-compose-comment-this - "rt-liberation-gnus.el") - -(defun rt-liber-viewer-answer () - "Answer the ticket." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-reply-to-requestor)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-answer-this () - "Answer the ticket using the current context." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-reply-to-requestor-to-this)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-answer-verbatim-this () - "Answer the ticket using the current context verbatim." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-reply-to-requestor-verbatim-this)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-answer-provisionally () - "Provisionally answer the ticket." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-provisional)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-answer-provisionally-this () - "Provisionally answer the ticket using the current context." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-provisional-to-this)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-comment () - "Comment on the ticket." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-comment)) - (t (error "no function defined")))) - -(defun rt-liber-viewer-comment-this () - "Comment on the ticket using the current context." - (interactive) - (cond ((featurep 'rt-liberation-gnus) - (rt-liber-gnus-compose-comment-this)) - (t (error "no function defined")))) - - -(provide 'rt-liberation-viewer) - -;;; rt-liberation-viewer.el ends here. diff --git a/rt-liberation.el b/rt-liberation.el index 9fbcdf5..143923c 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -38,14 +38,15 @@ ;;; Code: - (require 'browse-url) (require 'time-date) (require 'cl-lib) (require 'rt-liberation-rest) -(declare-function rt-liber-display-ticket-history "rt-liberation-viewer.el" (ticket-alist &optional assoc-browser)) +(declare-function rt-liber-get-ancillary-text "rt-liberation-storage.el") +(declare-function rt-liber-ticket-marked-p "rt-liberation-multi.el") +(declare-function rt-liber-set-ancillary-text "rt-liberation-storage.el") (defgroup rt-liber nil @@ -58,6 +59,24 @@ :type 'string :group 'rt-liber) +(defvar rt-liber-viewer-section-header-regexp + "^# [0-9]+/[0-9]+ (id/[0-9]+/total)") + +(defvar rt-liber-viewer-section-field-regexp + "^\\(.+\\): \\(.+\\)$") + +(defconst rt-liber-viewer-font-lock-keywords + (let ((header-regexp (regexp-opt '("id: " "Ticket: " "TimeTaken: " + "Type: " "Field: " "OldValue: " + "NewValue: " "Data: " + "Description: " "Created: " + "Creator: " "Attachments: ") + t))) + (list + (list (concat "^" header-regexp ".*$") 0 + 'font-lock-comment-face))) + "Expressions to font-lock for RT ticket viewer.") + (defvar rt-liber-created-string "Created" "String representation of \"created\" query tag.") @@ -426,7 +445,6 @@ AFTER date after predicate." ;;; -------------------------------------------------------- ;;; Ticket utilities ;;; -------------------------------------------------------- - (defun rt-liber-ticket-days-old (ticket-alist) "Return the age of the ticket in positive days." (days-between (format-time-string "%Y-%m-%dT%T%z" (current-time)) @@ -467,11 +485,6 @@ AFTER date after predicate." ;;; -------------------------------------------------------- ;;; Ticket browser ;;; -------------------------------------------------------- - -(declare-function - rt-liber-get-ancillary-text - "rt-liberation-storage.el") - ;; accept a ticket-alist object and return an alist mapping ticket ;; properties to format characters for use in `rt-liber-format'. (defun rt-liber-format-function (ticket-alist) @@ -552,8 +565,7 @@ The ticket's priority is compared to the variable '(face font-lock-comment-face))) (newline)) -(declare-function rt-liber-ticket-marked-p - "rt-liberation-multi.el") + (defun rt-liber-ticketlist-browser-redraw (ticketlist &optional query) "Display TICKETLIST. Optionally display QUERY as well." @@ -645,14 +657,6 @@ If POINT is nil then called on (point)." (let ((ticket-alist (get-text-property (point) 'rt-ticket))) (rt-liber-display-ticket-history ticket-alist (current-buffer)))) -;; remove after release START -(defun rt-liber-viewer2-display-ticket-at-point () - "Display the contents of the ticket at point." - (interactive) - (let ((ticket-alist (get-text-property (point) 'rt-ticket))) - (rt-liber-viewer2-display-ticket-history ticket-alist (current-buffer)))) -;; remove after release END - (defun rt-liber-browser-search (id) "Return point where ticket with ID is displayed or nil." (let ((p nil)) @@ -730,7 +734,6 @@ If POINT is nil then called on (point)." ;;; -------------------------------------------------------- ;;; Ticket browser filtering ;;; -------------------------------------------------------- - ;; See the fine manual for example code. (defun rt-liber-default-filter-f (_ticket) @@ -744,7 +747,6 @@ and as such always return t." ;;; -------------------------------------------------------- ;;; Entry points ;;; -------------------------------------------------------- - (defun rt-liber-browse-query (query &optional new) "Run QUERY against the server and launch the browser. @@ -787,7 +789,6 @@ returned as no associated text properties." ;;; -------------------------------------------------------- ;;; Major mode definitions ;;; -------------------------------------------------------- - (defun rt-liber-browser-mode-quit () "Bury the ticket browser." (interactive) @@ -873,8 +874,6 @@ returned as no associated text properties." (switch-to-buffer rt-liber-browser-buffer) (setq buffer-read-only t)) -(declare-function rt-liber-set-ancillary-text "rt-liberation-storage.el") - (defun rt-liber-browser-ancillary-text () "Wrapper function around storage backend." (interactive) @@ -888,7 +887,6 @@ returned as no associated text properties." ;;; -------------------------------------------------------- ;;; Command module ;;; -------------------------------------------------------- - (defun rt-liber-command-get-dictionary-value (sym dic) "Utility function for retrieving alist values." (let ((value (cdr (assoc sym dic)))) @@ -1002,6 +1000,435 @@ returned as no associated text properties." (rt-liber-browser-assign rt-liber-username)) +;;; -------------------------------------------------------- +;;; Viewer +;;; -------------------------------------------------------- +(defun rt-liber-display-ticket-history (ticket-alist &optional assoc-browser) + "Display history for ticket. +TICKET-ALIST alist of ticket data. +ASSOC-BROWSER if non-nil should be a ticket browser." + (let* ((ticket-id (rt-liber-ticket-id-only ticket-alist)) + (contents (rt-liber-rest-run-ticket-history-base-query ticket-id)) + (new-ticket-buffer (get-buffer-create + (concat "*RT Ticket #" ticket-id "*")))) + (with-current-buffer new-ticket-buffer + (let ((inhibit-read-only t)) + (erase-buffer) + (insert contents) + (goto-char (point-min)) + (rt-liber-viewer-mode) + (set + (make-local-variable 'rt-liber-ticket-local) + ticket-alist) + (when assoc-browser + (set + (make-local-variable 'rt-liber-assoc-browser) + assoc-browser)) + (set-buffer-modified-p nil) + (setq buffer-read-only t))) + (switch-to-buffer new-ticket-buffer))) + + +;;; ------------------------------------------------------------------ +;;; viewer mode functions +;;; ------------------------------------------------------------------ +(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 + rt-liber-assoc-browser) + (error "not viewing a ticket"))) + +(defun rt-liber-jump-to-latest-correspondence () + "Move point to the newest correspondence section." + (interactive) + (let (latest-point) + (save-excursion + (goto-char (point-max)) + (when (re-search-backward rt-liber-correspondence-regexp + (point-min) t) + (setq latest-point (point)))) + (if latest-point + (progn + (goto-char latest-point) + (rt-liber-next-section-in-viewer)) + (message "no correspondence found")))) + +(defun rt-liber-viewer-visit-in-browser () + "Visit this ticket in the RT Web interface." + (interactive) + (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))) + (if id + (browse-url + (concat rt-liber-base-url "Ticket/Display.html?id=" id)) + (error "no ticket currently in view")))) + +(defun rt-liber-viewer-mode-quit () + "Bury the ticket viewer." + (interactive) + (bury-buffer)) + +(defun rt-liber-viewer-show-ticket-browser () + "Return to the ticket browser buffer." + (interactive) + (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))) + (if id + (let ((target-buffer + (if rt-liber-assoc-browser + (buffer-name rt-liber-assoc-browser) + (buffer-name rt-liber-browser-buffer-name)))) + (if target-buffer + (switch-to-buffer target-buffer) + (error "associated ticket browser buffer no longer exists")) + (rt-liber-browser-move-point-to-ticket id)) + (error "no ticket currently in view")))) + +(defun rt-liber-next-section-in-viewer () + "Move point to next section." + (interactive) + (forward-line 1) + (when (not (re-search-forward rt-liber-content-regexp (point-max) t)) + (message "no next section")) + (goto-char (point-at-bol))) + +(defun rt-liber-previous-section-in-viewer () + "Move point to previous section." + (interactive) + (forward-line -1) + (when (not (re-search-backward rt-liber-content-regexp (point-min) t)) + (message "no previous section")) + (goto-char (point-at-bol))) + +(defconst rt-liber-viewer-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "q") 'rt-liber-viewer-mode-quit) + (define-key map (kbd "n") 'rt-liber-next-section-in-viewer) + (define-key map (kbd "N") 'rt-liber-jump-to-latest-correspondence) + (define-key map (kbd "p") 'rt-liber-previous-section-in-viewer) + (define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser) + (define-key map (kbd "m") 'rt-liber-viewer-answer) + (define-key map (kbd "M") 'rt-liber-viewer-answer-this) + (define-key map (kbd "t") 'rt-liber-viewer-answer-provisionally) + (define-key map (kbd "T") 'rt-liber-viewer-answer-provisionally-this) + (define-key map (kbd "F") 'rt-liber-viewer-answer-verbatim-this) + (define-key map (kbd "c") 'rt-liber-viewer-comment) + (define-key map (kbd "C") 'rt-liber-viewer-comment-this) + (define-key map (kbd "g") 'revert-buffer) + (define-key map (kbd "SPC") 'scroll-up) + (define-key map (kbd "DEL") 'scroll-down) + (define-key map (kbd "h") 'rt-liber-viewer-show-ticket-browser) + map) + "Key map for ticket viewer.") + +(define-derived-mode rt-liber-viewer-mode nil + "RT Liberation Viewer" + "Major Mode for viewing RT tickets. +\\{rt-liber-viewer-mode-map}" + (set + (make-local-variable 'font-lock-defaults) + '((rt-liber-viewer-font-lock-keywords))) + (set (make-local-variable 'revert-buffer-function) + #'rt-liber-refresh-ticket-history) + (set (make-local-variable 'buffer-stale-function) + (lambda (&optional _noconfirm) 'slow)) + (when rt-liber-jump-to-latest + (rt-liber-jump-to-latest-correspondence)) + (run-hooks 'rt-liber-viewer-hook)) + +;; wrapper functions around specific functions provided by a backend +(declare-function + rt-liber-gnus-compose-reply-to-requestor + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-reply-to-requestor-to-this + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-reply-to-requestor-verbatim-this + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-provisional + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-provisional-to-this + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-comment + "rt-liberation-gnus.el") +(declare-function + rt-liber-gnus-compose-comment-this + "rt-liberation-gnus.el") + +(defun rt-liber-viewer-answer () + "Answer the ticket." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-reply-to-requestor)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-answer-this () + "Answer the ticket using the current context." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-reply-to-requestor-to-this)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-answer-verbatim-this () + "Answer the ticket using the current context verbatim." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-reply-to-requestor-verbatim-this)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-answer-provisionally () + "Provisionally answer the ticket." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-provisional)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-answer-provisionally-this () + "Provisionally answer the ticket using the current context." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-provisional-to-this)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-comment () + "Comment on the ticket." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-comment)) + (t (error "no function defined")))) + +(defun rt-liber-viewer-comment-this () + "Comment on the ticket using the current context." + (interactive) + (cond ((featurep 'rt-liberation-gnus) + (rt-liber-gnus-compose-comment-this)) + (t (error "no function defined")))) + + +;;; ------------------------------------------------------------------ +;;; viewer2 functions +;;; ------------------------------------------------------------------ +(defun rt-liber-viewer-reduce (section-list f acc) + "A Not Invented Here tail-recursive reduce function." + (cond ((null (cdr section-list)) acc) + (t (rt-liber-viewer-reduce (cdr section-list) + f + (append acc (list + (funcall f + (car section-list) + (cadr section-list)))))))) + +;; According to: +;; "https://rt-wiki.bestpractical.com/wiki/REST#Ticket_History_Entry" +;; id: +;; Ticket: +;; TimeTaken: <...> +;; Type: <...> +;; Field: <...> +;; OldValue: <...> +;; NewValue: <...> +;; Data: <...> +;; Description: <...> + +;; Content: +;; +;; ... +;; + +;; Creator: <...> +;; Created: <...> +;; Attachments: <...> +(defun rt-liber-viewer-parse-section (start end) + (goto-char start) + (when (not (re-search-forward + rt-liber-viewer-section-header-regexp + end t)) + (error "invalid section")) + (forward-line 2) + (let (section-field-alist + (rt-field-list + '(id Ticket TimeTaken Type Field + OldValue NewValue Data Description + Creator Created))) + ;; definitely error out if any of this doesn't work + (setq section-field-alist + (mapcar + (lambda (field-symbol) + (re-search-forward (format "^%s:" (symbol-name field-symbol)) end nil) + (cons field-symbol (buffer-substring (1+ (point)) (point-at-eol)))) + rt-field-list)) + ;; content + (goto-char start) + (let ((content-start (re-search-forward "^Content: " end nil)) + (content-end (progn + (re-search-forward "^Creator: " end nil) + (point-at-bol)))) + (append section-field-alist + `(,(cons 'Content + (buffer-substring content-start + content-end))))))) + +;; According to: +;; "https://rt-wiki.bestpractical.com/wiki/REST#Ticket_History" is of +;; the form: "# / (id//total)" +(defun rt-liber-viewer-parse-history (ticket-history) + "Parse the string TICKET-HISTORY." + (when (not (stringp ticket-history)) + (error "invalid ticket-history")) + (with-temp-buffer + (insert ticket-history) + (goto-char (point-min)) + ;; find history detail sections and procude a list of section + ;; (start . end) pairs + (let (section-point-list + section-list) + (while (re-search-forward rt-liber-viewer-section-header-regexp (point-max) t) + (setq section-point-list (append section-point-list + (list (point-at-bol))))) + (when (not section-point-list) + (error "no history detail sections found")) + (setq section-point-list (append section-point-list + (list (point-max))) + section-point-list (rt-liber-viewer-reduce section-point-list #'cons nil)) + ;; collect the sections + (setq section-list + (mapcar + (lambda (section-points) + (rt-liber-viewer-parse-section + (car section-points) + (cdr section-points))) + section-point-list)) + section-list))) + +(defun rt-liber-viewer2-format-content (content) + (with-temp-buffer + (insert content) + + ;; Convert the 9 leading whitespaces from RT's comment lines. + (goto-char (point-min)) + (insert " ") + (while (re-search-forward "^ " (point-max) t) + (replace-match " ")) + + (fill-region (point-min) + (point-max)) + + (buffer-substring (point-min) + (point-max)))) + +(defun rt-liber-viewer2-display-section (section) + (let ((ticket-id (alist-get 'Ticket section)) + (creator (alist-get 'Creator section)) + (date (alist-get 'Created section)) + (type (alist-get 'Type section)) + (content (alist-get 'Content section))) + (insert + (format "Ticket %s by %s on %s (-N- days ago) (%s)\n" + ticket-id + creator + date + type)) + (cond ((or (string= type "Status") + (string= type "CustomField") + ;; (string= type "EmailRecord") + (string= type "Set")) + 'nop-for-now) + (t (insert + (format "\n%s\n" + (rt-liber-viewer2-format-content content))))))) + +(defun rt-liber-viewer2-display-history (contents) + (let ((section-list (rt-liber-viewer-parse-history contents))) + (mapc + (lambda (section) + (rt-liber-viewer2-display-section section)) + section-list))) + +;; Before release: move this back to the top +(defconst rt-liber-viewer2-font-lock-keywords + (let ((header-regexp (regexp-opt '("id: ") + t))) + (list + (list (concat "^" header-regexp ".*$") 0 + 'font-lock-comment-face))) + "Expressions to font-lock for RT ticket viewer.") + +(defun rt-liber-viewer2-display-ticket-at-point () + "Display the contents of the ticket at point." + (interactive) + (let ((ticket-alist (get-text-property (point) 'rt-ticket))) + (rt-liber-viewer2-display-ticket-history ticket-alist (current-buffer)))) + +(defun rt-liber-viewer2-display-ticket-history (ticket-alist &optional assoc-browser) + "Display history for ticket. +TICKET-ALIST alist of ticket data. +ASSOC-BROWSER if non-nil should be a ticket browser." + (let* ((ticket-id (rt-liber-ticket-id-only ticket-alist)) + (contents (rt-liber-rest-run-ticket-history-base-query ticket-id)) + (new-ticket-buffer (get-buffer-create + (concat "*RT (Viewer) Ticket #" ticket-id "*")))) + (with-current-buffer new-ticket-buffer + (let ((inhibit-read-only t)) + (erase-buffer) + (rt-liber-viewer2-display-history contents) + (goto-char (point-min)) + (rt-liber-viewer2-mode) + (set + (make-local-variable 'rt-liber-ticket-local) + ticket-alist) + (when assoc-browser + (set + (make-local-variable 'rt-liber-assoc-browser) + assoc-browser)) + (set-buffer-modified-p nil) + (setq buffer-read-only t))) + (switch-to-buffer new-ticket-buffer))) + +(defun rt-liber-viewer2-refresh-ticket-history (&optional _ignore-auto _noconfirm) + (interactive) + (if rt-liber-ticket-local + (rt-liber-viewer2-display-ticket-history rt-liber-ticket-local + rt-liber-assoc-browser) + (error "not viewing a ticket"))) + +(defconst rt-liber-viewer2-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "q") 'rt-liber-viewer-mode-quit) + (define-key map (kbd "n") 'rt-liber-next-section-in-viewer) + (define-key map (kbd "N") 'rt-liber-jump-to-latest-correspondence) + (define-key map (kbd "p") 'rt-liber-previous-section-in-viewer) + (define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser) + (define-key map (kbd "m") 'rt-liber-viewer-answer) + (define-key map (kbd "M") 'rt-liber-viewer-answer-this) + (define-key map (kbd "t") 'rt-liber-viewer-answer-provisionally) + (define-key map (kbd "T") 'rt-liber-viewer-answer-provisionally-this) + (define-key map (kbd "F") 'rt-liber-viewer-answer-verbatim-this) + (define-key map (kbd "c") 'rt-liber-viewer-comment) + (define-key map (kbd "C") 'rt-liber-viewer-comment-this) + (define-key map (kbd "g") 'revert-buffer) + (define-key map (kbd "SPC") 'scroll-up) + (define-key map (kbd "DEL") 'scroll-down) + (define-key map (kbd "h") 'rt-liber-viewer-show-ticket-browser) + map) + "Key map for ticket viewer.") + +(define-derived-mode rt-liber-viewer2-mode nil + "RT Liberation Viewer" + "Major Mode for viewing RT tickets. +\\{rt-liber-viewer-mode-map}" + (set + (make-local-variable 'font-lock-defaults) + '((rt-liber-viewer2-font-lock-keywords))) + (set (make-local-variable 'revert-buffer-function) + #'rt-liber-viewer2-refresh-ticket-history) + (set (make-local-variable 'buffer-stale-function) + (lambda (&optional _noconfirm) 'slow)) + (run-hooks 'rt-liber-viewer-hook)) + + (provide 'rt-liberation) ;;; rt-liberation.el ends here. -- cgit v1.2.3 From 3b95e84156da397e07a0183a10582c5181afbafb Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Tue, 24 Nov 2020 10:11:39 -0500 Subject: * rt-liberation.el: reformatting --- rt-liberation.el | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 143923c..a1e6d62 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -133,7 +133,6 @@ (defvar rt-liber-browser-default-filter-function 'rt-liber-default-filter-f "Default filtering function. - This is a function which accepts the ticket alist as a single argument and returns nil if the ticket needs to be filtered out, dropped or ignored (however you wish to put it.), otherwise the @@ -203,7 +202,6 @@ server.") (status . "Status") (priority . "Priority")) "Mapping between field symbols and RT field strings. - The field symbols provide the programmer with a consistent way of referring to RT fields.") @@ -213,14 +211,12 @@ referring to RT fields.") (open . "open") (new . "new")) "Mapping between status symbols and status strings. - The status symbols provide the programmer with a consistent way of referring to certain statuses. The status strings are the server specific strings.") (defvar rt-liber-debug-log-enable nil "If t then enable logging of communication to a buffer. - Careful! This might create a sizable buffer.") (defvar rt-liber-debug-log-buffer-name "*rt-liber debug log*" @@ -228,19 +224,16 @@ Careful! This might create a sizable buffer.") (defvar rt-liber-ticket-local nil "Buffer local storage for a ticket. - This variable is made buffer local for the ticket history") (defvar rt-liber-assoc-browser nil "Browser associated with a ticket history. - This variable is made buffer local for the ticket history") ;;; -------------------------------------------------------- ;;; Debug log ;;; -------------------------------------------------------- - (defun rt-liber-debug-log-write (str) "Write STR to debug log." (when (not (stringp str)) @@ -254,7 +247,6 @@ This variable is made buffer local for the ticket history") ;;; -------------------------------------------------------- ;;; TicketSQL compiler ;;; -------------------------------------------------------- - (defun rt-liber-bool-p (sym) "Return t if SYM is a boolean operator, otherwise nil." (member sym '(and or))) @@ -362,7 +354,6 @@ AFTER date after predicate." ;;; -------------------------------------------------------- ;;; Parse Answer ;;; -------------------------------------------------------- - (defun rt-liber-parse-answer (answer-string parser-f) "Operate on ANSWER-STRING with PARSER-F." (with-temp-buffer @@ -377,7 +368,6 @@ AFTER date after predicate." ;;; -------------------------------------------------------- ;;; Ticket list retriever ;;; -------------------------------------------------------- - (put 'rt-liber-no-result-from-query-error 'error-conditions '(error rt-liber-errors rt-liber-no-result-from-query-error)) @@ -565,8 +555,6 @@ The ticket's priority is compared to the variable '(face font-lock-comment-face))) (newline)) - - (defun rt-liber-ticketlist-browser-redraw (ticketlist &optional query) "Display TICKETLIST. Optionally display QUERY as well." (erase-buffer) @@ -691,7 +679,6 @@ If POINT is nil then called on (point)." ;;; -------------------------------------------------------- ;;; Ticket browser sorting ;;; -------------------------------------------------------- - (defun rt-liber-lex-lessthan-p (a b field) "Return t if A is lexicographically less than B in FIELD." (let ((field-a (cdr (assoc field a))) -- cgit v1.2.3 From 79d8eb1fe48849337c539d060a304084a4478206 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 25 Nov 2020 22:31:19 -0500 Subject: * rt-liberation.el: viewer2 work restarts --- rt-liberation.el | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index a1e6d62..5813af4 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1196,7 +1196,7 @@ ASSOC-BROWSER if non-nil should be a ticket browser." ;;; ------------------------------------------------------------------ -;;; viewer2 functions +;;; viewer2 ;;; ------------------------------------------------------------------ (defun rt-liber-viewer-reduce (section-list f acc) "A Not Invented Here tail-recursive reduce function." @@ -1312,12 +1312,16 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (date (alist-get 'Created section)) (type (alist-get 'Type section)) (content (alist-get 'Content section))) - (insert - (format "Ticket %s by %s on %s (-N- days ago) (%s)\n" - ticket-id - creator - date - type)) + (let ((start (point))) + (insert + (format "Ticket %s by %s on %s (-N- days ago) (%s)\n" + ticket-id + creator + date + type)) + (add-text-properties start + (point) + `(font-lock-face font-lock-comment-face))) (cond ((or (string= type "Status") (string= type "CustomField") ;; (string= type "EmailRecord") @@ -1383,24 +1387,24 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (defconst rt-liber-viewer2-mode-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "q") 'rt-liber-viewer-mode-quit) - (define-key map (kbd "n") 'rt-liber-next-section-in-viewer) - (define-key map (kbd "N") 'rt-liber-jump-to-latest-correspondence) - (define-key map (kbd "p") 'rt-liber-previous-section-in-viewer) - (define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser) - (define-key map (kbd "m") 'rt-liber-viewer-answer) - (define-key map (kbd "M") 'rt-liber-viewer-answer-this) - (define-key map (kbd "t") 'rt-liber-viewer-answer-provisionally) - (define-key map (kbd "T") 'rt-liber-viewer-answer-provisionally-this) - (define-key map (kbd "F") 'rt-liber-viewer-answer-verbatim-this) - (define-key map (kbd "c") 'rt-liber-viewer-comment) - (define-key map (kbd "C") 'rt-liber-viewer-comment-this) + (define-key map (kbd "q") 'rt-liber-viewer2-mode-quit) + (define-key map (kbd "n") 'rt-liber-viewer2-next-section-in) + (define-key map (kbd "N") 'rt-liber-vewier2-jump-to-latest-correspondence) + (define-key map (kbd "p") 'rt-liber-vewier2-previous-section-in) + (define-key map (kbd "V") 'rt-liber-viewer2-visit-in-browser) + (define-key map (kbd "m") 'rt-liber-viewer2-answer) + (define-key map (kbd "M") 'rt-liber-viewer2-answer-this) + (define-key map (kbd "t") 'rt-liber-viewer2-answer-provisionally) + (define-key map (kbd "T") 'rt-liber-viewer2-answer-provisionally-this) + (define-key map (kbd "F") 'rt-liber-viewer2-answer-verbatim-this) + (define-key map (kbd "c") 'rt-liber-viewer2-comment) + (define-key map (kbd "C") 'rt-liber-viewer2-comment-this) (define-key map (kbd "g") 'revert-buffer) (define-key map (kbd "SPC") 'scroll-up) (define-key map (kbd "DEL") 'scroll-down) (define-key map (kbd "h") 'rt-liber-viewer-show-ticket-browser) map) - "Key map for ticket viewer.") + "Key map for ticket viewer2.") (define-derived-mode rt-liber-viewer2-mode nil "RT Liberation Viewer" -- cgit v1.2.3 From 79104c6512c99083ee89eca061e73be7869ad705 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 25 Nov 2020 23:36:05 -0500 Subject: * rt-liberation.el: --- rt-liberation.el | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/rt-liberation.el b/rt-liberation.el index 5813af4..6d6196c 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1198,6 +1198,29 @@ ASSOC-BROWSER if non-nil should be a ticket browser." ;;; ------------------------------------------------------------------ ;;; viewer2 ;;; ------------------------------------------------------------------ +(defconst rt-liber-viewer-font-lock-keywords + (let ((header-regexp (regexp-opt '("id: " "Ticket: " "TimeTaken: " + "Type: " "Field: " "OldValue: " + "NewValue: " "Data: " + "Description: " "Created: " + "Creator: " "Attachments: ") + t))) + (list + (list (concat "^" header-regexp ".*$") 0 + 'font-lock-comment-face))) + "Expressions to font-lock for RT ticket viewer.") + +(defface rt-liber-ticket-subdued-face + '((((class color) (background dark)) + (:foreground "gray33")) + (((class color) (background light)) + (:foreground "gray85")) + (((type tty) (class mono)) + (:inverse-video t)) + (t (:background "Blue"))) + "Face for less important text.") + + (defun rt-liber-viewer-reduce (section-list f acc) "A Not Invented Here tail-recursive reduce function." (cond ((null (cdr section-list)) acc) @@ -1321,7 +1344,7 @@ ASSOC-BROWSER if non-nil should be a ticket browser." type)) (add-text-properties start (point) - `(font-lock-face font-lock-comment-face))) + `(font-lock-face rt-liber-ticket-subdued-face))) (cond ((or (string= type "Status") (string= type "CustomField") ;; (string= type "EmailRecord") -- cgit v1.2.3 From ac07fea9ad60840f637178d0ab0469fbd5eddf88 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 25 Nov 2020 23:39:24 -0500 Subject: * rt-liberation.el: --- rt-liberation.el | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 6d6196c..7d9612e 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1198,18 +1198,6 @@ ASSOC-BROWSER if non-nil should be a ticket browser." ;;; ------------------------------------------------------------------ ;;; viewer2 ;;; ------------------------------------------------------------------ -(defconst rt-liber-viewer-font-lock-keywords - (let ((header-regexp (regexp-opt '("id: " "Ticket: " "TimeTaken: " - "Type: " "Field: " "OldValue: " - "NewValue: " "Data: " - "Description: " "Created: " - "Creator: " "Attachments: ") - t))) - (list - (list (concat "^" header-regexp ".*$") 0 - 'font-lock-comment-face))) - "Expressions to font-lock for RT ticket viewer.") - (defface rt-liber-ticket-subdued-face '((((class color) (background dark)) (:foreground "gray33")) @@ -1220,6 +1208,10 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (t (:background "Blue"))) "Face for less important text.") +(defconst rt-liber-viewer2-font-lock-keywords + `(("^.*$" 0 'font-lock-comment-face)) + "Expressions to font-lock for RT ticket viewer.") + (defun rt-liber-viewer-reduce (section-list f acc) "A Not Invented Here tail-recursive reduce function." @@ -1361,15 +1353,6 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (rt-liber-viewer2-display-section section)) section-list))) -;; Before release: move this back to the top -(defconst rt-liber-viewer2-font-lock-keywords - (let ((header-regexp (regexp-opt '("id: ") - t))) - (list - (list (concat "^" header-regexp ".*$") 0 - 'font-lock-comment-face))) - "Expressions to font-lock for RT ticket viewer.") - (defun rt-liber-viewer2-display-ticket-at-point () "Display the contents of the ticket at point." (interactive) -- cgit v1.2.3 From c50bb85cb87e88fffe05c3af5bc5745395333ccc Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 25 Nov 2020 23:41:37 -0500 Subject: * rt-liberation.el: --- rt-liberation.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rt-liberation.el b/rt-liberation.el index 7d9612e..796f606 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1209,7 +1209,7 @@ ASSOC-BROWSER if non-nil should be a ticket browser." "Face for less important text.") (defconst rt-liber-viewer2-font-lock-keywords - `(("^.*$" 0 'font-lock-comment-face)) + `(("^Ticket.*$" 0 'rt-liber-ticket-subdued-face)) "Expressions to font-lock for RT ticket viewer.") -- cgit v1.2.3 From d86507f7ae75912974e0793d603f68f4b2875969 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sun, 29 Nov 2020 22:27:36 -0500 Subject: * rt-liberation-rest.el: formatting --- rt-liberation-rest.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index e266e15..67b099e 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -34,6 +34,9 @@ (require 'auth-source) +;;; ------------------------------------------------------------------ +;;; variables and constants +;;; ------------------------------------------------------------------ (defvar rt-liber-rest-debug-buffer-name "*rt-liber-rest debug log*" "Buffer name of debug capture.") @@ -56,6 +59,9 @@ "If non-nil, be verbose about what's happening.") +;;; ------------------------------------------------------------------ +;;; functions +;;; ------------------------------------------------------------------ (defun rt-liber-rest-write-debug (str) "Write to debug buffer." (when (not (stringp str)) -- cgit v1.2.3 From e7ec4188d9d9b9f3fe89ec49ea49c510d9e3bd7d Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sun, 29 Nov 2020 22:27:42 -0500 Subject: * rt-liberation-rest.el: check for a non-empty string --- rt-liberation-rest.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index 67b099e..860ff88 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -75,7 +75,9 @@ (defun rt-liber-rest-auth () "Try to get the REST credentials." (if (and (stringp rt-liber-rest-username) - (stringp rt-liber-rest-password)) + (stringp rt-liber-rest-password) + (< 0 (length rt-liber-rest-username)) + (< 0 (length rt-liber-rest-password))) t (message "rt-liber: no REST credentials set, so attempting auth-source") (let ((auth-source-found-p -- cgit v1.2.3 From 73a2ba0a1c8fa8eb2ff627c0a22156d69bf3be44 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sun, 29 Nov 2020 23:20:28 -0500 Subject: * rt-liberation.el: find sections --- rt-liberation.el | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 796f606..4af325f 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1198,18 +1198,18 @@ ASSOC-BROWSER if non-nil should be a ticket browser." ;;; ------------------------------------------------------------------ ;;; viewer2 ;;; ------------------------------------------------------------------ -(defface rt-liber-ticket-subdued-face +(defface rt-liber-ticket-emph-face '((((class color) (background dark)) - (:foreground "gray33")) + (:foreground "gray53")) (((class color) (background light)) - (:foreground "gray85")) + (:foreground "gray65")) (((type tty) (class mono)) (:inverse-video t)) (t (:background "Blue"))) - "Face for less important text.") + "Face for important text.") (defconst rt-liber-viewer2-font-lock-keywords - `(("^Ticket.*$" 0 'rt-liber-ticket-subdued-face)) + `(("^$" 0 'rt-liber-ticket-subdued-face)) "Expressions to font-lock for RT ticket viewer.") @@ -1336,7 +1336,10 @@ ASSOC-BROWSER if non-nil should be a ticket browser." type)) (add-text-properties start (point) - `(font-lock-face rt-liber-ticket-subdued-face))) + `(font-lock-face rt-liber-ticket-emph-face)) + (add-text-properties start + (point) + `(rt-liberation-viewer-header t))) (cond ((or (string= type "Status") (string= type "CustomField") ;; (string= type "EmailRecord") @@ -1391,12 +1394,31 @@ ASSOC-BROWSER if non-nil should be a ticket browser." rt-liber-assoc-browser) (error "not viewing a ticket"))) +(defun rt-liber-viewer2-next-section-in () + (interactive) + (forward-line) + (let ((next (next-single-property-change + (point) + 'rt-liberation-viewer-header))) + (when next + (goto-char next)))) + +(defun rt-liber-viewer2-previous-section-in () + (interactive) + (forward-line -1) + (let ((prev (previous-single-property-change + (point-at-bol) + 'rt-liberation-viewer-header))) + (when prev + (goto-char prev) + (forward-line -1)))) + (defconst rt-liber-viewer2-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "q") 'rt-liber-viewer2-mode-quit) (define-key map (kbd "n") 'rt-liber-viewer2-next-section-in) - (define-key map (kbd "N") 'rt-liber-vewier2-jump-to-latest-correspondence) - (define-key map (kbd "p") 'rt-liber-vewier2-previous-section-in) + (define-key map (kbd "N") 'rt-liber-viewer2-jump-to-latest-correspondence) + (define-key map (kbd "p") 'rt-liber-viewer2-previous-section-in) (define-key map (kbd "V") 'rt-liber-viewer2-visit-in-browser) (define-key map (kbd "m") 'rt-liber-viewer2-answer) (define-key map (kbd "M") 'rt-liber-viewer2-answer-this) -- cgit v1.2.3 From 680e177b176d6c43cd8b5c41c6ece76447c5a573 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Tue, 1 Dec 2020 22:21:42 -0500 Subject: * rt-liberation.el: remove leading blank lines --- rt-liberation.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rt-liberation.el b/rt-liberation.el index 4af325f..1adee43 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1309,6 +1309,12 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (with-temp-buffer (insert content) + (save-excursion + (goto-char (point-min)) + (re-search-forward "[[:graph:]]" (point-max) t) + (forward-line -1) + (flush-lines "^[[:space:]]+$" (point-min) (point))) + ;; Convert the 9 leading whitespaces from RT's comment lines. (goto-char (point-min)) (insert " ") -- cgit v1.2.3 From cbfb99c308c09808386c34467530388b7dc9b62e Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Tue, 1 Dec 2020 22:52:56 -0500 Subject: * rt-liberation.el: start making sense of section types --- rt-liberation.el | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 1adee43..9e759dc 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1332,28 +1332,43 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (creator (alist-get 'Creator section)) (date (alist-get 'Created section)) (type (alist-get 'Type section)) - (content (alist-get 'Content section))) + (content (alist-get 'Content section)) + (oldvalue (alist-get 'OldValue section)) + (newvalue (alist-get 'NewValue section)) + (field (alist-get 'Field section))) (let ((start (point))) (insert - (format "Ticket %s by %s on %s (-N- days ago) (%s)\n" + (format "Ticket %s by %s on %s (-N- days ago) (%s)%s\n" ticket-id creator date - type)) + type + (if (and (string= type "Set") + (string= field "Owner")) + " (owner change)" + ""))) (add-text-properties start (point) `(font-lock-face rt-liber-ticket-emph-face)) (add-text-properties start (point) `(rt-liberation-viewer-header t))) - (cond ((or (string= type "Status") - (string= type "CustomField") - ;; (string= type "EmailRecord") - (string= type "Set")) - 'nop-for-now) - (t (insert - (format "\n%s\n" - (rt-liber-viewer2-format-content content))))))) + (cond ((or (string= type "CustomField") + (string= type "EmailRecord") + (string= type "Set") + (string= type "SetWatcher")) + (insert + (format "\n" field oldvalue newvalue))) + ((string= type "Status") + (insert + (format "\n%s: %s -> %s\n" field oldvalue newvalue))) + ((or (string= type "Create") + (string= type "Comment") + (string= type "CommentEmailRecord")) + + (insert + (format "\n%s\n" + (rt-liber-viewer2-format-content content))))))) (defun rt-liber-viewer2-display-history (contents) (let ((section-list (rt-liber-viewer-parse-history contents))) -- cgit v1.2.3 From b23df79bd7f5a6dac61704aceb8036d3ec314a5f Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 2 Dec 2020 11:51:38 -0500 Subject: * rt-liberation.el: forward and back section movement --- rt-liberation.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 9e759dc..bc5e8c6 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1213,6 +1213,11 @@ ASSOC-BROWSER if non-nil should be a ticket browser." "Expressions to font-lock for RT ticket viewer.") +(defun rt-liber-viewer2-mode-quit () + "Bury the ticket viewer." + (interactive) + (bury-buffer)) + (defun rt-liber-viewer-reduce (section-list f acc) "A Not Invented Here tail-recursive reduce function." (cond ((null (cdr section-list)) acc) @@ -1421,16 +1426,17 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (let ((next (next-single-property-change (point) 'rt-liberation-viewer-header))) - (when next - (goto-char next)))) + (if next + (goto-char next) + (message "no next section")))) (defun rt-liber-viewer2-previous-section-in () (interactive) - (forward-line -1) (let ((prev (previous-single-property-change (point-at-bol) 'rt-liberation-viewer-header))) - (when prev + (if (not prev) + (message "no previous section") (goto-char prev) (forward-line -1)))) -- cgit v1.2.3 From 95553c6eff2a710901d0684842ee16636f2ca578 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 2 Dec 2020 14:46:17 -0500 Subject: * rt-liberation.el: vernacular time delta --- rt-liberation.el | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index bc5e8c6..4520c8f 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1213,6 +1213,36 @@ ASSOC-BROWSER if non-nil should be a ticket browser." "Expressions to font-lock for RT ticket viewer.") +(defun rt-liber-viewer2-vernacular-plural (time) + "Add an ess as needed." + (if (= time 1) + "" + "s")) + +(defun rt-liber-viewer2-vernacular-date (date) + "Return a vernacular time delta." + (let* ((now (format-time-string "%Y-%m-%dT%T%z" (current-time))) + (days-ago (days-between now date))) + (cond ((= 0 days-ago) + "today") + ((< 0 days-ago 7) + (format "%s day%s ago" days-ago + (rt-liber-viewer2-vernacular-plural days-ago))) + ((< 7 days-ago 30) + (let ((weeks (floor (/ days-ago 7.0)))) + (format "%s week%s ago" + weeks + (rt-liber-viewer2-vernacular-plural weeks)))) + ((< 30 days-ago 365) + (let ((months (floor (/ days-ago 30.0)))) + (format "%s month%s ago" + months + (rt-liber-viewer2-vernacular-plural months)))) + (t (let ((years (floor (/ days-ago 365.0)))) + (format "%s year%s ago" + years + (rt-liber-viewer2-vernacular-plural years))))))) + (defun rt-liber-viewer2-mode-quit () "Bury the ticket viewer." (interactive) @@ -1343,15 +1373,16 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (field (alist-get 'Field section))) (let ((start (point))) (insert - (format "Ticket %s by %s on %s (-N- days ago) (%s)%s\n" + (format "Ticket %s by %s, %s (%s) %s [%s]\n" ticket-id creator - date + (rt-liber-viewer2-vernacular-date date) type (if (and (string= type "Set") (string= field "Owner")) - " (owner change)" - ""))) + "(owner change)" + "") + date)) (add-text-properties start (point) `(font-lock-face rt-liber-ticket-emph-face)) -- cgit v1.2.3 From f529257ac3d3c6c29ea6d1c2b3b9d6b6b91f73f1 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Thu, 3 Dec 2020 12:13:51 -0500 Subject: * rt-liberation.el: section display --- rt-liberation.el | 99 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 4520c8f..623c029 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1344,23 +1344,26 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (with-temp-buffer (insert content) - (save-excursion - (goto-char (point-min)) - (re-search-forward "[[:graph:]]" (point-max) t) - (forward-line -1) - (flush-lines "^[[:space:]]+$" (point-min) (point))) - - ;; Convert the 9 leading whitespaces from RT's comment lines. (goto-char (point-min)) - (insert " ") - (while (re-search-forward "^ " (point-max) t) - (replace-match " ")) + (if (re-search-forward "^This transaction appears to have no content" (point-max) t) + "" + (save-excursion + (goto-char (point-min)) + (re-search-forward "[[:graph:]]" (point-max) t) + (forward-line -1) + (flush-lines "^[[:space:]]+$" (point-min) (point))) + + ;; Convert the 9 leading whitespaces from RT's comment lines. + (goto-char (point-min)) + (insert " ") + (while (re-search-forward "^ " (point-max) t) + (replace-match " ")) - (fill-region (point-min) - (point-max)) + (fill-region (point-min) + (point-max)) - (buffer-substring (point-min) - (point-max)))) + (buffer-substring (point-min) + (point-max))))) (defun rt-liber-viewer2-display-section (section) (let ((ticket-id (alist-get 'Ticket section)) @@ -1372,39 +1375,41 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (newvalue (alist-get 'NewValue section)) (field (alist-get 'Field section))) (let ((start (point))) - (insert - (format "Ticket %s by %s, %s (%s) %s [%s]\n" - ticket-id - creator - (rt-liber-viewer2-vernacular-date date) - type - (if (and (string= type "Set") - (string= field "Owner")) - "(owner change)" - "") - date)) - (add-text-properties start - (point) - `(font-lock-face rt-liber-ticket-emph-face)) - (add-text-properties start - (point) - `(rt-liberation-viewer-header t))) - (cond ((or (string= type "CustomField") - (string= type "EmailRecord") - (string= type "Set") - (string= type "SetWatcher")) - (insert - (format "\n" field oldvalue newvalue))) - ((string= type "Status") - (insert - (format "\n%s: %s -> %s\n" field oldvalue newvalue))) - ((or (string= type "Create") - (string= type "Comment") - (string= type "CommentEmailRecord")) - - (insert - (format "\n%s\n" - (rt-liber-viewer2-format-content content))))))) + (when (not (or (string= type "CommentEmailRecord") + (string= type "EmailRecord"))) + (insert + (format "Ticket %s by %s, %s (%s) [%s]\n" + ticket-id + creator + (rt-liber-viewer2-vernacular-date date) + date + (format "%s%s%s" + type + (if (< 0 (length oldvalue)) + (concat " " oldvalue) + "") + (if (< 0 (length newvalue)) + (concat "->" newvalue) + "")))) + (add-text-properties start + (point) + `(font-lock-face rt-liber-ticket-emph-face)) + (add-text-properties start + (point) + `(rt-liberation-viewer-header t)) + (cond ((string= type "Status") + (insert + (format "\n Status change from %s to %s\n\n" oldvalue newvalue))) + ((and (string= type "Set") + (string= field "Owner") + (string= oldvalue "10")) + (insert + (format "\n Ticket assigned\n\n" oldvalue newvalue))) + ;; catch-all + (t + (insert + (format "\n%s\n" + (rt-liber-viewer2-format-content content))))))))) (defun rt-liber-viewer2-display-history (contents) (let ((section-list (rt-liber-viewer-parse-history contents))) -- cgit v1.2.3 From 1038ecc683545100d0a3df972be1c3e1a8501c4f Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Thu, 3 Dec 2020 14:20:27 -0500 Subject: * rt-liberation.el: fill content --- rt-liberation.el | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 623c029..bf59ede 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1347,21 +1347,28 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (goto-char (point-min)) (if (re-search-forward "^This transaction appears to have no content" (point-max) t) "" + ;; remove leading blank lines (save-excursion (goto-char (point-min)) (re-search-forward "[[:graph:]]" (point-max) t) (forward-line -1) (flush-lines "^[[:space:]]+$" (point-min) (point))) - + ;; remove trailing blank lines + (save-excursion + (goto-char (point-max)) + (re-search-backward "[[:graph:]]" (point-min) t) + (forward-line 2) + (flush-lines "^[[:space:]]+$" (point-max) (point))) ;; Convert the 9 leading whitespaces from RT's comment lines. (goto-char (point-min)) (insert " ") (while (re-search-forward "^ " (point-max) t) (replace-match " ")) - - (fill-region (point-min) - (point-max)) - + ;; fill + (let ((paragraph-separate " >[[:space:]]+$")) + (fill-region (point-min) + (point-max))) + ;; finally (buffer-substring (point-min) (point-max))))) -- cgit v1.2.3 From dacb48c574049200c8799ecbc8cb9aa12d5f956d Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Thu, 3 Dec 2020 16:08:40 -0500 Subject: * rt-liberation.el: trim down viewer2 key map. --- rt-liberation.el | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index bf59ede..37c20aa 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1487,16 +1487,10 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (let ((map (make-sparse-keymap))) (define-key map (kbd "q") 'rt-liber-viewer2-mode-quit) (define-key map (kbd "n") 'rt-liber-viewer2-next-section-in) - (define-key map (kbd "N") 'rt-liber-viewer2-jump-to-latest-correspondence) (define-key map (kbd "p") 'rt-liber-viewer2-previous-section-in) - (define-key map (kbd "V") 'rt-liber-viewer2-visit-in-browser) - (define-key map (kbd "m") 'rt-liber-viewer2-answer) - (define-key map (kbd "M") 'rt-liber-viewer2-answer-this) - (define-key map (kbd "t") 'rt-liber-viewer2-answer-provisionally) - (define-key map (kbd "T") 'rt-liber-viewer2-answer-provisionally-this) - (define-key map (kbd "F") 'rt-liber-viewer2-answer-verbatim-this) - (define-key map (kbd "c") 'rt-liber-viewer2-comment) - (define-key map (kbd "C") 'rt-liber-viewer2-comment-this) + (define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser) + (define-key map (kbd "M") 'rt-liber-viewer2-answer) + (define-key map (kbd "C") 'rt-liber-viewer2-comment) (define-key map (kbd "g") 'revert-buffer) (define-key map (kbd "SPC") 'scroll-up) (define-key map (kbd "DEL") 'scroll-down) -- cgit v1.2.3 From 3a0dfc30d90346a6d6420b5d000310606777e6af Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Thu, 3 Dec 2020 21:32:34 -0500 Subject: * rt-liberation.el: section data --- rt-liberation.el | 86 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 37c20aa..af2eb26 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1340,6 +1340,15 @@ ASSOC-BROWSER if non-nil should be a ticket browser." section-point-list)) section-list))) +(defun rt-liber-viewer2-get-section-data () + "Return the current section data." + (let ((section (get-text-property (point) 'rt-liberation-section-data))) + (when (not section) + (save-excursion + (rt-liber-viewer2-previous-section-in) + (setq section (get-text-property (point) 'rt-liberation-section-data)))) + section)) + (defun rt-liber-viewer2-format-content (content) (with-temp-buffer (insert content) @@ -1380,43 +1389,46 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (content (alist-get 'Content section)) (oldvalue (alist-get 'OldValue section)) (newvalue (alist-get 'NewValue section)) - (field (alist-get 'Field section))) - (let ((start (point))) - (when (not (or (string= type "CommentEmailRecord") - (string= type "EmailRecord"))) - (insert - (format "Ticket %s by %s, %s (%s) [%s]\n" - ticket-id - creator - (rt-liber-viewer2-vernacular-date date) - date - (format "%s%s%s" - type - (if (< 0 (length oldvalue)) - (concat " " oldvalue) - "") - (if (< 0 (length newvalue)) - (concat "->" newvalue) - "")))) - (add-text-properties start - (point) - `(font-lock-face rt-liber-ticket-emph-face)) - (add-text-properties start - (point) - `(rt-liberation-viewer-header t)) - (cond ((string= type "Status") - (insert - (format "\n Status change from %s to %s\n\n" oldvalue newvalue))) - ((and (string= type "Set") - (string= field "Owner") - (string= oldvalue "10")) - (insert - (format "\n Ticket assigned\n\n" oldvalue newvalue))) - ;; catch-all - (t - (insert - (format "\n%s\n" - (rt-liber-viewer2-format-content content))))))))) + (field (alist-get 'Field section)) + (start (point))) + (when (not (or (string= type "CommentEmailRecord") + (string= type "EmailRecord"))) + (insert + (format "Ticket %s by %s, %s (%s) [%s]\n" + ticket-id + creator + (rt-liber-viewer2-vernacular-date date) + date + (format "%s%s%s" + type + (if (< 0 (length oldvalue)) + (concat " " oldvalue) + "") + (if (< 0 (length newvalue)) + (concat "->" newvalue) + "")))) + (add-text-properties start + (point) + `(font-lock-face rt-liber-ticket-emph-face)) + (add-text-properties start + (point) + `(rt-liberation-viewer-header t)) + (add-text-properties start + (point) + `(rt-liberation-section-data ,section)) + (cond ((string= type "Status") + (insert + (format "\n Status change from %s to %s\n\n" oldvalue newvalue))) + ((and (string= type "Set") + (string= field "Owner") + (string= oldvalue "10")) + (insert + (format "\n Ticket assigned\n\n" oldvalue newvalue))) + ;; catch-all + (t + (insert + (format "\n%s\n" + (rt-liber-viewer2-format-content content)))))))) (defun rt-liber-viewer2-display-history (contents) (let ((section-list (rt-liber-viewer-parse-history contents))) -- cgit v1.2.3 From b1a1dc690b2baaef9058882668d9945217e53353 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Thu, 3 Dec 2020 22:30:17 -0500 Subject: * rt-liberation.el: prep for mail --- rt-liberation.el | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index af2eb26..b364839 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1350,19 +1350,19 @@ ASSOC-BROWSER if non-nil should be a ticket browser." section)) (defun rt-liber-viewer2-format-content (content) + "Wrangle RT's content format." (with-temp-buffer (insert content) - (goto-char (point-min)) (if (re-search-forward "^This transaction appears to have no content" (point-max) t) - "" - ;; remove leading blank lines + "" ; make no content mean... no content + ;; trim leading blank lines (save-excursion (goto-char (point-min)) (re-search-forward "[[:graph:]]" (point-max) t) (forward-line -1) (flush-lines "^[[:space:]]+$" (point-min) (point))) - ;; remove trailing blank lines + ;; trim trailing blank lines (save-excursion (goto-char (point-max)) (re-search-backward "[[:graph:]]" (point-min) t) @@ -1381,8 +1381,25 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (buffer-substring (point-min) (point-max))))) +(defun rt-liber-viewer2-clean-content (section) + "Format section content for email." + (with-temp-buffer + (insert (rt-liber-viewer2-format-content + (alist-get 'Content section))) + (goto-char (point-min)) + (while (re-search-forward "^ " (point-max) t) + (replace-match "")) + ;; fill + (let ((paragraph-separate ">[[:space:]]+$")) + (fill-region (point-min) + (point-max))) + ;; finally + (buffer-substring (point-min) + (point-max)))) + (defun rt-liber-viewer2-display-section (section) - (let ((ticket-id (alist-get 'Ticket section)) + (let ((start (point)) + (ticket-id (alist-get 'Ticket section)) (creator (alist-get 'Creator section)) (date (alist-get 'Created section)) (type (alist-get 'Type section)) @@ -1390,7 +1407,8 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (oldvalue (alist-get 'OldValue section)) (newvalue (alist-get 'NewValue section)) (field (alist-get 'Field section)) - (start (point))) + (s-content (rt-liber-viewer2-format-content + (alist-get 'Content section)))) (when (not (or (string= type "CommentEmailRecord") (string= type "EmailRecord"))) (insert @@ -1427,8 +1445,7 @@ ASSOC-BROWSER if non-nil should be a ticket browser." ;; catch-all (t (insert - (format "\n%s\n" - (rt-liber-viewer2-format-content content)))))))) + (format "\n%s\n" s-content))))))) (defun rt-liber-viewer2-display-history (contents) (let ((section-list (rt-liber-viewer-parse-history contents))) @@ -1495,6 +1512,18 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (goto-char prev) (forward-line -1)))) +(defun rt-liber-viewer2-answer () + (interactive) + (let ((section (rt-liber-viewer2-get-section-data))) + (when (not section) + (error "no section found")) + (if (not (featurep 'rt-liberation-gnus)) + (error "rt-liberation-gnus feature not found") + (rt-liber-gnus-compose + rt-liber-gnus-address + rt-liber-ticket-local + `((contents . ,(rt-liber-viewer2-clean-content section))))))) + (defconst rt-liber-viewer2-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "q") 'rt-liber-viewer2-mode-quit) -- cgit v1.2.3 From 44823a014511525fa5496f738cc9ae403a3a7768 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 4 Dec 2020 09:53:48 -0500 Subject: * rt-liberation.el: gnus integration --- rt-liberation.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rt-liberation.el b/rt-liberation.el index b364839..4cb4086 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1524,6 +1524,18 @@ ASSOC-BROWSER if non-nil should be a ticket browser." rt-liber-ticket-local `((contents . ,(rt-liber-viewer2-clean-content section))))))) +(defun rt-liber-viewer2-comment () + (interactive) + (let ((section (rt-liber-viewer2-get-section-data))) + (when (not section) + (error "no section found")) + (if (not (featurep 'rt-liberation-gnus)) + (error "rt-liberation-gnus feature not found") + (rt-liber-gnus-compose + rt-liber-gnus-comment-address + rt-liber-ticket-local + `((contents . ,(rt-liber-viewer2-clean-content section))))))) + (defconst rt-liber-viewer2-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "q") 'rt-liber-viewer2-mode-quit) -- cgit v1.2.3 From bd533b21bb4c57593728ff84244a8b873cacac5f Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 4 Dec 2020 10:38:16 -0500 Subject: fix compiler warnings --- rt-liberation-gnus.el | 10 ---------- rt-liberation.el | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/rt-liberation-gnus.el b/rt-liberation-gnus.el index a2e5414..789e482 100644 --- a/rt-liberation-gnus.el +++ b/rt-liberation-gnus.el @@ -32,16 +32,6 @@ :prefix "rt-liber-gnus-" :group 'rt-liber-gnus) -(defcustom rt-liber-gnus-comment-address "no comment address set" - "*Email address for adding a comment." - :type 'string - :group 'rt-liber-gnus) - -(defcustom rt-liber-gnus-address "no reply address set" - "*Email address for replying to requestor." - :type 'string - :group 'rt-liber-gnus) - (defcustom rt-liber-gnus-subject-name "no subject name set" "*Subject name to be included in email header." :type 'string diff --git a/rt-liberation.el b/rt-liberation.el index 4cb4086..8b6103c 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -230,6 +230,16 @@ This variable is made buffer local for the ticket history") "Browser associated with a ticket history. This variable is made buffer local for the ticket history") +(defcustom rt-liber-gnus-comment-address "no comment address set" + "*Email address for adding a comment." + :type 'string + :group 'rt-liber-gnus) + +(defcustom rt-liber-gnus-address "no reply address set" + "*Email address for replying to requestor." + :type 'string + :group 'rt-liber-gnus) + ;;; -------------------------------------------------------- ;;; Debug log @@ -1123,6 +1133,9 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (run-hooks 'rt-liber-viewer-hook)) ;; wrapper functions around specific functions provided by a backend +(declare-function + rt-liber-gnus-compose + "rt-liberation-gnus.el") (declare-function rt-liber-gnus-compose-reply-to-requestor "rt-liberation-gnus.el") @@ -1403,7 +1416,6 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (creator (alist-get 'Creator section)) (date (alist-get 'Created section)) (type (alist-get 'Type section)) - (content (alist-get 'Content section)) (oldvalue (alist-get 'OldValue section)) (newvalue (alist-get 'NewValue section)) (field (alist-get 'Field section)) @@ -1441,7 +1453,7 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (string= field "Owner") (string= oldvalue "10")) (insert - (format "\n Ticket assigned\n\n" oldvalue newvalue))) + (format "\n Ticket assigned\n\n"))) ;; catch-all (t (insert -- cgit v1.2.3 From a99fc59d344d3819972f87674bf93f90ca0d7c03 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 4 Dec 2020 16:05:53 -0500 Subject: * rt-liberation.el: high recenter --- rt-liberation.el | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 8b6103c..3c2962f 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -240,6 +240,12 @@ This variable is made buffer local for the ticket history") :type 'string :group 'rt-liber-gnus) +(defvar rt-liber-display-ticket-at-point-f 'rt-liber-viewer2-display-ticket-at-point + "Function for displaying ticket at point in the browser.") + +(defvar rt-liber-viewer2-recenter 4 + "Argument passed to `recenter' in the viewer.") + ;;; -------------------------------------------------------- ;;; Debug log @@ -655,6 +661,11 @@ If POINT is nil then called on (point)." (let ((ticket-alist (get-text-property (point) 'rt-ticket))) (rt-liber-display-ticket-history ticket-alist (current-buffer)))) +(defun rt-liber-ticket-at-point () + "Display the contents of the ticket at point." + (interactive) + (funcall rt-liber-display-ticket-at-point-f)) + (defun rt-liber-browser-search (id) "Return point where ticket with ID is displayed or nil." (let ((p nil)) @@ -796,7 +807,7 @@ returned as no associated text properties." (define-key map (kbd "q") 'rt-liber-browser-mode-quit) (define-key map (kbd "n") 'rt-liber-next-ticket-in-browser) (define-key map (kbd "p") 'rt-liber-previous-ticket-in-browser) - (define-key map (kbd "RET") 'rt-liber-display-ticket-at-point) + (define-key map (kbd "RET") 'rt-liber-ticket-at-point) (define-key map (kbd "g") 'revert-buffer) (define-key map (kbd "G") 'rt-liber-browser-refresh-and-return) (define-key map (kbd "a") 'rt-liber-browser-assign) @@ -1211,6 +1222,10 @@ ASSOC-BROWSER if non-nil should be a ticket browser." ;;; ------------------------------------------------------------------ ;;; viewer2 ;;; ------------------------------------------------------------------ + +;; Comment: The goal is to eventually break this code away to its own +;; file. + (defface rt-liber-ticket-emph-face '((((class color) (background dark)) (:foreground "gray53")) @@ -1510,9 +1525,10 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (let ((next (next-single-property-change (point) 'rt-liberation-viewer-header))) - (if next - (goto-char next) - (message "no next section")))) + (if (not next) + (message "no next section") + (goto-char next) + (recenter rt-liber-viewer2-recenter)))) (defun rt-liber-viewer2-previous-section-in () (interactive) @@ -1522,7 +1538,8 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (if (not prev) (message "no previous section") (goto-char prev) - (forward-line -1)))) + (forward-line -1) + (recenter rt-liber-viewer2-recenter)))) (defun rt-liber-viewer2-answer () (interactive) -- cgit v1.2.3 From d567c5942a06fa2604d065101c990d3743bf5f13 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 11 Dec 2020 14:29:00 -0500 Subject: * rt-liberation.el: fix n/p in viewer2 Not the best solution, but one that reliably works. --- rt-liberation.el | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/rt-liberation.el b/rt-liberation.el index 3c2962f..d708f43 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -243,6 +243,9 @@ This variable is made buffer local for the ticket history") (defvar rt-liber-display-ticket-at-point-f 'rt-liber-viewer2-display-ticket-at-point "Function for displaying ticket at point in the browser.") +(defvar rt-liber-viewer2-section-regexp "^Ticket [0-9]+ by " + "Regular expression to match a section in the viewer.") + (defvar rt-liber-viewer2-recenter 4 "Argument passed to `recenter' in the viewer.") @@ -1521,25 +1524,29 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (defun rt-liber-viewer2-next-section-in () (interactive) - (forward-line) - (let ((next (next-single-property-change - (point) - 'rt-liberation-viewer-header))) - (if (not next) - (message "no next section") - (goto-char next) - (recenter rt-liber-viewer2-recenter)))) + (when (looking-at rt-liber-viewer2-section-regexp) + (goto-char (1+ (point)))) + (let ((next (re-search-forward rt-liber-viewer2-section-regexp + (point-max) + t))) + (cond ((not next) + (message "no next section")) + (t + (recenter rt-liber-viewer2-recenter))) + (goto-char (point-at-bol)))) (defun rt-liber-viewer2-previous-section-in () (interactive) - (let ((prev (previous-single-property-change - (point-at-bol) - 'rt-liberation-viewer-header))) - (if (not prev) - (message "no previous section") - (goto-char prev) - (forward-line -1) - (recenter rt-liber-viewer2-recenter)))) + (when (looking-at rt-liber-viewer2-section-regexp) + (goto-char (1- (point)))) + (let ((prev (re-search-backward rt-liber-viewer2-section-regexp + (point-min) + t))) + (cond ((not prev) + (message "no previous section")) + (t + (recenter rt-liber-viewer2-recenter))) + (goto-char (point-at-bol)))) (defun rt-liber-viewer2-answer () (interactive) -- cgit v1.2.3 From fd1e4a9e61445706d700ee67dd92a8b77911526e Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 14 Dec 2020 15:04:38 -0500 Subject: * rt-liberation.el: add jump to last section --- rt-liberation.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rt-liberation.el b/rt-liberation.el index d708f43..1117889 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1535,6 +1535,17 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (recenter rt-liber-viewer2-recenter))) (goto-char (point-at-bol)))) +(defun rt-liber-viewer2-last-section-in () + (interactive) + (goto-char (point-max)) + (let ((last (re-search-backward rt-liber-viewer2-section-regexp + (point-min) + t))) + (if (not last) + (error "no sections found") + (recenter rt-liber-viewer2-recenter) + (goto-char (point-at-bol))))) + (defun rt-liber-viewer2-previous-section-in () (interactive) (when (looking-at rt-liber-viewer2-section-regexp) @@ -1575,6 +1586,7 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (defconst rt-liber-viewer2-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "q") 'rt-liber-viewer2-mode-quit) + (define-key map (kbd "N") 'rt-liber-viewer2-last-section-in) (define-key map (kbd "n") 'rt-liber-viewer2-next-section-in) (define-key map (kbd "p") 'rt-liber-viewer2-previous-section-in) (define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser) -- cgit v1.2.3 From 50eba43bf041d8c524f964fcaadac2feb3c557b5 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 14 Dec 2020 15:11:49 -0500 Subject: * rt-liberation-rest.el: formatting --- rt-liberation-rest.el | 1 - 1 file changed, 1 deletion(-) diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index 860ff88..57aff8d 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -150,7 +150,6 @@ (buffer-substring-no-properties (point-min) (point-max))) 'utf-8)) - (rt-liber-rest-write-debug (format "outgoing rest call -->\n%s\n<-- incoming\n%s\n" url str)) str))) -- cgit v1.2.3 From 33761234843f1c24c57b80db7f4c87dad82d3a53 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 14 Dec 2020 15:16:05 -0500 Subject: * rt-liberation-rest.el: better user interaction --- rt-liberation-rest.el | 1 + 1 file changed, 1 insertion(+) diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index 57aff8d..a7eb076 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -150,6 +150,7 @@ (buffer-substring-no-properties (point-min) (point-max))) 'utf-8)) + (message "done") (rt-liber-rest-write-debug (format "outgoing rest call -->\n%s\n<-- incoming\n%s\n" url str)) str))) -- cgit v1.2.3 From b3f34ab05e5d44a16e4085431cf5bdaac2c65bb6 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 16 Dec 2020 09:27:06 -0500 Subject: update documentation across the board --- doc/developer-release.txt | 6 ++ doc/rt-liber.texinfo | 74 ++++++------------ rt-liber.info | 189 ++++++++++++++++++++-------------------------- 3 files changed, 110 insertions(+), 159 deletions(-) diff --git a/doc/developer-release.txt b/doc/developer-release.txt index 81b275e..14c4096 100644 --- a/doc/developer-release.txt +++ b/doc/developer-release.txt @@ -17,6 +17,12 @@ Update the NEWS file to tell all of the people the Good News. Update the manual, compile it, and update the copy of the info file in the root directory so that ELPA can install it. +Compile an HTML version of the manual and update it on the Website: + + $ cvs commit -m "update manual" rt-liber.html + + $ cvs commit -m "update website" index.html + * push Push these updates to the git repo. diff --git a/doc/rt-liber.texinfo b/doc/rt-liber.texinfo index 0436425..bc2a095 100644 --- a/doc/rt-liber.texinfo +++ b/doc/rt-liber.texinfo @@ -48,7 +48,8 @@ This is the Manual for the rt-liberation system @menu * Introduction:: Introduction to rt-liberation. -* Installation:: Setup rt-liberation to work on the system. +* Installation:: Install rt-liberation on the system. +* Configuration:: Setup rt-liberation to work on the system. Using rt-liberation * Queries:: Retrieve particular tickets from the server. @@ -117,10 +118,12 @@ operations on the tickets. @chapter Installation @cindex installation -rt-liberation is available via GNU ELPA. +rt-liberation is available via GNU ELPA. Invoke @kbd{M-x +list-packages} and choose to install the rt-liberation package. -If you install rt-liberation manually instead you'll need to tell -Emacs where to find it, and tell Emacs to load the package: +If you install rt-liberation manually, by copying the code to your +machine, instead you'll need to tell Emacs where to find it, and then +tell Emacs to load the package: @lisp (add-to-list 'load-path "/PATH/TO/rt-liberation/") @@ -131,6 +134,11 @@ Emacs where to find it, and tell Emacs to load the package: @end lisp +@c -------------------------------------------------- +@node Configuration +@chapter Configuration +@cindex configuration + rt-liberation needs to be configured in your ~/.emacs, an ~/.rt-liber file, or similar. @@ -622,10 +630,8 @@ buffers will be created displaying the query results and named @chapter Ticket Viewer @cindex ticket viewer -The ticket viewer is an interface for viewing the contents of a -ticket. It provides font-locking to make reading the contents easier -via @var{rt-liber-viewer-font-lock-keywords} and a number of -key-bindings. +The ticket viewer is an interface for viewing the contents of a ticket +and for sending answers. The ticket viewer provides key-bindings to help compose emails to send to the RT email interface. The key-bindings for composing email @@ -634,34 +640,26 @@ them depends on the email-backend system you have installed into rt-liberation. @file{rt-liberation-gnus.el} provides integration with Gnus, @xref{Gnus Integration}. -Setting @var{rt-liber-jump-to-latest} to `t' will cause the viewer to -automatically scroll to the latest comment in a ticket when that -ticket is visited. By default @var{rt-liber-jump-to-latest} is set to -`nil'. - -When in the ticket viewer buffer, invoking -@dfn{rt-liber-viewer-take-ticket} will ``take'' the ticket. - @table @kbd @item q @kindex q (ticket viewer) -@findex rt-liber-viewer-mode-quit +@findex rt-liber-viewer2-mode-quit Bury the ticket viewer buffer. @item n @kindex n (ticket viewer) -@findex rt-liber-next-section-in-viewer -Move point to the next section in ticket. +@findex rt-liber-viewer2-next-section-in +Move to the next section in ticket. @item N @kindex N (ticket viewer) -@findex rt-liber-jump-to-latest-correspondence -Move point to the newest correspondence section, if any. +@findex rt-liber-viewer2-last-section-in +Move to the last section. @item p @kindex p (ticket viewer) -@findex rt-liber-previous-section-in-viewer +@findex rt-liber-viewer2-previous-section-in Move point to the previous section in ticket. @item V @@ -669,43 +667,15 @@ Move point to the previous section in ticket. @findex rt-liber-viewer-visit-in-browser Visit the current ticket in a Web browser. -@item m -@kindex m (ticket viewer) -@findex rt-liber-viewer-answer -Compose an answer to the current ticket. - @item M @kindex M (ticket viewer) -@findex rt-liber-viewer-answer-this +@findex rt-liber-viewer2-answer Compose an answer to the current ticket. The content section around point will be inserted into the email body and commented out. -@item t -@kindex t (ticket viewer) -@findex rt-liber-viewer-answer-provisionally -Compose a provisional answer to the current ticket. - -@item T -@kindex t (ticket viewer) -@findex rt-liber-viewer-answer-provisionally-this -Compose a provisional answer to the current ticket. The content -section around point will be inserted into the email body and -commented out. - -@item F -@kindex F (ticket viewer) -@findex rt-liber-viewer-answer-verbatim-this -Compose an answer to the current ticket. The content section around -point will be inserted into the email body verbatim. - -@item c -@kindex c (ticket viewer) -@findex rt-liber-viewer-comment -Compose a comment for the current ticket. - @item C @kindex C (ticket viewer) -@findex rt-liber-viewer-comment-this +@findex rt-liber-viewer2-comment Comment on the ticket using the current context @item g diff --git a/rt-liber.info b/rt-liber.info index d227b86..c2df1d8 100644 --- a/rt-liber.info +++ b/rt-liber.info @@ -36,7 +36,8 @@ Foundation, Inc. * Menu: * Introduction:: Introduction to rt-liberation. -* Installation:: Setup rt-liberation to work on the system. +* Installation:: Install rt-liberation on the system. +* Configuration:: Setup rt-liberation to work on the system. Using rt-liberation * Queries:: Retrieve particular tickets from the server. @@ -95,21 +96,29 @@ browsing the resulting tickets, viewing the tickets' contents and performing operations on the tickets.  -File: rt-liber.info, Node: Installation, Next: Queries, Prev: Introduction, Up: Top +File: rt-liber.info, Node: Installation, Next: Configuration, Prev: Introduction, Up: Top 2 Installation ************** -rt-liberation is available via GNU ELPA. +rt-liberation is available via GNU ELPA. Invoke 'M-x list-packages' and +choose to install the rt-liberation package. - If you install rt-liberation manually instead you'll need to tell -Emacs where to find it, and tell Emacs to load the package: + If you install rt-liberation manually, by copying the code to your +machine, instead you'll need to tell Emacs where to find it, and then +tell Emacs to load the package: (add-to-list 'load-path "/PATH/TO/rt-liberation/") (require 'rt-liberation) - rt-liberation needs to be configured in your ~/.emacs, an ~/.rt-liber + +File: rt-liber.info, Node: Configuration, Next: Queries, Prev: Installation, Up: Top + +3 Configuration +*************** + +rt-liberation needs to be configured in your ~/.emacs, an ~/.rt-liber file, or similar. Tell rt-liberation where to find the RT server's REST interface: @@ -142,9 +151,9 @@ to work the base URL needs to be set in RT-LIBER-BASE-URL. For example: (setq rt-liber-base-url "https://rt.foo.org/")  -File: rt-liber.info, Node: Queries, Next: Ticket Browser, Prev: Installation, Up: Top +File: rt-liber.info, Node: Queries, Next: Ticket Browser, Prev: Configuration, Up: Top -3 Queries +4 Queries ********* A typical RT server is meant to manage a large amount of tickets. Much @@ -162,7 +171,7 @@ RT's TicketSQL language.  File: rt-liber.info, Node: Query Compiler, Next: Query Language, Up: Queries -3.1 Query Compiler +4.1 Query Compiler ================== In order to browse and view tickets a list of needs to be requested from @@ -178,7 +187,7 @@ number of TicketSQL tokens.  File: rt-liber.info, Node: Query Language, Prev: Query Compiler, Up: Queries -3.2 Query Language +4.2 Query Language ================== rt-liberation's Sexp-based query language covers a portion of the @@ -246,7 +255,7 @@ in function calls:  File: rt-liber.info, Node: Ticket Browser, Next: Ticket Viewer, Prev: Queries, Up: Top -4 Ticket Browser +5 Ticket Browser **************** The ticket browser is a special buffer which provides a convenient @@ -338,7 +347,7 @@ string, the following is equivalent:  File: rt-liber.info, Node: Ticket Browser Display, Next: Ticket Browser Sorting, Up: Ticket Browser -4.1 Ticket Browser Display +5.1 Ticket Browser Display ========================== The ticket browser displays the tickets in the browser by calling @@ -398,7 +407,7 @@ RT-LIBER-BROWSER-PRIORITY-CUTOFF  File: rt-liber.info, Node: Ticket Browser Sorting, Next: Ticket Browser Filtering, Prev: Ticket Browser Display, Up: Ticket Browser -4.2 Ticket Browser Sorting +5.2 Ticket Browser Sorting ========================== The tickets in the browser are displayed by default in reverse @@ -445,7 +454,7 @@ functions to perform comparisons between ticket objects:  File: rt-liber.info, Node: Ticket Browser Filtering, Next: Multiple Ticket Browsers, Prev: Ticket Browser Sorting, Up: Ticket Browser -4.3 Ticket Browser Filtering +5.3 Ticket Browser Filtering ============================ The Ticket Browser can also filter out (that is, not display) certain @@ -483,7 +492,7 @@ ticket is to be filtered.  File: rt-liber.info, Node: Multiple Ticket Browsers, Prev: Ticket Browser Filtering, Up: Ticket Browser -4.4 Multiple Ticket Browsers +5.4 Multiple Ticket Browsers ============================ It is sometimes useful to rename the ticket browser buffer to something @@ -517,12 +526,11 @@ supervisor*" and "*new tickets*" respectively:  File: rt-liber.info, Node: Ticket Viewer, Next: Gnus Integration, Prev: Ticket Browser, Up: Top -5 Ticket Viewer +6 Ticket Viewer *************** -The ticket viewer is an interface for viewing the contents of a ticket. -It provides font-locking to make reading the contents easier via -RT-LIBER-VIEWER-FONT-LOCK-KEYWORDS and a number of key-bindings. +The ticket viewer is an interface for viewing the contents of a ticket +and for sending answers. The ticket viewer provides key-bindings to help compose emails to send to the RT email interface. The key-bindings for composing email @@ -531,21 +539,14 @@ depends on the email-backend system you have installed into rt-liberation. 'rt-liberation-gnus.el' provides integration with Gnus, *Note Gnus Integration::. - Setting RT-LIBER-JUMP-TO-LATEST to 't' will cause the viewer to -automatically scroll to the latest comment in a ticket when that ticket -is visited. By default RT-LIBER-JUMP-TO-LATEST is set to 'nil'. - - When in the ticket viewer buffer, invoking -"rt-liber-viewer-take-ticket" will "take" the ticket. - 'q' Bury the ticket viewer buffer. 'n' - Move point to the next section in ticket. + Move to the next section in ticket. 'N' - Move point to the newest correspondence section, if any. + Move to the last section. 'p' Move point to the previous section in ticket. @@ -553,29 +554,11 @@ is visited. By default RT-LIBER-JUMP-TO-LATEST is set to 'nil'. 'V' Visit the current ticket in a Web browser. -'m' - Compose an answer to the current ticket. - 'M' Compose an answer to the current ticket. The content section around point will be inserted into the email body and commented out. -'t' - Compose a provisional answer to the current ticket. - -'T' - Compose a provisional answer to the current ticket. The content - section around point will be inserted into the email body and - commented out. - -'F' - Compose an answer to the current ticket. The content section - around point will be inserted into the email body verbatim. - -'c' - Compose a comment for the current ticket. - 'C' Comment on the ticket using the current context @@ -594,7 +577,7 @@ is visited. By default RT-LIBER-JUMP-TO-LATEST is set to 'nil'.  File: rt-liber.info, Node: Gnus Integration, Next: Tracking Updates, Prev: Ticket Viewer, Up: Top -6 Gnus Integration +7 Gnus Integration ****************** The file 'rt-liberation-gnus.el' implements integration with Gnus for @@ -649,7 +632,7 @@ the Viewer will be able to call into it, *Note Ticket Viewer::.  File: rt-liber.info, Node: Tracking Updates, Next: Batch Operations, Prev: Gnus Integration, Up: Top -7 Tracking Updates +8 Tracking Updates ****************** The functions in 'rt-liberation-update.el' help keep up with updates to @@ -678,7 +661,7 @@ watch for updates. For example:  File: rt-liber.info, Node: Batch Operations, Next: Local Storage, Prev: Tracking Updates, Up: Top -8 Batch Operations +9 Batch Operations ****************** The extension 'rt-liberation-multi.el' implements performing batch @@ -711,8 +694,8 @@ through all of the marked tickets.  File: rt-liber.info, Node: Local Storage, Next: Copying, Prev: Batch Operations, Up: Top -9 Local Storage -*************** +10 Local Storage +**************** 'rt-liberation-storage.el' implements associating arbitrary ancillary data with tickets. The data is stored locally and is not sent to the RT @@ -744,7 +727,7 @@ can be extended to associate any arbitrary data with any ticket.  File: rt-liber.info, Node: Copying, Next: The GNU FDL, Prev: Local Storage, Up: Top -10 The GNU General Public License. +11 The GNU General Public License. ********************************** Version 3, 29 June 2007 @@ -1460,7 +1443,7 @@ please read .  File: rt-liber.info, Node: The GNU FDL, Next: Concept Index, Prev: Copying, Up: Top -11 GNU Free Documentation License +12 GNU Free Documentation License ********************************* Version 1.2, November 2002 @@ -1855,7 +1838,7 @@ File: rt-liber.info, Node: The GNU FDL, Next: Concept Index, Prev: Copying, choose any version ever published (not as a draft) by the Free Software Foundation. -11.1 ADDENDUM: How to use this License for your documents +12.1 ADDENDUM: How to use this License for your documents ========================================================= To use this License in a document you have written, include a copy of @@ -1896,6 +1879,7 @@ Concept Index * Menu: * Batch Operations: Batch Operations. (line 6) +* configuration: Configuration. (line 6) * FDL, GNU Free Documentation License: The GNU FDL. (line 6) * Gnus Integration: Gnus Integration. (line 6) * installation: Installation. (line 6) @@ -1926,7 +1910,7 @@ Function Index * Menu: * revert-buffer: Ticket Browser. (line 48) -* revert-buffer <1>: Ticket Viewer. (line 66) +* revert-buffer <1>: Ticket Viewer. (line 40) * rt-liber-browse-query: Ticket Browser. (line 12) * rt-liber-browser-ancillary-text: Local Storage. (line 22) * rt-liber-browser-assign: Ticket Browser. (line 62) @@ -1939,7 +1923,6 @@ Function Index * rt-liber-browser-resolve: Ticket Browser. (line 65) * rt-liber-browser-take-ticket-at-point: Ticket Browser. (line 71) * rt-liber-display-ticket-at-point: Ticket Browser. (line 45) -* rt-liber-jump-to-latest-correspondence: Ticket Viewer. (line 31) * rt-liber-lex-lessthan-p: Ticket Browser Sorting. (line 15) * rt-liber-mark-ticket-at-point: Batch Operations. (line 18) @@ -1948,27 +1931,23 @@ Function Index * rt-liber-multi-flag-as-spam-and-delete: Batch Operations. (line 30) * rt-liber-multi-set-status-open: Batch Operations. (line 21) * rt-liber-multi-set-status-resolved: Batch Operations. (line 24) -* rt-liber-next-section-in-viewer: Ticket Viewer. (line 28) * rt-liber-next-ticket-in-browser: Ticket Browser. (line 39) -* rt-liber-previous-section-in-viewer: Ticket Viewer. (line 34) * rt-liber-previous-ticket-in-browser: Ticket Browser. (line 42) * rt-liber-time-lessthan-p: Ticket Browser Sorting. (line 30) * rt-liber-update: Tracking Updates. (line 17) -* rt-liber-viewer-answer: Ticket Viewer. (line 40) -* rt-liber-viewer-answer-provisionally: Ticket Viewer. (line 48) -* rt-liber-viewer-answer-provisionally-this: Ticket Viewer. (line 51) -* rt-liber-viewer-answer-this: Ticket Viewer. (line 43) -* rt-liber-viewer-answer-verbatim-this: Ticket Viewer. (line 56) -* rt-liber-viewer-comment: Ticket Viewer. (line 60) -* rt-liber-viewer-comment-this: Ticket Viewer. (line 63) -* rt-liber-viewer-mode-quit: Ticket Viewer. (line 25) -* rt-liber-viewer-show-ticket-browser: Ticket Viewer. (line 75) -* rt-liber-viewer-visit-in-browser: Ticket Viewer. (line 37) +* rt-liber-viewer-show-ticket-browser: Ticket Viewer. (line 49) +* rt-liber-viewer-visit-in-browser: Ticket Viewer. (line 29) +* rt-liber-viewer2-answer: Ticket Viewer. (line 32) +* rt-liber-viewer2-comment: Ticket Viewer. (line 37) +* rt-liber-viewer2-last-section-in: Ticket Viewer. (line 23) +* rt-liber-viewer2-mode-quit: Ticket Viewer. (line 17) +* rt-liber-viewer2-next-section-in: Ticket Viewer. (line 20) +* rt-liber-viewer2-previous-section-in: Ticket Viewer. (line 26) * scroll-down: Ticket Browser. (line 77) -* scroll-down <1>: Ticket Viewer. (line 72) +* scroll-down <1>: Ticket Viewer. (line 46) * scroll-up: Ticket Browser. (line 74) -* scroll-up <1>: Ticket Viewer. (line 69) +* scroll-up <1>: Ticket Viewer. (line 43)  File: rt-liber.info, Node: Variable Index, Next: Keybinding Index, Prev: Function Index, Up: Top @@ -1994,63 +1973,59 @@ Keybinding Index * a (ticket browser): Ticket Browser. (line 62) * A (ticket browser): Local Storage. (line 22) -* c (ticket viewer): Ticket Viewer. (line 60) -* C (ticket viewer): Ticket Viewer. (line 63) +* C (ticket viewer): Ticket Viewer. (line 37) * DEL (ticket browser): Ticket Browser. (line 77) -* DEL (ticket viewer): Ticket Viewer. (line 72) -* F (ticket viewer): Ticket Viewer. (line 56) +* DEL (ticket viewer): Ticket Viewer. (line 46) * g (ticket browser): Ticket Browser. (line 48) * G (ticket browser): Ticket Browser. (line 51) -* g (ticket viewer): Ticket Viewer. (line 66) -* h (ticket viewer): Ticket Viewer. (line 75) +* g (ticket viewer): Ticket Viewer. (line 40) +* h (ticket viewer): Ticket Viewer. (line 49) * m (ticket browser): Ticket Browser. (line 80) * M (ticket browser): Batch Operations. (line 18) -* m (ticket viewer): Ticket Viewer. (line 40) -* M (ticket viewer): Ticket Viewer. (line 43) +* M (ticket viewer): Ticket Viewer. (line 32) * n (ticket browser): Ticket Browser. (line 39) -* n (ticket viewer): Ticket Viewer. (line 28) -* N (ticket viewer): Ticket Viewer. (line 31) +* n (ticket viewer): Ticket Viewer. (line 20) +* N (ticket viewer): Ticket Viewer. (line 23) * o (ticket browser): Ticket Browser. (line 68) * p (ticket browser): Ticket Browser. (line 42) * P (ticket browser): Ticket Browser. (line 83) -* p (ticket viewer): Ticket Viewer. (line 34) +* p (ticket viewer): Ticket Viewer. (line 26) * q (ticket browser): Ticket Browser. (line 36) -* q (ticket viewer): Ticket Viewer. (line 25) +* q (ticket viewer): Ticket Viewer. (line 17) * r (ticket browser): Ticket Browser. (line 65) * RET (ticket browser): Ticket Browser. (line 45) * s (ticket browser): Ticket Browser. (line 55) * S (ticket browser): Ticket Browser. (line 58) * SPC (ticket browser): Ticket Browser. (line 74) -* SPC (ticket viewer): Ticket Viewer. (line 69) +* SPC (ticket viewer): Ticket Viewer. (line 43) * t (ticket browser): Ticket Browser. (line 71) -* t (ticket viewer): Ticket Viewer. (line 48) -* t (ticket viewer) <1>: Ticket Viewer. (line 51) -* V (ticket viewer): Ticket Viewer. (line 37) +* V (ticket viewer): Ticket Viewer. (line 29)  Tag Table: Node: Top680 -Node: Introduction2956 -Node: Installation3563 -Node: Queries5135 -Node: Query Compiler5697 -Node: Query Language6338 -Node: Ticket Browser8777 -Node: Ticket Browser Display11249 -Node: Ticket Browser Sorting13240 -Node: Ticket Browser Filtering15190 -Node: Multiple Ticket Browsers16733 -Node: Ticket Viewer17902 -Node: Gnus Integration20074 -Node: Tracking Updates22362 -Node: Batch Operations23439 -Node: Local Storage24619 -Node: Copying25697 -Node: The GNU FDL63246 -Node: Concept Index85638 -Node: Function Index87219 -Node: Variable Index90569 -Node: Keybinding Index90945 +Node: Introduction3025 +Node: Installation3632 +Node: Configuration4139 +Node: Queries5451 +Node: Query Compiler6014 +Node: Query Language6655 +Node: Ticket Browser9094 +Node: Ticket Browser Display11566 +Node: Ticket Browser Sorting13557 +Node: Ticket Browser Filtering15507 +Node: Multiple Ticket Browsers17050 +Node: Ticket Viewer18219 +Node: Gnus Integration19478 +Node: Tracking Updates21766 +Node: Batch Operations22843 +Node: Local Storage24023 +Node: Copying25103 +Node: The GNU FDL62652 +Node: Concept Index85044 +Node: Function Index86698 +Node: Variable Index89683 +Node: Keybinding Index90059  End Tag Table -- cgit v1.2.3 From e72ecd837dce602d0478b553bb1de0191c15241d Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 16 Dec 2020 09:36:53 -0500 Subject: * doc/developer-release.txt: --- doc/developer-release.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/developer-release.txt b/doc/developer-release.txt index 14c4096..484938d 100644 --- a/doc/developer-release.txt +++ b/doc/developer-release.txt @@ -29,11 +29,11 @@ Push these updates to the git repo. * tag Tag the release with the ELPA version number: - $ git tag -a 1.31 -m "1.31" + $ git tag -a 2.00 -m "2.00" Then push that tag to the VCS: - $ git push --tags origin "1.31" + $ git push --tags origin "2.00" * ELPA Push the changes to externals/rt-liberation on elpa.git with: -- cgit v1.2.3 From 35f4cd559b93acb458b6bc4d394a65cea91d4998 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 16 Dec 2020 09:59:15 -0500 Subject: * doc/developer-release.txt: --- doc/developer-release.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/developer-release.txt b/doc/developer-release.txt index 484938d..e15282c 100644 --- a/doc/developer-release.txt +++ b/doc/developer-release.txt @@ -38,4 +38,4 @@ Then push that tag to the VCS: * ELPA Push the changes to externals/rt-liberation on elpa.git with: - $ git push elpa elpa:externals/rt-liberation + $ git push elpa elpa:refs/heads/externals/rt-liberation -- cgit v1.2.3 From d964a9295fc69b2bb5ad6662cc72a6f4570925d5 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 16 Dec 2020 11:08:29 -0500 Subject: * rt-liberation.el: bump to 2.01 --- rt-liberation.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rt-liberation.el b/rt-liberation.el index 1117889..4ee51c9 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -5,7 +5,7 @@ ;; Author: Yoni Rabkin ;; Authors: Aaron S. Hawley , John Sullivan ;; Maintainer: Yoni Rabkin -;; Version: 1.31 +;; Version: 2.01 ;; Keywords: rt, tickets ;; Package-Type: multi ;; url: http://www.nongnu.org/rtliber/ -- cgit v1.2.3