bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#19556: eww: make URI rewriting fully customizable


From: Lars Magne Ingebrigtsen
Subject: bug#19556: eww: make URI rewriting fully customizable
Date: Sat, 10 Jan 2015 17:08:33 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Ivan Shmakov <ivan@siamics.net> writes:

>       Leaving the obvious customizations aside, it doesn’t seem to be
>       anywhere near “complicated” to me.
>
> (defun my-eww-wh-uri (keywords)
>   "Return an English Wikipedia history page URI for KEYWORDS.
> Return nil if the KEYWORDS string does not begin with \"!wh\"."
>   (save-match-data
>     (when (string-match "^ *!wh\\> *" keywords)
>       (concat "https://en.wikipedia.org/wiki/";
>               (substring keywords (match-end 0))
>               "?action=history"))))
>
> (add-to-list 'eww-uri-rewrite-hook 'my-eww-wh-uri)

Customisations that require users to write code like this is seldom
used, and you could just define your own `eww' function if you want
something else to happen.

>       Otherwise, how do I add my own abbreviation-processing code to
>       EWW as currently implemented apart from resorting to defadvice?

Resorting to defadvice is perfectly fine.

And eww should have built-in abbreviation functionality.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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