From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: bugs in commenting and filling Date: Fri, 31 Aug 2012 08:10:34 +0200 Message-ID: <87harjiobp.fsf@gmail.com> References: <87a9xfqlzu.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7KUy-0001h4-V7 for emacs-orgmode@gnu.org; Fri, 31 Aug 2012 02:14:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7KUx-0008LU-Ox for emacs-orgmode@gnu.org; Fri, 31 Aug 2012 02:14:32 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:50631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7KUx-0008KE-Hf for emacs-orgmode@gnu.org; Fri, 31 Aug 2012 02:14:31 -0400 Received: by weys10 with SMTP id s10so1580579wey.0 for ; Thu, 30 Aug 2012 23:14:31 -0700 (PDT) In-Reply-To: (Samuel Wales's message of "Thu, 30 Aug 2012 19:01:34 -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: > On 8/28/12, Nicolas Goaziou wrote: >>> #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. > > As a user, what is the best way in both the old and new exporters to > remove #[^+] lines on export? Flush lines in one of the hooks? Or is > there a setting? You can flush such lines in a hook: #+begin_src emacs-lisp (defun my-flush-old-comment-syntax (backend) (while (re-search-forward "^#[^ \t+]" nil t) (when (memq (org-element-type (org-element-at-point)) '(paragraph verse-block)) (delete-region (line-beginning-position) (progn (forward-line) (point)))))) (add-hook 'org-export-before-parsing-hook 'my-flush-old-comment-syntax) #+end_src > Or error if there are any such lines in the exported subtree. (I > always export subtrees.) Is this possible? For a warning, you may want to have something like: #+begin_src emacs-lisp (defun my-old-comment-syntax-warning (backend) (when (re-search-forward "^#[^ \t+]" nil t) (or (yes-or-no-p "Document may contain old-style comment syntax. Still proceed? ") (error "Export aborted")))) (add-hook 'org-export-before-parsing-hook 'my-old-comment-syntax-warning) #+end_src >>> #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. > > filladapt worked as it does in the rest of Emacs until pretty > recently, but it stopped working (error) when Org changed filling. If the error, which you haven't reported yet, happens when using filladapt, then filladapt has to be tweaked. > This bug refers to how Org without filladapt works. > > Are you suggesting getting it to work again, then fixing this bug? My > concern is that further changes in Org might make it not work again. > > The alternative is to make the Org behavior work as it used to with > filladapt. I am probably misunderstanding "bug 5". May you describe it again along with both the expected and actual behaviour in the situation? Regards, -- Nicolas Goaziou