From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#24104: 25.1.50; frame-or-buffer-changed-p also check file size Date: Fri, 29 Jul 2016 21:10:29 +0900 (JST) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: ger.gmane.org 1469794307 10187 80.91.229.3 (29 Jul 2016 12:11:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jul 2016 12:11:47 +0000 (UTC) To: 24104@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 29 14:11:33 2016 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 1bT6dY-0002VL-Uq for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Jul 2016 14:11:33 +0200 Original-Received: from localhost ([::1]:59183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT6dT-00043F-1n for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Jul 2016 08:11:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT6dA-0003vS-Ar for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 08:11:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bT6d4-0004UN-Vf for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 08:11:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT6d4-0004UH-Si for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 08:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bT6d4-0000Xv-NI for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 08:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Jul 2016 12:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24104 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14697942562084 (code B ref -1); Fri, 29 Jul 2016 12:11:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Jul 2016 12:10:56 +0000 Original-Received: from localhost ([127.0.0.1]:50056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bT6cy-0000XX-JS for submit@debbugs.gnu.org; Fri, 29 Jul 2016 08:10:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bT6cw-0000XK-UM for submit@debbugs.gnu.org; Fri, 29 Jul 2016 08:10:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bT6cn-0004Q4-Db for submit@debbugs.gnu.org; Fri, 29 Jul 2016 08:10:49 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT6cn-0004Pv-AZ for submit@debbugs.gnu.org; Fri, 29 Jul 2016 08:10:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT6ci-0003g6-2J for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 08:10:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bT6cc-0004O8-M5 for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 08:10:38 -0400 Original-Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:33704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT6cc-0004Nn-Dv for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2016 08:10:34 -0400 Original-Received: by mail-pf0-x243.google.com with SMTP id i6so5399466pfe.0 for ; Fri, 29 Jul 2016 05:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:subject:message-id:user-agent:mime-version; bh=r6qxEHe+Iz4X9GLYkkRDWGxpLdgMCudxOI6VOwOHFj4=; b=yap2W+11+jYqUnSrf+jUdbGJO88PEcY6L1H2i9R8qLU45nTFLaCwBxr0M/yIRfv8AT joHfxkinmj9HfQjflVrIqjNXpZ4xDHuWN0YQM8+0JbXS1YWJP7qCRwz24TQqJvfDLn7n ey1hk8QvKxAVj8o3LthtyJWzqK0N+5V+CaoTIhJB45Qlkuac5w/UUUtmPaL1F05Tvnhu 69pBi4wCfNqssGVNvdRjL1NS6IO5+hE//bU2YxUVwuNlWt8GFX+TcsSScx2ELFaa4tEh 8POws62EroSHm/h3zeqXrItavjSjMkjUWVxUmxbZxUrdaADxOl2V4vXLrUq7u6ibTdsX QUlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:subject:message-id:user-agent :mime-version; bh=r6qxEHe+Iz4X9GLYkkRDWGxpLdgMCudxOI6VOwOHFj4=; b=fQdMDZxtDQFZm0lmYCIalDz3ur/2kcA13CklV752S4IcdIG2GPa1GET+mLGQh+fkcO 50D/2MSIKhPcz/zKO7c5fiKmK5y3v1o2LnTg3zOymXdAKWYk73qvZrXlys9PTumms2gC shJvPaEN7CQEEUze5G4LWnjHP99E/9pCP0j7709Cb0EHZm7VTdX2g4SGr0dF7Bw+bxa0 q5gNmXBaGZELrzNfuAJioX3+YbEbB1TUNWcLguBJZSI7KXldtxy9h+COptMM/25BiuC6 PUcHIj0vq86N2phHXIln1Fj2PTD3nbbSznGCQqiSsTN7zmqnZlarzNyJ2mI8moyZ9lwV V8ig== X-Gm-Message-State: AEkoousKiXnjd/xqRD0m0vuYngjKZIGbgQThmkJ9Lmzr0CrrfZne7HlgvFUJ6GV3NLrFXA== X-Received: by 10.98.106.65 with SMTP id f62mr67552155pfc.107.1469794232900; Fri, 29 Jul 2016 05:10:32 -0700 (PDT) Original-Received: from calancha-pc ([103.5.140.173]) by smtp.gmail.com with ESMTPSA id 5sm24545064pac.34.2016.07.29.05.10.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jul 2016 05:10:32 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc User-Agent: Alpine 2.20 (DEB 67 2015-01-07) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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" Xref: news.gmane.org gmane.emacs.bugs:121677 Archived-At: Assume a buffer BUF, with size, SIZE, returning non-nil for predicate 'buffer-modified-p'; then we write some text on BUF, so that the new size is SIZE_2 != SIZE. In this scenario, 'frame-or-buffer-changed-p' return nil, i.e., the buffer state appears to not have changed. It might be convenient to extend 'frame-or-buffer-changed-p' so that, it also check the buffer size. Then, for instance, Ibuffer operating on auto mode ('ibuffer-auto-mode') would update the listing. emacs -Q --eval="(progn (require 'ibuffer) (ibuffer))" M-x ibuffer-auto-mode RET M-! echo Hi Emacs! RET ;; *Shell Command Output* appear with size 10 M-! echo Could you update Ibuffer for me? ;; It seems not: maybe i should add please next time... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From 1c9ef031b2bd283c6641d5249cbfa7226b764ab1 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Fri, 29 Jul 2016 21:05:23 +0900 Subject: [PATCH] frame-or-buffer-changed-p also check file size * src/dispnew.c (frame-or-buffer-changed-p): Check if buffer size has changed. Update the new file size in VARIABLE (Bug#24104). --- src/dispnew.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dispnew.c b/src/dispnew.c index 82d0b76..0218a68 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5812,7 +5812,7 @@ DEFUN ("frame-or-buffer-changed-p", Fframe_or_buffer_changed_p, VARIABLE is a variable name whose value is either nil or a state vector that will be updated to contain all frames and buffers, aside from buffers whose names start with space, -along with the buffers' read-only and modified flags. This allows a fast +along with the buffers' read-only, modified flags and buffer size. This allows a fast check to see whether buffer menus might need to be recomputed. If this function returns non-nil, it updates the internal vector to reflect the current state. @@ -5864,6 +5864,8 @@ pass nil for VARIABLE. */) goto changed; if (!EQ (AREF (state, idx++), Fbuffer_modified_p (buf))) goto changed; + if (!EQ (AREF (state, idx++), BVAR (XBUFFER (buf), save_length))) + goto changed; } if (idx == ASIZE (state)) goto changed; @@ -5914,6 +5916,8 @@ pass nil for VARIABLE. */) idx++; ASET (state, idx, Fbuffer_modified_p (buf)); idx++; + ASET (state, idx, Fbuffer_size (buf)); + idx++; } /* Fill up the vector with lambdas (always at least one). */ ASET (state, idx, Qlambda); -- 2.8.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GNU Emacs 25.1.50 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6) of 2016-07-28 Repository revision: 4a5b6e621c68172bb69d60fe8a76932f7c779f81