bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#4631: 23.1; Warnings from repeat.el


From: Stefan Monnier
Subject: bug#4631: 23.1; Warnings from repeat.el
Date: Sun, 04 Oct 2009 12:49:28 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

>>>>> "Drew" == Drew Adams <address@hidden> 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]