emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Gregor Zattler <telegraph@gmx.net>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: Orgalist notes
Date: Mon, 07 May 2018 18:57:31 +0200	[thread overview]
Message-ID: <877eofe744.fsf@len.workgroup> (raw)
In-Reply-To: <87a7tbwsiz.fsf@nicolasgoaziou.fr>

Hi Nicolas,
* Nicolas Goaziou <mail@nicolasgoaziou.fr> [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-list-get-item-end-before-blank item struct)) (beforep (progn (looking-at org-list-full-item-re) (<= 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-internal 'evaporate))) (match-beginning 4)) (t (save-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 (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-match "\\`[ \11]+" text-cut) (replace-match "" t t text-cut) text-cut)))) (item-sep (make-string (1+ blank-nb) 10)) (item-size (+ ind-size (length body) (length item-sep))) (size-offset (- item-size (length text-cut)))) (goto-char item) (indent-to-column ind) (insert body item-sep) (mapc (function (lambda (e) (let ((p (car e)) (end (nth 6 e))) (cond ((< p item) (if (> end item) (progn (setcar (nthcdr 6 e) (+ end size-offset))))) ((or beforep (not split-line-p)) (setcar e (+ p item-size)) (setcar (nthcdr 6 e) (+ end item-size))) ((< p pos) (setcar e (+ p item-size)) (if (< 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 pos (length item-sep)))) (if (= 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) (setq struct (cons (list item ind bullet nil box nil (+ item item-size)) struct)) (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-char (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)) (beforep (progn (looking-at org-list-full-item-re) (<= 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-internal 'evaporate))) (match-beginning 4)) (t (save-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 (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-match "\\`[ \11]+" text-cut) (replace-match "" t t text-cut) text-cut)))) (item-sep (make-string (1+ blank-nb) 10)) (item-size (+ ind-size (length body) (length item-sep))) (size-offset (- item-size (length text-cut)))) (goto-char item) (indent-to-column ind) (insert body item-sep) (mapc (function (lambda (e) (let ((p (car e)) (end (nth 6 e))) (cond ((< p item) (if (> end item) (progn (setcar (nthcdr 6 e) (+ end size-offset))))) ((or beforep (not split-line-p)) (setcar e (+ p item-size)) (setcar (nthcdr 6 e) (+ end item-size))) ((< p pos) (setcar e (+ p item-size)) (if (< 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 pos (length item-sep)))) (if (= 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) (setq struct (cons (list item ind bullet nil box nil (+ item item-size)) struct)) (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))
  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))) (prevs (org-list-prevs-alist struct)) (desc (and (eq 'descriptive (org-list-get-list-type item\? struct prevs)) " :: "))) (setq struct (org-list-insert-item (point) struct prevs checkbox desc)) (org-list-write-struct struct (org-list-parents-alist struct)) (looking-at orgalist--item-re) (goto-char (if (and (match-beginning 4) (let ((save-match-data-internal (match-data))) (unwind-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--struct))) (prevs (org-list-prevs-alist struct)) (desc (and (eq 'descriptive (org-list-get-list-type item\? struct prevs)) " :: "))) (setq struct (org-list-insert-item (point) struct prevs checkbox desc)) (org-list-write-struct struct (org-list-parents-alist struct)) (looking-at orgalist--item-re) (goto-char (if (and (match-beginning 4) (let ((save-match-data-internal (match-data))) (unwind-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)))))
  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

  reply	other threads:[~2018-05-07 17:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03 23:21 Orgalist notes Eric Abrahamsen
2018-05-03 23:44 ` Eric Abrahamsen
2018-05-04  5:53 ` Eric S Fraga
2018-05-04  6:45   ` Eric Abrahamsen
2018-05-04  8:14     ` Alan Schmitt
2018-05-04  8:50     ` Eric S Fraga
2018-05-04 16:44       ` Eric Abrahamsen
2018-05-04 16:55         ` Eric S Fraga
2018-05-05 11:37     ` Gregor Zattler
2018-05-05 12:50       ` Nicolas Goaziou
2018-05-05 23:55         ` Eric Abrahamsen
2018-05-06  7:30           ` Nicolas Goaziou
2018-05-06 10:43           ` Gregor Zattler
2018-05-06 11:32             ` Nicolas Goaziou
2018-05-07  9:13               ` Gregor Zattler
2018-05-07 12:37                 ` Nicolas Goaziou
2018-05-07 16:57                   ` Gregor Zattler [this message]
     [not found]                     ` <87lgcvv0aw.fsf@nicolasgoaziou.fr>
2018-05-07 20:22                       ` Gregor Zattler
2018-05-07 20:29                         ` Nicolas Goaziou
2018-05-08 18:32                           ` Gregor Zattler
2018-05-06 14:34           ` Bernt Hansen
2018-05-06 16:04             ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877eofe744.fsf@len.workgroup \
    --to=telegraph@gmx.net \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).