Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove setq-local usages #10

Closed
chrisbarrett opened this issue Jun 4, 2014 · 4 comments
Closed

Remove setq-local usages #10

chrisbarrett opened this issue Jun 4, 2014 · 4 comments

Comments

@chrisbarrett
Copy link
Collaborator

Replace with (set (make-local-variable ...) ...). This is compatible with older emacsen and will allow removal of the reimplementation of setq-local.

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 4, 2014

Bad idea, mate. Simply inline it like this:

;;; Compatibility
(eval-and-compile
  ;; `setq-local' for Emacs 24.2 and below
  (unless (fboundp 'setq-local)
    (defmacro setq-local (var val)
      "Set variable VAR to value VAL in current buffer."
      `(set (make-local-variable ',var) ,val))))

No need to degrade the code, when the solution is so simple. Btw, you'd be crazy to supporting anything older than Emacs 24.1.

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 4, 2014

I see you've already done that, so I don't see the point in this issue.

@chrisbarrett
Copy link
Collaborator Author

This came up in feedback on my MELPA pull request. See @purcell's comments at melpa/melpa#1748

I'm not fussed either way, I just want this package to be a good citizen.

@purcell
Copy link

purcell commented Jun 5, 2014

@bbatsov It's still bad practice to shim built-in functions/macros, generally speaking, for the reasons I described in the comments on melpa/melpa#1748. This isn't the most egregious example, though. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants