emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* `orgstruct++-mode',`fill-paragraph', and `mail-mode'
@ 2013-09-27 19:19 Rene
  2013-10-04 12:50 ` orgstruct++-mode, fill-paragraph, and mail-mode Rene
  0 siblings, 1 reply; 2+ messages in thread
From: Rene @ 2013-09-27 19:19 UTC (permalink / raw)
  To: emacs-orgmode

I like the intuitive way the Org mode structure editing and list
formatting works.  Thus I turn it on in mail-mode with 

     (add-hook 'mail-mode-hook 'turn-on-orgstruct)

This works alright.

But when I use `orgstruct++-mode'

     (add-hook 'mail-mode-hook 'turn-on-orgstruct++)

Then `fill-paragraph' (M-q) doesn't behave correctly anymore when
applied to the paragraph right below the `mail-header-separator'
("--text follows this line--").  All the above lines get rearranged.

I just realized that with `orgstruct-mode' the regexp
`paragraph-separate' contains the `mail-header-separator', whereas
with `orgstruct++-mode' this regexp does NOT contain the
`mail-header-separator'.  

The value of `paragraph-separate' is predefined in `sendmail.el'.

`orgstruct-mode' appends new regexps to `paragraph-separate', whereas
`orgstruct++-mode' replaces the initial value (given within
`sendmail.el') by orgmode specific ones.

--
Rene

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

* Re: orgstruct++-mode, fill-paragraph, and mail-mode
  2013-09-27 19:19 `orgstruct++-mode',`fill-paragraph', and `mail-mode' Rene
@ 2013-10-04 12:50 ` Rene
  0 siblings, 0 replies; 2+ messages in thread
From: Rene @ 2013-10-04 12:50 UTC (permalink / raw)
  To: emacs-orgmode

Rene <jlr_0 <at> yahoo.com> writes:

> I like the intuitive way the Org mode structure editing and list
> formatting works.  Thus I turn it on in mail-mode with 
> 
>      (add-hook 'mail-mode-hook 'turn-on-orgstruct)
> 
> This works alright.
> 
> But when I use orgstruct++-mode
> 
>      (add-hook 'mail-mode-hook 'turn-on-orgstruct++)
> 
> Then fill-paragraph (M-q) doesn't behave correctly anymore when
> applied to the paragraph right below the mail-header-separator
> ("--text follows this line--").  All the above lines get rearranged.
> 
> I just realized that with orgstruct-mode the regexp
> paragraph-separate contains the mail-header-separator, whereas
> with orgstruct++-mode this regexp does NOT contain the
> mail-header-separator.  

The value of paragraph-separate as predefined in sendmail.el is

  (setq paragraph-separate
	(concat (regexp-quote mail-header-separator)
		;; This is based on adaptive-fill-regexp (presumably
		;; the idea is to allow navigation etc of cited paragraphs).
		"$\\|\t*[-–!|#%;>*·•‣⁃◦ ]+$"
		"\\|[ \t]*[-[:alnum:]]*>+[ \t]*$\\|[ \t]*$\\|"
		"--\\( \\|-+\\)$\\|"
		page-delimiter))

With orgstruct-mode the value of paragraph-separate becomes

"--text follows this line--$\\|	*[-–!|#%;>*·•‣⁃◦ ]+$\\|[ 
]*[-[:alnum:]]*>+[ 	]*$\\|[ 	]*$\\|--\\( \\|-+\\)$\\|^\f"

As one can see orgstruct-mod do not alter this variable.

Whereas with orgstruct++-mode, the initial value of paragraph-separate
(given within
sendmail.el) vanishes, and turns into

"\\(?:\\*+ \\|\\[\\(?:[0-9]+\\|fn:[-_[:word:]]+\\)\\]\\|%%(\\|
[ ]*\\(?:$\\|\\(?:|\\|\\+-[-+]\\)\\|[#:]\\|-\\{5,\\}[ ]*$\\|
\\\\begin{\\([A-Za-z0-9]+\\*?\\)}\\|
\\(?:\\(?:CLO\\(?:CK\\|SED\\)\\|DEADLINE\\|SCHEDULED\\):\\)\\|
\\(?:[-+*]\\|\\(?:[0-9]+\\)[.)]\\)\\(?:[	]\\|$\\)\\)\\)"

Why is that so?

--
Rene

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

end of thread, other threads:[~2013-10-04 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-27 19:19 `orgstruct++-mode',`fill-paragraph', and `mail-mode' Rene
2013-10-04 12:50 ` orgstruct++-mode, fill-paragraph, and mail-mode Rene

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