Function: url-completion-function

url-completion-function is a byte-compiled function defined in url-history.el.gz.

This function is obsolete since 26.1; use url-history-hash-table instead.

Signature

(url-completion-function STRING PREDICATE FUNCTION)

Source Code

;; Defined in /usr/src/emacs/lisp/url/url-history.el.gz
(defun url-completion-function (string predicate function)
  (declare (obsolete url-history-hash-table "26.1"))
  ;; Completion function to complete urls from the history.
  ;; This is obsolete since we can now pass the hash-table directly as a
  ;; completion table.
  (url-do-setup)
  (cond
   ((eq function nil)
    (let ((list nil))
      (maphash (lambda (key _) (push key list))
               url-history-hash-table)
      ;; Not sure why we bother reversing the list.  --Stef
      (try-completion string (nreverse list) predicate)))
   ((eq function t)
    (let ((stub (concat "\\`" (regexp-quote string)))
	  (retval nil))
      (maphash
       (lambda (url _)
         (if (string-match stub url) (push url retval)))
       url-history-hash-table)
      retval))
   ((eq function 'lambda)
    (and (gethash string url-history-hash-table) t))
   (t
    (error "url-completion-function very confused"))))