emacs-devel
[Top][All Lists]
Advanced

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

weird bogosity relating to "copyright-update"


From: Miles Bader
Subject: weird bogosity relating to "copyright-update"
Date: Mon, 07 Feb 2011 16:07:44 +0900

I use Emacs' copyright-updating stuff, which is generally really nice,
but for a few months it's been misbehaving in a way I found very
confusing...  I can't seem to reproduce it using a minimal
configuration.

Basically I enable it in my .emacs mode like this:

   (add-hook 'write-file-hooks 'copyright-update)

the `copyright-update' function is autoloaded by default from
"copyright.el".

This worked fine for years, but recently it's started giving an error
when saving a file:

  run-hook-with-args-until-success: Symbol's value as variable is void: 
copyright-update

... making the file-write fail.

Oddly, examining the state of Emacs afterwards, it's clear that
"copyright.el" _has_ been loaded by the autoload, but for some reason
the `copyright-update' variable -- which is defvar'd in copyright.el --
has become unbound, making the copyright-update function code always
fail thereafter.

The only way I can then save files, is to manually do "M-x load-library
RET copyright RET", upon which everything starts working properly.

However today I noticed another message which I hadn't before:

    Warning: defvar ignored because copyright-update is let-bound

... emitted while Gnus was saving some mail via FCC.

Now I can see what's going on:  Gnus ("lisp/gnus/nnfolder.el":1094) is
let-binding `copyright-update' _around_ the file write which results in
"copyright.el" being autoloaded, but the let-binding suppresses the
global binding, screwing up all writes once the original let-binding
exits.

So... what change tickled this problem, and what's the right way to fix
it...?  It doesn't seem a bad thing that Gnus is doing that let-binding
(you probably _don't_ want your mail FCCs to get copyright-updated), but
it's clearly bad that the let-binding is screwing things up...

Thanks,

-Miles

-- 
Admiration, n. Our polite recognition of another's resemblance to ourselves.



reply via email to

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