From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: 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: Mon, 12 Aug 2019 13:55:05 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d13b7b058fea323c" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37938) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hx8v6-00016q-1p for emacs-orgmode@gnu.org; Mon, 12 Aug 2019 07:55:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hx8v4-0008Sh-R8 for emacs-orgmode@gnu.org; Mon, 12 Aug 2019 07:55:23 -0400 Received: from mail-ed1-f48.google.com ([209.85.208.48]:38962) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hx8v4-0008SG-Kf for emacs-orgmode@gnu.org; Mon, 12 Aug 2019 07:55:22 -0400 Received: by mail-ed1-f48.google.com with SMTP id e16so10172321edv.6 for ; Mon, 12 Aug 2019 04:55:22 -0700 (PDT) In-Reply-To: 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: =?UTF-8?B?SMOpY3RvciBFbnLDrXF1ZXogUmFtw7Nu?= Cc: org-mode list --000000000000d13b7b058fea323c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Fixed, thank you. Carsten On Sun, Aug 11, 2019 at 4:50 PM H=C3=A9ctor Enr=C3=ADquez Ram=C3=B3n wrote: > --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/) > --000000000000d13b7b058fea323c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Fixed, thank you.

Carsten
On Sun, = Aug 11, 2019 at 4:50 PM H=C3=A9ctor Enr=C3=ADquez Ram=C3=B3n <hector.e.r@gmail.com> wrote:
=
--text f= ollows this line--

Hi.


* Issue:

1. Use max length = format %<number>.<max>, example

(setq org-agenda-prefix-format
=C2=A0 =C2=A0 =C2=A0 '((agenda . &qu= ot; %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")<= br>=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 (sear= ch . " %i %-4.4 c")) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; (search= . " %i %-12:c"))


2. Open an org file.

3. Ty= ping C-c a a (for example) raise:

=C2=A0 =C2=A0org-compile-prefix-fo= rmat: 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 (match-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 (strin= g-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 (string-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 (string-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 &= #39;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-p= c-linux-gnu, X toolkit, Xaw scroll bars)
=C2=A0of 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/)
--000000000000d13b7b058fea323c--