Function: auth-source-forget+

auth-source-forget+ is a byte-compiled function defined in auth-source.el.gz.

Signature

(auth-source-forget+ &rest SPEC)

Documentation

Forget any cached data matching SPEC. Return forgotten count.

This is not a full auth-source-search spec but works similarly. For instance, (:host "myhost" "yourhost") would find all the cached data that was found with a search for those two hosts, while (:host t) would find all host entries.

Source Code

;; Defined in /usr/src/emacs/lisp/auth-source.el.gz
(defun auth-source-forget+ (&rest spec)
  "Forget any cached data matching SPEC.  Return forgotten count.

This is not a full `auth-source-search' spec but works similarly.
For instance, \(:host \"myhost\" \"yourhost\") would find all the
cached data that was found with a search for those two hosts,
while \(:host t) would find all host entries."
  (let ((count 0))
    (maphash
     (lambda (key _password)
       (when (and (eq 'auth-source (car-safe key))
                  ;; and the spec matches what was stored in the cache
                  (auth-source-specmatchp spec (cdr key)))
         ;; remove that key
         (password-cache-remove key)
         (incf count)))
     password-data)
    count))