[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eww - multiple buffers

From: Andreas Röhler
Subject: Re: eww - multiple buffers
Date: Mon, 13 Jun 2016 10:55:40 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Icedove/38.8.0

Here is a eww-browse-url based hack, displaying the initials of visited URL in buffer-name

(defun ar--compose-buffer-name-initials (liste)
  (let (erg)
    (dolist (ele liste)
      (unless (string= "" ele)
    (setq erg (concat erg (char-to-string (aref ele 0))))))

(defun ar-eww-browse-url (url &optional new-window)
  (when new-window
    (if (stringp new-window)
    (set-buffer (get-buffer-create (concat "*eww " new-window "*")))
      (pop-to-buffer-same-window (generate-new-buffer "*eww*")))
  (eww url))

(defun ar-eww (&optional new-buffer)
  (interactive "P")
  (let* ((erg (read-from-minibuffer "Url: "))
(acronym (ar--compose-buffer-name-initials (split-string (substring erg (ignore-errors (1+ (string-match "www\\." erg)))) "[^a-z]"))))
    (if (eq 4 (prefix-numeric-value new-buffer))
    (ar-eww-browse-url erg acronym)
      (ar-eww-browse-url erg))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]