aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Petton2015-10-11 22:58:25 +0200
committerNicolas Petton2015-10-11 22:58:25 +0200
commit831807fafeb782c43dcf4c1927a0a4f886e226e0 (patch)
tree5f0b228fe096f48210fbca07affe9a3bd4f3bd79
parent732d259948833935c343ed88b08316253e12b306 (diff)
downloademacs-831807fafeb782c43dcf4c1927a0a4f886e226e0.tar.gz
emacs-831807fafeb782c43dcf4c1927a0a4f886e226e0.zip
* lisp/gnus/auth-source.el: Use sharp-quoting with functions.
-rw-r--r--lisp/gnus/auth-source.el40
1 files changed, 20 insertions, 20 deletions
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index 32e22ebc29b..52ea368dfce 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -340,12 +340,12 @@ If the value is not a list, symmetric encryption will be used."
340;; (let ((auth-source-debug nil)) (auth-source-do-debug "hello")) 340;; (let ((auth-source-debug nil)) (auth-source-do-debug "hello"))
341(defun auth-source-do-debug (&rest msg) 341(defun auth-source-do-debug (&rest msg)
342 (when auth-source-debug 342 (when auth-source-debug
343 (apply 'auth-source-do-warn msg))) 343 (apply #'auth-source-do-warn msg)))
344 344
345(defun auth-source-do-trivia (&rest msg) 345(defun auth-source-do-trivia (&rest msg)
346 (when (or (eq auth-source-debug 'trivia) 346 (when (or (eq auth-source-debug 'trivia)
347 (functionp auth-source-debug)) 347 (functionp auth-source-debug))
348 (apply 'auth-source-do-warn msg))) 348 (apply #'auth-source-do-warn msg)))
349 349
350(defun auth-source-do-warn (&rest msg) 350(defun auth-source-do-warn (&rest msg)
351 (apply 351 (apply
@@ -365,7 +365,7 @@ Only one of CHOICES will be returned. The PROMPT is augmented
365with \"[a/b/c] \" if CHOICES is \(?a ?b ?c)." 365with \"[a/b/c] \" if CHOICES is \(?a ?b ?c)."
366 (when choices 366 (when choices
367 (let* ((prompt-choices 367 (let* ((prompt-choices
368 (apply 'concat (loop for c in choices 368 (apply #'concat (loop for c in choices
369 collect (format "%c/" c)))) 369 collect (format "%c/" c))))
370 (prompt-choices (concat "[" (substring prompt-choices 0 -1) "] ")) 370 (prompt-choices (concat "[" (substring prompt-choices 0 -1) "] "))
371 (full-prompt (concat prompt prompt-choices)) 371 (full-prompt (concat prompt prompt-choices))
@@ -685,7 +685,7 @@ actually useful. So the caller must arrange to call this function.
685 685
686The token's :secret key can hold a function. In that case you 686The token's :secret key can hold a function. In that case you
687must call it to obtain the actual value." 687must call it to obtain the actual value."
688 (let* ((backends (mapcar 'auth-source-backend-parse auth-sources)) 688 (let* ((backends (mapcar #'auth-source-backend-parse auth-sources))
689 (max (or max 1)) 689 (max (or max 1))
690 (ignored-keys '(:require :create :delete :max)) 690 (ignored-keys '(:require :create :delete :max))
691 (keys (loop for i below (length spec) by 2 691 (keys (loop for i below (length spec) by 2
@@ -902,7 +902,7 @@ while \(:host t) would find all host entries."
902;; (auth-source-pick-first-password :port "imap") 902;; (auth-source-pick-first-password :port "imap")
903(defun auth-source-pick-first-password (&rest spec) 903(defun auth-source-pick-first-password (&rest spec)
904 "Pick the first secret found from applying SPEC to `auth-source-search'." 904 "Pick the first secret found from applying SPEC to `auth-source-search'."
905 (let* ((result (nth 0 (apply 'auth-source-search (plist-put spec :max 1)))) 905 (let* ((result (nth 0 (apply #'auth-source-search (plist-put spec :max 1))))
906 (secret (plist-get result :secret))) 906 (secret (plist-get result :secret)))
907 907
908 (if (functionp secret) 908 (if (functionp secret)
@@ -1011,8 +1011,8 @@ Note that the MAX parameter is used so we can exit the parse early."
1011 (auth-source--aput 1011 (auth-source--aput
1012 auth-source-netrc-cache file 1012 auth-source-netrc-cache file
1013 (list :mtime (nth 5 (file-attributes file)) 1013 (list :mtime (nth 5 (file-attributes file))
1014 :secret (lexical-let ((v (mapcar '1+ (buffer-string)))) 1014 :secret (lexical-let ((v (mapcar #'1+ (buffer-string))))
1015 (lambda () (apply 'string (mapcar '1- v))))))) 1015 (lambda () (apply #'string (mapcar #'1- v)))))))
1016 (goto-char (point-min)) 1016 (goto-char (point-min))
1017 (let ((entries (auth-source-netrc-parse-entries check max)) 1017 (let ((entries (auth-source-netrc-parse-entries check max))
1018 alist) 1018 alist)
@@ -1241,7 +1241,7 @@ See `auth-source-search' for details on SPEC."
1241 ;; to get the updated data. 1241 ;; to get the updated data.
1242 1242
1243 ;; the result will be returned, even if the search fails 1243 ;; the result will be returned, even if the search fails
1244 (apply 'auth-source-netrc-search 1244 (apply #'auth-source-netrc-search
1245 (plist-put spec :create nil))))) 1245 (plist-put spec :create nil)))))
1246 results)) 1246 results))
1247 1247
@@ -1591,7 +1591,7 @@ authentication tokens:
1591 ;; build a search spec without the ignored keys 1591 ;; build a search spec without the ignored keys
1592 ;; if a search key is nil or t (match anything), we skip it 1592 ;; if a search key is nil or t (match anything), we skip it
1593 (search-specs (auth-source-secrets-listify-pattern 1593 (search-specs (auth-source-secrets-listify-pattern
1594 (apply 'append (mapcar 1594 (apply #'append (mapcar
1595 (lambda (k) 1595 (lambda (k)
1596 (if (or (null (plist-get spec k)) 1596 (if (or (null (plist-get spec k))
1597 (eq t (plist-get spec k))) 1597 (eq t (plist-get spec k)))
@@ -1605,7 +1605,7 @@ authentication tokens:
1605 (items 1605 (items
1606 (loop for search-spec in search-specs 1606 (loop for search-spec in search-specs
1607 nconc 1607 nconc
1608 (loop for item in (apply 'secrets-search-items coll search-spec) 1608 (loop for item in (apply #'secrets-search-items coll search-spec)
1609 unless (and (stringp label) 1609 unless (and (stringp label)
1610 (not (string-match label item))) 1610 (not (string-match label item)))
1611 collect item))) 1611 collect item)))
@@ -1620,7 +1620,7 @@ authentication tokens:
1620 (lexical-let ((v (secrets-get-secret coll item))) 1620 (lexical-let ((v (secrets-get-secret coll item)))
1621 (lambda () v))) 1621 (lambda () v)))
1622 ;; rewrite the entry from ((k1 v1) (k2 v2)) to plist 1622 ;; rewrite the entry from ((k1 v1) (k2 v2)) to plist
1623 (apply 'append 1623 (apply #'append
1624 (mapcar (lambda (entry) 1624 (mapcar (lambda (entry)
1625 (list (car entry) (cdr entry))) 1625 (list (car entry) (cdr entry)))
1626 (secrets-get-attributes coll item))))) 1626 (secrets-get-attributes coll item)))))
@@ -1628,7 +1628,7 @@ authentication tokens:
1628 ;; ensure each item has each key in `returned-keys' 1628 ;; ensure each item has each key in `returned-keys'
1629 (items (mapcar (lambda (plist) 1629 (items (mapcar (lambda (plist)
1630 (append 1630 (append
1631 (apply 'append 1631 (apply #'append
1632 (mapcar (lambda (req) 1632 (mapcar (lambda (req)
1633 (if (plist-get plist req) 1633 (if (plist-get plist req)
1634 nil 1634 nil
@@ -1722,7 +1722,7 @@ entries for git.gnus.org:
1722 collect (nth i spec))) 1722 collect (nth i spec)))
1723 ;; build a search spec without the ignored keys 1723 ;; build a search spec without the ignored keys
1724 ;; if a search key is nil or t (match anything), we skip it 1724 ;; if a search key is nil or t (match anything), we skip it
1725 (search-spec (apply 'append (mapcar 1725 (search-spec (apply #'append (mapcar
1726 (lambda (k) 1726 (lambda (k)
1727 (if (or (null (plist-get spec k)) 1727 (if (or (null (plist-get spec k))
1728 (eq t (plist-get spec k))) 1728 (eq t (plist-get spec k)))
@@ -1733,7 +1733,7 @@ entries for git.gnus.org:
1733 (returned-keys (mm-delete-duplicates (append 1733 (returned-keys (mm-delete-duplicates (append
1734 '(:host :login :port :secret) 1734 '(:host :login :port :secret)
1735 search-keys))) 1735 search-keys)))
1736 (items (apply 'auth-source-macos-keychain-search-items 1736 (items (apply #'auth-source-macos-keychain-search-items
1737 coll 1737 coll
1738 type 1738 type
1739 max 1739 max
@@ -1742,7 +1742,7 @@ entries for git.gnus.org:
1742 ;; ensure each item has each key in `returned-keys' 1742 ;; ensure each item has each key in `returned-keys'
1743 (items (mapcar (lambda (plist) 1743 (items (mapcar (lambda (plist)
1744 (append 1744 (append
1745 (apply 'append 1745 (apply #'append
1746 (mapcar (lambda (req) 1746 (mapcar (lambda (req)
1747 (if (plist-get plist req) 1747 (if (plist-get plist req)
1748 nil 1748 nil
@@ -1782,7 +1782,7 @@ entries for git.gnus.org:
1782 (setq args (append args (list coll)))) 1782 (setq args (append args (list coll))))
1783 1783
1784 (with-temp-buffer 1784 (with-temp-buffer
1785 (apply 'call-process "/usr/bin/security" nil t nil args) 1785 (apply #'call-process "/usr/bin/security" nil t nil args)
1786 (goto-char (point-min)) 1786 (goto-char (point-min))
1787 (while (not (eobp)) 1787 (while (not (eobp))
1788 (cond 1788 (cond
@@ -1850,7 +1850,7 @@ entries for git.gnus.org:
1850 collect (nth i spec))) 1850 collect (nth i spec)))
1851 ;; build a search spec without the ignored keys 1851 ;; build a search spec without the ignored keys
1852 ;; if a search key is nil or t (match anything), we skip it 1852 ;; if a search key is nil or t (match anything), we skip it
1853 (search-spec (apply 'append (mapcar 1853 (search-spec (apply #'append (mapcar
1854 (lambda (k) 1854 (lambda (k)
1855 (let ((v (plist-get spec k))) 1855 (let ((v (plist-get spec k)))
1856 (if (or (null v) 1856 (if (or (null v)
@@ -1881,7 +1881,7 @@ entries for git.gnus.org:
1881 ;; ensure each item has each key in `returned-keys' 1881 ;; ensure each item has each key in `returned-keys'
1882 (items (mapcar (lambda (plist) 1882 (items (mapcar (lambda (plist)
1883 (append 1883 (append
1884 (apply 'append 1884 (apply #'append
1885 (mapcar (lambda (req) 1885 (mapcar (lambda (req)
1886 (if (plist-get plist req) 1886 (if (plist-get plist req)
1887 nil 1887 nil
@@ -1903,7 +1903,7 @@ entries for git.gnus.org:
1903 ;; to get the updated data. 1903 ;; to get the updated data.
1904 1904
1905 ;; the result will be returned, even if the search fails 1905 ;; the result will be returned, even if the search fails
1906 (apply 'auth-source-plstore-search 1906 (apply #'auth-source-plstore-search
1907 (plist-put spec :create nil))))) 1907 (plist-put spec :create nil)))))
1908 ((and delete 1908 ((and delete
1909 item-names) 1909 item-names)
@@ -2103,7 +2103,7 @@ MODE can be \"login\" or \"password\"."
2103 host port username) 2103 host port username)
2104 found) ; return the found data 2104 found) ; return the found data
2105 ;; else, if not found, search with a max of 1 2105 ;; else, if not found, search with a max of 1
2106 (let ((choice (nth 0 (apply 'auth-source-search 2106 (let ((choice (nth 0 (apply #'auth-source-search
2107 (append '(:max 1) search))))) 2107 (append '(:max 1) search)))))
2108 (when choice 2108 (when choice
2109 (dolist (m mode) 2109 (dolist (m mode)