all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Change in `revert-buffer' behavior [28.0.50]
@ 2021-07-27 15:09 Kaushal Modi
  2021-07-27 15:25 ` bug#35166: " Lars Ingebrigtsen
  2021-07-27 15:28 ` Óscar Fuentes
  0 siblings, 2 replies; 5+ messages in thread
From: Kaushal Modi @ 2021-07-27 15:09 UTC (permalink / raw)
  To: Emacs developers, Lars Ingebrigtsen

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

Hello,

I use the `revert-buffer' function frequently and after a recent rebuild of
emacs from master after about a month, I noticed a big difference in its
behavior.

When I change the read-onlyness of a file from the disk, M-x revert-buffer
doesn't reflect that change any more. This is really important as I am
working in a centralized VCS where the files have to be "checked out" i.e.
make writable before I can modify them.

Now when the commands in the terminal check in and check out the file, the
read-only/writable status doesn't update when I revert-buffer in Emacs.

*Earlier M-x revert-buffer always showed the correct read-only state. Now,
I need to kill the buffer and reopen to see the correct status.*

I believe it is kind of related to this commit:
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=fcae435f598471a2911641412125c5ac4f73559f

Here's my Emacs devel version:

Emacs version: GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+
Version 3.22.30, cairo version 1.15.12)
 of 2021-07-26, built using commit 1ff02c53b5f21dfcaff1794f3eb2f42fb6160dae.



--
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 1600 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#35166: Change in `revert-buffer' behavior [28.0.50]
  2021-07-27 15:09 Change in `revert-buffer' behavior [28.0.50] Kaushal Modi
@ 2021-07-27 15:25 ` Lars Ingebrigtsen
  2021-07-27 15:39   ` Kaushal Modi
  2021-07-27 15:28 ` Óscar Fuentes
  1 sibling, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-27 15:25 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: 35166, Emacs developers

Kaushal Modi <kaushal.modi@gmail.com> writes:

> When I change the read-onlyness of a file from the disk, M-x revert-buffer
> doesn't reflect that change any more. This is really important as I am working in
> a centralized VCS where the files have to be "checked out" i.e. make writable
> before I can modify them.

I've now reverted the change and reopened bug#35166 -- the problem there
will have to be fixed in a different way.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Change in `revert-buffer' behavior [28.0.50]
  2021-07-27 15:09 Change in `revert-buffer' behavior [28.0.50] Kaushal Modi
  2021-07-27 15:25 ` bug#35166: " Lars Ingebrigtsen
@ 2021-07-27 15:28 ` Óscar Fuentes
  2021-07-27 15:43   ` Kaushal Modi
  1 sibling, 1 reply; 5+ messages in thread
From: Óscar Fuentes @ 2021-07-27 15:28 UTC (permalink / raw)
  To: emacs-devel

Kaushal Modi <kaushal.modi@gmail.com> writes:

> Hello,
>
> I use the `revert-buffer' function frequently and after a recent rebuild of
> emacs from master after about a month, I noticed a big difference in its
> behavior.
>
> When I change the read-onlyness of a file from the disk, M-x revert-buffer
> doesn't reflect that change any more. This is really important as I am
> working in a centralized VCS where the files have to be "checked out" i.e.
> make writable before I can modify them.
>
> Now when the commands in the terminal check in and check out the file, the
> read-only/writable status doesn't update when I revert-buffer in Emacs.
>
> *Earlier M-x revert-buffer always showed the correct read-only state. Now,
> I need to kill the buffer and reopen to see the correct status.*
>
> I believe it is kind of related to this commit:
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=fcae435f598471a2911641412125c5ac4f73559f

I think that the author was trying to preserve the user's decision about
the read-only-ness of the buffer, assuming that the file's permissions
did not change since last visit.

AFAIK currently we have no method for distinguising if the buffer was
made read-only/writable by the user or because Emacs reflected the file
system's permissions.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#35166: Change in `revert-buffer' behavior [28.0.50]
  2021-07-27 15:25 ` bug#35166: " Lars Ingebrigtsen
@ 2021-07-27 15:39   ` Kaushal Modi
  0 siblings, 0 replies; 5+ messages in thread
From: Kaushal Modi @ 2021-07-27 15:39 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 35166, Emacs developers

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

On Tue, Jul 27, 2021 at 11:25 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:

>
> I've now reverted the change and reopened bug#35166 -- the problem there
> will have to be fixed in a different way.
>

Thanks for that quick fix! This restores the old `revert-buffer' behavior.

[-- Attachment #2: Type: text/html, Size: 589 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Change in `revert-buffer' behavior [28.0.50]
  2021-07-27 15:28 ` Óscar Fuentes
@ 2021-07-27 15:43   ` Kaushal Modi
  0 siblings, 0 replies; 5+ messages in thread
From: Kaushal Modi @ 2021-07-27 15:43 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

On Tue, Jul 27, 2021 at 11:29 AM Óscar Fuentes <ofv@wanadoo.es> wrote:

>
> I think that the author was trying to preserve the user's decision about
> the read-only-ness of the buffer, assuming that the file's permissions
> did not change since last visit.
>
> AFAIK currently we have no method for distinguising if the buffer was
> made read-only/writable by the user or because Emacs reflected the file
> system's permissions.
>

I have used `revert-buffer' for more than (gulp) 13 years to always update
the buffer to changes in files on disk. That would revert the buffer
contents to the latest file contents, read/write permissions, etc.

So this change was pretty much a breaking change for me. For context, I use
the p4.el package[0] to check-in and check-out files from within Emacs. But
after that change, M-x p4-edit checked out the file on the system, but
still kept the buffer read-only. So I had to kill and reopen the buffer to
have the read-only status update correctly.

[0]: https://github.com/gareth-rees/p4.el

[-- Attachment #2: Type: text/html, Size: 1467 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-27 15:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-27 15:09 Change in `revert-buffer' behavior [28.0.50] Kaushal Modi
2021-07-27 15:25 ` bug#35166: " Lars Ingebrigtsen
2021-07-27 15:39   ` Kaushal Modi
2021-07-27 15:28 ` Óscar Fuentes
2021-07-27 15:43   ` Kaushal Modi

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.