emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Samuel Wales <samologist@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: bugs in commenting and filling
Date: Tue, 28 Aug 2012 13:44:37 +0200	[thread overview]
Message-ID: <87a9xfqlzu.fsf@gmail.com> (raw)
In-Reply-To: <CAJcAo8sxZCC7-v9RasM3h79sf0F0kjY_x2oG_FOEZbb+Fc-ctg@mail.gmail.com> (Samuel Wales's message of "Mon, 27 Aug 2012 09:44:42 -0700")


Samuel Wales <samologist@gmail.com> writes:

> Here are 6 bugs (or at least changes that might need to be
> documented) in Org commenting and filling.
> Context: commenting and filling used to use generic Emacs
> facilities, but now use Org-specific ones.
> original:
> ===
> x
> bug 1: the line above now does not get commented even if
> comment-empty-lines is t.
>   bug 2: this line now does not indent consistently with the
> rest of emacs.
> ===
> comment-dwim:
> ===
> # x
> # bug 1: the line above now does not get commented even if
> # comment-empty-lines is t.
>   # bug 2: this line now does not indent consistently with the
> # rest of emacs.
> ===

Both fixed.

>   bug 3: outside of org with filladapt turned OFF, filling this
> paragraph does not
> indent it.  also auto-fill
> indents unlike the rest of emacs.  ret tab is ok.


> #bug 4: this paragraph now gets exported in HTML subtree
> #export, which will likely surprise many people who formerly
> #used "#" comments instead of "# " comments and don't
> #carefully check all output.  they might
> #even publish private information automatically without
> #realizing it using old files that they forgot or did not
> #know to convert.

This has been announced in 7.9 changes.

> #bug 5: filling this paragraph with "===" on the following
> #line will fill the ===, unlike the rest of emacs with
> #filladapt turned ON.  we are supposed to not use filladapt
> #with org.  therefore, how do you emulate the filladapt
> #behavior so that there is consistency between emacs and
> #org?

I don't know filladapt.el. I've done my homework, though, and looked at
the file.

If you want to use filladapt.el, you'll have to tweak
`filladapt-token-*' variables. If you come up with a working setup,
please put it on org-hacks.org as some users may appreciate it.

For example, `cc-mode' does it in `c-setup-filladapt' function.

> Bug 6: what does the Org-specific commenting do?  i was not
> able to determine that from the docstring to
> org-comment-or-uncomment-region.  maybe update docstring
> would help others trying to find out why commenting works
> differently in org from the rest of emacs?

I don't think such explanations belong to
`org-comment-or-uncomment-region' docstring. Though, I have dropped
a note in org.el:

   Org comments syntax is quite complex. It requires the entire line to
   be just a comment. Also, even with the right syntax at the beginning
   of line, some some elements (i.e. verse-block or example-block) don't
   accept comments. Usual Emacs comment commands cannot cope with those
   requirements. Therefore, Org replaces them.

   Org still relies on `comment-dwim', but cannot trust
   `comment-only-p'. So, `comment-region-function' and
   `uncomment-region-function' both point
   to`org-comment-or-uncomment-region'. Eventually, `org-insert-comment'
   takes care of insertion of comments at the beginning of line.

I hope it is clearer now.

Thanks for the detailed report.


Nicolas Goaziou

  reply	other threads:[~2012-08-28 11:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-27 16:44 bugs in commenting and filling Samuel Wales
2012-08-28 11:44 ` Nicolas Goaziou [this message]
2012-08-31  2:01   ` Samuel Wales
2012-08-31  6:10     ` Nicolas Goaziou
2012-08-31  7:20       ` Samuel Wales
2012-08-31  7:32       ` Samuel Wales
2012-08-31  7:34         ` 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:

  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=87a9xfqlzu.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=samologist@gmail.com \


* 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


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