summaryrefslogtreecommitdiff
path: root/lisp/net/browse-url.el
diff options
context:
space:
mode:
authorSimen Heggestøyl <simenheg@gmail.com>2020-06-16 21:32:58 +0200
committerSimen Heggestøyl <simenheg@gmail.com>2020-08-07 17:37:06 +0200
commit7196abecb5f5c3cc1282280d2d337b6a86761656 (patch)
treec0de3c8f00dacc03289467f7ecd90cc41ca4efc4 /lisp/net/browse-url.el
parent3e39aa6cfa6822b535d597b3e59abfea38610a48 (diff)
downloademacs-7196abecb5f5c3cc1282280d2d337b6a86761656.tar.gz
Use lexical-binding in browse-url.el and add tests
* lisp/net/browse-url.el: Turn on lexical-binding. (browse-url--mailto, browse-url--man, browse-url--browser): Use imperative form in docstrings. (browse-url-delete-temp-file): Turn comment into a proper docstring. * test/lisp/net/browse-url-tests.el: New file with tests for browse-url.el.
Diffstat (limited to 'lisp/net/browse-url.el')
-rw-r--r--lisp/net/browse-url.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 7c2fde98cc7..2b8d4d0ce62 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -1,4 +1,4 @@
-;;; browse-url.el --- pass a URL to a WWW browser
+;;; browse-url.el --- pass a URL to a WWW browser -*- lexical-binding: t; -*-
;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
@@ -587,7 +587,7 @@ process), or nil (we don't know)."
kind)))
(defun browse-url--mailto (url &rest args)
- "Calls `browse-url-mailto-function' with URL and ARGS."
+ "Call `browse-url-mailto-function' with URL and ARGS."
(funcall browse-url-mailto-function url args))
(defun browse-url--browser-kind-mailto (url)
@@ -596,7 +596,7 @@ process), or nil (we don't know)."
#'browse-url--browser-kind-mailto)
(defun browse-url--man (url &rest args)
- "Calls `browse-url-man-function' with URL and ARGS."
+ "Call `browse-url-man-function' with URL and ARGS."
(funcall browse-url-man-function url args))
(defun browse-url--browser-kind-man (url)
@@ -605,7 +605,7 @@ process), or nil (we don't know)."
#'browse-url--browser-kind-man)
(defun browse-url--browser (url &rest args)
- "Calls `browse-url-browser-function' with URL and ARGS."
+ "Call `browse-url-browser-function' with URL and ARGS."
(funcall browse-url-browser-function url args))
(defun browse-url--browser-kind-browser (url)
@@ -819,8 +819,8 @@ narrowed."
(browse-url-of-file file-name))))
(defun browse-url-delete-temp-file (&optional temp-file-name)
- ;; Delete browse-url-temp-file-name from the file system
- ;; If optional arg TEMP-FILE-NAME is non-nil, delete it instead
+ "Delete `browse-url-temp-file-name' from the file system.
+If optional arg TEMP-FILE-NAME is non-nil, delete it instead."
(let ((file-name (or temp-file-name browse-url-temp-file-name)))
(if (and file-name (file-exists-p file-name))
(delete-file file-name))))