all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Drew Adams <drew.adams@oracle.com>
Cc: 4631@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org
Subject: bug#4631: 23.1; Warnings from repeat.el
Date: Sun, 04 Oct 2009 12:49:28 -0400	[thread overview]
Message-ID: <jwvtyyfayzv.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <5DDA07B831D643C5940FEFB414D6D6AF@us.oracle.com> (Drew Adams's message of "Sun, 4 Oct 2009 07:52:15 -0700")

>>>>> "Drew" == Drew Adams <drew.adams@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





       reply	other threads:[~2009-10-04 16:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5DDA07B831D643C5940FEFB414D6D6AF@us.oracle.com>
2009-10-04 16:49 ` Stefan Monnier [this message]
2009-10-04 18:59   ` bug#4631: 23.1; Warnings from repeat.el Drew Adams

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=jwvtyyfayzv.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=4631@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=drew.adams@oracle.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.