1

I was working on a mode, setq'ed them with my functions and... emacs broke (really)

For some reason these variable are global. I made them buffer-local, but is there a good reason for having them global in the first place or simply they forgot about them?

Drew
  • 75,699
  • 9
  • 109
  • 225

1 Answers1

2

I can't think of a particular reason why it couldn't have been automatically buffer-local.

or simply they forgot about them?

More likely it was simply considered fine as it was, but you'd probably have to ask the person who added it.

In general some vars are defined as automatically buffer-local and some are not, and if you don't know then it's sensible to check before setting them (or you can use setq-local consistently when setting buffer-local values -- that's still fine if the variable is automatically buffer-local).

Personally, I always assume that setq may be setting a global value if I don't already know differently; so if I need a buffer-local value then I check my assumptions.

phils
  • 48,657
  • 3
  • 76
  • 115