aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorJuanma Barranquero2010-01-02 02:05:44 +0100
committerJuanma Barranquero2010-01-02 02:05:44 +0100
commit0472835ff2f73013a9633306bf60faa49cd777ba (patch)
treeff0ede67f53f653b2cced21bf79cc30080c144d7 /lisp/net
parentdb4a7382f0ee49338f9c52adb93cd16c4b93dcd3 (diff)
downloademacs-0472835ff2f73013a9633306bf60faa49cd777ba.tar.gz
emacs-0472835ff2f73013a9633306bf60faa49cd777ba.zip
lisp/*: Fix typos in docstrings and messages.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/imap-hash.el88
1 files changed, 44 insertions, 44 deletions
diff --git a/lisp/net/imap-hash.el b/lisp/net/imap-hash.el
index 47ed4f33914..b0ee31f8fe8 100644
--- a/lisp/net/imap-hash.el
+++ b/lisp/net/imap-hash.el
@@ -67,16 +67,16 @@
67 (imap-hash-remove-cr-followed-by-lf)))) 67 (imap-hash-remove-cr-followed-by-lf))))
68 68
69(defun imap-hash-make (server port mailbox &optional user password ssl) 69(defun imap-hash-make (server port mailbox &optional user password ssl)
70 "Makes a new imap-hash object using SERVER, PORT, and MAILBOX. 70 "Make a new imap-hash object using SERVER, PORT, and MAILBOX.
71SSL, USER, PASSWORD are optional. 71USER, PASSWORD and SSL are optional.
72The test is set to t, meaning all messages are considered." 72The test is set to t, meaning all messages are considered."
73 (when (and server port mailbox) 73 (when (and server port mailbox)
74 (list :server server :port port :mailbox mailbox 74 (list :server server :port port :mailbox mailbox
75 :ssl ssl :user user :password password 75 :ssl ssl :user user :password password
76 :test t))) 76 :test t)))
77 77
78(defun imap-hash-p (iht) 78(defun imap-hash-p (iht)
79 "Checks whether IHT is a valid imap-hash." 79 "Check whether IHT is a valid imap-hash."
80 (and 80 (and
81 (imap-hash-server iht) 81 (imap-hash-server iht)
82 (imap-hash-port iht) 82 (imap-hash-port iht)
@@ -95,7 +95,7 @@ The test is set to t, meaning all messages are considered."
95(defun imap-hash-get (key iht &optional refetch) 95(defun imap-hash-get (key iht &optional refetch)
96 "Get the value for KEY in the imap-hash IHT. 96 "Get the value for KEY in the imap-hash IHT.
97Requires either `imap-hash-fetch' to be called beforehand 97Requires either `imap-hash-fetch' to be called beforehand
98(e.g. by `imap-hash-map'), or REFETCH to be t. 98\(e.g. by `imap-hash-map'), or REFETCH to be t.
99Returns a list of the headers (an alist, see `imap-hash-map') and 99Returns a list of the headers (an alist, see `imap-hash-map') and
100the body of the message as a string. 100the body of the message as a string.
101Also see `imap-hash-test'." 101Also see `imap-hash-test'."
@@ -106,13 +106,13 @@ Also see `imap-hash-test'."
106 (list 106 (list
107 (imap-hash-get-headers 107 (imap-hash-get-headers
108 (imap-hash-data-headers details)) 108 (imap-hash-data-headers details))
109 (imap-hash-get-body 109 (imap-hash-get-body
110 (imap-hash-data-body details)))))) 110 (imap-hash-data-body details))))))
111 111
112(defun imap-hash-put (value iht &optional key) 112(defun imap-hash-put (value iht &optional key)
113 "Put VALUE in the imap-hash IHT. Returns the new key. 113 "Put VALUE in the imap-hash IHT. Return the new key.
114If KEY is given, removes it. 114If KEY is given, removes it.
115VALUE can be a list of the headers (an alist, see `imap-hash-map') 115VALUE can be a list of the headers (an alist, see `imap-hash-map')
116and the body of the message as a string. It can also be a uid, 116and the body of the message as a string. It can also be a uid,
117in which case `imap-hash-get' will be called to get the value. 117in which case `imap-hash-get' will be called to get the value.
118Also see `imap-hash-test'." 118Also see `imap-hash-test'."
@@ -121,19 +121,19 @@ Also see `imap-hash-test'."
121 newuid) 121 newuid)
122 (when value 122 (when value
123 (with-temp-buffer 123 (with-temp-buffer
124 (funcall 'imap-hash-make-message 124 (funcall 'imap-hash-make-message
125 (nth 0 value) 125 (nth 0 value)
126 (nth 1 value) 126 (nth 1 value)
127 nil) 127 nil)
128 (setq newuid (nth 1 (imap-message-append 128 (setq newuid (nth 1 (imap-message-append
129 (imap-hash-mailbox iht) 129 (imap-hash-mailbox iht)
130 (current-buffer) nil nil server-buffer))) 130 (current-buffer) nil nil server-buffer)))
131 (when key (imap-hash-rem key iht)))) 131 (when key (imap-hash-rem key iht))))
132 newuid)) 132 newuid))
133 133
134(defun imap-hash-make-message (headers body &optional overrides) 134(defun imap-hash-make-message (headers body &optional overrides)
135 "Make a message with HEADERS and BODY suitable for `imap-append', 135 "Make a message with HEADERS and BODY suitable for `imap-append',
136using `message-setup'.. 136using `message-setup'.
137Look in the alist OVERRIDES for header overrides as per `imap-hash-headers'." 137Look in the alist OVERRIDES for header overrides as per `imap-hash-headers'."
138 ;; don't insert a signature no matter what 138 ;; don't insert a signature no matter what
139 (let (message-signature) 139 (let (message-signature)
@@ -154,7 +154,7 @@ Look in the alist OVERRIDES for header overrides as per `imap-hash-headers'."
154(defun imap-hash-rem (key iht) 154(defun imap-hash-rem (key iht)
155 "Remove KEY in the imap-hash IHT. 155 "Remove KEY in the imap-hash IHT.
156Also see `imap-hash-test'. Requires `imap-hash-fetch' to have 156Also see `imap-hash-test'. Requires `imap-hash-fetch' to have
157been called and the imap-hash server buffer to be current, 157been called and the imap-hash server buffer to be current,
158so it's best to use it inside `imap-hash-map'. 158so it's best to use it inside `imap-hash-map'.
159The key will not be found on the next `imap-hash-map' call." 159The key will not be found on the next `imap-hash-map' call."
160 (with-current-buffer (imap-hash-get-buffer iht) 160 (with-current-buffer (imap-hash-get-buffer iht)
@@ -172,7 +172,7 @@ Also see `imap-hash-test'."
172 (with-temp-buffer 172 (with-temp-buffer
173 (insert (or text-headers "")) 173 (insert (or text-headers ""))
174 (imap-hash-remove-cr-followed-by-lf) 174 (imap-hash-remove-cr-followed-by-lf)
175 (mapcar (lambda (header) 175 (mapcar (lambda (header)
176 (cons header 176 (cons header
177 (message-fetch-field (format "%s" header)))) 177 (message-fetch-field (format "%s" header))))
178 imap-hash-headers))) 178 imap-hash-headers)))
@@ -199,11 +199,11 @@ Also see `imap-hash-test'."
199 (headers (imap-hash-data-headers details)) 199 (headers (imap-hash-data-headers details))
200 (hlist (imap-hash-get-headers headers)) 200 (hlist (imap-hash-get-headers headers))
201 (runit (cond 201 (runit (cond
202 ((stringp test) 202 ((stringp test)
203 (string-match 203 (string-match
204 test 204 test
205 (format "%s" (aget hlist 'Subject)))) 205 (format "%s" (aget hlist 'Subject))))
206 ((functionp test) 206 ((functionp test)
207 (funcall test hlist)) 207 (funcall test hlist))
208 ;; otherwise, return test itself 208 ;; otherwise, return test itself
209 (t test)))) 209 (t test))))
@@ -218,7 +218,7 @@ Also see `imap-hash-test'."
218 "UID"))))) 218 "UID")))))
219 219
220(defun imap-hash-count (iht) 220(defun imap-hash-count (iht)
221 "Counts the number of messages in the imap-hash IHT. 221 "Count the number of messages in the imap-hash IHT.
222Also see `imap-hash-test'. It uses `imap-hash-map' so just use that 222Also see `imap-hash-test'. It uses `imap-hash-map' so just use that
223function if you want to do more than count the elements." 223function if you want to do more than count the elements."
224 (length (imap-hash-map (lambda (a b c)) iht t))) 224 (length (imap-hash-map (lambda (a b c)) iht t)))
@@ -226,36 +226,36 @@ function if you want to do more than count the elements."
226(defalias 'imap-hash-size 'imap-hash-count) 226(defalias 'imap-hash-size 'imap-hash-count)
227 227
228(defun imap-hash-test (iht) 228(defun imap-hash-test (iht)
229 "Returns the test used by `imap-hash-map' for IHT. 229 "Return the test used by `imap-hash-map' for IHT.
230When the test is t, any key will be a candidate. 230When the test is t, any key will be a candidate.
231When the test is a string, messages will be filtered on that string as a regexp 231When the test is a string, messages will be filtered on that string as a
232against the subject. 232regexp against the subject.
233When the test is a function, messages will be filtered with it. 233When the test is a function, messages will be filtered with it.
234The function is passed the message headers (see `imap-hash-get-headers')." 234The function is passed the message headers (see `imap-hash-get-headers')."
235 (plist-get iht :test)) 235 (plist-get iht :test))
236 236
237(defun imap-hash-server (iht) 237(defun imap-hash-server (iht)
238 "Returns the server used by the imap-hash IHT." 238 "Return the server used by the imap-hash IHT."
239 (plist-get iht :server)) 239 (plist-get iht :server))
240 240
241(defun imap-hash-port (iht) 241(defun imap-hash-port (iht)
242 "Returns the port used by the imap-hash IHT." 242 "Return the port used by the imap-hash IHT."
243 (plist-get iht :port)) 243 (plist-get iht :port))
244 244
245(defun imap-hash-ssl (iht) 245(defun imap-hash-ssl (iht)
246 "Returns the SSL need for the imap-hash IHT." 246 "Return the SSL need for the imap-hash IHT."
247 (plist-get iht :ssl)) 247 (plist-get iht :ssl))
248 248
249(defun imap-hash-mailbox (iht) 249(defun imap-hash-mailbox (iht)
250 "Returns the mailbox used by the imap-hash IHT." 250 "Return the mailbox used by the imap-hash IHT."
251 (plist-get iht :mailbox)) 251 (plist-get iht :mailbox))
252 252
253(defun imap-hash-user (iht) 253(defun imap-hash-user (iht)
254 "Returns the username used by the imap-hash IHT." 254 "Return the username used by the imap-hash IHT."
255 (plist-get iht :user)) 255 (plist-get iht :user))
256 256
257(defun imap-hash-password (iht) 257(defun imap-hash-password (iht)
258 "Returns the password used by the imap-hash IHT." 258 "Return the password used by the imap-hash IHT."
259 (plist-get iht :password)) 259 (plist-get iht :password))
260 260
261(defun imap-hash-open-connection (iht) 261(defun imap-hash-open-connection (iht)
@@ -263,16 +263,16 @@ The function is passed the message headers (see `imap-hash-get-headers')."
263 (let* ((server (imap-hash-server iht)) 263 (let* ((server (imap-hash-server iht))
264 (port (imap-hash-port iht)) 264 (port (imap-hash-port iht))
265 (ssl-need (imap-hash-ssl iht)) 265 (ssl-need (imap-hash-ssl iht))
266 (auth-need (not (and (imap-hash-user iht) 266 (auth-need (not (and (imap-hash-user iht)
267 (imap-hash-password iht)))) 267 (imap-hash-password iht))))
268 ;; this will not be needed if auth-need is t 268 ;; this will not be needed if auth-need is t
269 (auth-info (when auth-need 269 (auth-info (when auth-need
270 (auth-source-user-or-password 270 (auth-source-user-or-password
271 '("login" "password") 271 '("login" "password")
272 server port))) 272 server port)))
273 (auth-user (or (imap-hash-user iht) 273 (auth-user (or (imap-hash-user iht)
274 (nth 0 auth-info))) 274 (nth 0 auth-info)))
275 (auth-passwd (or (imap-hash-password iht) 275 (auth-passwd (or (imap-hash-password iht)
276 (nth 1 auth-info))) 276 (nth 1 auth-info)))
277 (imap-logout-timeout nil)) 277 (imap-logout-timeout nil))
278 278
@@ -283,7 +283,7 @@ The function is passed the message headers (see `imap-hash-get-headers')."
283 ;; (debug "after opening server: opened+state" (imap-opened (current-buffer)) imap-state) 283 ;; (debug "after opening server: opened+state" (imap-opened (current-buffer)) imap-state)
284 ;; (debug "authenticating" auth-user auth-passwd) 284 ;; (debug "authenticating" auth-user auth-passwd)
285 (if (not (imap-capability 'IMAP4rev1)) 285 (if (not (imap-capability 'IMAP4rev1))
286 (error "IMAP server does not support IMAP4r1, it won't work, sorry.") 286 (error "IMAP server does not support IMAP4r1, it won't work, sorry")
287 (imap-authenticate auth-user auth-passwd) 287 (imap-authenticate auth-user auth-passwd)
288 (imap-id) 288 (imap-id)
289 ;; (debug "after authenticating: opened+state" (imap-opened (current-buffer)) imap-state) 289 ;; (debug "after authenticating: opened+state" (imap-opened (current-buffer)) imap-state)
@@ -314,8 +314,8 @@ The function is passed the message headers (see `imap-hash-get-headers')."
314 "Fetch all the messages for imap-hash IHT. 314 "Fetch all the messages for imap-hash IHT.
315Get only the headers if HEADERS-ONLY is not nil." 315Get only the headers if HEADERS-ONLY is not nil."
316 (with-current-buffer (imap-hash-get-buffer iht) 316 (with-current-buffer (imap-hash-get-buffer iht)
317 (let ((range (if messages 317 (let ((range (if messages
318 (list 318 (list
319 (imap-range-to-message-set messages) 319 (imap-range-to-message-set messages)
320 (imap-range-to-message-set messages)) 320 (imap-range-to-message-set messages))
321 '("1:*" . "1,*:*")))) 321 '("1:*" . "1,*:*"))))
@@ -329,9 +329,9 @@ Get only the headers if HEADERS-ONLY is not nil."
329 (imap-fetch-safe range 329 (imap-fetch-safe range
330 (concat (format "(UID RFC822.SIZE BODY %s " 330 (concat (format "(UID RFC822.SIZE BODY %s "
331 (if headers-only "" "BODY.PEEK[TEXT]")) 331 (if headers-only "" "BODY.PEEK[TEXT]"))
332 (format "BODY.PEEK[HEADER.FIELDS %s])" 332 (format "BODY.PEEK[HEADER.FIELDS %s])"
333 imap-hash-headers)))))) 333 imap-hash-headers))))))
334 334
335(provide 'imap-hash) 335(provide 'imap-hash)
336;;; imap-hash.el ends here 336;;; imap-hash.el ends here
337 337