Function: eww--alternate-urls-affixation

eww--alternate-urls-affixation is a byte-compiled function defined in eww.el.gz.

Signature

(eww--alternate-urls-affixation URLS)

Source Code

;; Defined in /usr/src/emacs/lisp/net/eww.el.gz
(defun eww--alternate-urls-affixation (urls)
  (let ((url-max-width
         (seq-max (cons 0 (mapcar #'string-pixel-width urls))))
        (title-max-width
         (seq-max
          (cons 0 (mapcar
                   (lambda (url)
                     (string-pixel-width (get-text-property 0 'title url)))
                   urls))))
        (sep-width (string-pixel-width " ")))
    (mapcar
     (lambda (url)
       (let ((title (get-text-property 0 'title url)))
         (list
          url ""
          (propertize
           (concat
            (propertize
             " " 'display
             `( space :width
                (,(+ sep-width
                     (- url-max-width (string-pixel-width url))))))
            title
            (when-let* ((type (get-text-property 0 'type url)))
              (concat
               (propertize
                " " 'display
                `( space :width
                   (,(+ sep-width
                        (- title-max-width (string-pixel-width title))))))
               "[" type "]")))
           'face 'completions-annotations))))
     urls)))