From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#12396: 24.2.50; [PATCH] extend usability of gnus-read-ephemeral-emacs-bug-group Date: Mon, 10 Sep 2012 23:02:18 +0200 Message-ID: <877gs18ucl.fsf@rosalinde.fritz.box> References: <87d31vtccn.fsf@rosalinde.fritz.box> <87txv7yqwa.fsf@gnus.org> <878vcjt1se.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1347311023 31773 80.91.229.3 (10 Sep 2012 21:03:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2012 21:03:43 +0000 (UTC) To: 12396@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 10 23:03:41 2012 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 1TBB8s-0006e0-E8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Sep 2012 23:03:38 +0200 Original-Received: from localhost ([::1]:56322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBB8p-0003bX-1B for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Sep 2012 17:03:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBB8j-0003as-NG for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 17:03:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBB8f-0003eY-PB for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 17:03:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBB8f-0003eQ-Lw for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 17:03:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TBB9F-0003ml-QO for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 17:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Sep 2012 21:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12396 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 12396-submit@debbugs.gnu.org id=B12396.134731098914487 (code B ref 12396); Mon, 10 Sep 2012 21:04:01 +0000 Original-Received: (at 12396) by debbugs.gnu.org; 10 Sep 2012 21:03:09 +0000 Original-Received: from localhost ([127.0.0.1]:52849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBB8K-0003lY-MG for submit@debbugs.gnu.org; Mon, 10 Sep 2012 17:03:08 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:39035) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1TBB8E-0003l6-PP for 12396@debbugs.gnu.org; Mon, 10 Sep 2012 17:03:03 -0400 Original-Received: (qmail invoked by alias); 10 Sep 2012 21:02:20 -0000 Original-Received: from i59F547FD.versanet.de (EHLO rosalinde.fritz.box) [89.245.71.253] by mail.gmx.net (mp004) with SMTP; 10 Sep 2012 23:02:20 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX18CO04I6xECo6VzHdOSuiFJCiEh5IMCWfdJPAQydZ DkBetRQPWg1Ong In-Reply-To: <878vcjt1se.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Sun, 09 Sep 2012 21:49:05 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:64081 Archived-At: I discovered that the definition of gnus-get-emacs-bug-number in my patch was deficient, so, in hopes that this feature may still make it into Emacs, here is an improved definition (though the bit about bug number 0 is probably dispensible). I'll be happy to provide an updated patch if desired. Steve Berman (defun gnus-get-emacs-bug-number (&optional n) "Return an Emacs bug number in this line, if any. If point is on a recognizable bug number, return it; otherwise, if argument N is a positive integer, return the Nth bug number in this line, counting from the left, or nil if there is no Nth bug number." (save-excursion ;; Get the number if point is anywhere within a string like "bug#1234", or ;; similar strings with a capital "B" or with a space before or after "#", ;; or without "#", as well as strings like ;; "http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1234". (when (or (eq (char-after) ?#) (eq (char-before) ?#) (string= (thing-at-point 'word) "Bug") (string= (thing-at-point 'word) "bug")) (forward-word) (skip-chars-forward " #=")) (let* ((str (thing-at-point 'word)) (num (if str (string-to-number str))) (case-fold-search t)) (if (and num ;; If bug number 0 is allowed (though it isn't in the Emacs ;; bugtracker), it requires special handling, since ;; string-to-number also returns 0 if str is alphabetical. (or (string= "0" str) (not (zerop num))) ;; Make sure this is a bug number, not just any number. (beginning-of-thing 'word) (looking-back "bug ?[#=]? ?")) num ;; Otherwise look for the Nth bug number on this line. (goto-char (line-beginning-position)) (when (re-search-forward "bug ?[#=]? ?\\([0-9]+\\)" (line-end-position) t n) (string-to-number (match-string 1)))))))