redguardtoo / mastering-emacs-in-one-year-guide

Be great at emacs in one year
6.38k stars 896 forks source link

would this be useful? jump to gmail (web browser) from gnus #105

Open dmgerman opened 7 years ago

dmgerman commented 7 years ago

I wrote this function to be able to jump to gmail from a given email in gnus. if you are interested, i can create a pull request

(defun dmg-gmail-goto-message-id ()
  (interactive)
  (save-excursion
    (setq save-buffer-name (buffer-name))
    (switch-to-buffer-other-window gnus-article-buffer)
    (gnus-summary-toggle-header 1)
    (goto-char (point-min))
    (if (re-search-forward "^Message-ID: *\\(.*\\)$")
        (browse-url
         (format "https://mail.google.com/mail/u/0/#search/rfc822msgid%%3A%s" (org-link-escape (match-string 1))
                 )
         )
      (message "Message id not found")
      )
    (gnus-summary-toggle-header -1)
    (switch-to-buffer-other-window save-buffer-name)
    )
  )
redguardtoo commented 7 years ago

Interesting. Could you change browse-url to browse-url-generic? Please also format code a little bit before send me the pull request.