From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: bugs in commenting and filling Date: Tue, 28 Aug 2012 13:44:37 +0200 Message-ID: <87a9xfqlzu.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6KHg-0002wD-2G for emacs-orgmode@gnu.org; Tue, 28 Aug 2012 07:48:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6KHY-0002rn-3k for emacs-orgmode@gnu.org; Tue, 28 Aug 2012 07:48:40 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:56121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6KHX-0002rQ-TS for emacs-orgmode@gnu.org; Tue, 28 Aug 2012 07:48:32 -0400 Received: by wgbdt14 with SMTP id dt14so2491159wgb.30 for ; Tue, 28 Aug 2012 04:48:30 -0700 (PDT) In-Reply-To: (Samuel Wales's message of "Mon, 27 Aug 2012 09:44:42 -0700") 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: Samuel Wales Cc: emacs-orgmode@gnu.org Hello, Samuel Wales 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. Fixed. > #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. Regards, -- Nicolas Goaziou