From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#29008: 26.0.90; two bugs in gnus-read-ephemeral-* Date: Thu, 26 Oct 2017 17:15:32 +0900 Organization: Emacsen advocacy group Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1509005841 10301 195.159.176.226 (26 Oct 2017 08:17:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 26 Oct 2017 08:17:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (i686-pc-cygwin) To: 29008@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 26 10:17:16 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7dLj-0001Wy-GP for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Oct 2017 10:17:11 +0200 Original-Received: from localhost ([::1]:51584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7dLn-0000ow-My for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Oct 2017 04:17:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7dLe-0000lh-C4 for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2017 04:17:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7dLb-0007Xk-4L for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2017 04:17:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53521) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7dLa-0007XJ-WC for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2017 04:17:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e7dLZ-0006PP-NU for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2017 04:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Katsumi Yamaoka Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Oct 2017 08:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29008 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.150900579224589 (code B ref -1); Thu, 26 Oct 2017 08:17:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Oct 2017 08:16:32 +0000 Original-Received: from localhost ([127.0.0.1]:33969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7dL5-0006OX-O1 for submit@debbugs.gnu.org; Thu, 26 Oct 2017 04:16:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7dL4-0006OK-88 for submit@debbugs.gnu.org; Thu, 26 Oct 2017 04:16:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7dKx-0006tg-Ug for submit@debbugs.gnu.org; Thu, 26 Oct 2017 04:16:25 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e7dKx-0006tE-R3 for submit@debbugs.gnu.org; Thu, 26 Oct 2017 04:16:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7dKw-0000cs-BK for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2017 04:16:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7dKt-0006qd-2O for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2017 04:16:22 -0400 Original-Received: from mail-hampton.hostforweb.net ([205.234.186.191]:51288 helo=hampton.hostforweb.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e7dKs-0006an-TF for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2017 04:16:18 -0400 Original-Received: from s70.gtokyofl21.vectant.ne.jp ([202.215.75.70]:60000 helo=localhost) by hampton.hostforweb.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1e7dKB-0039MI-F6; Thu, 26 Oct 2017 03:15:36 -0500 X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( Cancel-Lock: sha1:l+u07JqIzw16ClUb60DxbRQjktw= X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hampton.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Get-Message-Sender-Via: hampton.hostforweb.net: authenticated_id: yamaoka/from_h X-Authenticated-Sender: hampton.hostforweb.net: yamaoka@jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (barebone) [generic] [fuzzy] 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:139001 Archived-At: --=-=-= 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 "\\" (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#. --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- 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 --=-=-=--