all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: supercite bugfix.
Date: Fri, 19 Nov 2004 13:01:26 -0700	[thread overview]
Message-ID: <3071osF2t9939U1@uni-berlin.de> (raw)
In-Reply-To: <mailman.36.1100889732.27204.bug-gnu-emacs@gnu.org>

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  <anray@inet.ua>
 > +
 > +	* 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  <ihs_46642yahoo.com>

	* 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))

   \f
***************
*** 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

       reply	other threads:[~2004-11-19 20:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.36.1100889732.27204.bug-gnu-emacs@gnu.org>
2004-11-19 20:01 ` Kevin Rodgers [this message]
2004-11-19 18:32 supercite bugfix Andrey Slusar

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=3071osF2t9939U1@uni-berlin.de \
    --to=ihs_4664@yahoo.com \
    /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.