Skip to main content

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
10 votes
2 answers

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 ...
Saint Aardvark the Carpeted's user avatar
16 votes
2 answers

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 ...
Eric Johnson's user avatar
8 votes
2 answers

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 ...
jcv's user avatar
  • 235
5 votes
3 answers

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, ...
ideasman42's user avatar
  • 8,846
10 votes
0 answers

Display all local variables within a edebug session

When using edebug one can get a local variable by command describe-variable (C-h v), but are there any ways to display all local variables? For example in Python you can call locals() in a pdb ...
atevm's user avatar
  • 948
4 votes
1 answer

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 ...)...
antonio's user avatar
  • 1,822
1 vote
2 answers

.dir-locals for specific directory but not its children

How to set a directory local variable for a directory itself non-recursively? I don't want the variable set in .dir-locals.el affect the sub-directories. Edited: My use case is: I'd like to hide dot ...
Saddle Point's user avatar
1 vote
1 answer

Local variable's state mutated across function calls [duplicate]

I was surprised to discover that a local variable can have it's state modified across function invocations. Consider the following example. (defun example-mutable () (let ((x '("the" "quick" "...
dpritch's user avatar
  • 445