emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug and patch in org-toggle-fixed-width-section
@ 2009-10-22 14:07 Matthieu Lemerre
  2009-10-22 14:09 ` Bernt Hansen
  2009-10-22 14:13 ` Bernt Hansen
  0 siblings, 2 replies; 3+ messages in thread
From: Matthieu Lemerre @ 2009-10-22 14:07 UTC (permalink / raw)
  To: emacs-orgmode

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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug and patch in org-toggle-fixed-width-section
  2009-10-22 14:07 Bug and patch in org-toggle-fixed-width-section Matthieu Lemerre
@ 2009-10-22 14:09 ` Bernt Hansen
  2009-10-22 14:13 ` Bernt Hansen
  1 sibling, 0 replies; 3+ messages in thread
From: Bernt Hansen @ 2009-10-22 14:09 UTC (permalink / raw)
  To: Matthieu Lemerre; +Cc: emacs-orgmode

Matthieu Lemerre <matthieu.lemerre@cea.fr> writes:

> 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)
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug and patch in org-toggle-fixed-width-section
  2009-10-22 14:07 Bug and patch in org-toggle-fixed-width-section Matthieu Lemerre
  2009-10-22 14:09 ` Bernt Hansen
@ 2009-10-22 14:13 ` Bernt Hansen
  1 sibling, 0 replies; 3+ messages in thread
From: Bernt Hansen @ 2009-10-22 14:13 UTC (permalink / raw)
  To: Matthieu Lemerre; +Cc: emacs-orgmode

Matthieu Lemerre <matthieu.lemerre@cea.fr> writes:

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

This was fixed in commit 730ef5f (Fix bug in `org-toggle-fixed-width-section'., 2009-03-14)
which was part of release_6.25

-Bernt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-22 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-22 14:07 Bug and patch in org-toggle-fixed-width-section Matthieu Lemerre
2009-10-22 14:09 ` Bernt Hansen
2009-10-22 14:13 ` Bernt Hansen

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