From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?I=C3=B1igo?= Serna Newsgroups: gmane.emacs.devel Subject: Re: Advicing select-windows, shr rendering, and per-buffer-theme package Date: Fri, 18 Mar 2016 18:04:24 +0100 Message-ID: <87mvpvyaxz.fsf@gmail.com> References: <87wpp0xd1t.fsf@gmail.com> 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 1458321689 3415 80.91.229.3 (18 Mar 2016 17:21:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Mar 2016 17:21:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier , raman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 18 18:21:23 2016 Return-path: Envelope-to: ged-emacs-devel@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 1agy5T-0006rC-BC for ged-emacs-devel@m.gmane.org; Fri, 18 Mar 2016 18:21:23 +0100 Original-Received: from localhost ([::1]:45221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agy5S-0004bk-I7 for ged-emacs-devel@m.gmane.org; Fri, 18 Mar 2016 13:21:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agxpA-00043d-4o for emacs-devel@gnu.org; Fri, 18 Mar 2016 13:04:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agxp5-0000fy-Hh for emacs-devel@gnu.org; Fri, 18 Mar 2016 13:04:32 -0400 Original-Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:34239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agxp5-0000fY-9n for emacs-devel@gnu.org; Fri, 18 Mar 2016 13:04:27 -0400 Original-Received: by mail-wm0-x22d.google.com with SMTP id p65so77515845wmp.1 for ; Fri, 18 Mar 2016 10:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=ZffhdDF4777uOlqpMiiEXgnAcOkXy/1O/YOuUFi4iRI=; b=L6B91zgKPrs4F4Ux6QF5O3RZ7TIFeZMv+AffhSFI8kb0f9KEeBMXD/cE4cGv+NRc2w gZSZhLBr8KfuEn/ugKUt5rT7c5tnCbWbYoYsTesCihf0ok78GtQBO/5C+bGfelw5vxJh 09KQr06PaLZ9dLPGu0EIzoFtEKyz4mASyuck5yZIjHlOJTnZHCirz2bpePi8EcCxLZaS M38/INFTbH8XZCcFeNTwIRpUvIVa1yXxWF6AcJoHGv9/55wf/LHLdpbr9FVkGMfYqUUL qGeVKG3trWXfxoXQEvu7uJ+WAY3k0uSZc3Pd2ZDNmxZbFp8kWSgmSb5eQEfWr7iL+3XL I/3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=ZffhdDF4777uOlqpMiiEXgnAcOkXy/1O/YOuUFi4iRI=; b=nKMfUqW5ato3sxm7Ui2dShJfEy/y1YAXbvVf0CSZghgO2KcNT8p6FdmriCJsxq8sd4 KoYNpslecWCnweaEzJCrxImBMsLj1lhEQmvnTEwwvOm1FO7YCwwPZA3yP37WYBmvx9Hq xScZeg1rbCOQ0suKhw0HPEx1IxnWtGjfUXfzMxkP56zah/yGbMOMK0T+r6MNkDq24K8H 3YuNNbtX7U76vHp/Uvz/ZURK2Tdq2M9KZ/hMFibKmRnGWGK39bADq/JFu3YKmUcZOirK K2rFAphhJaD0kuySwK7+USzMYTWBD8tVz0ccZtp2SO4DpoefcvFy4g2w9yL7EEeHIg53 oyUw== X-Gm-Message-State: AD7BkJLZFYatumjUya8Q05Q+UwFZulhqLWQUKTFwf9VjXxBklvLbAFbAHOtMLmhDg7v8bg== X-Received: by 10.28.158.15 with SMTP id h15mr398700wme.89.1458320666557; Fri, 18 Mar 2016 10:04:26 -0700 (PDT) Original-Received: from inigo.katxi.org.gmail.com (62.57.74.108.dyn.user.ono.com. [62.57.74.108]) by smtp.gmail.com with ESMTPSA id e25sm123488wmi.21.2016.03.18.10.04.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Mar 2016 10:04:25 -0700 (PDT) User-agent: mu4e 0.9.16; emacs 25.1.50.1 In-reply-to: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201833 Archived-At: Hi, Stefan Monnier writes: > Indeed, `current-buffer' and `selected-window' don't correspond really > to the user's perception, because they can be changed temporarily > without the user even noticing (and it's not just a theoretical > possibility but is something that happens often enough). I noticed this when I started writing this package and was investigating the best way to achieve it, experimenting with different alternatives (hooks, advice, etc). raman writes: > See thread I had on this list re hooking sound themes based on current > mode -- I ran into this issue as well. As far as I know, it's more than > just shr/eww that triggers this: if you look, select-window gets called > way more often than you'd expect. > > After suggestions from folks like John, I ended up implementing my > solution via an idle timer, you can see the relevant code here: > https://github.com/tvraman/emacspeak/blob/master/lisp/soundscape.el#L191 The ideas Clément provided where enough to solve the problems I have. Not perfect but good enough for my case. Anyway, I'll search for that thread you mention and read it to look for better ideas. Thanks for the suggestions, Iñigo Serna