GNU bug report logs - #4631
23.1; Warnings from repeat.el

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sun, 4 Oct 2009 15:00:04 UTC

Severity: normal

Done: "Drew Adams" <drew.adams <at> oracle.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 4631 <at> debbugs.gnu.org, <bug-gnu-emacs <at> gnu.org>
Subject: bug#4631: 23.1; Warnings from repeat.el
Date: Sun, 04 Oct 2009 12:49:28 -0400
>>>>> "Drew" == Drew Adams <drew.adams <at> oracle.com> writes:

> emacs -Q
> I have some code that looks like this:
 
> (defun repeat-command (command)
>   "Repeat COMMAND."
>  (let ((repeat-previous-repeated-command  command)
>        (repeat-message-function           'ignore)
>        (last-repeatable-command           'repeat))
>    (repeat nil)))
 
> (defun foo (arg)
>   (interactive "P")
>   (repeat-command 'bar))
 
> When I use `foo', I see these warnings in *Messages* (and briefly in
> the echo area):
 
>  Warning: defvar ignored because repeat-message-function is let-bound
>  Warning: defvar ignored because repeat-previous-repeated-command is let-bound
 
> Is this normal?

Yes: the defvar of those variable (in repeat.el) will be processed when
repeat.el is loaded, which in your case, happens when `repeat' is called
(it's loaded via autoload), i.e. at that point where you've let-bound
them, so when you get out of the let, those variables will be
incorrectly set back to unbound (i.e. the defvar will have had no effect).

> A good idea? Avoidable?

Do (require 'repeat) sometime before the let.

> Dunno which defvars are involved; it seems they are defvars in
> `repeat.el'.  Why not mention the defvar's variable in the
> message, BTW?

It is mentioned.
 

        Stefan



This bug report was last modified 15 years and 317 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.