aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBasil L. Contovounesios2019-07-22 21:14:18 +0100
committerBasil L. Contovounesios2019-07-23 09:30:39 +0100
commit086a56ed43de17015a14a4f1e799d258a789440a (patch)
tree79a8b68079d6a37d56a65d0f7257a193aa1f4470
parent05924677f065c019bdbceeced995ae806f2e243c (diff)
downloademacs-086a56ed43de17015a14a4f1e799d258a789440a.tar.gz
emacs-086a56ed43de17015a14a4f1e799d258a789440a.zip
Clarify Gravatar docs
For discussion, see the following thread: https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00528.html * doc/misc/gnus.texi (X-Face): Fix cross-reference. (Gravatars): * lisp/gnus/gnus-gravatar.el (gnus-gravatar-too-ugly): * lisp/image/gravatar.el (gravatar-cache-ttl, gravatar-rating) (gravatar-size): Clarify user option descriptions. (gravatar-retrieve, gravatar-retrieve-synchronously): Document return value.
-rw-r--r--doc/misc/gnus.texi26
-rw-r--r--lisp/gnus/gnus-gravatar.el3
-rw-r--r--lisp/image/gravatar.el35
3 files changed, 45 insertions, 19 deletions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index ee504f5d351..f0458847295 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -23441,11 +23441,11 @@ XEmacs. Here are examples:
23441 (png . (:relief -2)))) 23441 (png . (:relief -2))))
23442@end lisp 23442@end lisp
23443 23443
23444@pxref{Image Descriptors, ,Image Descriptors, elisp, The Emacs Lisp 23444@xref{Image Descriptors,,, elisp, The Emacs Lisp Reference Manual},
23445Reference Manual} for the valid properties for various image types. 23445for the valid properties for various image types. Currently,
23446Currently, @code{pbm} is used for X-Face images and @code{png} is used 23446@code{pbm} is used for X-Face images and @code{png} is used for Face
23447for Face images in Emacs. Only the @code{:face} property is effective 23447images in Emacs. Only the @code{:face} property is effective on the
23448on the @code{xface} image type in XEmacs if it is built with the 23448@code{xface} image type in XEmacs if it is built with the
23449@samp{libcompface} library. 23449@samp{libcompface} library.
23450@end table 23450@end table
23451 23451
@@ -23716,21 +23716,25 @@ The following variables offer control over how things are displayed.
23716@item gnus-gravatar-size 23716@item gnus-gravatar-size
23717@vindex gnus-gravatar-size 23717@vindex gnus-gravatar-size
23718The size in pixels of gravatars. Gravatars are always square, so one 23718The size in pixels of gravatars. Gravatars are always square, so one
23719number for the size is enough. 23719number for the size is enough. If @code{nil}, this defaults to the
23720value of @code{gravatar-size}.
23720 23721
23721@item gnus-gravatar-properties 23722@item gnus-gravatar-properties
23722@vindex gnus-gravatar-properties 23723@vindex gnus-gravatar-properties
23723List of image properties applied to Gravatar images. 23724List of image properties applied to Gravatar images (@pxref{Image
23725Descriptors,,, elisp, The Emacs Lisp Reference Manual}).
23724 23726
23725@item gnus-gravatar-too-ugly 23727@item gnus-gravatar-too-ugly
23726@vindex gnus-gravatar-too-ugly 23728@vindex gnus-gravatar-too-ugly
23727Regexp that matches mail addresses or names of people of which avatars 23729Regexp that matches mail addresses or names of people whose avatars
23728should not be displayed, or @code{nil}. It default to the value of 23730should not be displayed, or @code{nil} to display all avatars. It
23729@code{gnus-article-x-face-too-ugly} (@pxref{X-Face}). 23731defaults to the value of @code{gnus-article-x-face-too-ugly}
23732(@pxref{X-Face}).
23730 23733
23731@end table 23734@end table
23732 23735
23733If you want to see them in the From field, set: 23736If you want to see gravatars in the From field, set:
23737
23734@lisp 23738@lisp
23735(setq gnus-treat-from-gravatar 'head) 23739(setq gnus-treat-from-gravatar 'head)
23736@end lisp 23740@end lisp
diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el
index d271a52f908..19cbf529c65 100644
--- a/lisp/gnus/gnus-gravatar.el
+++ b/lisp/gnus/gnus-gravatar.el
@@ -46,7 +46,8 @@ If nil, default to `gravatar-size'."
46 :group 'gnus-gravatar) 46 :group 'gnus-gravatar)
47 47
48(defcustom gnus-gravatar-too-ugly gnus-article-x-face-too-ugly 48(defcustom gnus-gravatar-too-ugly gnus-article-x-face-too-ugly
49 "Regexp matching posters whose avatar shouldn't be shown automatically." 49 "Regexp matching posters whose avatar shouldn't be shown automatically.
50If nil, show all avatars."
50 :type '(choice regexp (const nil)) 51 :type '(choice regexp (const nil))
51 :version "24.1" 52 :version "24.1"
52 :group 'gnus-gravatar) 53 :group 'gnus-gravatar)
diff --git a/lisp/image/gravatar.el b/lisp/image/gravatar.el
index 2b106ba0675..76c1ac1644d 100644
--- a/lisp/image/gravatar.el
+++ b/lisp/image/gravatar.el
@@ -40,18 +40,35 @@
40 40
41;; FIXME a time value is not the nicest format for a custom variable. 41;; FIXME a time value is not the nicest format for a custom variable.
42(defcustom gravatar-cache-ttl (days-to-time 30) 42(defcustom gravatar-cache-ttl (days-to-time 30)
43 "Time to live for gravatar cache entries." 43 "Time to live for gravatar cache entries.
44If a requested gravatar has been cached for longer than this, it
45is retrieved anew."
44 :type '(repeat integer) 46 :type '(repeat integer)
45 :group 'gravatar) 47 :group 'gravatar)
46 48
47;; FIXME Doc is tautological. What are the options?
48(defcustom gravatar-rating "g" 49(defcustom gravatar-rating "g"
49 "Default rating for gravatar." 50 "Most explicit Gravatar rating level to allow.
51Some gravatars are rated according to how suitable they are for
52different audiences. The supported rating levels are, in order
53of increasing explicitness, the following:
54
55\"g\" - Suitable for any audience.
56\"pg\" - May contain rude gestures, provocatively dressed
57 individuals, mild profanity, or mild violence.
58\"r\" - May contain harsh profanity, intense violence, nudity,
59 or hard drug use.
60\"x\" - May contain hardcore sexual imagery or extremely
61 disturbing violence.
62
63Each level covers itself as well as all less explicit levels.
64For example, setting this variable to \"pg\" will allow gravatars
65rated either \"g\" or \"pg\"."
50 :type 'string 66 :type 'string
51 :group 'gravatar) 67 :group 'gravatar)
52 68
53(defcustom gravatar-size 32 69(defcustom gravatar-size 32
54 "Default size in pixels for gravatars." 70 "Gravatar size in pixels to request.
71Valid sizes range from 1 to 2048 inclusive."
55 :type 'integer 72 :type 'integer
56 :group 'gravatar) 73 :group 'gravatar)
57 74
@@ -104,8 +121,10 @@ If no image available, return 'error."
104 121
105;;;###autoload 122;;;###autoload
106(defun gravatar-retrieve (mail-address cb &optional cbargs) 123(defun gravatar-retrieve (mail-address cb &optional cbargs)
107 "Retrieve MAIL-ADDRESS gravatar and call CB on retrieval. 124 "Asynchronously retrieve a gravatar for MAIL-ADDRESS.
108You can provide a list of argument to pass to CB in CBARGS." 125When finished, call CB as (apply CB GRAVATAR CBARGS),
126where GRAVATAR is either an image descriptor, or the symbol
127`error' if the retrieval failed."
109 (let ((url (gravatar-build-url mail-address))) 128 (let ((url (gravatar-build-url mail-address)))
110 (if (gravatar-cache-expired url) 129 (if (gravatar-cache-expired url)
111 (let ((args (list url 130 (let ((args (list url
@@ -126,7 +145,9 @@ You can provide a list of argument to pass to CB in CBARGS."
126 145
127;;;###autoload 146;;;###autoload
128(defun gravatar-retrieve-synchronously (mail-address) 147(defun gravatar-retrieve-synchronously (mail-address)
129 "Retrieve MAIL-ADDRESS gravatar and returns it." 148 "Synchronously retrieve a gravatar for MAIL-ADDRESS.
149Value is either an image descriptor, or the symbol `error' if the
150retrieval failed."
130 (let ((url (gravatar-build-url mail-address))) 151 (let ((url (gravatar-build-url mail-address)))
131 (if (gravatar-cache-expired url) 152 (if (gravatar-cache-expired url)
132 (with-current-buffer (url-retrieve-synchronously url) 153 (with-current-buffer (url-retrieve-synchronously url)