From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gregor Zattler Subject: Re: Orgalist notes Date: Mon, 07 May 2018 18:57:31 +0200 Message-ID: <877eofe744.fsf@len.workgroup> References: <87a7tbwsiz.fsf@nicolasgoaziou.fr> 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]:39792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFjc9-0001Od-W9 for emacs-orgmode@gnu.org; Mon, 07 May 2018 13:07:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fFjc6-0002IN-Nq for emacs-orgmode@gnu.org; Mon, 07 May 2018 13:07:53 -0400 Received: from mout.gmx.net ([212.227.17.20]:53027) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fFjc6-0002Hp-DK for emacs-orgmode@gnu.org; Mon, 07 May 2018 13:07:50 -0400 Received: from len.workgroup ([46.94.158.96]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MOBOi-1fCRpQ3OaK-005YxI for ; Mon, 07 May 2018 19:07:48 +0200 Resent-To: emacs-orgmode Resent-Message-ID: <874ljje6n2.fsf@len.workgroup> In-Reply-To: <87a7tbwsiz.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Hi Nicolas, * Nicolas Goaziou [2018-05-07; 14:37]: > I cannot reproduce the issue. It seems to be with "org-list.el". > > Could you do it again, this time after loading Org uncompiled? I need > the backtrace to step into `org-list-insert-item'. Sure: 1. hdf ds gjdfg dzg vizdgvzu uid vjudgfvkjui dkjui uiv dfu du sjuds gdhfj dhfg vhjf df dfkjh vkjM-RET Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) goto-char(nil) (progn (goto-char pos) (goto-char (org-list-get-item-begin))) (let* ((item (progn (goto-char pos) (goto-char (org-list-get-item-begin))= )) (item-end (org-list-get-item-end item struct)) (item-end-no-blank (org-l= ist-get-item-end-before-blank item struct)) (beforep (progn (looking-at org= -list-full-item-re) (<=3D pos (cond ((not (match-beginning 4)) (match-end 0= )) ((let ((save-match-data-internal (match-data))) (unwind-protect (progn (= string-match "[.)]" (match-string 1))) (set-match-data save-match-data-inte= rnal 'evaporate))) (match-beginning 4)) (t (save-excursion (goto-char (matc= h-end 4)) (skip-chars-forward " \11") (point))))))) (split-line-p (org-get-= alist-option org-M-RET-may-split-line 'item)) (blank-nb (org-list-separatin= g-blank-lines-number pos struct prevs)) (ind (org-list-get-ind item struct)= ) (ind-size (if indent-tabs-mode (+ (/ ind tab-width) (mod ind tab-width)) = ind)) (bullet (org-list-bullet-string (org-list-get-bullet item struct))) (= box (if checkbox (progn "[ ]"))) (text-cut (and (not beforep) split-line-p = (progn (goto-char pos) (if (< item-end pos) (progn (delete-region (1- item-= end) (point-at-eol)))) (skip-chars-backward " \15\11\n") (setq pos (point))= (delete-and-extract-region pos item-end-no-blank)))) (body (concat bullet = (if box (progn (concat box " "))) after-bullet (and text-cut (if (string-ma= tch "\\`[ \11]+" text-cut) (replace-match "" t t text-cut) text-cut)))) (it= em-sep (make-string (1+ blank-nb) 10)) (item-size (+ ind-size (length body)= (length item-sep))) (size-offset (- item-size (length text-cut)))) (goto-c= har item) (indent-to-column ind) (insert body item-sep) (mapc (function (la= mbda (e) (let ((p (car e)) (end (nth 6 e))) (cond ((< p item) (if (> end it= em) (progn (setcar (nthcdr 6 e) (+ end size-offset))))) ((or beforep (not s= plit-line-p)) (setcar e (+ p item-size)) (setcar (nthcdr 6 e) (+ end item-s= ize))) ((< p pos) (setcar e (+ p item-size)) (if (< end pos) (setcar (nthcd= r 6 e) (+ end item-size)) (setcar (nthcdr 6 e) (+ end size-offset)))) ((< p= item-end) (setcar e (+ p size-offset (- item pos (length item-sep)))) (if = (=3D end item-end) (setcar (nthcdr 6 e) (+ item item-size)) (setcar (nthcdr= 6 e) (+ end size-offset (- item pos (length item-sep)))))) (t (setcar e (+= p size-offset)) (setcar (nthcdr 6 e) (+ end size-offset))))))) struct) (se= tq struct (cons (list item ind bullet nil box nil (+ item item-size)) struc= t)) (setq struct (sort struct (function (lambda (e1 e2) (< (car e1) (car e2= )))))) (if beforep (goto-char item) (setq struct (org-list-swap-items item = (+ item item-size) struct)) (goto-char (org-list-get-next-item item struct = (org-list-prevs-alist struct)))) struct) (let ((case-fold-search t)) (let* ((item (progn (goto-char pos) (goto-cha= r (org-list-get-item-begin)))) (item-end (org-list-get-item-end item struct= )) (item-end-no-blank (org-list-get-item-end-before-blank item struct)) (be= forep (progn (looking-at org-list-full-item-re) (<=3D pos (cond ((not (matc= h-beginning 4)) (match-end 0)) ((let ((save-match-data-internal (match-data= ))) (unwind-protect (progn (string-match "[.)]" (match-string 1))) (set-mat= ch-data save-match-data-internal 'evaporate))) (match-beginning 4)) (t (sav= e-excursion (goto-char (match-end 4)) (skip-chars-forward " \11") (point)))= )))) (split-line-p (org-get-alist-option org-M-RET-may-split-line 'item)) (= blank-nb (org-list-separating-blank-lines-number pos struct prevs)) (ind (o= rg-list-get-ind item struct)) (ind-size (if indent-tabs-mode (+ (/ ind tab-= width) (mod ind tab-width)) ind)) (bullet (org-list-bullet-string (org-list= -get-bullet item struct))) (box (if checkbox (progn "[ ]"))) (text-cut (and= (not beforep) split-line-p (progn (goto-char pos) (if (< item-end pos) (pr= ogn (delete-region (1- item-end) (point-at-eol)))) (skip-chars-backward " \= 15\11\n") (setq pos (point)) (delete-and-extract-region pos item-end-no-bla= nk)))) (body (concat bullet (if box (progn (concat box " "))) after-bullet = (and text-cut (if (string-match "\\`[ \11]+" text-cut) (replace-match "" t = t text-cut) text-cut)))) (item-sep (make-string (1+ blank-nb) 10)) (item-si= ze (+ ind-size (length body) (length item-sep))) (size-offset (- item-size = (length text-cut)))) (goto-char item) (indent-to-column ind) (insert body i= tem-sep) (mapc (function (lambda (e) (let ((p (car e)) (end (nth 6 e))) (co= nd ((< p item) (if (> end item) (progn (setcar (nthcdr 6 e) (+ end size-off= set))))) ((or beforep (not split-line-p)) (setcar e (+ p item-size)) (setca= r (nthcdr 6 e) (+ end item-size))) ((< p pos) (setcar e (+ p item-size)) (i= f (< end pos) (setcar (nthcdr 6 e) (+ end item-size)) (setcar (nthcdr 6 e) = (+ end size-offset)))) ((< p item-end) (setcar e (+ p size-offset (- item p= os (length item-sep)))) (if (=3D end item-end) (setcar (nthcdr 6 e) (+ item= item-size)) (setcar (nthcdr 6 e) (+ end size-offset (- item pos (length it= em-sep)))))) (t (setcar e (+ p size-offset)) (setcar (nthcdr 6 e) (+ end si= ze-offset))))))) struct) (setq struct (cons (list item ind bullet nil box n= il (+ item item-size)) struct)) (setq struct (sort struct (function (lambda= (e1 e2) (< (car e1) (car e2)))))) (if beforep (goto-char item) (setq struc= t (org-list-swap-items item (+ item item-size) struct)) (goto-char (org-lis= t-get-next-item item struct (org-list-prevs-alist struct)))) struct)) org-list-insert-item(619 ((515 0 "1. " nil nil nil 620)) ((515)) nil nil) (setq struct (org-list-insert-item (point) struct prevs checkbox desc)) (let* ((struct (save-excursion (goto-char item\?) (orgalist--struct))) (p= revs (org-list-prevs-alist struct)) (desc (and (eq 'descriptive (org-list-g= et-list-type item\? struct prevs)) " :: "))) (setq struct (org-list-insert-= item (point) struct prevs checkbox desc)) (org-list-write-struct struct (or= g-list-parents-alist struct)) (looking-at orgalist--item-re) (goto-char (if= (and (match-beginning 4) (let ((save-match-data-internal (match-data))) (u= nwind-protect (progn (string-match "\\." (match-string 1))) (set-match-data= save-match-data-internal 'evaporate)))) (match-beginning 4) (match-end 0))= ) (if desc (progn (backward-char 1)))) (let ((item\? (orgalist--in-item-p))) (if item\? nil (user-error "Not in = a list")) (let* ((struct (save-excursion (goto-char item\?) (orgalist--stru= ct))) (prevs (org-list-prevs-alist struct)) (desc (and (eq 'descriptive (or= g-list-get-list-type item\? struct prevs)) " :: "))) (setq struct (org-list= -insert-item (point) struct prevs checkbox desc)) (org-list-write-struct st= ruct (org-list-parents-alist struct)) (looking-at orgalist--item-re) (goto-= char (if (and (match-beginning 4) (let ((save-match-data-internal (match-da= ta))) (unwind-protect (progn (string-match "\\." (match-string 1))) (set-ma= tch-data save-match-data-internal 'evaporate)))) (match-beginning 4) (match= -end 0))) (if desc (progn (backward-char 1))))) orgalist-insert-item(nil) funcall-interactively(orgalist-insert-item nil) call-interactively(orgalist-insert-item nil nil) command-execute(orgalist-insert-item) Thanks for your persitence, Gregor