From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: [BUG] org-fill-paragraph seems broken Date: Fri, 27 Apr 2012 13:00:13 -0400 Message-ID: <719.1335546013@alphaville> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNoWw-0003Hu-7p for emacs-orgmode@gnu.org; Fri, 27 Apr 2012 13:00:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SNoWo-0005FB-G1 for emacs-orgmode@gnu.org; Fri, 27 Apr 2012 13:00:25 -0400 Received: from g5t0006.atlanta.hp.com ([15.192.0.43]:35484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNoWo-0005D6-9K for emacs-orgmode@gnu.org; Fri, 27 Apr 2012 13:00:18 -0400 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g5t0006.atlanta.hp.com (Postfix) with ESMTP id 65F61C512 for ; Fri, 27 Apr 2012 17:00:16 +0000 (UTC) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: nicholas.dokos@hp.com Running M-q in a draft message with orgstruct++-mode enabled gives me the appended backtrace. The problem seems to have been introduced by commit 84a358e3. Git blame fingers the following two as the most recent commits that affected org-fill-paragraph: 187f77a2 2012-04-04 84a358e3 2012-04-26 With the first one in force, I don't get the problem; with the second, I do. Nick Debugger entered--Lisp error: (wrong-number-of-arguments #[(arg) ("/usr/local/share/emacs/24.0.95/lisp/mail/sendmail.elc" . 26697) nil 4] 0) mail-mode-fill-paragraph() funcall(mail-mode-fill-paragraph) (cond ((and (equal (char-after (point-at-bol)) 42) (save-excursion (goto-char (point-at-bol)) (looking-at org-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 b eg) (skip-chars-forward " ") (make-string ... 32)))) (t (catch (quote exit) (while (setq next ...) (if ... ... ... ...))))) (flet ((fill-context-prefix (from to &optional flr) prefix)) (sav e-restriction (narrow-to-region beg end) (save-excursion (fill-paragraph justify)))) t)) ((and (derived-mode-p (quote org-mode)) (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))) ((and (eq major-mode (quote org-mode)) (save-excursion (forward-paragraph -1) (or (looking-at (concat "^[^\n]*" org-scheduled-regexp ".*$")) (looking-at (concat "^[^\n]*" org-deadline-regexp ".*$"))))) (save-restriction (narrow-to-region (1+ (match-end 0)) (save-excursion (forward-paragraph 1) (point))) (fill-paragraph justify) t)) (org-fill-paragraph-fallback-function (funcall o rg-fill-paragraph-fallback-function)) (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 org-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-excurs ion ... ... ...))) (t (catch (quote exit) (while ... ...)))) (flet ((fill-context-prefix (from to &optional flr) prefix)) (save-restriction (narrow-to-region beg end) (save-excursion (fill-p aragraph justify)))) t)) ((and (derived-mode-p (quote org-mode)) (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))) ((and (eq major-mode (quote org-mode)) (save-excursion (forward-paragraph -1) (or (looking-at (concat "^[^\n]*" org-scheduled-regexp ".*$")) (looking-at (concat "^[^\n]*" org-deadline-regexp ".*$"))))) (save-restriction (narrow-to-region (1+ (match-end 0)) (save-excursion (forward-paragraph 1) (point))) (fill-paragraph justify) t)) (org-fill-paragraph-fallback-function (funcall org-fill-paragraph-fallback-function)) (t nil))) org-fill-paragraph(nil) fill-paragraph(nil t) call-interactively(fill-paragraph) (let (orgstruct-mode) (call-interactively (or (key-binding "\361") (quote orgstruct-error)))) (if (org-context-p (quote headline) (quote item) (and orgstruct-is-++ nil (quote item-body))) (org-run-like-in-org-mode (quote fill-paragraph)) (let (orgstruct-mode) (call-interactively (or (key-binding "\361") (quote orgstruct-error))))) orgstruct-hijacker-command-22(1) call-interactively(orgstruct-hijacker-command-22 nil nil)