Commit bda3c460 authored by Eli Zaretskii's avatar Eli Zaretskii

Document 'url-user-agent'.

* lisp/url/url-http.el (url-user-agent): Move from here...
* lisp/url/url-vars.el (url-user-agent): ...to here.  This is to
keep all the URL defcustoms in one place, and also have it defined
whenever the URL library is loaded.

* doc/misc/url.texi (Customization): Document 'url-user-agent'.
parent 3a9664d0
......@@ -1330,6 +1330,14 @@ Connect directly.
@end table
@end defopt
@defopt url-user-agent
The User Agent string used for sending HTTP/HTTPS requests. The value
should be a string or a function of no arguments that returns a
string. The default value is @w{@samp{User-Agent: @var{package-name}
URL/Emacs}}, where @var{package-name} is the value of
@code{url-package-name} and its version, if they are non-@code{nil}.
@end defopt
@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
......
......@@ -763,6 +763,7 @@ See the doc string of `sh-indent-after-continuation' for details.
When `url-handler-mode' is enabled, file operations for these
protocols as well as for "telnet" and "ftp" are passed to Tramp.
+++
*** The URL package allows customizing the `url-user-agent' string.
The new `url-user-agent' variable can be customized to be a string or
a function.
......
......@@ -135,17 +135,6 @@ request.")
(507 insufficient-storage "Insufficient storage"))
"The HTTP return codes and their text.")
(defcustom url-user-agent (format "User-Agent: %sURL/%s\r\n"
(if url-package-name
(concat url-package-name "/"
url-package-version " ")
"") url-version)
"User Agent used by the URL package."
:type '(choice (string :tag "A static User-Agent string")
(function :tag "Call a function to get the User-Agent string"))
:version "25.1"
:group 'url)
;(eval-when-compile
;; These are all macros so that they are hidden from external sight
;; when the file is byte-compiled.
......
......@@ -357,6 +357,18 @@ Currently supported methods:
(const :tag "Direct connection" :value native))
:group 'url-hairy)
(defcustom url-user-agent (format "User-Agent: %sURL/%s\r\n"
(if url-package-name
(concat url-package-name "/"
url-package-version " ")
"") url-version)
"User Agent used by the URL package for HTTP/HTTPS requests
Should be a string or a function of no arguments returning a string."
:type '(choice (string :tag "A static User-Agent string")
(function :tag "Call a function to get the User-Agent string"))
:version "25.1"
:group 'url)
(defvar url-setup-done nil "Has setup configuration been done?")
(defconst url-weekday-alist
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment