emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: Enhancing the Org/Gnus experience
Date: Thu, 04 Nov 2010 14:11:04 +0100	[thread overview]
Message-ID: <80sjzh9qtz.fsf@mundaneum.com> (raw)
In-Reply-To: 877hgtfhaq.fsf@ucl.ac.uk

Eric,

Eric S Fraga wrote:
> Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>> Hi Eric (and Dan),
>> "Eric Schulte" wrote:
>>> This is really great.  I finally folded it into my gnus setup, and while
>>> it looks great when it works
>>
>> Great you love it. I'm *VERY* pleased. Moreover, having no reaction on that
>> (and on some other posts[1]), I thought I'd been kill-filed ;-)[2]
>
> Sébastien et al.,
>
> I have also included the code in my gnus configuration but I am not sure
> if it is actually doing anything or not.  Well, actually, I think it
> *is* doing something but I haven't actually seen any fontification etc.
> On the other hand, I am still getting to grips with gnus article display
> functionality so I've probably done something wrong...
>
> If there are any obvious things I should be looking at, please let me know.

Not that I know of.

For the sake of completeness, this is the part I have about my viewing
customizations.

Maybe take this into your .gnus and see what it gives?

#+begin_src emacs-lisp
;;*** 1.2 (info "(emacs-mime)Non-MIME")

      ;; regexp of Emacs sources groups
      (setq mm-uu-emacs-sources-regexp "emacs")

      ;; regexp matching diff groups
      (setq mm-uu-diff-groups-regexp
            "\\(diff\\|commit\\|cvs\\|bug\\|devel\\|reviews\\|mc\\|orgmode\\)")

      ;; regexp matching TeX groups
      (setq mm-uu-tex-groups-regexp ".*") ;; 2010-10-21 was "tex"

      (eval-after-load "mm-uu"
        '(progn
           ;; correctly fontify Org-mode attachments
           (add-to-list 'mailcap-mime-extensions '(".org" . "text/org"))
           (add-to-list 'mm-automatic-display "text/org")

           (add-to-list 'mm-inline-media-tests
                        '("text/org" my/display-org-inline
                          (lambda (el) t)))

           (defun my/display-org-inline (handle)
             (condition-case nil
                 (mm-display-inline-fontify handle 'org-mode)
               (error
                (insert
                 (with-temp-buffer (mm-insert-part handle) (buffer-string))
                 "\n"))))

           ;; update `org-src-lang-modes' to provide some leeway for posters
           (add-to-list 'org-src-lang-modes '("elisp" . emacs-lisp))
           (add-to-list 'org-src-lang-modes '("emacs_lisp" . emacs-lisp))

           ;; fontify code blocks in the text of messages
           (defun my/mm-org-babel-src-extract ()
             (mm-make-handle (mm-uu-copy-to-buffer start-point end-point)
                             '("text/org")))

           (add-to-list 'mm-uu-type-alist
                        '(org-babel-block
                          "^[ \t]*#\\+begin_"
                          "^[ \t]*#\\+end_"
                          my/mm-org-babel-src-extract
                          nil))

           (mm-uu-configure)))


;;*** 1.5 (info "(emacs-mime)Display Customization")

      ;; You can view "text/html" parts of the current article with a WWW
      ;; browser by pressing `K H' (`gnus-article-browse-html-article')

      ;; ;; MIME type that will be displayed externally automatically
      ;; (add-to-list 'mm-automatic-external-display "text/html")

      ;; do not treat inline images as real attachments (display them,
      ;; instead)
      (add-to-list 'mm-attachment-override-types "image/.*")
                                        ; "text/x-vcard"...

      ;; don't render HTML automatically *when plain text alternative is
      ;; available*
      (eval-after-load "mm-decode"
        '(progn
           (add-to-list 'mm-discouraged-alternatives "text/html")
           (add-to-list 'mm-discouraged-alternatives "text/richtext")
           (add-to-list 'mm-discouraged-alternatives "text/enriched")
           (add-to-list 'mm-discouraged-alternatives "multipart/related")))

      ;; all images fit in the buffer
      (setq mm-inline-large-images t)

      ;; ;; always show HTML mails as attachments (even if they can be
      ;; ;; displayed) use `browse-url-browser-function' (firefox) to render
      ;; ;; HTML mails
      ;; (push "text/html" mm-inline-override-types)


      ;; use `w3m' browser (if installed) to render HTML-only mails
      (setq mm-text-html-renderer
            (cond ((executable-find "w3m") 'w3m)
                  (t 'html2text))) ;; Emacs built-in

      (eval-after-load "w3m"
        '(progn
           ;; (setq browse-url-browser-function 'w3m-browse-url)
           (setq mm-inline-text-html-renderer
                 'mm-inline-text-html-render-with-w3m)
           (setq gnus-article-wash-function
                 'gnus-article-wash-html-with-w3m)

           ;; Whenever you try to browse URLs found in articles, Gnus
           ;; (`emacs-w3m', in fact) complains that "This link is considered
           ;; unsafe...". To turn it off, frob the variables
           ;; `w3m-safe-url-regexp' and `mm-w3m-safe-url-regexp'.
           ))

      ;; allow retrieving images in HTML contents with the <img> tags
      (setq mm-inline-text-html-with-images t)

      ;; Remove HTML tags from a buffer
      (defun my/wash-ugly-html ()
        "Remove ugly HTML tags."
        (interactive)
        (toggle-read-only -1)
        (save-excursion
          (goto-char (point-min))
          (while (re-search-forward "<[^#][^<@>]*>" nil t)
            (replace-match "" nil nil))
          (goto-char (point-min))
          (while (re-search-forward "&gt;" nil t)
            (replace-match ">" nil nil))
          (goto-char (point-min))
          (while (re-search-forward "&lt;" nil t)
            (replace-match "<" nil nil))

          ;; FIXME Do not simply remove accents like it does now
          (goto-char (point-min))
          (while (re-search-forward "&[^;]*;" nil t)
            (replace-match "" nil nil))))
#+end_src


>>> I was getting frequent errors throw by the org-mode fontification engine
>>> recursing too deeply. I've changed it to the following which augments what
>>> you sent with some simple error handling.
>>
>> I _never_ observed problems in my case. Anyway, adding such a protection is
>> the code is a great addition. Thanks!
>>
>> I've just singed the FSF papers. Once received by the FSF, I'll
>> propagate your update onto the Gnus newsgroup.
>
> Please post here as well.  I do follow the gnus newsgroup but less
> frequently.

I'll do. For sure!


>> When that will be done, we will have a real Org experience when
>> reading mails with Gnus. I love all this tools.
>
> Yes, there's great potential for the gnus+org combination to give a
> really nice email experience!

I'm impatient to have the above things added...

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2010-11-04 13:11 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15 15:51 Enhancing the Org/Gnus experience Sébastien Vauban
2010-10-15 16:59 ` Eric Schulte
2010-10-18 15:55   ` Sébastien Vauban
2010-10-18 20:57     ` Sébastien Vauban
2010-10-31 17:30       ` Eric Schulte
2010-10-31 20:57         ` Dan Davison
2010-11-04 11:18         ` Sébastien Vauban
2010-11-04 11:40           ` Eric S Fraga
2010-11-04 12:22             ` Eric Schulte
2010-11-04 13:53               ` Eric S Fraga
2010-11-04 15:06                 ` Sébastien Vauban
2010-11-04 16:21                 ` Tassilo Horn
2010-11-05 12:48                   ` Eric S Fraga
2010-11-05 12:58                     ` Sébastien Vauban
2010-11-05 21:36                       ` Eric S Fraga
2010-11-04 13:11             ` Sébastien Vauban [this message]
2010-11-04 14:24               ` Eric S Fraga
2010-11-04 15:11               ` Eric S Fraga
2010-11-04 13:29           ` Eric Schulte
2010-11-04 14:16             ` Sébastien Vauban
2010-11-04 15:24               ` Eric Schulte
2010-11-04 18:18           ` Jambunathan K
2010-11-29 13:40         ` Julien Danjou
2010-11-29 14:11           ` Sébastien Vauban
2011-01-17 16:09             ` Julien Danjou
2011-01-19 13:28               ` Sébastien Vauban
2011-01-20 10:16                 ` Julien Danjou
2011-01-20 18:00                   ` Julien Danjou
2011-01-20 22:09                     ` Sébastien Vauban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80sjzh9qtz.fsf@mundaneum.com \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).