Gnus development mailing list
 help / color / mirror / Atom feed
* K-e does not open html in browser anymore
@ 2013-06-25  8:37 Rainer M Krug
  2013-06-25  9:17 ` Erik Colson
  0 siblings, 1 reply; 7+ messages in thread
From: Rainer M Krug @ 2013-06-25  8:37 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 15659 bytes --]

Hi 

I migrated from Linux to OS X and I am coping quite well on the emacs /
gnus side. The only main thing which is still bothering me is that an
html email, with K-e is not opened in the browser anymore. emacs / gnus
asks in the mini-buffer about the MIME type, although it is displayed
useing W3M correctly in emacs:

,----
| View as MIME type (default text/plain): 
`----

Any ideas? I used K-e quite regularly.

Thanks,

Rainer
 

My gnus config is as follow:

,----
| * gnus (gnus.conf.el)
| :PROPERTIES:
| :tangle: ./gnus.conf.el
| :END:
| See  [[http://www.emacswiki.org/emacs/GnusGmail#toc2]]
| ** Load Gnus  
| #+begin_src emacs-lisp
|     (require 'gnus)
|   #+end_src
| ** COMMENT Start offlineimap before startup of gnus
| #+begin_src emacs-lisp :tangle no
| (require offlineimap)
| (setq offlineimap-command "/usr/local/bin/offlineimap")
| (add-hook 'gnus-before-startup-hook offlineimap)
| #+end_src
| 
| 
| ** Define news sources
| *** Primary source - "news.gmane.org" (news.gmane.org)
| #+begin_src emacs-lisp
|   (setq gnus-select-method 
|         '(nntp "news.gmane.org"
|                (nntp-open-connection-function nntp-open-tls-stream)
|                (nntp-port-number 563)))
|   
|   ;;              '(nnimap "gmail"
|   ;;                       (nnimap-address "imap.gmail.com")
|   ;;                       (nnimap-server-port 993)
|   ;;                       (nnimap-stream ssl)
|   ;;                       (nnimap-authinfo-file "~/.authinfo.gpg")
|   ;;                       (nnir-search-engine 'notmuch)))
|   #+end_src
| 
| *** Secondary source - "Maildir" (localhost imap)
| #+begin_src emacs-lisp 
|   (add-to-list 'gnus-secondary-select-methods          
|                ;; '(nnimap "localhost"
|                ;;       (nnimap-stream network)
|                ;;       (nnimap-address "localhost")x
|                ;;       (nnimap-authinfo-file "~/.authinfo.gpg")
|                ;;       (nnimap-authenticator login)))
|   
|                '(nnimap "Maildir"
|                         (nnimap-stream shell)
|                         (nnimap-shell-program "/usr/local/Cellar/dovecot/2.2.2/libexec/dovecot/imap -o mail_location=maildir:$HOME/Maildir")))
|                         ;;(nnir-search-engine 'notmuch)))
| #+end_src
| 
| ** Configure outgoing mail to use smtp.gmail.com
| #+begin_src emacs-lisp
| (setq starttls-gnutls-program "/usr/local/bin/gnutls-cli")
| (setq starttls-use-gnutls t) 
| (setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
|       smtpmail-smtp-server "smtp.gmail.com"
|       smtpmail-default-smtp-server "smtp.gmail.com"
|       send-mail-function 'smtpmail-send-it
|       message-send-mail-function 'smtpmail-send-it
|       smtpmail-smtp-service 587
|       smtpmail-auth-credentials '(("smtp.gmail.com" 587 "R.M.Krug@gmail.com" nil))
|       smtpmail-debug-info t
|       smtpmail-debug-verb t
|       )
| #+end_src
| 
| ** Prioritize for text display
| #+begin_src emacs-lisp
|   (setq mm-discouraged-alternatives
|         '("text/html" "text/richtext"))
|   (setq gnus-buttonized-mime-types
|         '("multipart/alternative" "multipart/signed")
|         mm-discouraged-alternatives
|         '("text/html" "image/.*"))
| #+end_src
| 
| 
| ** Set renderer for html email 
| Set renderer for html mail to w3m in emacs
| #+begin_src emacs-lisp
|   (setq mm-text-html-renderer 'w3m)
| #+end_src
| 
| ** expiring default
| *** nnmail-expiry-wait
| Time until an as Expired marked email will actually be expired
| #+begin_src emacs-lisp
|   (setq nnmail-expiry-wait 'immediate)
| #+end_src
| *** nnmail-expiry-target
| Target of expired emails.
| #+begin_src emacs-lisp
|   (setq nnmail-expiry-target 'nnmail-fancy-expiry-target
|         nnmail-fancy-expiry-targets
|         '(;;(to-from "boss" "nnfolder:Work")
|           ;;("subject" "IMPORTANT" "nnfolder:IMPORTANT.%Y.%b")
|           ;; ("from" ".*" "nnimap+Maildir:RMKrugGMAIL.[Gmail].Bin")))
|           ("from" ".*" "nnimap+Maildir:Archives.%Y")))
| #+end_src
| 
| ** Set gnus-parameter
| #+begin_src emacs-lisp
|   (setq gnus-parameters
|         '(        
|           (".*"
|            (gnus-use-scoring nil)
|            ;; (expiry-wait . immediate)
|            ;; (expiry-target "nnimap+Maildir:RMKrugGMAIL.[Gmail].Bin")
|            ;; (display . all)
|            (gcc-self . t)
|            )
|           ("^gmane.*"
|            (gcc-self . "nnimap+Maildir:RMKrugGMAIL.[Gmail].Sent Mail"))
|           ))
| #+end_src
| 
| ** Set gcc mail to read
| #+begin_src emacs-lisp
|   (setq gnus-gcc-mark-as-read t)
| #+end_src
| 
| ** Define a "large newsgroup"
| Based on [[http://stackoverflow.com/questions/4982831/i-dont-want-to-expire-mail-in-gnus]]
| #+begin_src emacs-lisp
|   (setq gnus-large-newsgroup 100)
| #+end_src
| 
| ** Set thread gathering function
| #+begin_src emacs-lisp
|   (setq-default gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references)
| #+end_src
| 
| ** Customize group view
| *** Replacing common prefixes of group names with spaces
| This is based on [[http://www.emacswiki.org/emacs/GnusFormatting#toc8]]
| Here’s a user-format-function that prints the group name, but if the first part of it is the same as the above group name, it’ll replace the common prefix with spaces. So instead of
| #+begin_src emacs-lisp
|   (defvar gnus-user-format-function-g-prev "" "")
|   (defun empty-common-prefix (left right)
|     "Given `left' '(\"foo\" \"bar\" \"fie\") and `right' '(\"foo\"
|       \"bar\" \"fum\"), return '(\"   \" \"   \" \"fum\")."
|     (if (and (cdr right)                  ; always keep the last part of right
|              (equal (car left) (car right)))
|         (cons (make-string (length (car left)) ? )
|               (empty-common-prefix (cdr left) (cdr right)))
|       right))
|   (defun gnus-user-format-function-g (arg)
|     "The full group name, but if it starts with a previously seen
|       prefix, empty that prefix."
|     (if (equal gnus-user-format-function-g-prev gnus-tmp-group) ; line-format is updated on exiting the summary, making prev equal this
|         gnus-tmp-group
|       (let* ((prev (split-string-and-unquote gnus-user-format-function-g-prev "\\."))
|              (this (split-string-and-unquote gnus-tmp-group "\\.")))
|         (setq gnus-user-format-function-g-prev gnus-tmp-group)
|         (combine-and-quote-strings
|          (empty-common-prefix prev this)
|          "."))))
|   (setq gnus-group-line-format "%M%S%p%P%5y:%B%(%ug%)\n")
| #+end_src
| 
| ** Thread sort order
| #+begin_src emacs-lisp
|   (setq gnus-thread-sort-functions
|         '(
|           gnus-thread-sort-by-most-recent-number
|           gnus-thread-sort-by-most-recent-date
|           ))
| #+end_src
| 
| ** Define custom date format
| Based on [[https://emacs.wordpress.com/2008/04/21/two-gnus-tricks/]]
| #+begin_src emacs-lisp
|   (setq gnus-user-date-format-alist
|         '(((gnus-seconds-today) . "Today, %H:%M")
|           ((+ 86400 (gnus-seconds-today)) . "Yesterday, %H:%M")
|           (604800 . "%A %H:%M") ;;that's one week
|           ((gnus-seconds-month) . "%A %d")
|           ((gnus-seconds-year) . "%B %d")
|           (t . "%B %d '%y"))) ;;this one is used when no other does match
| #+end_src
| 
| 
| ** More attractive Summary View
| From http://github.com/eschulte/emacs24-starter-kit/
| (There: Thanks to Dan Davison. see [[https://raw.github.com/eschulte/emacs24-starter-kit/master/starter-kit-gnus.org]])
| See also http://groups.google.com/group/gnu.emacs.gnus/browse_thread/thread/a673a74356e7141f
| #+begin_src emacs-lisp
|   (when window-system
|     (setq gnus-sum-thread-tree-indent "  ")
|     (setq gnus-sum-thread-tree-root "") ;; "● ")
|     (setq gnus-sum-thread-tree-false-root "") ;; "◯ ")
|     (setq gnus-sum-thread-tree-single-indent "") ;; "◎ ")
|     (setq gnus-sum-thread-tree-vertical        "│")
|     (setq gnus-sum-thread-tree-leaf-with-other "├─► ")
|     (setq gnus-sum-thread-tree-single-leaf     "╰─► "))
|   (setq gnus-summary-line-format
|         (concat
|          "%U%R%z"
|          "│" 
|          "%17&user-date;"  ;; date
|          "│"
|          "  "
|          "%-20,20f"               ;; name
|          "  "
|          "│"
|          " "
|          "%B"
|          "%s\n"))
|     
|   (setq gnus-summary-display-arrow t)
| #+end_src
| 
| ** Configure Gnus buffer configutration for wide screens
| #+begin_src emacs-lisp
|   (setq gnus-buffer-configuration
|         ;; '((group (horizontal 1.0 (group 1.0 point)))
|         ;;        (summary (horizontal 1.0 (summary 0.6 point) (group 1.0)))
|         ;;        (article (horizontal 1.0 (article 0.6) (summary 1.0 point)))
|         ;;        (forward (horizontal 1.0 (message 0.6 point) (article 1.0)))
|         ;;        (message (horizontal 1.0 (message 0.6 point) (article 1.0)))
|         ;;        (reply (horizontal 1.0 (message 0.6 point) (article 1.0)))
|         ;;        (reply-yank (horizontal 1.0 (message 0.6 point) (article 1.0)))))
|         '((group (horizontal 1.0 (group 1.0 point)))
|           (summary (horizontal 1.0 (summary 1.0 point)))
|           (article
|            (cond
|             (gnus-use-trees
|              '(horizontal 1.0 (summary 0.25 point) (tree 0.25)(article 1.0)))
|             (t
|              '(horizontal 1.0 (summary 0.4 point) (article 1.0)))))
|           (server (horizontal 1.0 (server 1.0 point)))
|           (browse (horizontal 1.0 (browse 1.0 point)))
|           (message (horizontal 1.0 (message 1.0 point)))
|           (pick (horizontal 1.0 (article 1.0 point)))
|           (info (horizontal 1.0 (info 1.0 point)))
|           (summary-faq (horizontal 1.0 (summary 0.25) (faq 1.0 point)))
|           (only-article (horizontal 1.0 (article 1.0 point)))
|           (edit-article (horizontal 1.0 (article 1.0 point)))
|           (edit-form (horizontal 1.0 (group 0.5) (edit-form 1.0 point)))
|           (edit-score (horizontal 1.0 (summary 0.25) (edit-score 1.0 point)))
|           (edit-server(horizontal 1.0(server 0.5) (edit-form 1.0 point)))
|           (post (horizontal 1.0 (post 1.0 point)))
|           (reply (horizontal 1.0(article 0.5) (message 1.0 point)))
|           (forward (horizontal 1.0 (message 1.0 point)))
|           (reply-yank (horizontal 1.0 (message 1.0 point)))
|           (mail-bounce (horizontal 1.0 (article 0.5) (message 1.0 point)))
|           (pipe (horizontal 1.0 (summary 0.25 point) ("*Shell Command Output*" 1.0)))
|           (bug (horizontal 1.0 (if gnus-bug-create-help-buffer '("*Gnus Help Bug*" 0.5)) ("*Gnus Bug*" 1.0 point)))
|           (score-trace (horizontal 1.0 (summary 0.5 point) ("*Score Trace*" 1.0)))
|           (score-words (horizontal 1.0 (summary 0.5 point) ("*Score Words*" 1.0)))
|           (split-trace(horizontal 1.0 (summary 0.5 point) ("*Split Trace*" 1.0)))
|           (category (horizontal 1.0 (category 1.0)))
|           (compose-bounce (horizontal 1.0 (article 0.5) (message 1.0 point)))
|           (display-term (horizontal 1.0 ("*display*" 1.0)))
|           (mml-preview (horizontal 1.0 (message 0.5) (mml-preview 1.0 point)))))
| #+end_src
| 
| 
| ** Always encrypt outgoing mails using easyPGP
| From notmuch [[http://notmuchmail.org/emacstips/#index16h2]]
| #+begin_src emacs-lisp
|   (add-hook 'message-setup-hook 'mml-secure-message-sign-pgpmime)
| #+end_src
| ** Bind offline-resync to o
| #+begin_src emacs-lisp
| (add-hook 'gnus-group-mode-hook
| 	  (lambda () (local-set-key "o" 'offlineimap-resync)))
| #+end_src
| 
| ** Define default move target
| 
| #+begin_src emacs-lisp
|   (setq gnus-move-split-methods
|         '((".*" "nnimap+Maildir:RMKrugGMAIL.[Gmail].Bin")))
| #+end_src 
| 
| ** notmuch integration
| *** Overwrite GG to start notmuch-search
| from [[http://roland.entierement.nu/blog/2010/09/08/gnus-dovecot-offlineimap-search-a-howto.html]]
| #+begin_src emacs-lisp
|   (define-key gnus-group-mode-map "GG" 'notmuch-search)
| #+end_src
| 
| *** In notmuch jump to gnus folder
| from [[http://roland.entierement.nu/blog/2010/09/08/gnus-dovecot-offlineimap-search-a-howto.html]]:
|   But seeing just the message that matches is not enough, 
|   sometimes we want the whole thread. Here's a snippet of 
|   Lisp for your .gnus, based on Tassilo Horn's configuration. 
|   Do a Notmuch search, enter one of the results, type C-c C-c, 
|   you'll get transported to the folder where that message was, 
|   with the context. Note this requires code from org-mode, 
|   so you might need to install that.
| 
| #+begin_src emacs-lisp
|   (add-hook 'gnus-group-mode-hook 'lld-notmuch-shortcut)
|   
|   (defun lld-notmuch-shortcut ()
|     (define-key gnus-group-mode-map "GG" 'notmuch-search)
|     )
|   
|   (defun lld-notmuch-file-to-group (file)
|     "Calculate the Gnus group name from the given file name.
|   "
|     (let ((group (file-name-directory (directory-file-name (file-name-directory file)))))
|       (setq group (replace-regexp-in-string ".*/Maildir/" "nnimap+Maildir:" group))
|       (setq group (replace-regexp-in-string "/$" "" group))
|       (if (string-match ":$" group)
|           (concat group "INBOX")
|         (replace-regexp-in-string ":\\." ":" group))))
|   
|   (defun lld-notmuch-goto-message-in-gnus ()
|     "Open a summary buffer containing the current notmuch
|   article."
|     (interactive)
|     (let ((group (lld-notmuch-file-to-group (notmuch-show-get-filename)))
|           (message-id (replace-regexp-in-string
|                        "^id:" "" (notmuch-show-get-message-id))))
|       (setq message-id (replace-regexp-in-string "\"" "" message-id))
|       (if (and group message-id)
|           (progn 
|       (switch-to-buffer "*Group*")
|       (org-gnus-follow-link group message-id))
|         (message "Couldn't get relevant infos for switching to Gnus."))))
|   
|   (define-key notmuch-show-mode-map (kbd "C-c C-c") 'lld-notmuch-goto-message-in-gnus)
| #+end_src
| 
| ** kill buffer after succesfull sending of mail
| See [[http://www.gnus.org/manual/gnus_399.html#SEC504]]
| #+begin_src emacs-lisp
|   (setq message-kill-buffer-on-exit t)
| #+end_src
| 
| ** Posting styles
| See [[https://www.gnu.org/software/emacs/manual/html_node/gnus/Posting-Styles.html]] for details.
| #+begin_src emacs-lisp
|   (setq gnus-posting-styles
|         '((".*"
|            (signature-file "~/.signature")
|            (name "Rainer M Krug"))
|           ("gmane.*"
|            (signature-file "~/.signature.news"))))
| #+end_src
| 
| ** Customizing Articles
| *** hide citation
| #+begin_src emacs-lisp
|   (setq gnus-cited-lines-visible 2)
| #+end_src
| 
| 
| ** Colour theming
| **** add path to leuven-theme
| #+begin_src emacs-lisp
|   (add-to-list 'custom-theme-load-path "~/.emacs.d/emacs-leuven-theme/")
| #+end_src
| 
| **** Select colour theme
| #+begin_src emacs-lisp
|   ;; dark background
|   ;; (load-theme 'cyberpunk t)
|   ;; (load-theme 'wombat txs)  
| 
|   ;; light background
|   ;; (load-theme 'twilight-bright t)
|   (load-theme 'anti-zenburn t)
|   ;; (load-theme 'solarized-light t)
|   ;; (load-theme 'occidental t)  
|   ;; (load-theme 'leuven t)  
| #+end_src
`----



-- 
Rainer M. Krug

email: RMKrug<at>gmail<dot>com

[-- Attachment #2: Type: application/pgp-signature, Size: 486 bytes --]

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

end of thread, other threads:[~2013-06-25 11:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-25  8:37 K-e does not open html in browser anymore Rainer M Krug
2013-06-25  9:17 ` Erik Colson
2013-06-25 10:44   ` Rainer M Krug
2013-06-25 10:53     ` Erik Colson
2013-06-25 11:03       ` Tassilo Horn
2013-06-25 11:12         ` Rainer M Krug
2013-06-25 11:07       ` Rainer M Krug

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 NNTP newsgroup(s).