From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: org-fill-paragraph invoked on column 0 Date: Tue, 31 Jul 2012 17:35:31 +0200 Message-ID: References: <87wr1kly1b.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwETt-0002J9-IG for emacs-orgmode@gnu.org; Tue, 31 Jul 2012 11:35:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwETs-0000S4-Ek for emacs-orgmode@gnu.org; Tue, 31 Jul 2012 11:35:33 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:56718) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwETs-0000Ry-8G for emacs-orgmode@gnu.org; Tue, 31 Jul 2012 11:35:32 -0400 Received: by wgbez12 with SMTP id ez12so4674436wgb.30 for ; Tue, 31 Jul 2012 08:35:31 -0700 (PDT) In-Reply-To: <87wr1kly1b.fsf@gmail.com> 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: Nicolas Goaziou Cc: Org Mode Hi Nicolas On Mon, Jul 30, 2012 at 11:49 PM, Nicolas Goaziou wrote: > Yes. It's all about document's structure. First paragraph starts after > bullet. Before, it's the item. Since you want to fill the first > paragraph, you have to move into it. Thank you for the explanations. I appreciate your improvements in correctness of parsing and interpreting the Org structure. Oh, and only now I see that, as your improvements exclude the item bullet from filling, C-c and M-q (org-fill-paragraph) now leave the manual alignment of the description in description lists untouched. This is nice, it helps me as shown in my new post here: "alignment of description list in Org and export old and new" http://thread.gmane.org/gmane.emacs.orgmode/56631/focus=58222 > You can use navigation functions, move to the end of line, which is > quicker, or to the beginning of the next line, even at column 0. Because I need to fill list items so often and when I am on column 0 of the bullet line, I start to override M-q at least until maybe the community decides that this old behaviour of M-q should be restored: #+BEGIN_SRC emacs-lisp (add-hook 'org-mode-hook 'my-org-bind-M-q) (defun my-org-bind-M-q () (define-key org-mode-map "\M-q" 'my-org-fill-paragraph)) (defun my-org-fill-paragraph () (interactive) (if (and (org-in-item-p) (not mark-active)) (save-excursion ;; must deal also with: ;; - cmd --log-level=wrn -o DST SRC :: ;; description ;; for long term ;; or: ;; - cmd --log-level=wrn -o DST SRC ;; :: description ;; for long term (org-end-of-item) (backward-char) (org-fill-paragraph)) (org-fill-paragraph))) #+END_SRC Michael