emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* error in orgstruct-mode
@ 2012-10-18 16:52 Peter Salazar
  2012-10-19 22:31 ` Peter Salazar
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Salazar @ 2012-10-18 16:52 UTC (permalink / raw)
  To: org-mode

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

I'm using Aquamacs in markdown-mode with orgstruct-mode turned on.

When I start a numbered list:

1. foo

...at the end of that line, I want to automatically generate the next
number on the list, so I hit OPTION-RETURN

but instead of generating a "2. " on the next line, I get this error:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  byte-code("\b\203

This used to work fine in markdown-mode with orgstruct-mode turned on...

Backtrace:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  byte-code("\b\203

[-- Attachment #2: Type: text/html, Size: 971 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: error in orgstruct-mode
  2012-10-18 16:52 error in orgstruct-mode Peter Salazar
@ 2012-10-19 22:31 ` Peter Salazar
  2012-10-19 22:54   ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Salazar @ 2012-10-19 22:31 UTC (permalink / raw)
  To: org-mode

[-- Attachment #1: Type: text/plain, Size: 5551 bytes --]

Oops. Here's the full backtrace. Anyone have any thoughts? Help!


Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  byte-code("\b\203
  \306\x10\202
\307\310!\210m\203\x16\311\312\306\"\210\313\314!\203!\311\315\306\"\210\316\306w\210i\211\x11\nV\2032\311\315\317\"\210
\nW\203=\311\312\317\"\210\320
\204G\311\312\306\"\210\321\310!\x13\310\224\310\225|\210\310\224b\210\322\f
T\211\x15\"\211\x16\x17c\210\x0e\x17G
GZ\x16\x18\323\x0e\x18!\210\306\x1e\x19\212\x0e\x19\203{\x0e\x19b\210n\203\203\324\202\204\325\326\324`\"\\*\x0e\x1aU\203\227\x0e^[\x0e\x18\\\x16^[\306\207"
[bobp ind1 ind old fmt n nil beginning-of-line 2 throw exit looking-at "[ ]*$"
next " " t org-at-item-p match-string format org-shift-item-indentation 1 0
count-lines new delta pos line col] 5)
  byte-code("\300\301\215\210\202" [next (byte-code "\b\203 \306\x10\202
\307\310!\210m\203\x16\311\312\306\"\210\313\314!\203!\311\315\306\"\210\316\306w\210i\211\x11\nV\2032\311\315\317\"\210
\nW\203=\311\312\317\"\210\320
\204G\311\312\306\"\210\321\310!\x13\310\224\310\225|\210\310\224b\210\322\f
T\211\x15\"\211\x16\x17c\210\x0e\x17G
GZ\x16\x18\323\x0e\x18!\210\306\x1e\x19\212\x0e\x19\203{\x0e\x19b\210n\203\203\324\202\204\325\326\324`\"\\*\x0e\x1aU\203\227\x0e^[\x0e\x18\\\x16^[\306\207"
[bobp ind1 ind old fmt n nil beginning-of-line 2 throw exit looking-at "[ ]*$"
next " " t org-at-item-p match-string format org-shift-item-indentation 1 0
count-lines new delta pos line col] 5)] 2)
  org-renumber-ordered-list(1)
  org-maybe-renumber-ordered-list()
  org-insert-item()
  org-insert-heading(nil)
  call-interactively(org-insert-heading)
  (let ((auto-fill-function ...) (indent-line-function ...)
(paragraph-start ...) (auto-fill-inhibit-regexp ...) (paragraph-separate
...) (outline-regexp ...) (outline-level ...) (org-todo-kwd-alist ...)
(org-todo-key-alist ...) (org-todo-key-trigger ...) (org-todo-keywords-1
...) (org-done-keywords ...) (org-todo-heads ...) (org-todo-sets ...)
(org-todo-log-states ...) (org-file-properties ...) (org-file-tags ...)
(org-ds-keyword-length ...) (org-drawer-regexp ...) (org-not-done-keywords
...) (org-todo-regexp ...) (org-not-done-regexp ...) (org-todo-line-regexp
...) (org-complex-heading-regexp ...) (org-complex-heading-regexp-format
...) (org-nl-done-regexp ...) (org-todo-line-tags-regexp ...)
(org-looking-at-done-regexp ...) (org-deadline-regexp ...)
(org-deadline-time-regexp ...) (org-deadline-line-regexp ...)
(org-scheduled-regexp ...) (org-scheduled-time-regexp ...)
(org-closed-time-regexp ...) (org-keyword-time-regexp ...)
(org-keyword-time-not-clock-regexp ...) (org-maybe-keyword-time-regexp ...)
(org-planning-or-clock-line-re ...) (org-latex-and-specials-regexp ...)
(org-font-lock-keywords ...) (org-table-may-need-update ...)
(comment-start-skip ...) (fill-paragraph-function ...)
(adaptive-fill-regexp ...) (adaptive-fill-function ...)
(org-target-link-regexp ...) (comment-padding ...)
(outline-isearch-open-invisible-function ...) (org-indent-mode ...)
(org-after-demote-entry-hook ...) ...) (call-interactively (quote
org-insert-heading)))
  eval((let ((auto-fill-function ...) (indent-line-function ...)
(paragraph-start ...) (auto-fill-inhibit-regexp ...) (paragraph-separate
...) (outline-regexp ...) (outline-level ...) (org-todo-kwd-alist ...)
(org-todo-key-alist ...) (org-todo-key-trigger ...) (org-todo-keywords-1
...) (org-done-keywords ...) (org-todo-heads ...) (org-todo-sets ...)
(org-todo-log-states ...) (org-file-properties ...) (org-file-tags ...)
(org-ds-keyword-length ...) (org-drawer-regexp ...) (org-not-done-keywords
...) (org-todo-regexp ...) (org-not-done-regexp ...) (org-todo-line-regexp
...) (org-complex-heading-regexp ...) (org-complex-heading-regexp-format
...) (org-nl-done-regexp ...) (org-todo-line-tags-regexp ...)
(org-looking-at-done-regexp ...) (org-deadline-regexp ...)
(org-deadline-time-regexp ...) (org-deadline-line-regexp ...)
(org-scheduled-regexp ...) (org-scheduled-time-regexp ...)
(org-closed-time-regexp ...) (org-keyword-time-regexp ...)
(org-keyword-time-not-clock-regexp ...) (org-maybe-keyword-time-regexp ...)
(org-planning-or-clock-line-re ...) (org-latex-and-specials-regexp ...)
(org-font-lock-keywords ...) (org-table-may-need-update ...)
(comment-start-skip ...) (fill-paragraph-function ...)
(adaptive-fill-regexp ...) (adaptive-fill-function ...)
(org-target-link-regexp ...) (comment-padding ...)
(outline-isearch-open-invisible-function ...) (org-indent-mode ...)
(org-after-demote-entry-hook ...) ...) (call-interactively (quote
org-insert-heading))))
  org-run-like-in-org-mode(org-insert-heading)
  (if (org-context-p (quote headline) (quote item) (and orgstruct-is-++ t
...)) (org-run-like-in-org-mode (quote org-insert-heading)) (let
(orgstruct-mode) (call-interactively ...)))
  orgstruct-hijacker-command-106(1)
  call-interactively(orgstruct-hijacker-command-106 nil nil)


On Thu, Oct 18, 2012 at 12:52 PM, Peter Salazar <cycleofsong@gmail.com>wrote:

> I'm using Aquamacs in markdown-mode with orgstruct-mode turned on.
>
> When I start a numbered list:
>
> 1. foo
>
> ...at the end of that line, I want to automatically generate the next
> number on the list, so I hit OPTION-RETURN
>
> but instead of generating a "2. " on the next line, I get this error:
>
> Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
>   byte-code(" \203
>
> This used to work fine in markdown-mode with orgstruct-mode turned on...
>
> Backtrace:
>
> Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
>   byte-code(" \203
>

[-- Attachment #2: Type: text/html, Size: 6919 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: error in orgstruct-mode
  2012-10-19 22:31 ` Peter Salazar
@ 2012-10-19 22:54   ` Nick Dokos
  2012-10-20  0:21     ` Peter Salazar
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2012-10-19 22:54 UTC (permalink / raw)
  To: Peter Salazar; +Cc: org-mode

Peter Salazar <cycleofsong@gmail.com> wrote:

> Oops. Here's the full backtrace. Anyone have any thoughts? Help!
> 

>   org-maybe-renumber-ordered-list()
>   org-insert-item()
>   org-insert-heading(nil)
>   call-interactively(org-insert-heading)

Well, org-maybe-renumber-ordered-list was removed by this commit:

,----
| commit 15928db323904fe8c892d7289a0cdda89cde8694
| Author: Nicolas Goaziou <n.goaziou@gmail.com>
| Date:   Mon Aug 30 13:55:44 2010 +0200
| 
|     Implement new list definition
| 
|     ...    
|     * org-list.el (org-maybe-renumber-ordered-list): function removed.
`----

so maybe it's time to upgrade.

Nick

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: error in orgstruct-mode
  2012-10-19 22:54   ` Nick Dokos
@ 2012-10-20  0:21     ` Peter Salazar
  2012-10-20  1:13       ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Salazar @ 2012-10-20  0:21 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: org-mode

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

Thanks. I tried upgrading my version of org to 7.9.2, but then whenever I
launched Aquamacs, I got this message:

Wrong type argument: integer-or-marker-p, nil

I couldn't save or do anything, so I went back to the old version.

Anyone know the solution to the Wrong type argument: integer-or-marker-p,
nil?



On Fri, Oct 19, 2012 at 6:54 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Peter Salazar <cycleofsong@gmail.com> wrote:
>
> > Oops. Here's the full backtrace. Anyone have any thoughts? Help!
> >
>
> >   org-maybe-renumber-ordered-list()
> >   org-insert-item()
> >   org-insert-heading(nil)
> >   call-interactively(org-insert-heading)
>
> Well, org-maybe-renumber-ordered-list was removed by this commit:
>
> ,----
> | commit 15928db323904fe8c892d7289a0cdda89cde8694
> | Author: Nicolas Goaziou <n.goaziou@gmail.com>
> | Date:   Mon Aug 30 13:55:44 2010 +0200
> |
> |     Implement new list definition
> |
> |     ...
> |     * org-list.el (org-maybe-renumber-ordered-list): function removed.
> `----
>
> so maybe it's time to upgrade.
>
> Nick
>

[-- Attachment #2: Type: text/html, Size: 1709 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: error in orgstruct-mode
  2012-10-20  0:21     ` Peter Salazar
@ 2012-10-20  1:13       ` Nick Dokos
  2012-10-20 21:27         ` Peter Salazar
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2012-10-20  1:13 UTC (permalink / raw)
  To: Peter Salazar; +Cc: org-mode

Peter Salazar <cycleofsong@gmail.com> wrote:

> Thanks. I tried upgrading my version of org to 7.9.2, but then whenever I launched Aquamacs, I got
> this message:
> 
> Wrong type argument: integer-or-marker-p, nil
> 
> I couldn't save or do anything, so I went back to the old version. 
> 
> Anyone know the solution to the Wrong type argument: integer-or-marker-p, nil?
> 

Presumably something incompatible in your org initialization.
Does aquamacs allow for --debug-init? If not, then do the aquamacs
equivalent of -q, turn on debug-on-error, load your org initialization
by hand and send the backtrace.

Nick

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: error in orgstruct-mode
  2012-10-20  1:13       ` Nick Dokos
@ 2012-10-20 21:27         ` Peter Salazar
  2012-10-20 23:11           ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Salazar @ 2012-10-20 21:27 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: org-mode

[-- Attachment #1: Type: text/plain, Size: 8644 bytes --]

OK, I was able to successfully install org-mode 7.9.2. But there's
something still wrong with the way org-mode and orgstruct-mode are handling
numbered lists.

In org-mode itself, when I enter "1. " and then hit OPTION-RETURN, it
generates the next line "2. " but my cursor stays on the first line "1. "

In markdown-mode with orgstruct-mode on, I get the following error:


Debugger entered--Lisp error: (args-out-of-range -1 2)
  replace-match("- " nil nil nil 1)
  (if (equal old-bul new-bul) nil (replace-match new-bul nil nil nil 1))
  (unless (equal old-bul new-bul) (replace-match new-bul nil nil nil 1))
  (let* ((new-ind ...) (old-ind ...) (new-bul ...) (old-bul ...) (new-box
...)) (looking-at org-list-full-item-re) (unless (equal old-bul new-bul)
(replace-match new-bul nil nil nil 1)) (cond (...) (... ...) (... ... ...)
(t ...)) (unless (= new-ind old-ind) (delete-region ... ...) (indent-to
new-ind)))
  (lambda (item) (goto-char item) (let* (... ... ... ... ...) (looking-at
org-list-full-item-re) (unless ... ...) (cond ... ... ... ...) (unless ...
... ...)))(399)
  funcall((lambda (item) (goto-char item) (let* (... ... ... ... ...)
(looking-at org-list-full-item-re) (unless ... ...) (cond ... ... ... ...)
(unless ... ... ...))) 399)
  (if (or (not cell) (equal cell ...)) nil (funcall modify-item beg))
  (unless (or (not cell) (equal cell ...)) (funcall modify-item beg))
  (let* ((beg ...) (cell ...)) (unless (or ... ...) (funcall modify-item
beg)))
  (lambda (e) (unless (zerop ...) (apply shift-body-ind e)) (let* (... ...)
(unless ... ...)))((404 399 0))
  mapc((lambda (e) (unless (zerop ...) (apply shift-body-ind e)) (let* (...
...) (unless ... ...))) ((408 404 0) (404 399 0) (399 379 0) (379 300 0)
(300 231 0) (231 147 0)))
  (let (end-list acc-end itm-shift all-ends sliced-struct) (mapc (lambda
... ...) old-struct) (setq all-ends (sort ... ...)) (while (cdr all-ends)
(let* ... ...)) (mapc (lambda ... ... ...) sliced-struct))
  (let* ((origin ...) (inlinetask-re ...) (item-re ...) (shift-body-ind
...) (modify-item ...)) (let (end-list acc-end itm-shift all-ends
sliced-struct) (mapc ... old-struct) (setq all-ends ...) (while ... ...)
(mapc ... sliced-struct)) (goto-char origin) (move-marker origin nil))
  org-list-struct-apply-struct(((147 1 "- " nil nil nil 231) (231 1 "- "
nil nil nil 300) (300 1 "- " nil nil nil 379) (379 1 "- " nil nil nil 399)
(399 1 "- " nil nil nil 404) (404 1 "- " nil nil nil 408)) ((147 1 "- " nil
nil nil 231) (231 1 "- " nil nil nil 300) (300 1 "- " nil nil nil 379) (379
1 "- " nil nil nil 399) (399 0 "1. " nil nil nil 404) (404 0 "1. " nil nil
nil 408)))
  (let ((old-struct ...)) (org-list-struct-fix-ind struct parents 2)
(org-list-struct-fix-item-end struct) (let (...) (org-list-struct-fix-bul
struct prevs) (org-list-struct-fix-ind struct parents)
(org-list-struct-fix-box struct parents prevs))
(org-list-struct-apply-struct struct old-struct))
  org-list-write-struct(((147 1 "- " nil nil nil 231) (231 1 "- " nil nil
nil 300) (300 1 "- " nil nil nil 379) (379 1 "- " nil nil nil 399) (399 1
"- " nil nil nil 404) (404 1 "- " nil nil nil 408)) ((147) (231) (300)
(379) (399) (404)))
  (let* ((struct ...) (prevs ...) (desc ...)) (setq struct
(org-list-insert-item pos struct prevs checkbox desc))
(org-list-write-struct struct (org-list-parents-alist struct)) (when
checkbox (org-update-checkbox-count-maybe)) (looking-at
org-list-full-item-re) (goto-char (if ... ... ...)) t)
  (if (save-excursion (goto-char itemp) (org-at-item-timer-p)) (progn
(org-timer-item) t) (let* (... ... ...) (setq struct ...)
(org-list-write-struct struct ...) (when checkbox ...) (looking-at
org-list-full-item-re) (goto-char ...) t))
  (if (or (not itemp) (save-excursion ... ...)) nil (if (save-excursion ...
...) (progn ... t) (let* ... ... ... ... ... ... t)))
  (unless (or (not itemp) (save-excursion ... ...)) (if (save-excursion ...
...) (progn ... t) (let* ... ... ... ... ... ... t)))
  (let ((itemp ...) (pos ...)) (unless (or ... ...) (if ... ... ...)))
  org-insert-item()
  (not (org-insert-item))
  (or force-heading (not (org-insert-item)))
  (if (or force-heading (not ...)) (progn (let* ... ... ... ... ... ... ...
... ...)))
  (when (or force-heading (not ...)) (let* (... ... ... ... ... ... pos
hide-previous previous-pos) (cond ... ... ...) (insert head)
(just-one-space) (setq pos ...) (end-of-line 1) (unless ... ... ...) (when
... ...) (run-hooks ...)))
  (if (or (= ... 0) (and ... ...)) (progn (insert "\n* ") (run-hooks ...))
(when (or force-heading ...) (let* ... ... ... ... ... ... ... ... ...)))
  org-insert-heading(nil)
  call-interactively(org-insert-heading)
  (let ((auto-fill-function ...) (indent-line-function ...)
(paragraph-start ...) (auto-fill-inhibit-regexp ...) (paragraph-separate
...) (outline-regexp ...) (outline-level ...) (org-todo-kwd-alist ...)
(org-todo-key-alist ...) (org-todo-key-trigger ...) (org-todo-keywords-1
...) (org-done-keywords ...) (org-todo-heads ...) (org-todo-sets ...)
(org-todo-log-states ...) (org-file-properties ...) (org-file-tags ...)
(org-use-sub-superscripts ...) (org-ds-keyword-length ...)
(org-drawer-regexp ...) (org-not-done-keywords ...) (org-todo-regexp ...)
(org-not-done-regexp ...) (org-todo-line-regexp ...)
(org-complex-heading-regexp ...) (org-complex-heading-regexp-format ...)
(org-todo-line-tags-regexp ...) (org-deadline-regexp ...)
(org-deadline-time-regexp ...) (org-deadline-line-regexp ...)
(org-scheduled-regexp ...) (org-scheduled-time-regexp ...)
(org-closed-time-regexp ...) (org-keyword-time-regexp ...)
(org-keyword-time-not-clock-regexp ...) (org-maybe-keyword-time-regexp ...)
(org-all-time-keywords ...) (org-latex-and-specials-regexp ...)
(org-font-lock-keywords ...) (org-table-may-need-update ...)
(indent-region-function ...) (org-target-link-regexp ...)
(fill-paragraph-function ...) (normal-auto-fill-function ...)
(comment-line-break-function ...) (comment-use-syntax ...) (comment-start
...) (comment-start-skip ...) (comment-insert-comment-function ...)
(comment-region-function ...) ...) (call-interactively (quote
org-insert-heading)))
  eval((let ((auto-fill-function ...) (indent-line-function ...)
(paragraph-start ...) (auto-fill-inhibit-regexp ...) (paragraph-separate
...) (outline-regexp ...) (outline-level ...) (org-todo-kwd-alist ...)
(org-todo-key-alist ...) (org-todo-key-trigger ...) (org-todo-keywords-1
...) (org-done-keywords ...) (org-todo-heads ...) (org-todo-sets ...)
(org-todo-log-states ...) (org-file-properties ...) (org-file-tags ...)
(org-use-sub-superscripts ...) (org-ds-keyword-length ...)
(org-drawer-regexp ...) (org-not-done-keywords ...) (org-todo-regexp ...)
(org-not-done-regexp ...) (org-todo-line-regexp ...)
(org-complex-heading-regexp ...) (org-complex-heading-regexp-format ...)
(org-todo-line-tags-regexp ...) (org-deadline-regexp ...)
(org-deadline-time-regexp ...) (org-deadline-line-regexp ...)
(org-scheduled-regexp ...) (org-scheduled-time-regexp ...)
(org-closed-time-regexp ...) (org-keyword-time-regexp ...)
(org-keyword-time-not-clock-regexp ...) (org-maybe-keyword-time-regexp ...)
(org-all-time-keywords ...) (org-latex-and-specials-regexp ...)
(org-font-lock-keywords ...) (org-table-may-need-update ...)
(indent-region-function ...) (org-target-link-regexp ...)
(fill-paragraph-function ...) (normal-auto-fill-function ...)
(comment-line-break-function ...) (comment-use-syntax ...) (comment-start
...) (comment-start-skip ...) (comment-insert-comment-function ...)
(comment-region-function ...) ...) (call-interactively (quote
org-insert-heading))))
  org-run-like-in-org-mode(org-insert-heading)
  (if (org-context-p (quote headline) (quote item) (and orgstruct-is-++ t
...)) (org-run-like-in-org-mode (quote org-insert-heading)) (let
(orgstruct-mode) (call-interactively ...)))
  orgstruct-hijacker-command-106(1)
  call-interactively(orgstruct-hijacker-command-106 nil nil)



On Fri, Oct 19, 2012 at 9:13 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Peter Salazar <cycleofsong@gmail.com> wrote:
>
> > Thanks. I tried upgrading my version of org to 7.9.2, but then whenever
> I launched Aquamacs, I got
> > this message:
> >
> > Wrong type argument: integer-or-marker-p, nil
> >
> > I couldn't save or do anything, so I went back to the old version.
> >
> > Anyone know the solution to the Wrong type argument:
> integer-or-marker-p, nil?
> >
>
> Presumably something incompatible in your org initialization.
> Does aquamacs allow for --debug-init? If not, then do the aquamacs
> equivalent of -q, turn on debug-on-error, load your org initialization
> by hand and send the backtrace.
>
> Nick
>

[-- Attachment #2: Type: text/html, Size: 9851 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: error in orgstruct-mode
  2012-10-20 21:27         ` Peter Salazar
@ 2012-10-20 23:11           ` Nick Dokos
  0 siblings, 0 replies; 7+ messages in thread
From: Nick Dokos @ 2012-10-20 23:11 UTC (permalink / raw)
  To: Peter Salazar; +Cc: org-mode

Peter Salazar <cycleofsong@gmail.com> wrote:

> OK, I was able to successfully install org-mode 7.9.2. But there's something still wrong with the
> way org-mode and orgstruct-mode are handling numbered lists. 
> 
> In org-mode itself, when I enter "1. " and then hit OPTION-RETURN, it generates the next line "2. "
> but my cursor stays on the first line "1. "
> 

It does that for me too if I leave the item empty, but if I say

1. foo

and press META-RET it generates the 2. line and goes to it.

> In markdown-mode with orgstruct-mode on, I get the following error:
> 

I don't have markdown mode, but in fundamental mode, turning on
orgstruct-mode and adding a numbered list behaves properly for me.
Can you try that? Is markdown mode a necessary prerequisite for the
bug to occur? If so, where does one get markdown mode?

I looked at the code a bit, but it's not obvious to me what's wrong.
The relevant code (in org-list.el:org-list-struct-apply-struct) is

,----
|       ;; 3. Shift each slice in buffer, provided delta isn't 0, from
|       ;;    end to beginning.  Take a special action when beginning is
|       ;;    at item bullet.
|       (mapc (lambda (e)
| 	      (unless (zerop (nth 2 e)) (apply shift-body-ind e))
| 	      (let* ((beg (nth 1 e))
| 		     (cell (assq beg struct)))
| 		(unless (or (not cell) (equal cell (assq beg old-struct)))
| 		  (funcall modify-item beg))))
| 	    sliced-struct))
`----

in the (funcall modify-item beg) line. The modify-item function does

,----
|	       (looking-at org-list-full-item-re)
| 	       ;; a.  Replace bullet
| 	       (unless (equal old-bul new-bul)
| 		 (replace-match new-bul nil nil nil 1))
`----

which is where it blows up. It uses match data from the previous search,
the call to looking-at, but what happens if looking-at returned nil?
Does it set the match data or is it then the case that the replace-match
is trying to use match data from some previous unrelated search?

Nick

> Debugger entered--Lisp error: (args-out-of-range -1 2)
>   replace-match("- " nil nil nil 1)
>   (if (equal old-bul new-bul) nil (replace-match new-bul nil nil nil 1))
>   (unless (equal old-bul new-bul) (replace-match new-bul nil nil nil 1))
>   (let* ((new-ind ...) (old-ind ...) (new-bul ...) (old-bul ...) (new-box ...)) (looking-at
> org-list-full-item-re) (unless (equal old-bul new-bul) (replace-match new-bul nil nil nil 1)) (cond
> (...) (... ...) (... ... ...) (t ...)) (unless (= new-ind old-ind) (delete-region ... ...)
> (indent-to new-ind)))
>   (lambda (item) (goto-char item) (let* (... ... ... ... ...) (looking-at org-list-full-item-re)
> (unless ... ...) (cond ... ... ... ...) (unless ... ... ...)))(399)
>   funcall((lambda (item) (goto-char item) (let* (... ... ... ... ...) (looking-at
> org-list-full-item-re) (unless ... ...) (cond ... ... ... ...) (unless ... ... ...))) 399)
>   (if (or (not cell) (equal cell ...)) nil (funcall modify-item beg))
>   (unless (or (not cell) (equal cell ...)) (funcall modify-item beg))
>   (let* ((beg ...) (cell ...)) (unless (or ... ...) (funcall modify-item beg)))
>   (lambda (e) (unless (zerop ...) (apply shift-body-ind e)) (let* (... ...) (unless ... ...)))((404
> 399 0))
>   mapc((lambda (e) (unless (zerop ...) (apply shift-body-ind e)) (let* (... ...) (unless ... ...)))
> ((408 404 0) (404 399 0) (399 379 0) (379 300 0) (300 231 0) (231 147 0)))
>   (let (end-list acc-end itm-shift all-ends sliced-struct) (mapc (lambda ... ...) old-struct) (setq
> all-ends (sort ... ...)) (while (cdr all-ends) (let* ... ...)) (mapc (lambda ... ... ...)
> sliced-struct))
> ...

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-10-20 23:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-18 16:52 error in orgstruct-mode Peter Salazar
2012-10-19 22:31 ` Peter Salazar
2012-10-19 22:54   ` Nick Dokos
2012-10-20  0:21     ` Peter Salazar
2012-10-20  1:13       ` Nick Dokos
2012-10-20 21:27         ` Peter Salazar
2012-10-20 23:11           ` Nick Dokos

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).