emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: emacs-orgmode@gnu.org
Cc: nicholas.dokos@hp.com
Subject: [BUG] fill-paragraph in orgstruct mode blows up
Date: Sat, 19 Mar 2011 21:56:44 -0400	[thread overview]
Message-ID: <10983.1300586204@alphaville.dokosmarshall.org> (raw)


I use orgstruct mode when composing email and fill-paragraph blew up
with the following backtrace when I tried to fill a paragraph after a
drawer, as described in the last paragraph of this email.

:SETUP:
# Local variables:
# eval: (org-update-all-dblocks) -*-
# End:
:END:

This is a dummy paragraph after the drawer. Put cursor here and call fill-paragraph
after enabling orgstruct-mode. You should get the error below.

Nick

Org-mode version 7.5 (release_7.5.86.g6daa.dirty)

,----
| Debugger entered--Lisp error: (wrong-type-argument stringp nil)
|   re-search-backward(nil nil t)
|   (cond ((and (looking-at item-re) (or (< ind ind-ref) (eq org-list-ending-method (quote regexp)))) (throw (quote exit) (point))) ((<= (point) lim-up) (throw (quote exit) nil)) ((and (not (eq org-list-ending-method (quote indent))) (looking-at org-list-end-re)) (throw (quote exit) nil)) ((looking-at "^[ 	]*#\\+end_") (re-search-backward "^[ 	]*#\\+begin_" nil t)) ((looking-at "^[ 	]*:END:") (re-search-backward org-drawer-regexp nil t) (beginning-of-line)) ((and inlinetask-re (looking-at inlinetask-re)) (org-inlinetask-goto-beginning) (forward-line -1)) ((looking-at "^[ 	]*$") (forward-line -1)) ((zerop ind) (throw (quote exit) nil)) ((< ind ind-ref) (setq ind-ref ind) (forward-line -1)) (t (forward-line -1)))
|   (let ((ind (org-get-indentation))) (cond ((and (looking-at item-re) (or (< ind ind-ref) (eq org-list-ending-method (quote regexp)))) (throw (quote exit) (point))) ((<= (point) lim-up) (throw (quote exit) nil)) ((and (not (eq org-list-ending-method (quote indent))) (looking-at org-list-end-re)) (throw (quote exit) nil)) ((looking-at "^[ 	]*#\\+end_") (re-search-backward "^[ 	]*#\\+begin_" nil t)) ((looking-at "^[ 	]*:END:") (re-search-backward org-drawer-regexp nil t) (beginning-of-line)) ((and inlinetask-re (looking-at inlinetask-re)) (org-inlinetask-goto-beginning) (forward-line -1)) ((looking-at "^[ 	]*$") (forward-line -1)) ((zerop ind) (throw (quote exit) nil)) ((< ind ind-ref) (setq ind-ref ind) (forward-line -1)) (t (forward-line -1))))
|   (while t (let ((ind (org-get-indentation))) (cond ((and (looking-at item-re) (or (< ind ind-ref) (eq org-list-ending-method (quote regexp)))) (throw (quote exit) (point))) ((<= (point) lim-up) (throw (quote exit) nil)) ((and (not (eq org-list-ending-method (quote indent))) (looking-at org-list-end-re)) (throw (quote exit) nil)) ((looking-at "^[ 	]*#\\+end_") (re-search-backward "^[ 	]*#\\+begin_" nil t)) ((looking-at "^[ 	]*:END:") (re-search-backward org-drawer-regexp nil t) (beginning-of-line)) ((and inlinetask-re (looking-at inlinetask-re)) (org-inlinetask-goto-beginning) (forward-line -1)) ((looking-at "^[ 	]*$") (forward-line -1)) ((zerop ind) (throw (quote exit) nil)) ((< ind ind-ref) (setq ind-ref ind) (forward-line -1)) (t (forward-line -1)))))
|   (catch (quote exit) (while t (let ((ind (org-get-indentation))) (cond ((and (looking-at item-re) (or (< ind ind-ref) (eq org-list-ending-method ...))) (throw (quote exit) (point))) ((<= (point) lim-up) (throw (quote exit) nil)) ((and (not (eq org-list-ending-method ...)) (looking-at org-list-end-re)) (throw (quote exit) nil)) ((looking-at "^[ 	]*#\\+end_") (re-search-backward "^[ 	]*#\\+begin_" nil t)) ((looking-at "^[ 	]*:END:") (re-search-backward org-drawer-regexp nil t) (beginning-of-line)) ((and inlinetask-re (looking-at inlinetask-re)) (org-inlinetask-goto-beginning) (forward-line -1)) ((looking-at "^[ 	]*$") (forward-line -1)) ((zerop ind) (throw (quote exit) nil)) ((< ind ind-ref) (setq ind-ref ind) (forward-line -1)) (t (forward-line -1))))))
|   (cond ((eq (nth 2 context) (quote invalid)) nil) ((looking-at item-re) (point)) (t (let ((hl 0) (i -1) end-bounds) (when (and (not (eq org-list-ending-method (quote indent))) (progn (while (setq i ...) (setq hl ...)) (setq end-bounds (org-in-regexp org-list-end-re hl))) (>= (point) (car end-bounds)) (< (point) (cdr end-bounds))) (goto-char (car end-bounds)) (forward-line -1))) (catch (quote exit) (while t (let ((ind (org-get-indentation))) (cond ((and ... ...) (throw ... ...)) ((<= ... lim-up) (throw ... nil)) ((and ... ...) (throw ... nil)) ((looking-at "^[ 	]*#\\+end_") (re-search-backward "^[ 	]*#\\+begin_" nil t)) ((looking-at "^[ 	]*:END:") (re-search-backward org-drawer-regexp nil t) (beginning-of-line)) ((and inlinetask-re ...) (org-inlinetask-goto-beginning) (forward-line -1)) 
 ((looking-at "^[ 	]*$") (forward-line -1)) ((zerop ind) (throw ... nil)) ((< ind ind-ref) (setq ind-ref ind) (forward-line -1)) (t (forward-line -1))))))))
|   (let* ((case-fold-search t) (context (org-list-context)) (lim-up (car context)) (inlinetask-re (and (featurep (quote org-inlinetask)) (org-inlinetask-outline-regexp))) (item-re (org-item-re)) (ind-ref (if (or (looking-at "^[ 	]*$") (and inlinetask-re (looking-at inlinetask-re))) 10000 (org-get-indentation)))) (cond ((eq (nth 2 context) (quote invalid)) nil) ((looking-at item-re) (point)) (t (let ((hl 0) (i -1) end-bounds) (when (and (not (eq org-list-ending-method ...)) (progn (while ... ...) (setq end-bounds ...)) (>= (point) (car end-bounds)) (< (point) (cdr end-bounds))) (goto-char (car end-bounds)) (forward-line -1))) (catch (quote exit) (while t (let ((ind ...)) (cond (... ...) (... ...) (... ...) (... ...) (... ... ...) (... ... ...) (... ...) (... ...) (... ... ...) (t ...))))))
 ))
|   (save-excursion (beginning-of-line) (let* ((case-fold-search t) (context (org-list-context)) (lim-up (car context)) (inlinetask-re (and (featurep (quote org-inlinetask)) (org-inlinetask-outline-regexp))) (item-re (org-item-re)) (ind-ref (if (or (looking-at "^[ 	]*$") (and inlinetask-re (looking-at inlinetask-re))) 10000 (org-get-indentation)))) (cond ((eq (nth 2 context) (quote invalid)) nil) ((looking-at item-re) (point)) (t (let ((hl 0) (i -1) end-bounds) (when (and (not ...) (progn ... ...) (>= ... ...) (< ... ...)) (goto-char (car end-bounds)) (forward-line -1))) (catch (quote exit) (while t (let (...) (cond ... ... ... ... ... ... ... ... ... ...))))))))
|   org-in-item-p()
|   (setq itemp (org-in-item-p))
|   (save-excursion (forward-paragraph -1) (setq itemp (org-in-item-p)))
|   (cond ((and (equal (char-after (point-at-bol)) 42) (save-excursion (goto-char (point-at-bol)) (looking-at outline-regexp))) t) (table\.el-p t) (table-p (org-table-align) t) (itemp (let* ((struct (save-excursion (goto-char itemp) (org-list-struct))) (parents (org-list-parents-alist struct)) (children (org-list-get-children itemp struct parents)) beg end prev next prefix) (cond ((not children) (setq prefix (make-string (org-list-item-body-column itemp) 32) beg itemp end (org-list-get-item-end itemp struct))) ((< (point) (setq next (car children))) (setq prefix (make-string (org-list-item-body-column itemp) 32) beg itemp end next)) ((> (point) (setq prev (car ...))) (setq beg (org-list-get-item-end prev struct) end (org-list-get-item-end itemp struct) prefix (save-excursion (goto-char beg
 ) (skip-chars-forward " 	") (make-string ... 32)))) (t (catch (quote exit) (while (setq next ...) (if ... ... ... ...))))) (flet ((fill-context-prefix (from to &optional flr) prefix)) (save-
 restriction (narrow-to-region beg end) (save-excursion (fill-paragraph justify)))) t)) ((save-excursion (forward-paragraph -1) (setq itemp (org-in-item-p))) (let ((struct (save-excursion (goto-char itemp) (org-list-struct)))) (save-restriction (narrow-to-region (org-list-get-bottom-point struct) (save-excursion (forward-paragraph 1) (point))) (fill-paragraph justify) t))) (t nil))
|   (let ((table-p (org-at-table-p)) (table\.el-p (org-at-table\.el-p)) (itemp (org-in-item-p))) (cond ((and (equal (char-after (point-at-bol)) 42) (save-excursion (goto-char (point-at-bol)) (looking-at outline-regexp))) t) (table\.el-p t) (table-p (org-table-align) t) (itemp (let* ((struct (save-excursion (goto-char itemp) (org-list-struct))) (parents (org-list-parents-alist struct)) (children (org-list-get-children itemp struct parents)) beg end prev next prefix) (cond ((not children) (setq prefix (make-string ... 32) beg itemp end (org-list-get-item-end itemp struct))) ((< (point) (setq next ...)) (setq prefix (make-string ... 32) beg itemp end next)) ((> (point) (setq prev ...)) (setq beg (org-list-get-item-end prev struct) end (org-list-get-item-end itemp struct) prefix (save-excursio
 n ... ... ...))) (t (catch (quote exit) (while ... ...)))) (flet ((fill-context-prefix (from to &optional flr) prefix)) (save-restriction (narrow-to-region beg end) (save-excursion (fill-par
 agraph justify)))) t)) ((save-excursion (forward-paragraph -1) (setq itemp (org-in-item-p))) (let ((struct (save-excursion (goto-char itemp) (org-list-struct)))) (save-restriction (narrow-to-region (org-list-get-bottom-point struct) (save-excursion (forward-paragraph 1) (point))) (fill-paragraph justify) t))) (t nil)))
|   org-fill-paragraph(nil)
|   fill-paragraph(nil t)
|   call-interactively(fill-paragraph t nil)
`----

             reply	other threads:[~2011-03-20  1:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-20  1:56 Nick Dokos [this message]
2011-03-20  8:15 ` [BUG] fill-paragraph in orgstruct mode blows up Nicolas

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=10983.1300586204@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    /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).