From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#21305: 25.0.50; `get-buffer-window-list' doc - what order? Date: Fri, 21 Aug 2015 10:42:18 -0700 (PDT) Message-ID: References: <<089f48ed-6ce9-4753-abcf-3f86d43a278e@default>> <<83vbc8iyut.fsf@gnu.org>> <5430f5a7-2939-4f96-8c6c-3e820ffcfd6b@default> <55D74386.6010708@gmx.at> <7036da11-d296-45a9-b6ee-d7b68830927e@default> <55D74AA3.1070202@gmx.at> <1b17a036-c525-4dbc-84fa-cc8adc2b6488@default> <50fbb71c-8a6d-45b4-a467-a31bcc73ac09@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1440179014 18808 80.91.229.3 (21 Aug 2015 17:43:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Aug 2015 17:43:34 +0000 (UTC) Cc: 21305@debbugs.gnu.org To: martin rudalics , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 21 19:43:21 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 1ZSqLP-0003Qn-Aa for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Aug 2015 19:43:11 +0200 Original-Received: from localhost ([::1]:43006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSqLO-0005sF-M6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Aug 2015 13:43:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSqLK-0005rl-W2 for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2015 13:43:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZSqLG-0000CI-8y for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2015 13:43:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSqLG-0000CE-72 for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2015 13:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZSqLG-0005rg-1g for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2015 13:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Aug 2015 17:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21305 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21305-submit@debbugs.gnu.org id=B21305.144017894322496 (code B ref 21305); Fri, 21 Aug 2015 17:43:01 +0000 Original-Received: (at 21305) by debbugs.gnu.org; 21 Aug 2015 17:42:23 +0000 Original-Received: from localhost ([127.0.0.1]:34746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZSqKc-0005qm-S9 for submit@debbugs.gnu.org; Fri, 21 Aug 2015 13:42:23 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:48130) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZSqKb-0005qf-Pl for 21305@debbugs.gnu.org; Fri, 21 Aug 2015 13:42:22 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t7LHgKtH023417 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 21 Aug 2015 17:42:20 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t7LHgK30006525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 21 Aug 2015 17:42:20 GMT Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t7LHgJO4022246; Fri, 21 Aug 2015 17:42:20 GMT In-Reply-To: <50fbb71c-8a6d-45b4-a467-a31bcc73ac09@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] 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: 208.118.235.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:105678 Archived-At: > (defun mru-window-for-buffer (buffer &optional minibuf all-frames) > "Return the most recently used window for BUFFER. > Optional args MINIBUF and ALL-FRAMES are as for `get-buffer-window- > list'." > (let* ((wins (get-buffer-window-list buffer minibuf all-frames)) > (mru-win (car wins))) > (dolist (win (cdr wins)) > (unless (time-less-p win mru-win) (setq mru-win win))) > mru-win)) >=20 > Similarly, `lru-window-for-buffer'. Sorry, I meant something like this: (defun mru-window-for-buffer (buffer &optional minibuf all-frames) "Return the most recently used window for BUFFER. Optional args MINIBUF and ALL-FRAMES are as for `get-buffer-window-list'." (let* ((wins (get-buffer-window-list buffer minibuf all-frames)) (mru-win (car wins)) (mru-time (window-use-time mru-win)) wtime) (dolist (win (cdr wins)) (when (time-less-p (setq wtime (window-use-time win)) mru-time) (setq mru-time wtime mru-win win))) mru-win))