From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Amos Bird Newsgroups: gmane.emacs.help Subject: Re: how can I run commands when window displays a different buffer? Date: Fri, 27 Oct 2017 21:34:31 +0800 Message-ID: <87lgjw90k8.fsf@gmail.com> References: <59F32C2F.8020701@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1509111313 28536 195.159.176.226 (27 Oct 2017 13:35:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 27 Oct 2017 13:35:13 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 25.3.1 Cc: help-gnu-emacs@gnu.org To: martin rudalics Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 27 15:35:07 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e84mp-0005sU-Hs for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Oct 2017 15:34:59 +0200 Original-Received: from localhost ([::1]:57356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e84mw-0002VY-Qc for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Oct 2017 09:35:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e84mW-0002VT-Di for help-gnu-emacs@gnu.org; Fri, 27 Oct 2017 09:34:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e84mS-0005yn-Gx for help-gnu-emacs@gnu.org; Fri, 27 Oct 2017 09:34:40 -0400 Original-Received: from mail-pg0-x22a.google.com ([2607:f8b0:400e:c05::22a]:53359) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e84mS-0005yE-BY for help-gnu-emacs@gnu.org; Fri, 27 Oct 2017 09:34:36 -0400 Original-Received: by mail-pg0-x22a.google.com with SMTP id s2so5302467pge.10 for ; Fri, 27 Oct 2017 06:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:user-agent:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=ziXIbk7MHnIhIRrRL6VlAM4gEILDeoIwC/ZM2U7Nyy8=; b=apf8Qc+/PW1DcCBmetVSMsoamp9r9f/SzCqaPnZZ+8Dn/cMkXQ2EVT5ztO0ofq5Dba bbMH7BGYBoznpky0TDKdGvdL3VMZWjTlIoELfyx1QMst9KNm1fAk+hMX3Wrw+T40aytT aIATMUWvE360ifrv3lnlSIXTtXU5Sulkn1Tj/r8UyHXSD3m6h0N6pZr7U9UPggfDMDhb cPposl+gbcncIluNaCQ6efjvi0Kij9AG4/b9opWycNT08W2vMTP2+iHOm2eOqGNApUiy TvzuEV++TRtwaDOyb1GOn424fiaoXKSjKaPcekg1yqH1A47+pc8ty/U7Ojsk8PYsN+3S jcjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:user-agent :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=ziXIbk7MHnIhIRrRL6VlAM4gEILDeoIwC/ZM2U7Nyy8=; b=POTasdvzF4YQFTpjX7462FhCjl6nvuEFrVpQxBi4AGCWeWNiKaKgSSdrNb1BUVJlMN 2bSbBHxtinMedsyqDAvG3Yccjz7jN22bBjbk+IM1G0Udc0F8aGNoXRJwb/pLRrZ4T8sF 9wosAqiWDg47kaC5bi3qzJPnrviCV/JX/Rx60sBU6zh/PjointwELIuPTcj1vNB/RWpG fHemS5CjWUaRyacETRK6tWiOu97z+GNCh1fB9udXgiAUYd9WhJyKvIBpD2HlBrMvDif2 tX/y4IF2elz0kfv2oUSgNfkXT5vQPGEtEXuvQH5ds1ua4fM7k8ECABILocOqIE4cfWst NbbQ== X-Gm-Message-State: AMCzsaXtQjEFVwZAmBQsJze8BSGoaSI0e0KNS0ard7ZwRH2HE5yU47Am MMXAJBXyLnPKmyd0EOrXhd/hcpjM X-Google-Smtp-Source: ABhQp+QEG1Rgmxb2YT2FXADs8rY5BAt/w+N5OehPwCWGfRvK4Ih616lbEeuPeSmHHR1BMtXT5nNLjQ== X-Received: by 10.99.172.25 with SMTP id v25mr332067pge.182.1509111275497; Fri, 27 Oct 2017 06:34:35 -0700 (PDT) Original-Received: from localhost ([2604:180:3:28::c542]) by smtp.gmail.com with ESMTPSA id b68sm14828990pfg.171.2017.10.27.06.34.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Oct 2017 06:34:34 -0700 (PDT) In-reply-to: <59F32C2F.8020701@gmx.at> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::22a X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114662 Archived-At: =20 Thanks martin! I was thinking the similar but cannot find a way to construct the=20 window-buffer associations. Do you mind giving me some hint :) regards, martin rudalics writes: > In a function on =E2=80=98window-configuration-change-hook=E2=80=99 you h= ave to remember > all window-buffer associations in a list, removing defunct windows from > that list. If you find a window whose association changed since the > last time that hook was run (and maybe also if you find a new window), > you know that that "window displays a different buffer" now. > > martin --=20 Amos Bird amosbird@gmail.com