emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Re: Org minor mode in mail-mode


From: Nicolas
Subject: [O] Re: Org minor mode in mail-mode
Date: Sun, 20 Mar 2011 15:59:27 +0100

Hello,

Matt Lundin <address@hidden> writes:

>> Any idea on how to make use of org minor mode in mail-mode and still
>> be able to fill-paragraph without impacting mail headers?
>
> The org minor modes set the local value of fill-paragraph-function to
> org-fill-paragraph. You can override this by adding a line to your hook
> function:
>
>     (defun turn-on-full-org-mailing ()
>       (turn-on-orgstruct++)
>       (turn-on-orgtbl)
>       (load "org-html-mail")
>       (setq fill-paragraph-function 'message-fill-paragraph))
>
> I'm not sure how this will affect calling fill on lists or tables,
> however.

It will break list and tables filling.

> A proper fix would probably add a test to org-fill-paragraph to see if
> we are in message mode.

Another idea would be to change `paragraph-start' and
`paragraph-separate' values when turning on orgstruct and orgtbl.

#+begin_src emacs-lisp
(setq paragraph-start
      (concat
       (regexp-quote mail-header-separator) "$\\|"
       "-- $\\|"                         ; signature delimiter
       "---+$\\|"                        ; delimiters for forwarded messages
       page-delimiter "$\\|"             ; spoiler warnings
       ".*wrote:$\\|"                    ; attribution lines
       message-cite-prefix-regexp "$\\|" ; empty lines in quoted text
                                         ; mml tags
       "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)"
       paragraph-start))

(setq paragraph-separate paragraph-start)
#+end_src

Regards,

-- 
Nicolas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]