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

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

bug#64117: closed (28.2; "gnus-request-set-mark: Buffer is read-only" wh


From: GNU bug Tracking System
Subject: bug#64117: closed (28.2; "gnus-request-set-mark: Buffer is read-only" when exiting agentized, unplugged summary buffer)
Date: Sun, 02 Jul 2023 07:16:01 +0000

Your message dated Sun, 2 Jul 2023 09:14:59 +0200
with message-id <4dc1c34e-837c-71f2-3fd7-5c420fc63a1a@vodafonemail.de>
and subject line Re: bug#64117: 28.2; "gnus-request-set-mark: Buffer is 
read-only" when exiting agentized, unplugged summary buffer
has caused the debbugs.gnu.org bug report #64117,
regarding 28.2; "gnus-request-set-mark: Buffer is read-only" when exiting 
agentized, unplugged summary buffer
to be marked as done.

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


-- 
64117: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64117
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 28.2; "gnus-request-set-mark: Buffer is read-only" when exiting agentized, unplugged summary buffer Date: Fri, 16 Jun 2023 20:58:05 +0200 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
This issue should be also present in Emacs master, judging by the
code.  However I have reproduced this issue only in my
"production Emacs" on 28.2 and, in particular, *not* in an "emacs
-Q" environment.  Gnus setup complete with IMAP and all is
finicky, so probably you accept this bug report without all that.

Here are the steps to reproduce the issue:

- Ensure you have an agentized nnimap group G with some unread
  articles.

- Ensure Gnus is unplugged.

- Enter group G from the *Group* buffer by pressing "RET" on it.

- Mark some unread articles in the summary buffer of G as "read"
  by positioning point on them and pressing "d".

- Exit group G from the summary buffer by pressing "q".

The last step results in an error

gnus-request-set-mark: Buffer is read-only: #<buffer *Summary nnimap+<host>:INBOX*>

for me.

Expected result is that the agent writes the information on the
marks that have changed while unplugged to a separate file which
it later, when Gnus gets plugged again, replays.

The reason for the bug us most likely commit


https://git.savannah.gnu.org/cgit/emacs.git/commit/src?id=cb12a84f2c519a48dd87453c925e3bc36d9944db

and here the change

  * lisp/gnus/nnagent.el: Don't use a unibyte buffer.

The author has removed a macro call to `mm-with-unibyte-buffer'
in function `nnagent-request-set-mark' without replacing it by,
for example, a call to `with-temp-buffer'.  Accordingly, function
`nnagent-request-set-mark' tries to operate on the current
buffer, which happens to be the read-only summary buffer.

Adding a `with-temp-buffer' around the inserts and the call to
`write-region' fixes this issue (showing 28.2-based code):

(deffoo nnagent-request-set-mark (group action server)
  (with-temp-buffer
    (insert "(gnus-agent-synchronize-group-flags \""
            group
            "\" '")
    (gnus-pp action)
    (insert " \""
            (gnus-method-to-server gnus-command-method)
            "\"")
    (insert ")\n")
    (let ((coding-system-for-write nnheader-file-coding-system))
      (write-region (point-min) (point-max) (gnus-agent-lib-file "flags")
                    t 'silent)))
  ;; Also set the marks for the original back end that keeps marks in
  ;; the local system.
  (let ((gnus-agent nil))
    (when (and (memq (car gnus-command-method) '(nntp))
               (gnus-check-backend-function 'request-set-mark
                                            (car gnus-command-method)))
      (funcall (gnus-get-function gnus-command-method 'request-set-mark)
               group action server)))
  nil)

I could provide a patch on emacs-29 but only without actually
testing it...



--- End Message ---
--- Begin Message --- Subject: Re: bug#64117: 28.2; "gnus-request-set-mark: Buffer is read-only" when exiting agentized, unplugged summary buffer Date: Sun, 2 Jul 2023 09:14:59 +0200 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0
On 2023-07-02  01:54, Eric Abrahamsen wrote:

Thanks to all for taking care of this!

Same here.

Closed.



--- End Message ---

reply via email to

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