From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#19556: eww: make URI rewriting fully customizable Date: Sat, 10 Jan 2015 19:37:22 +0200 Message-ID: <83r3v25ygd.fsf@gnu.org> References: <87sifi22rg.fsf@violet.siamics.net> <831tn27m78.fsf@gnu.org> <87lhla1yx2.fsf@violet.siamics.net> <83vbke62wi.fsf@gnu.org> <8761ce1rit.fsf@violet.siamics.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1420911497 13589 80.91.229.3 (10 Jan 2015 17:38:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Jan 2015 17:38:17 +0000 (UTC) Cc: 19556@debbugs.gnu.org To: Ivan Shmakov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 10 18:38:10 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y9zzF-00066C-L2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Jan 2015 18:38:09 +0100 Original-Received: from localhost ([::1]:55792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9zzE-0001bN-Rt for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Jan 2015 12:38:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9zzB-0001az-5P for bug-gnu-emacs@gnu.org; Sat, 10 Jan 2015 12:38:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9zz7-0003Fd-Tr for bug-gnu-emacs@gnu.org; Sat, 10 Jan 2015 12:38:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9zz7-0003FN-Qx for bug-gnu-emacs@gnu.org; Sat, 10 Jan 2015 12:38:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y9zz7-0003vP-MK for bug-gnu-emacs@gnu.org; Sat, 10 Jan 2015 12:38:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Jan 2015 17:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19556 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19556-submit@debbugs.gnu.org id=B19556.142091144815004 (code B ref 19556); Sat, 10 Jan 2015 17:38:01 +0000 Original-Received: (at 19556) by debbugs.gnu.org; 10 Jan 2015 17:37:28 +0000 Original-Received: from localhost ([127.0.0.1]:42063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y9zya-0003tv-72 for submit@debbugs.gnu.org; Sat, 10 Jan 2015 12:37:28 -0500 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:60935) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y9zyW-0003td-24 for 19556@debbugs.gnu.org; Sat, 10 Jan 2015 12:37:25 -0500 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NHZ00H001VZLW00@mtaout25.012.net.il> for 19556@debbugs.gnu.org; Sat, 10 Jan 2015 19:33:22 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NHZ00GHY23MSR10@mtaout25.012.net.il>; Sat, 10 Jan 2015 19:33:22 +0200 (IST) In-reply-to: <8761ce1rit.fsf@violet.siamics.net> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:98188 Archived-At: > From: Ivan Shmakov > Date: Sat, 10 Jan 2015 17:20:42 +0000 > > >>>>> Eli Zaretskii writes: > >>>>> From: Ivan Shmakov Date: Sat, 10 Jan 2015 14:40:57 +0000 > >>>>> Eli Zaretskii writes: > > >>> Why put the "standard" rules into the defcustom? > > >> So to make the tricks played by EWW on unsuspecting URIs more > >> obvious to the user. > > > How does that make it more obvious? > > By showing them in the “Customize Group” buffer? That buffer is too large to make anything obvious. > >>> That's what hooks are normally for -- _modifying_ the default > >>> behavior, not supplanting it. > > >> Are they? For instance, when run with -Q, my find-file-hooks > >> includes ange-ftp-set-buffer-mode, epa-file-find-file-hook, > >> vc-find-file-hook > > > None of these replace the default behavior of their hookee functions. > > They _add_ something to it. The default behavior is not in the hook, > > it's in the code that calls the hook. > > We seem to be disagreeing on the terms. To me, the way > unmodified Emacs behaves when started with ‘-Q’ is the default. We are not talking about the Emacs behavior, we are talking about the behavior of a certain function. Things that are central to that function's job are that function's default behavior. find-file's job is to find and visit files, and that functionality should not be in a hook, available for removal by users. Similarly, eww's job is to find and visit a URL, which includes processing file:// URLs, and that functionality should always be in the function, not in any hook. > I see no reason for EWW to be different in that its default > behavior cannot be customized – whether that’d mean adding > elements to some list, removing others from there, or doing > something else. It makes very little sense to me to customize out something that is an inherent part of a function's job. > > And anyway, I said "normally", so a couple of examples to the > > contrary doesn't yet invalidate what I said. > > Should I look for a couple more examples on top of that couple > within the Emacs source tree just for the sake of this argument? If you wish. But I'd rather you invested your time and talent where it could benefit Emacs more than by looking for those examples. > > It sounds like we have some deep disagreement about what the hooks > > are for. You want a hook to _remove_ some behaviors, but that's not > > what hooks are for. > > Except for those which are. > > Besides, what’d be the point of run-hook-with-args-until-success > if not to allow the user to prepend his or her own function to > override the behavior of the (default) functions coming later in > that same hook? Hooks do not override behavior. They let the user run some code _in_addition_ to the normal behavior. It's therefore no accident that a hook is called near the end of the function which provides it, after To _override_ behavior, we provide function variables that get used _instead_ of the default. Like indent-region-function, for example. So in that case, you'd need to make 'eww' call the value of eww-mangle-uri-function, whose default value is a function that does what the current code does inside eww itself, and then users could override that by providing their own URI-mangling function.