From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#18198: Gnus fails to read ~/.newsrc with group names which are not symbols Date: Tue, 05 Aug 2014 10:07:50 +0000 Message-ID: <878un3ckqx.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1407233363 23789 80.91.229.3 (5 Aug 2014 10:09:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Aug 2014 10:09:23 +0000 (UTC) To: 18198@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 05 12:09:15 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XEbgB-0001EI-HW for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 12:09:15 +0200 Original-Received: from localhost ([::1]:58366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEbgB-0005YD-1j for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 06:09:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEbg4-0005Xw-81 for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:09:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEbfz-0004Dh-LX for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:09:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEbfy-0004Dc-SC for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XEbfx-000311-RM; Tue, 05 Aug 2014 06:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Tue, 05 Aug 2014 10:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18198 X-GNU-PR-Package: emacs, gnus X-GNU-PR-Keywords: patch X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.140723328411515 (code B ref -1); Tue, 05 Aug 2014 10:09:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Aug 2014 10:08:04 +0000 Original-Received: from localhost ([127.0.0.1]:58298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEbf2-0002ze-30 for submit@debbugs.gnu.org; Tue, 05 Aug 2014 06:08:04 -0400 Original-Received: from fely.am-1.org ([78.47.74.50]:49456) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEbez-0002zC-Ev for submit@debbugs.gnu.org; Tue, 05 Aug 2014 06:08:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Sender:Subject:To:From; bh=UToCbGh1MvI/9igmDM/oAD67wqX9iwBuM0EeAdBe0RA=; b=bseffXSz5Grqa6w5mKXA9FtbH4gSOILZIYt2AyRwrjOGqQZJoY6oGccWAI2YQA5lYYnAgA/U57qcirgS61gmweNaaAbcNQ5potfreB6STVn5EU9AX2A3DvPuOngW37YGaFW4s8U9E95p1MuIucbvaTzQ1uf45+INKJ+jzV2FtFw=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XEbex-0001OS-Qa for submit@debbugs.gnu.org; Tue, 05 Aug 2014 10:07:59 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XEbeo-0003Z6-L3 for submit@debbugs.gnu.org; Tue, 05 Aug 2014 17:07:50 +0700 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92126 Archived-At: Package: emacs, gnus Severity: minor Tags: patch As it seems, gnus-newsrc-to-gnus-format fails to correctly process ~/.newsrc entries with group names not being /complete/ Emacs Lisp expressions (integers, symbols, etc.), as in: [Hello]/World: 42 [[[This-fails: 1 I believe that the problem is at the following point. 2556 (narrow-to-region 2557 (point) 2558 (progn (skip-chars-forward "^ \t!:\n") (point))) 2559 (goto-char (point-min)) 2560 (setq symbol 2561 (and (/=3D (point-min) (point-max)) 2562 (let ((obarray gnus-active-hashtb)) (read buf)))) 2563 (widen) Here, the =E2=80=9Cgroup=E2=80=9D field of .newsrc is read as an Emacs Lisp expression. Which may result either in an error, or, in the case of [Hello]/World =E2=80=93 and, similarly, (Hello)/World =E2=80=93 in= only the leading [Hello] or (Hello) being actually read. Instead, I believe that the entire string is to be read and interned, as in (untested): (setq symbol (let ((save (point))) (skip-chars-forward "^ \t!:\n") (and (> (point) save) (intern (buffer-substring-no-properties save (point)) gnus-active-hashtb)))) 2582 (symbol 2583 ;; Group names can be just numbers. 2584 (when (numberp symbol) 2585 (setq symbol (intern (int-to-string symbol) gnus-active-hashtb))) 2586 (unless (boundp symbol) 2587 (set symbol nil)) Naturally, the numberp check above will no longer be necessary after the change suggested. Please note that this change also prevents the boundp check here from raising an error should the group name be a valid Emacs Lisp non-symbol form (say, a vector or a list.) --=20 FSF associate member #7257 http://boycottsystemd.org/ =E2=80=A6 3013 B6A0= 230E 334A