emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org-fill-paragraph invoked on column 0
Date: Tue, 31 Jul 2012 17:35:31 +0200	[thread overview]
Message-ID: <CALn3zoh-5uVgWZ=EYG39P2i6Td3pyM=VHH7C6DS2OuB2Z4xbvw@mail.gmail.com> (raw)
In-Reply-To: <87wr1kly1b.fsf@gmail.com>

Hi Nicolas

On Mon, Jul 30, 2012 at 11:49 PM, Nicolas Goaziou <n.goaziou@gmail.com> 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

  reply	other threads:[~2012-07-31 15:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30 19:52 org-fill-paragraph invoked on column 0 Michael Brand
2012-07-30 21:49 ` Nicolas Goaziou
2012-07-31 15:35   ` Michael Brand [this message]
2012-07-31 18:59     ` Nicolas Goaziou
2012-07-31 19:39       ` Michael Brand
2012-07-31 20:01         ` Michael Brand
2012-07-31 22:42           ` Nicolas Goaziou
2012-08-01 14:05             ` Michael Brand
2012-07-31 22:15         ` Nicolas Goaziou
2012-08-01 14:07           ` Michael Brand
2012-08-01 14:05             ` Nicolas Goaziou

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='CALn3zoh-5uVgWZ=EYG39P2i6Td3pyM=VHH7C6DS2OuB2Z4xbvw@mail.gmail.com' \
    --to=michael.ch.brand@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /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).