emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] fill-paragraph in orgstruct mode blows up
@ 2011-03-20  1:56 Nick Dokos
  2011-03-20  8:15 ` Nicolas
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Dokos @ 2011-03-20  1:56 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: nicholas.dokos


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

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

* Re: [BUG] fill-paragraph in orgstruct mode blows up
  2011-03-20  1:56 [BUG] fill-paragraph in orgstruct mode blows up Nick Dokos
@ 2011-03-20  8:15 ` Nicolas
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas @ 2011-03-20  8:15 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Hello,

Nick Dokos <nicholas.dokos@hp.com> writes:

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

This should be fixed now. Thanks for your report (again).

Regards,

-- 
Nicolas

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

end of thread, other threads:[~2011-03-20  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-20  1:56 [BUG] fill-paragraph in orgstruct mode blows up Nick Dokos
2011-03-20  8:15 ` Nicolas

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