From: Katsumi Yamaoka <yamaoka@jpl.org>
To: 29008@debbugs.gnu.org
Subject: bug#29008: 26.0.90; two bugs in gnus-read-ephemeral-*
Date: Thu, 26 Oct 2017 17:15:32 +0900 [thread overview]
Message-ID: <b4m7evi1g0r.fsf@jpl.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 2433 bytes --]
Hi,
BUG-1:
If a group for a certain bug number is once read and its contents
are cached, the following error happens. This is the case I do
M-x gnus-read-ephemeral-emacs-bug-group RET 26862 RET
for reading bug#26862.
Debugger entered--Lisp error: (file-error "https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26862;mboxmaint=yes;mboxstat=yes" "Not modified")
signal(file-error ("https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26862;mboxmaint=yes;mboxstat=yes" "Not modified"))
url-insert-file-contents("https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26862;mboxmaint=yes;mboxstat=yes")
gnus-read-ephemeral-bug-group((26862) "https://debbugs.gnu.org/cgi/bugreport.cgi?bug=%s;mboxmaint=yes;mboxstat=yes" nil)
gnus-read-ephemeral-emacs-bug-group(26862)
It's not intentional, is it? Fixing it is easy by passing t as
the second argument to `url-insert-file-contents'. However, it
causes another problem; the program prompts me for the yes-or-no
query when I redo `M-x gnus-read-ephemeral-emacs-bug-group' as:
Buffer *temp file* modified; kill anyway? (yes or no)
This happens when finishing the (with-temp-file ...) form because
`url-insert-file-contents' sets `buffer-file-name' as the second
argument is set. So, `buffer-file-name' has to be reset to nil.
BUG-2:
An example that (info "(gnus)Foreign Groups") introduces
Here is an example:
(require 'gnus-art)
(add-to-list
'gnus-button-alist
'("#\\([0-9]+\\)\\>" 1
(string-match "\\<emacs\\>" (or gnus-newsgroup-name ""))
gnus-read-ephemeral-emacs-bug-group 1))
passes a bug number to `gnus-read-ephemeral-emacs-bug-group' as
a string. Even if BUG-1 is fixed, this causes a bug as follows:
Debugger entered--Lisp error: (wrong-type-argument numberp "26862")
number-to-string("26862")
mapconcat(number-to-string ("26862") ",")
gnus-read-ephemeral-bug-group(("26862") "https://debbugs.gnu.org/cgi/bugreport.cgi?bug=%s;mboxmaint=yes;mboxstat=yes" nil)
gnus-read-ephemeral-emacs-bug-group("26862")
A patch for both the bugs is below. Thanks.
In GNU Emacs 26.0.90 (build 1, i686-pc-cygwin, GTK+ Version 3.18.9)
of 2017-10-26 built on localhost
Windowing system distributor 'The Cygwin/X Project', version 11.0.11900000
* lisp/gnus/gnus-group.el (gnus-read-ephemeral-gmane-group)
(gnus-read-ephemeral-bug-group): Make it work for any number of times.
(gnus-read-ephemeral-emacs-bug-group): Allow a string for bug#.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1628 bytes --]
--- gnus-group.el~ 2017-10-25 22:06:10.154071900 +0000
+++ gnus-group.el 2017-10-26 08:08:28.510090200 +0000
@@ -2373,7 +2373,10 @@
(with-temp-file tmpfile
(url-insert-file-contents
(format gnus-gmane-group-download-format
- group start (+ start range)))
+ group start (+ start range))
+ t)
+ ;; `url-insert-file-contents' sets this because of the 2nd arg.
+ (setq buffer-file-name nil)
(write-region (point-min) (point-max) tmpfile)
(gnus-group-read-ephemeral-group
(format "nndoc+ephemeral:%s.start-%s.range-%s" group start range)
@@ -2463,7 +2466,7 @@
(if (and (not gnus-plugged)
(file-exists-p file))
(insert-file-contents file)
- (url-insert-file-contents (format mbox-url id)))))
+ (url-insert-file-contents (format mbox-url id) t))))
;; Add the debbugs address so that we can respond to reports easily.
(let ((address
(format "%s@%s" (car ids)
@@ -2488,7 +2491,9 @@
(insert ", " address))
(insert "To: " address "\n")))
(goto-char (point-max))
- (widen)))))
+ (widen)))
+ ;; `url-insert-file-contents' sets this because of the 2nd arg.
+ (setq buffer-file-name nil)))
(gnus-group-read-ephemeral-group
(format "nndoc+ephemeral:bug#%s"
(mapconcat 'number-to-string ids ","))
@@ -2512,6 +2517,8 @@
(interactive (list (string-to-number
(read-string "Enter bug number: "
(thing-at-point 'word) nil))))
+ (when (stringp ids)
+ (setq ids (string-to-number ids)))
(unless (listp ids)
(setq ids (list ids)))
(gnus-read-ephemeral-bug-group
next reply other threads:[~2017-10-26 8:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 8:15 Katsumi Yamaoka [this message]
2017-10-26 12:19 ` bug#29008: 26.0.90; two bugs in gnus-read-ephemeral-* Noam Postavsky
2017-10-26 23:34 ` Katsumi Yamaoka
2017-10-27 0:12 ` Noam Postavsky
2017-10-27 0:47 ` Katsumi Yamaoka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b4m7evi1g0r.fsf@jpl.org \
--to=yamaoka@jpl.org \
--cc=29008@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.