Skip to main content
Change elisp syntax highlighting to lisp.
Source Link
JeanPierre
  • 7.5k
  • 1
  • 21
  • 39
g runs the command mu4e-view-go-to-url (found in mu4e-view-mode-map), which is
an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to g, <menu-bar> <headers> <goto-url>.

(mu4e-view-go-to-url &optional MULTI)

Offer to go to url(s). If MULTI (prefix-argument) is nil, go to
a single one, otherwise, offer to go to a range of urls.
g runs the command mu4e-view-go-to-url (found in mu4e-view-mode-map), which is
an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to g, <menu-bar> <headers> <goto-url>.

(mu4e-view-go-to-url &optional MULTI)

Offer to go to url(s). If MULTI (prefix-argument) is nil, go to
a single one, otherwise, offer to go to a range of urls.
mu4e-view-save-url is an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to k, <menu-bar> <headers> <save-url>.

(mu4e-view-save-url &optional MULTI)

Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs.
mu4e-view-save-url is an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to k, <menu-bar> <headers> <save-url>.

(mu4e-view-save-url &optional MULTI)

Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs.
g runs the command mu4e-view-go-to-url (found in mu4e-view-mode-map), which is
an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to g, <menu-bar> <headers> <goto-url>.

(mu4e-view-go-to-url &optional MULTI)

Offer to go to url(s). If MULTI (prefix-argument) is nil, go to
a single one, otherwise, offer to go to a range of urls.
mu4e-view-save-url is an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to k, <menu-bar> <headers> <save-url>.

(mu4e-view-save-url &optional MULTI)

Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs.
g runs the command mu4e-view-go-to-url (found in mu4e-view-mode-map), which is
an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to g, <menu-bar> <headers> <goto-url>.

(mu4e-view-go-to-url &optional MULTI)

Offer to go to url(s). If MULTI (prefix-argument) is nil, go to
a single one, otherwise, offer to go to a range of urls.
mu4e-view-save-url is an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to k, <menu-bar> <headers> <save-url>.

(mu4e-view-save-url &optional MULTI)

Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs.
g runs the command mu4e-view-go-to-url (found in mu4e-view-mode-map), which is
an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to g, <menu-bar> <headers> <goto-url>.

(mu4e-view-go-to-url &optional MULTI)

Offer to go to url(s). If MULTI (prefix-argument) is nil, go to
a single one, otherwise, offer to go to a range of urls.
g runs the command mu4e-view-go-to-url (found in mu4e-view-mode-map), which is
an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to g, <menu-bar> <headers> <goto-url>.

(mu4e-view-go-to-url &optional MULTI)

Offer to go to url(s). If MULTI (prefix-argument) is nil, go to
a single one, otherwise, offer to go to a range of urls.
(defun mu4e-view-save-url (&optional multi)
  "Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs."
...
(defun mu4e-view-save-url (&optional multi)
  "Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs."
...
mu4e-view-save-url is an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to k, <menu-bar> <headers> <save-url>.

(mu4e-view-save-url &optional MULTI)

Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs.
mu4e-view-save-url is an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to k, <menu-bar> <headers> <save-url>.

(mu4e-view-save-url &optional MULTI)

Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs.
;; set Chromium path on macOS
(setq browse-url-chromium-program "/Applications/Chromium.app/Contents/MacOS/Chromium")

;; code to follow links in different browser
(defun browse-url-at-point-chromium (&optional ARG)
  (interactive)
  (let ((url (get-text-property (point) 'shr-url)))
    (if url
    (browse-url-chromium url ARG)
      (let ((url (browse-url-url-at-point)))
    (browse-url-chromium url ARG)))))

(define-key mu4e-view-mode-map (kbd "J") 'browse-url-at-point-chromium)
;; set Chromium path on macOS
(setq browse-url-chromium-program "/Applications/Chromium.app/Contents/MacOS/Chromium")

;; code to follow links in different browser
(defun browse-url-at-point-chromium (&optional ARG)
  (interactive)
  (let ((url (get-text-property (point) 'shr-url)))
    (if url
    (browse-url-chromium url ARG)
      (let ((url (browse-url-url-at-point)))
    (browse-url-chromium url ARG)))))

(define-key mu4e-view-mode-map (kbd "J") 'browse-url-at-point-chromium)
g runs the command mu4e-view-go-to-url (found in mu4e-view-mode-map), which is
an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to g, <menu-bar> <headers> <goto-url>.

(mu4e-view-go-to-url &optional MULTI)

Offer to go to url(s). If MULTI (prefix-argument) is nil, go to
a single one, otherwise, offer to go to a range of urls.
(defun mu4e-view-save-url (&optional multi)
  "Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs."
...
mu4e-view-save-url is an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to k, <menu-bar> <headers> <save-url>.

(mu4e-view-save-url &optional MULTI)

Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs.
;; set Chromium path on macOS
(setq browse-url-chromium-program "/Applications/Chromium.app/Contents/MacOS/Chromium")

;; code to follow links in different browser
(defun browse-url-at-point-chromium (&optional ARG)
  (interactive)
  (let ((url (get-text-property (point) 'shr-url)))
    (if url
    (browse-url-chromium url ARG)
      (let ((url (browse-url-url-at-point)))
    (browse-url-chromium url ARG)))))

(define-key mu4e-view-mode-map (kbd "J") 'browse-url-at-point-chromium)
g runs the command mu4e-view-go-to-url (found in mu4e-view-mode-map), which is
an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to g, <menu-bar> <headers> <goto-url>.

(mu4e-view-go-to-url &optional MULTI)

Offer to go to url(s). If MULTI (prefix-argument) is nil, go to
a single one, otherwise, offer to go to a range of urls.
(defun mu4e-view-save-url (&optional multi)
  "Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs."
...
mu4e-view-save-url is an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to k, <menu-bar> <headers> <save-url>.

(mu4e-view-save-url &optional MULTI)

Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs.
;; set Chromium path on macOS
(setq browse-url-chromium-program "/Applications/Chromium.app/Contents/MacOS/Chromium")

;; code to follow links in different browser
(defun browse-url-at-point-chromium (&optional ARG)
  (interactive)
  (let ((url (get-text-property (point) 'shr-url)))
    (if url
    (browse-url-chromium url ARG)
      (let ((url (browse-url-url-at-point)))
    (browse-url-chromium url ARG)))))

(define-key mu4e-view-mode-map (kbd "J") 'browse-url-at-point-chromium)
Source Link
emonigma
  • 2k
  • 14
  • 34

tl;dr

Use k, or mu4e-view-save-url, which saves it to the kill ring and to the clipboard.

Looking for the mu4e function

For similar functions, it helps to look at the documentation and source code. Press C-h k and g to view the documentation for the function bound to k:

g runs the command mu4e-view-go-to-url (found in mu4e-view-mode-map), which is
an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to g, <menu-bar> <headers> <goto-url>.

(mu4e-view-go-to-url &optional MULTI)

Offer to go to url(s). If MULTI (prefix-argument) is nil, go to
a single one, otherwise, offer to go to a range of urls.

Click the first link to visit the source code, which shows this function right after mu4e-view-go-to-url:

(defun mu4e-view-save-url (&optional multi)
  "Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs."
...

Then from a mu4e buffer, you can find its key binding with C-h f RET mu4e-view-save-url:

mu4e-view-save-url is an interactive compiled Lisp function in
‘/usr/local/Cellar/mu/1.2.0/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’.

It is bound to k, <menu-bar> <headers> <save-url>.

(mu4e-view-save-url &optional MULTI)

Offer to save urls(s) to the kill-ring. If
MULTI (prefix-argument) is nil, save a single one, otherwise, offer
to save a range of URLs.

Defining a custom function

You can also define a function to open a link in a browser other than the default. The code is from this thread and I was unable to make it work on Safari:

;; set Chromium path on macOS
(setq browse-url-chromium-program "/Applications/Chromium.app/Contents/MacOS/Chromium")

;; code to follow links in different browser
(defun browse-url-at-point-chromium (&optional ARG)
  (interactive)
  (let ((url (get-text-property (point) 'shr-url)))
    (if url
    (browse-url-chromium url ARG)
      (let ((url (browse-url-url-at-point)))
    (browse-url-chromium url ARG)))))

(define-key mu4e-view-mode-map (kbd "J") 'browse-url-at-point-chromium)