Function: url-bit-for-url

url-bit-for-url is a macro defined in url-parse.el.gz.

Signature

(url-bit-for-url METHOD LOOKFOR URL)

Source Code

;; Defined in /usr/src/emacs/lisp/url/url-parse.el.gz
(defmacro url-bit-for-url (method lookfor url)
  `(let* ((urlobj (url-generic-parse-url ,url))
          (bit (funcall ,method urlobj))
          (methods (list 'url-recreate-url
                         'url-host))
          auth-info)
     (while (and (not bit) (> (length methods) 0))
       (setq auth-info (auth-source-search
                        :max 1
                        :host (funcall (pop methods) urlobj)
                        :port (url-type urlobj)))
       (setq bit (plist-get (nth 0 auth-info) ,lookfor))
       (when (functionp bit)
         (setq bit (funcall bit))))
     bit))