Questions tagged [local-variables]

Use this tag for questions about variables local to a function, defined by let-binding them.

Filter by
Sorted by
Tagged with
15
votes
2answers
488 views

Is there a way to daisy chain .dir-locals.el files?

Suppose I have a directory with these files. /foo/bar/baz/.dir-locals.el /foo/bar/.dir-locals.el /foo/.dir-locals.el When I go to create a file in /foo/bar/baz/, I'd like to daisy chain them ...
8
votes
2answers
2k views

How can I prevent flycheck-mode from checking certain files?

I've configured Emacs to open files named *.cfg in shell-script-mode. These are config files, of course, rather than shell scripts, but 90% of the time it does what I want (mainly, good guesses about ...
8
votes
2answers
1k views

Only enable whitespace mode in certain buffers

I would like to have whitespace mode turned on for all buffer except for org-mode ones. It is easy to do this when emacs starts up, but since I use a persistant copy of emacs with emacs daemon mode I ...
4
votes
3answers
271 views

How to bind keys to a function which can be defined per-mode?

Currently I have variables defined with setq-local, this is useful for modes, so I can define variables only for a particular mode. How can this be done for functions? I'd like to have a function, ...
1
vote
1answer
149 views

Make a variable visible to some functions only

Consider the following metacode: ;;; -*- lexical-binding: t -*- (defvar var1 ...) (defvar var2 ...) (defun main () "Main entry point" ...) (defun func1 ...) (defun func2 ...) ... (defun funcn ...)...