From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?SMOpY3RvciBFbnLDrXF1ZXogUmFtw7Nu?= Subject: Bug: Org agenda category max length raise error [9.2.5 (9.2.5-1-gff6508-elpaplus @ /home/edo/.emacs.d/elpa/org-plus-contrib-20190805/)] Date: Sun, 11 Aug 2019 16:49:24 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000204866058fd884cb" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44179) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hwpAC-00019S-6X for emacs-orgmode@gnu.org; Sun, 11 Aug 2019 10:49:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hwpAA-00019V-Sz for emacs-orgmode@gnu.org; Sun, 11 Aug 2019 10:49:40 -0400 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]:43621) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hwpAA-00018e-7G for emacs-orgmode@gnu.org; Sun, 11 Aug 2019 10:49:38 -0400 Received: by mail-ot1-x335.google.com with SMTP id e12so6033171otp.10 for ; Sun, 11 Aug 2019 07:49:37 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --000000000000204866058fd884cb Content-Type: text/plain; charset="UTF-8" --text follows this line-- Hi. * Issue: 1. Use max length format %., example (setq org-agenda-prefix-format '((agenda . " %i %-4.4 c%?-12t% s") ;; (agenda . " %i %-12:c%?-12t% s") (timeline . " % s") (todo . " %i %-4.4 c%?-12t% s") ;; (todo . " %i %-12:c") (tags . " %i %-4.4 c") ;; (tags . " %i %-12:c") (search . " %i %-4.4 c")) ;; (search . " %i %-12:c")) 2. Open an org file. 3. Typing C-c a a (for example) raise: org-compile-prefix-format: Args out of range: "-4.4", 4, 11 * How to fix it: org-agenda.el: (see comments ;; + line added, ;; - line removed) (when (eq var 'category) (setq org-prefix-category-length (floor (abs (string-to-number (match-string 2 s))))) (setq org-prefix-category-max-length (let ((x (match-string 2 s))) (save-match-data ;; + (when (string-match "\\.[0-9]+" x) (string-to-number (substring (match-string 0 x) 1))))))) ;; + ;; (when (string-match-p "\\.[0-9]+" x) ;; - ;; (string-to-number (substring (match-string 0 x) 1)))))) ;; - (if (eq var 'eval) (setq varform `(format ,f (org-eval ,(read (match-string 4 s))))) Best regards. Hector Emacs : GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2019-04-13 Package: Org mode version 9.2.5 (9.2.5-1-gff6508-elpaplus @ /home/edo/.emacs.d/elpa/org-plus-contrib-20190805/) --000000000000204866058fd884cb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
--text follows this line--

Hi.


* Issue:<= br>
1. Use max length format %<number>.<max>, example
(setq org-agenda-prefix-format
=C2=A0 =C2=A0 = =C2=A0 '((agenda . " %i %-4.4 c%?-12t% s") =C2=A0;; (agenda .= " %i %-12:c%?-12t% s")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (timeline = . " =C2=A0% s")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (todo . " %i = %-4.4 c%?-12t% s") =C2=A0 =C2=A0;; (todo . " %i %-12:c")
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 (tags . " %i %-4.4 c") =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; (tags . " %i %-12:c")
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 (search . " %i %-4.4 c")) =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0;; (search . " %i %-12:c"))


2. Ope= n an org file.

3. Typing C-c a a (for example) raise:

=C2=A0 = =C2=A0org-compile-prefix-format: Args out of range: "-4.4", 4, 11=


* How to fix it:

org-agenda.el: (see comments ;; + line = added, ;; - line removed)

=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (when (eq var 'category)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (setq org-prefix-category-length
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (floor (abs (string-to-number (ma= tch-string 2 s)))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq org-= prefix-category-max-length
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (let ((x (match-string 2 s)))
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (save-match-data =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0;; +
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (when (string-match "\\.[0-9]+" x)
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (str= ing-to-number (substring (match-string 0 x) 1))))))) =C2=A0;; +
;; =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (s= tring-match-p "\\.[0-9]+" x) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; -
;; =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-to-number (= substring (match-string 0 x) 1)))))) =C2=A0;; -
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (if (eq var 'eval)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (setq varform `(format ,f (org-eval ,(read (match-string 4 s))))= )



Best regards. Hector

Emacs =C2=A0: GNU Emacs= 26.2 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
=C2=A0o= f 2019-04-13
Package: Org mode version 9.2.5 (9.2.5-1-gff6508-elpaplus @= /home/edo/.emacs.d/elpa/org-plus-contrib-20190805/)
--000000000000204866058fd884cb--