From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthieu Lemerre Subject: Bug and patch in org-toggle-fixed-width-section Date: Thu, 22 Oct 2009 15:07:02 +0100 Message-ID: <4AE06706.10106@cea.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0xNG-0000x7-JA for emacs-orgmode@gnu.org; Thu, 22 Oct 2009 09:06:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0xNA-0000uv-V1 for emacs-orgmode@gnu.org; Thu, 22 Oct 2009 09:06:37 -0400 Received: from [199.232.76.173] (port=58668 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0xN9-0000uW-IF for emacs-orgmode@gnu.org; Thu, 22 Oct 2009 09:06:32 -0400 Received: from oxalide-out.extra.cea.fr ([132.168.224.1]:36787) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N0xN8-0002fN-Pi for emacs-orgmode@gnu.org; Thu, 22 Oct 2009 09:06:31 -0400 Received: from pisaure.intra.cea.fr (pisaure.intra.cea.fr [132.166.88.21]) by oxalide.extra.cea.fr (8.14.2/8.14.2/CEAnet-Internet-out-2.0) with ESMTP id n9MD6MLj008838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 22 Oct 2009 15:06:22 +0200 Received: from muguet1.intra.cea.fr (muguet1.intra.cea.fr [132.166.192.6]) by pisaure.intra.cea.fr (8.14.2/8.14.2) with ESMTP id n9MD6MUc032272 for ; Thu, 22 Oct 2009 15:06:22 +0200 (envelope-from matthieu.lemerre@cea.fr) Received: from [132.166.135.72] (is002221.intra.cea.fr [132.166.135.72]) by muguet1.intra.cea.fr (8.13.8/8.13.8/CEAnet-Intranet-out-1.1) with ESMTP id n9MD6LwW029337 for ; Thu, 22 Oct 2009 15:06:22 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi There is a bug in org-toggle-fixed-width-section in the org version shipped with emacs23: this function only inserts ":", when this colon should be followed by a space. I joined a patch for your convenience; it seems to work. Maybe this has already been fixed in later versions. Regards, Matthieu Lemerre *** /tmp/ediff3735oPQ 2009-10-22 15:02:21.000000000 +0100 --- /tmp/ediff37351ZW 2009-10-22 15:02:21.000000000 +0100 *************** *** 1,3 **** --- 1,7 ---- + ;; This buffer is for notes you don't want to save, and for Lisp evaluation. + ;; If you want to create a file, visit that file with C-x C-f, + ;; then enter the text in that file's own buffer. + (defun org-toggle-fixed-width-section (arg) "Toggle the fixed-width export. If there is no active region, the QUOTE keyword at the current headline is *************** *** 13,19 **** (end (if regionp (region-end))) (nlines (or arg (if (and beg end) (count-lines beg end) 1))) (case-fold-search nil) ! (re "[ \t]*\\(:\\)") off) (if regionp (save-excursion --- 17,23 ---- (end (if regionp (region-end))) (nlines (or arg (if (and beg end) (count-lines beg end) 1))) (case-fold-search nil) ! (re "[ \t]*\\(: \\)") off) (if regionp (save-excursion *************** *** 31,37 **** (forward-line -1)) ((and off (looking-at re)) (replace-match "" t t nil 1)) ! ((not off) (org-move-to-column cc t) (insert ":"))) (forward-line 1))) (save-excursion (org-back-to-heading) --- 35,41 ---- (forward-line -1)) ((and off (looking-at re)) (replace-match "" t t nil 1)) ! ((not off) (org-move-to-column cc t) (insert ": "))) (forward-line 1))) (save-excursion (org-back-to-heading)