emacs-diffs
[Top][All Lists]
Advanced

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

master 80628df: Add global-goto-address-mode


From: Lars Ingebrigtsen
Subject: master 80628df: Add global-goto-address-mode
Date: Thu, 20 Aug 2020 09:17:28 -0400 (EDT)

branch: master
commit 80628df778c2608e0d0d934ed884365ae94f9ddd
Author: Noah Swainland <noah@distinctly.pink>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Add global-goto-address-mode
    
    * doc/emacs/misc.texi (Goto Address mode): Document it.
    
    * lisp/net/goto-addr.el (global-goto-address-mode)
    (goto-addr-mode--turn-on): New functions (bug#42937).
---
 doc/emacs/misc.texi   |  3 +++
 etc/NEWS              |  4 ++++
 lisp/net/goto-addr.el | 10 ++++++++++
 3 files changed, 17 insertions(+)

diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 317a197..c8b21e7 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -2945,6 +2945,9 @@ browse-url @key{RET}}.
 @table @kbd
 @item M-x goto-address-mode
 Activate URLs and e-mail addresses in the current buffer.
+
+@item M-x global-goto-address-mode
+Activate @code{goto-address-mode} in all buffers.
 @end table
 
 @kindex C-c RET @r{(Goto Address mode)}
diff --git a/etc/NEWS b/etc/NEWS
index bbd34a5..53391f9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -820,6 +820,10 @@ window after starting).  This variable defaults to nil.
 
 ** Miscellaneous
 
++++
+*** New global mode 'global-goto-address-mode'
+This will enable 'goto-address-mode' in all buffers.
+
 ---
 *** 'C-s' in 'M-x' now searches over completions again.
 In Emacs 23, typing 'M-x' ('read-extended-command') and then 'C-s' (to
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index 9436f45..43bea76 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -280,6 +280,16 @@ Also fontifies the buffer appropriately (see 
`goto-address-fontify-p' and
       (widen)
       (goto-address-unfontify (point-min) (point-max)))))
 
+(defun goto-addr-mode--turn-on ()
+  (when (not goto-address-mode)
+    (goto-address-mode 1)))
+
+;;;###autoload
+(define-globalized-minor-mode global-goto-address-mode
+  goto-address-mode goto-addr-mode--turn-on
+  :group 'goto-address
+  :version "28.1")
+
 ;;;###autoload
 (define-minor-mode goto-address-prog-mode
   "Like `goto-address-mode', but only for comments and strings."



reply via email to

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