From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: supercite bugfix. Date: Fri, 19 Nov 2004 13:01:26 -0700 Message-ID: <3071osF2t9939U1@uni-berlin.de> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1100894553 8527 80.91.229.6 (19 Nov 2004 20:02:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 Nov 2004 20:02:33 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 19 21:02:20 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CVExX-0003eV-00 for ; Fri, 19 Nov 2004 21:02:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CVF6S-0007pA-CI for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Nov 2004 15:11:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CVF5y-0007a1-JL for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2004 15:11:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CVF5w-0007ZL-8S for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2004 15:11:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CVF5w-0007Z6-1D for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2004 15:11:00 -0500 Original-Received: from [216.168.1.22] (helo=trinity.supernews.net) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CVEww-00061L-IM for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2004 15:01:42 -0500 Original-Received: from mail.fu-berlin.de ([130.133.1.2]:3728) by trinity.supernews.net with esmtp (Exim 4.42 (FreeBSD)) id 1CVEwv-0007Qh-EF for gnu-emacs-bug@moderators.isc.org; Fri, 19 Nov 2004 20:01:41 +0000 Original-Received: by Mail.FU-Berlin.DE (Exim 4.42) from curry.zedat.fu-berlin.de ([160.45.10.36]) for gnu-emacs-bug@moderators.isc.org with esmtp id <1CVEwn-000Fh4-I0>; Fri, 19 Nov 2004 21:01:33 +0100 Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.uni-berlin.de with bsmtp id ; Fri, 19 Nov 2004 21:01:33 +0100 (MET) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 139 X-Orig-X-Trace: news.uni-berlin.de jUHE3pviR28IBCnWGlJA7gM9nxQQRlC+Wi3jXWeMdb03J23K8= User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:9754 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:9754 Andrey Slusar wrote: > See: > ,----[ C-h v sc-cite-frame-alist RET ] > | `sc-cite-frame-alist' is a variable declared in Lisp. > | -- loaded from "supercite" > | > | Value: nil > | > | Documentation: > | *Alist for frame selection during citing. > | Each element of this list has the following form: > | > | (INFOKEY ((REGEXP . FRAME) > | (REGEXP . FRAME) > | (...))) > | > | Where INFOKEY is a key for `sc-mail-field', REGEXP is a regular > | expression to match against the INFOKEY's value. FRAME is a citation > | frame, or a variable containing a citation frame. > `---- > If FRAME is a variable containing a citation frame, when running > (sc-scan-info-alist 'FRAME). This is a bug. > > Patch, fixed this bug: > > --- lisp/ChangeLog.orig Fri Nov 19 14:54:39 2004 > +++ lisp/ChangeLog Fri Nov 19 14:58:40 2004 > @@ -0,0 +1,5 @@ > +2004-11-19 Andrey Slusar > + > + * mail/supercite.el (sc-cite-region): Fix bug, when FRAME is a variable > + containing a citation frame. > + sc-uncite-frame-alist and sc-recite-frame-alist may also contain variables, so the sc-uncite-region and sc-recite-region functions need the same fix. And since the sc-*cite-region functions are 3 of the 4 uses of sc-scan-info-alist in the Emacs distribution, it's easier to just fix it once there (and make sure the symbol is bound, as well, to avoid throwing an error): 2004-11-19 Kevin Rodgers * supercite.el (sc-scan-info-alist): Accept optional FRAME-VARIABLE argument, to handle sc-cite-frame-alist, sc-uncite-frame-alist, and sc-recite-frame-alist entries. (sc-cite-region, sc-uncite-region, sc-recite-region): Pass non-nil FRAME-VARIABLE arg to sc-scan-info-alist. *** emacs-21.3/lisp/mail/supercite.el~ Mon Oct 29 02:08:16 2001 --- emacs-21.3/lisp/mail/supercite.el Fri Nov 19 12:49:11 2004 *************** *** 753,760 **** (deallocate-event event)) p)) ! (defun sc-scan-info-alist (alist) ! "Find a match in the info alist that matches a regexp in ALIST." (let ((sc-mumble "") rtnvalue) (while alist --- 753,762 ---- (deallocate-event event)) p)) ! (defun sc-scan-info-alist (alist &optional frame-variable) ! "Find a match in the info alist that matches a regexp in ALIST. ! If FRAME-VARIABLE is non-nil and the match is a bound symbol, return its ! value instead (see `sc-cite-frame-alist')." (let ((sc-mumble "") rtnvalue) (while alist *************** *** 776,781 **** --- 778,785 ---- ))) ;end of mlist loop (setq alist (cdr alist)) )) ;end of alist loop + (when (and frame-variable (symbolp rtnvalue) (boundp rtnvalue)) + (setq rtnvalue (symbol-value rtnvalue))) rtnvalue)) *************** *** 1524,1530 **** `sc-pre-cite-hook'." (interactive "r\nP") (undo-boundary) ! (let ((frame (or (sc-scan-info-alist sc-cite-frame-alist) sc-default-cite-frame)) (sc-confirm-always-p (if confirm-p t sc-confirm-always-p))) (run-hooks 'sc-pre-cite-hook) --- 1528,1534 ---- `sc-pre-cite-hook'." (interactive "r\nP") (undo-boundary) ! (let ((frame (or (sc-scan-info-alist sc-cite-frame-alist t) sc-default-cite-frame)) (sc-confirm-always-p (if confirm-p t sc-confirm-always-p))) (run-hooks 'sc-pre-cite-hook) *************** *** 1537,1543 **** First runs `sc-pre-uncite-hook'." (interactive "r") (undo-boundary) ! (let ((frame (or (sc-scan-info-alist sc-uncite-frame-alist) sc-default-uncite-frame))) (run-hooks 'sc-pre-uncite-hook) (regi-interpret frame start end))) --- 1541,1547 ---- First runs `sc-pre-uncite-hook'." (interactive "r") (undo-boundary) ! (let ((frame (or (sc-scan-info-alist sc-uncite-frame-alist t) sc-default-uncite-frame))) (run-hooks 'sc-pre-uncite-hook) (regi-interpret frame start end))) *************** *** 1549,1555 **** (let ((sc-confirm-always-p t)) (sc-select-attribution)) (undo-boundary) ! (let ((frame (or (sc-scan-info-alist sc-recite-frame-alist) sc-default-recite-frame))) (run-hooks 'sc-pre-recite-hook) (regi-interpret frame start end))) --- 1553,1559 ---- (let ((sc-confirm-always-p t)) (sc-select-attribution)) (undo-boundary) ! (let ((frame (or (sc-scan-info-alist sc-recite-frame-alist t) sc-default-recite-frame))) (run-hooks 'sc-pre-recite-hook) (regi-interpret frame start end))) -- Kevin Rodgers