From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: raman Newsgroups: gmane.emacs.devel Subject: Re: HowTo: Run a hook when a buffer becomes "current" Date: Fri, 18 Dec 2015 08:15:00 -0800 Message-ID: References: <871takf6jq.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1450455335 4845 80.91.229.3 (18 Dec 2015 16:15:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Dec 2015 16:15:35 +0000 (UTC) Cc: Richard Stallman , emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 18 17:15:32 2015 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 1a9xgk-00009K-Qe for ged-emacs-devel@m.gmane.org; Fri, 18 Dec 2015 17:15:26 +0100 Original-Received: from localhost ([::1]:33328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9xgk-0000L7-2m for ged-emacs-devel@m.gmane.org; Fri, 18 Dec 2015 11:15:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9xgU-0008QY-Qx for emacs-devel@gnu.org; Fri, 18 Dec 2015 11:15:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9xgQ-0004PH-TB for emacs-devel@gnu.org; Fri, 18 Dec 2015 11:15:10 -0500 Original-Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]:35968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9xgP-0004Ly-Lu for emacs-devel@gnu.org; Fri, 18 Dec 2015 11:15:06 -0500 Original-Received: by mail-pa0-x236.google.com with SMTP id q3so42424445pav.3 for ; Fri, 18 Dec 2015 08:15:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=9NgHMrhuopTRPPx/xu8DTZIYNagDkoZeUur6IF5Sehk=; b=R66MG+2rOvPtR/JFi10uDxWnB1/QW1T+flXuWEgaOuvB4huZ4iWWRm6nLNS0a4DxgX Kfp+1CZVchbx7yYzPOfSa4odB3GnmHqk/SmGC9eOho9+RQsVmrD4SrS0frf46Y3pw7Lo cl4ONwVkPz/tTgyXI3M5/Gm8QRNHCjjcKYHkAymz6qz+w3EgTiPxtjVBFUUpVDzbF5qa 7M96zodeAE6VkPCQKAP9vqeqS6tzNw6zSsTlSrdg9R/HJFMA1mCTTf4qEPfPp4pGHzV3 1HCENsyzjWULuqJDdrz0vx6S7V74qQWFz520MGi67SxWkC2nbCH0hpkiVuvEDSskM6Er macQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=9NgHMrhuopTRPPx/xu8DTZIYNagDkoZeUur6IF5Sehk=; b=biPfXT9Owv3bz+KDyMPp5cAFDrEHmO4HfgJd6YsEX00Nb7DWsBjWEMPPypHVz+JUSF OOzMmsi/yVviKlG9WFp8brcbOqJmLH6k8oQVeznhfTvnVlFnnKr/f+XWDuGgR86ecs0h 0dzuMTOqVo3056OyU40lbbv/nqapjieqRSlQQ0REY+x/D0qRARkjUYVYbfa7CmMkdU+8 FdpsxNxD4Aa+9qboI+M7ZNzIT5aQzMBj8qwuyJOGUWAGWrS6/8Ba3vuu1+7k01HBKtiA sLEsoNIadm8ucq8WNBf+C2nNQ2AfFR5eca91abv0A4BQYWVzp+boIemx6AoCwh/fk94j 5B5g== X-Gm-Message-State: ALoCoQkrQBkqRlI02aFJ1uJEadnimHk2+d4Z/T9Wj9vEbWAuHlUJviQOq8BfWBlf7YrYI1eUMpSzXClL6VcOkkW4Tah+p3juNg== X-Received: by 10.67.3.170 with SMTP id bx10mr6549592pad.34.1450455305160; Fri, 18 Dec 2015 08:15:05 -0800 (PST) Original-Received: from raman-glaptop2 ([207.198.105.24]) by smtp.gmail.com with ESMTPSA id hw7sm23334943pac.12.2015.12.18.08.15.01 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 18 Dec 2015 08:15:02 -0800 (PST) In-Reply-To: <871takf6jq.fsf@fencepost.gnu.org> (David Kastrup's message of "Fri, 18 Dec 2015 10:30:01 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::236 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:196473 Archived-At: David Kastrup writes: mode-line-update ->mood-line-update:-) Eventually I think that is correct if this whole thing actually and proves useful in the sense: For someone who can see the screen and configures emacs window layout to reflect the current activity, the mood is best computed from the set of visible windows/frames -- and there, latching on to mode-line might be the right thing. For now I 'm keeping it simple by only looking at the current buffer -- > >> I divided the types of things I do into categories: >> (things I do == things I do in Emacs since I dont use anything else) >> >> Communicate: mail, gnus, twitter, jabber etc >> Program (prog-mode covers them all) >> text-mode (write content) >> special-mode: applications written in Emacs >> web: eww, w3 >> >> Then I created a mapping from modes to soundscapes (think mode -> mood) >> and finally, i attached myself to select-mode-hook to switch the >> soundscape that is playing. > > Sounds to me as if you want to hook in the mode line update. Which then > becomes more of a mood line update. --