emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24104: closed (25.1.50; frame-or-buffer-changed-p also check file si


From: GNU bug Tracking System
Subject: bug#24104: closed (25.1.50; frame-or-buffer-changed-p also check file size)
Date: Wed, 12 Aug 2020 02:00:02 +0000

Your message dated Tue, 11 Aug 2020 18:59:13 -0700
with message-id 
<CADwFkmnX61fP+yQWa-UmpxG35GAC3L8Au6QHxQd+uN6iQnFzMA@mail.gmail.com>
and subject line Re: bug#24104: 25.1.50; frame-or-buffer-changed-p also check 
file size
has caused the debbugs.gnu.org bug report #24104,
regarding 25.1.50; frame-or-buffer-changed-p also check file size
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
24104: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24104
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 25.1.50; frame-or-buffer-changed-p also check file size Date: Fri, 29 Jul 2016 21:10:29 +0900 (JST) User-agent: Alpine 2.20 (DEB 67 2015-01-07)

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 <tino.calancha@gmail.com>
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



--- End Message ---
--- Begin Message --- Subject: Re: bug#24104: 25.1.50; frame-or-buffer-changed-p also check file size Date: Tue, 11 Aug 2020 18:59:13 -0700 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Tino Calancha <tino.calancha@gmail.com> writes:

> On Fri, 29 Jul 2016, Eli Zaretskii wrote:
>
>> This function is used to decide whether we need to recompute menus, so
>> your proposed change will cause extra recomputation of them.  I'm not
>> sure we want that, as recomputing menus might be expensive.
> Ok.
[...]
> We can close this report.

I'm consequently closing this bug report now.

Best regards,
Stefan Kangas


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]