From mboxrd@z Thu Jan 1 00:00:00 1970 From: Narendra Joshi Subject: Re: How to stop org delete surrounding newline when adding headlines? Date: Fri, 10 Mar 2017 21:20:33 +0530 Message-ID: <87d1dpi112.fsf@vicarie> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmMjc-0000mu-1G for emacs-orgmode@gnu.org; Fri, 10 Mar 2017 10:45:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmMjY-0000pn-Q7 for emacs-orgmode@gnu.org; Fri, 10 Mar 2017 10:45:40 -0500 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:33428) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmMjY-0000ou-H2 for emacs-orgmode@gnu.org; Fri, 10 Mar 2017 10:45:36 -0500 Received: by mail-pg0-x242.google.com with SMTP id 77so10643398pgc.0 for ; Fri, 10 Mar 2017 07:45:34 -0800 (PST) Received: from vicarie ([223.229.138.220]) by smtp.gmail.com with ESMTPSA id s87sm19491015pfa.29.2017.03.10.07.45.31 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Mar 2017 07:45:32 -0800 (PST) In-Reply-To: (Shiyao Ma's message of "Thu, 9 Mar 2017 14:39:03 +0800") 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 Hi, I am getting Arithmetic Error with Emacs HEAD, while opening `org-agenda'. I think it's because of the zero in time stamps. (See <2017-0= 1-21 Sat ++0d>" ) Here is the trace: Debugger entered--Lisp error: (arith-error) org-closest-date(#("<2017-01-21 Sat ++0d>" 0 21 (fontified nil org-catego= ry "main")) 736398 #("+0d" 0 3 (org-category "main" fontified nil)) nil t) org-time-string-to-absolute(#("<2017-01-21 Sat ++0d>" 0 21 (fontified nil= org-category "main")) 736398 nil t # 38219) org-agenda-get-timestamps((#(" main: 5 d. ago: TODO Write a blog= post about something :writing:" 0 26 (org-category "main" tags ("writing"= ) org-highest-priority 65 org-lowest-priority 67 time-of-day nil duration n= il effort "" effort-minutes nil breadcrumbs nil txt #("TODO Write a blog po= st about something :writing:" 0 38 (fontified nil org-category "main" org-= heading t) 38 49 (org-heading t)) level " " time "" extra " 5 d. ago: " fo= rmat (((org-prefix-has-time t) (org-prefix-has-tag nil) (org-prefix-categor= y-length 12) (org-prefix-has-effort nil) (org-prefix-has-breadcrumbs nil)) = (format " %s %s%s%s" (format "%s" (if ... "" ...)) (format "%-12s" (if ... = "" ...)) (if (equal "" time) "" (format "%-12s" ...)) (format "%s" (if ... = "" ...)))) dotime nil mouse-face highlight org-not-done-regexp "\\(TODO\\|T= RACKING\\)" org-todo-regexp "\\(TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\= \)" org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(TODO\\|DONE\\|WONT-DO\= \|TRACKING\\|TRACKED\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\= (?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$" help-echo "mouse-2 or RET jump= to org file ~/miscellany/personal/org/main.org" org-marker # warntime nil ts-date 736393 org-hd-marker # priority 1005 ...) 26 64 (org-heading t org-category "main" fon= tified nil tags ("writing") org-highest-priority 65 org-lowest-priority 67 = time-of-day nil duration nil effort "" effort-minutes nil breadcrumbs nil t= xt #("TODO Write a blog post about something :writing:" 0 38 (fontified ni= l org-category "main" org-heading t) 38 49 (org-heading t)) level " " time= "" extra " 5 d. ago: " format (((org-prefix-has-time t) (org-prefix-has-ta= g nil) (org-prefix-category-length 12) (org-prefix-has-effort nil) (org-pre= fix-has-breadcrumbs nil)) (format " %s %s%s%s" (format "%s" (if ... "" ...)= ) (format "%-12s" (if ... "" ...)) (if (equal "" time) "" (format "%-12s" .= ..)) (format "%s" (if ... "" ...)))) dotime nil mouse-face highlight org-no= t-done-regexp "\\(TODO\\|TRACKING\\)" org-todo-regexp "\\(TODO\\|DONE\\|WON= T-DO\\|TRACKING\\|TRACKED\\)" org-complex-heading-regexp "^\\(\\*+\\)\\(?: = +\\(TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\\)\\)?\\(?: +\\(\\[#.\\]\\)\= \)?\\(?: +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$" help= -echo "mouse-2 or RET jump to org file ~/miscellany/personal/org/main.org" = org-marker # warntime nil ts-date 736393 ...) 6= 4 75 (org-heading t org-category "main" tags ("writing") org-highest-priori= ty 65 org-lowest-priority 67 time-of-day nil duration nil effort "" effort-= minutes nil breadcrumbs nil txt #("TODO Write a blog post about something = :writing:" 0 38 (fontified nil org-category "main" org-heading t) 38 49 (or= g-heading t)) level " " time "" extra " 5 d. ago: " format (((org-prefix-h= as-time t) (org-prefix-has-tag nil) (org-prefix-category-length 12) (org-pr= efix-has-effort nil) (org-prefix-has-breadcrumbs nil)) (format " %s %s%s%s"= (format "%s" (if ... "" ...)) (format "%-12s" (if ... "" ...)) (if (equal = "" time) "" (format "%-12s" ...)) (format "%s" (if ... "" ...)))) dotime ni= l mouse-face highlight org-not-done-regexp "\\(TODO\\|TRACKING\\)" org-todo= -regexp "\\(TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\\)" org-complex-head= ing-regexp "^\\(\\*+\\)\\(?: +\\(TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED= \\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum= :]_@#%:]+:\\)\\)?[ ]*$" help-echo "mouse-2 or RET jump to org file ~/misce= llany/personal/org/main.org" org-marker # warnt= ime nil ts-date 736393 org-hd-marker # ...)) #(= " main: 2 d. ago: TODO Learn about a culture every month :culture= :" 0 26 (org-category "main" tags ("culture") org-highest-priority 65 org-l= owest-priority 67 time-of-day nil duration nil effort "" effort-minutes nil= breadcrumbs nil txt #("TODO Learn about a culture every month :culture:" = 0 38 (fontified nil org-category "main" org-heading t) 38 49 (org-heading t= )) level " " time "" extra " 2 d. ago: " format (((org-prefix-has-time t) = (org-prefix-has-tag nil) (org-prefix-category-length 12) (org-prefix-has-ef= fort nil) (org-prefix-has-breadcrumbs nil)) (format " %s %s%s%s" (format "%= s" (if ... "" ...)) (format "%-12s" (if ... "" ...)) (if (equal "" time) ""= (format "%-12s" ...)) (format "%s" (if ... "" ...)))) dotime nil mouse-fac= e highlight org-not-done-regexp "\\(TODO\\|TRACKING\\)" org-todo-regexp "\\= (TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\\)" org-complex-heading-regexp = "^\\(\\*+\\)\\(?: +\\(TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\\)\\)?\\(?= : +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\= \)\\)?[ ]*$" help-echo "mouse-2 or RET jump to org file ~/miscellany/perso= nal/org/main.org" org-marker # warntime nil ts= -date 736396 org-hd-marker # priority 1002 ...= ) 26 64 (org-heading t org-category "main" fontified nil tags ("culture") o= rg-highest-priority 65 org-lowest-priority 67 time-of-day nil duration nil = effort "" effort-minutes nil breadcrumbs nil txt #("TODO Learn about a cult= ure every month :culture:" 0 38 (fontified nil org-category "main" org-hea= ding t) 38 49 (org-heading t)) level " " time "" extra " 2 d. ago: " forma= t (((org-prefix-has-time t) (org-prefix-has-tag nil) (org-prefix-category-l= ength 12) (org-prefix-has-effort nil) (org-prefix-has-breadcrumbs nil)) (fo= rmat " %s %s%s%s" (format "%s" (if ... "" ...)) (format "%-12s" (if ... "" = ...)) (if (equal "" time) "" (format "%-12s" ...)) (format "%s" (if ... "" = ...)))) dotime nil mouse-face highlight org-not-done-regexp "\\(TODO\\|TRAC= KING\\)" org-todo-regexp "\\(TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\\)"= org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(TODO\\|DONE\\|WONT-DO\\|T= RACKING\\|TRACKED\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:= [ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$" help-echo "mouse-2 or RET jump to= org file ~/miscellany/personal/org/main.org" org-marker # warntime nil ts-date 736396 ...) 64 75 (org-heading t org-cate= gory "main" tags ("culture") org-highest-priority 65 org-lowest-priority 67= time-of-day nil duration nil effort "" effort-minutes nil breadcrumbs nil = txt #("TODO Learn about a culture every month :culture:" 0 38 (fontified n= il org-category "main" org-heading t) 38 49 (org-heading t)) level " " tim= e "" extra " 2 d. ago: " format (((org-prefix-has-time t) (org-prefix-has-t= ag nil) (org-prefix-category-length 12) (org-prefix-has-effort nil) (org-pr= efix-has-breadcrumbs nil)) (format " %s %s%s%s" (format "%s" (if ... "" ...= )) (format "%-12s" (if ... "" ...)) (if (equal "" time) "" (format "%-12s" = ...)) (format "%s" (if ... "" ...)))) dotime nil mouse-face highlight org-n= ot-done-regexp "\\(TODO\\|TRACKING\\)" org-todo-regexp "\\(TODO\\|DONE\\|WO= NT-DO\\|TRACKING\\|TRACKED\\)" org-complex-heading-regexp "^\\(\\*+\\)\\(?:= +\\(TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\\)\\)?\\(?: +\\(\\[#.\\]\\)= \\)?\\(?: +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$" hel= p-echo "mouse-2 or RET jump to org file ~/miscellany/personal/org/main.org"= org-marker # warntime nil ts-date 736396 org-= hd-marker # ...)) #(" main: In 1 d.: = TODO Workout on alternate days :workout:" 0 26 (org-category "mai= n" tags ("workout") org-highest-priority 65 org-lowest-priority 67 time-of-= day nil duration nil effort "" effort-minutes nil breadcrumbs nil txt #("TO= DO Workout on alternate days :workout:" 0 30 (fontified nil org-ca= tegory "main" org-heading t) 30 49 (org-heading t)) level " " time "" extr= a "In 1 d.: " format (((org-prefix-has-time t) (org-prefix-has-tag nil) (= org-prefix-category-length 12) (org-prefix-has-effort nil) (org-prefix-has-= breadcrumbs nil)) (format " %s %s%s%s" (format "%s" (if ... "" ...)) (forma= t "%-12s" (if ... "" ...)) (if (equal "" time) "" (format "%-12s" ...)) (fo= rmat "%s" (if ... "" ...)))) dotime nil mouse-face highlight org-not-done-r= egexp "\\(TODO\\|TRACKING\\)" org-todo-regexp "\\(TODO\\|DONE\\|WONT-DO\\|T= RACKING\\|TRACKED\\)" org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(TODO= \\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?:= +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$" help-echo "m= ouse-2 or RET jump to org file ~/miscellany/personal/org/main.org" org-mark= er # warntime nil ts-date 736399 org-hd-marker= # priority 999 ...) 26 56 (org-heading t org-= category "main" fontified nil tags ("workout") org-highest-priority 65 org-= lowest-priority 67 time-of-day nil duration nil effort "" effort-minutes ni= l breadcrumbs nil txt #("TODO Workout on alternate days :workout:"= 0 30 (fontified nil org-category "main" org-heading t) 30 49 (org-heading = t)) level " " time "" extra "In 1 d.: " format (((org-prefix-has-time t)= (org-prefix-has-tag nil) (org-prefix-category-length 12) (org-prefix-has-e= ffort nil) (org-prefix-has-breadcrumbs nil)) (format " %s %s%s%s" (format "= %s" (if ... "" ...)) (format "%-12s" (if ... "" ...)) (if (equal "" time) "= " (format "%-12s" ...)) (format "%s" (if ... "" ...)))) dotime nil mouse-fa= ce highlight org-not-done-regexp "\\(TODO\\|TRACKING\\)" org-todo-regexp "\= \(TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\\)" org-complex-heading-regexp= "^\\(\\*+\\)\\(?: +\\(TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\\)\\)?\\(= ?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:= \\)\\)?[ ]*$" help-echo "mouse-2 or RET jump to org file ~/miscellany/pers= onal/org/main.org" org-marker # warntime nil t= s-date 736399 ...) 56 75 (org-heading t org-category "main" tags ("workout"= ) org-highest-priority 65 org-lowest-priority 67 time-of-day nil duration n= il effort "" effort-minutes nil breadcrumbs nil txt #("TODO Workout on alte= rnate days :workout:" 0 30 (fontified nil org-category "main" org-= heading t) 30 49 (org-heading t)) level " " time "" extra "In 1 d.: " fo= rmat (((org-prefix-has-time t) (org-prefix-has-tag nil) (org-prefix-categor= y-length 12) (org-prefix-has-effort nil) (org-prefix-has-breadcrumbs nil)) = (format " %s %s%s%s" (format "%s" (if ... "" ...)) (format "%-12s" (if ... = "" ...)) (if (equal "" time) "" (format "%-12s" ...)) (format "%s" (if ... = "" ...)))) dotime nil mouse-face highlight org-not-done-regexp "\\(TODO\\|T= RACKING\\)" org-todo-regexp "\\(TODO\\|DONE\\|WONT-DO\\|TRACKING\\|TRACKED\= \)" org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(TODO\\|DONE\\|WONT-DO\= \|TRACKING\\|TRACKED\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\= (?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$" help-echo "mouse-2 or RET jump= to org file ~/miscellany/personal/org/main.org" org-marker # warntime nil ts-date 736399 org-hd-marker # ...)))) org-agenda-get-day-entries("/home/nj/miscellany/personal/org/main.org" (3= 10 2017) :deadline :scheduled :timestamp :sexp) apply(org-agenda-get-day-entries "/home/nj/miscellany/personal/org/main.o= rg" (3 10 2017) (:deadline :scheduled :timestamp :sexp)) org-agenda-list(nil) funcall-interactively(org-agenda-list nil) call-interactively(org-agenda-list nil nil) #[1025 "\306.\211?\205.=00 \211.\306.\n\203.=00\307 \210.9\203(.=04\310N\= 203(.=0B\203(.\311\303!\202\244.=04\312.!\262.\211\211\242\313=3D\262.\203C= .\314.=06=07\"\211\262.\204).\315.!\203s.=04\203l.\316.=03E\fB.=0D\247\203l= .=0D\317V\203l.=0D\f\233\211:\203k.\211\306\241\210\210\316.=03\"\202\242.\= 320.=06.=06.=06#.=069\203\242.=06.\321N\203\242.=06.\322N\204\242.\323.=07\= 322\324#\210\325\326\327. \211\321N\330#\"\210\262.\207" [debug-on-next-cal= l prefix-arg current-prefix-arg disabled-command-function command-history h= istory-length nil prefix-command-update disabled run-hooks indirect-functio= n autoload autoload-do-load arrayp execute-kbd-macro 0 call-interactively b= yte-obsolete-info command-execute-obsolete-warned put t message "%s" macroe= xp--obsolete-warning "command"] 13 2406715](org-agenda-list nil nil nil) ad-Advice-command-execute(#[1025 "\306.\211?\205.=00 \211.\306.\n\203.=00= \307 \210.9\203(.=04\310N\203(.=0B\203(.\311\303!\202\244.=04\312.!\262.\21= 1\211\242\313=3D\262.\203C.\314.=06=07\"\211\262.\204).\315.!\203s.=04\203l= .\316.=03E\fB.=0D\247\203l.=0D\317V\203l.=0D\f\233\211:\203k.\211\306\241\2= 10\210\316.=03\"\202\242.\320.=06.=06.=06#.=069\203\242.=06.\321N\203\242.= =06.\322N\204\242.\323.=07\322\324#\210\325\326\327. \211\321N\330#\"\210\2= 62.\207" [debug-on-next-call prefix-arg current-prefix-arg disabled-command= -function command-history history-length nil prefix-command-update disabled= run-hooks indirect-function autoload autoload-do-load arrayp execute-kbd-m= acro 0 call-interactively byte-obsolete-info command-execute-obsolete-warne= d put t message "%s" macroexp--obsolete-warning "command"] 13 2406715] org-= agenda-list) apply(ad-Advice-command-execute #[1025 "\306.\211?\205.=00 \211.\306.\n\2= 03.=00\307 \210.9\203(.=04\310N\203(.=0B\203(.\311\303!\202\244.=04\312.!\2= 62.\211\211\242\313=3D\262.\203C.\314.=06=07\"\211\262.\204).\315.!\203s.= =04\203l.\316.=03E\fB.=0D\247\203l.=0D\317V\203l.=0D\f\233\211:\203k.\211\3= 06\241\210\210\316.=03\"\202\242.\320.=06.=06.=06#.=069\203\242.=06.\321N\2= 03\242.=06.\322N\204\242.\323.=07\322\324#\210\325\326\327. \211\321N\330#\= "\210\262.\207" [debug-on-next-call prefix-arg current-prefix-arg disabled-= command-function command-history history-length nil prefix-command-update d= isabled run-hooks indirect-function autoload autoload-do-load arrayp execut= e-kbd-macro 0 call-interactively byte-obsolete-info command-execute-obsolet= e-warned put t message "%s" macroexp--obsolete-warning "command"] 13 240671= 5] org-agenda-list) command-execute(org-agenda-list) --=20 Narendra Joshi