all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* weird bogosity relating to "copyright-update"
@ 2011-02-07  7:07 Miles Bader
  2011-02-07  9:37 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Miles Bader @ 2011-02-07  7:07 UTC (permalink / raw)
  To: emacs-devel

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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-07 15:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-07  7:07 weird bogosity relating to "copyright-update" Miles Bader
2011-02-07  9:37 ` Lars Ingebrigtsen
2011-02-07 10:44   ` Miles Bader
2011-02-07 15:57   ` Stefan Monnier

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.