Questions tagged [variables]
for variables in Emacs Lisp, which are symbols with values. The symbol’s name is also called the variable name. Most variable names, by convention, consist of lowercase, ordinary words separated by hyphens.
36
questions with no upvoted or accepted answers
11
votes
0
answers
2k
views
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 ...
5
votes
0
answers
571
views
list of current variables in a buffer for Python code
I would like to find a way to reproduce the "Workspace" of Matlab or the equivalent "Variables" window of the awesome pudb debugger directly in emacs for python code: it is a window which details the ...
4
votes
0
answers
190
views
Using a `defconst' or `defvar' While the Variable Has a Local Binding Sets the Global Binding?
The GNU Emacs Lisp Reference Manual, 12.5 Defining Global Variables:
If you use a defconst or defvar special form while the variable has a local binding (made with let, or a function argument), it ...
4
votes
1
answer
141
views
Update variable value without eval again
Let's say, If I have a directory variable named a-directory with its value. Also I have another variable named b-directory which gets its value from the previous variable.
(setq a-directory "C:/...
2
votes
0
answers
203
views
How do I set package-vc-selected-packages to use a specific commit?
Emacs 29.1 introduced new functions to install packages directly from source.
Configuring it to download from the latest commit works fine, but I can't find how to download from a specific commit ...
2
votes
0
answers
172
views
Why does (setopt ...) not give "assignment to free variable" warning, unlike setq and customize-set-variable?
I'm using Emacs 29.0.60
If I open emacs -q, open a Emacs Lisp buffer with FlyMake enabled and type this:
;;; init.el --- summary
;;; Commentary:
;;; Code:
(setq var1 2)
(customize-set-variable var2 ...
2
votes
2
answers
133
views
Is there a way to check if a symbol is a built-in variable?
This is how you check if an object is a built-in function:
(subrp (symbol-function 'assoc))
=> t
Is there an equivalent way to do this for variables as well?
2
votes
0
answers
167
views
How to find out the name of a variable Customize is customizing
I'd like to have a function that when run from within a Customize buffer will return the name of the variable that would be customized at point.
1
vote
0
answers
80
views
How to run a function when a variable is accessed/read in Emacs Lisp?
I'm trying to find a way to run a function whenever a specific variable is accessed or read in Emacs Lisp. I want to know which functions are using this variable, but I don't know them beforehand.
I'm ...
1
vote
0
answers
155
views
.bashrc environment variables not picked up by Spacemacs?
I've added a few environment variables to my .bashrc file, some of these are paths to customized bin/programs, such as:
export MY_ENV_PATH_VAR=/home/user/path/to/bin
I've refreshed spacemacs' ....
1
vote
0
answers
135
views
why doesn't use-package :defines stop this "variable is void" error?
Error (use-package): w3m/:config: Symbol’s value as variable is void: w3m-filter-configuration
I have a use-package statement that was producing an error because apparently emacs-w3m doesn't configure ...
1
vote
3
answers
577
views
The global value of a variable I set with setq in my config differs from the local value. How can I get my value to be what I want in every buffer?
I want web-mode-script-padding to be set to 0 at all times.
In my config, I have tried both
(with-eval-after-load 'web-mode
(setq web-mode-script-padding 0)
)
As well as simply,
(setq web-mode-...
1
vote
0
answers
105
views
Multiple cursors has undefined variables
I installed multiple cursors mode. My init.el has the following at the bottom:
(require 'bytecomp)
(require 'multiple-cursors)
(multiple-cursors-mode 1)
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-...
1
vote
0
answers
634
views
load environment variables of virtual environment in emacs
What is the best way to load in emacs the environment variables of a virtualenv?
I seem to have got virtualenvwrapper.el working. For example, after using venv-workon my_venv, then M-! printenv ...
1
vote
0
answers
148
views
My function seems to not know a variable has changed and gives the wrong output
I want to change the shebang string every time I create a new Python file, some projects use Python 2 and other use Python 3, so the shebang should change according to the value of a variable in the ....
0
votes
0
answers
23
views
Variable value changes when accessed (edebug "steps" twice on same variable)
As an aid, let me show you a video: https://streamable.com/c2bnko, though it's not needed to follow this question.
I'm going to edebug org-id-alist-to-hash (0:13 in video). First I verify that the ...
0
votes
0
answers
26
views
How can I load a specific language server for a particular file extension?
I'm using emacs29 on linux.
At present, if I load a file with the extension '.tsx', and then do 'M-x lsp-mode' I get an error: 'Symbol’s value as variable is void: lsp-ada-project-file'
I assume that ...
0
votes
1
answer
45
views
Can cape be disabled on a mode basis?
I love using cape in text mode, but I cannot figure out how to stop it from activating in programming modes. Is it possible to either only enable it in certain modes or to disable it in specific modes?...
0
votes
0
answers
48
views
(wrong-type-argument stringp custom-variable-set) Error when setting variable
I'm having an issue setting custom Emacs variables. When I try to set the variable pressing STATE I run into this error: (wrong-type-argument stringp custom-variable-set)
This is the full debugger ...
0
votes
0
answers
38
views
Random warning popping up occasionally when using eshell
I occasionally get this warning while running eshell:
Warning (comp): tramp-loaddefs.el.gz:745:2478: Warning: reference to free variable ‘tramp-remote-path’
and was wondering how to fix it. According ...
0
votes
0
answers
41
views
org-agenda files variable: I'm not sure that the value is set just on init.el
Pressing C-h v I can see the value of this variable.
In my init.el I've commented out this variable assignment: ;;(setq org-agenda-files '( "~/org/*.org")), and restarted Emacs.
But if I ...
0
votes
2
answers
216
views
Font issues using monokai on emacs 27.2 on WINDOWS 10
Hello guys i am experiencing some font issues using the theme monokai on windows 10 and emacs 27.2. Emacs seems to compile everything quite nice even there are not error and warnings. However, when i ...
0
votes
0
answers
53
views
set variable only if its name is already interned
Is there a built-in function/macro of Emacs that sets a variable only if it is already defined?
I mean something like that:
(cl-defmacro set-if-interned (symbol-name value &optional (use-obarray ...
0
votes
0
answers
215
views
open file specified via environment variable
Environment variables that points to specific location are of common occurrence. $HOME, $XDG_CACHE_HOME, %LOCALAPPDATA% and many more. It is pretty convenient to open files (and directories) just by ...
0
votes
0
answers
260
views
Setting variables for async org export
I have this function:
(defun cpm/org-export--file-beamer-handout ()
"Export file content to PDF handout. Handout uses a distinctive quote style."
(interactive)
(let ((org-latex-default-...
0
votes
0
answers
36
views
I want to make an alias to `org-babel-execute:emacs lisp`. the problem is with the space on `emacs lisp`
I'm using org-beamer exporter, and I would like to do the following:
(defalias 'org-babel-execute:emacs-lisp lisp 'org-babel-execute:emacs lisp)
My problem is 'org-babel-execute:emacs lisp has a ...
0
votes
0
answers
71
views
How to store a buffer in a variable so that the value of the variable isn't influenced by the fate of the buffer?
Say I'm in a buffer named init.el and I run
(setq mybuffer (current-buffer))
If I evaluate mybuffer I get #<buffer init.el>. Now I kill this buffer and evaluate mybuffer again. Emacs returns #&...
0
votes
0
answers
95
views
savehist-mode: Lisp error: (void-variable pell-buffer)
I am using GNU Emacs 26.3 in macOS. For (savehist-mode 1) I keep getting following error:
Debugger entered--Lisp error: (void-variable pell-buffer)
signal(void-variable (pell-buffer))
savehist-...
0
votes
0
answers
187
views
How do you avoid pollution of Emacs namespace with "private" variables?
Probably it is misunderstanding of Elisp execution model by I think some variables are only pollute runtime.
For example let's consider read-string argument HISTORY. Probably user don't need to know ...
0
votes
0
answers
51
views
Why won't emacs permanently save my buffer-local var?
For many files I have file-local variables which asked me once if they were safe and I could add them permanently to my "trusted" list, never to be asked again. However, I get asked every ...
0
votes
0
answers
40
views
It is safe to delete set free variables?
For example I have followins line of code (usually I get these code from answers).
(projectile-global-mode)
; smerge-mode
(setq smerge-command-prefix "\C-cv")
(setq undo-tree-show-...
0
votes
0
answers
80
views
How to extract symbols from an elisp buffer?
While I could parse the elisp myself, is there a way to extract symbols from an elisp buffer?
That is, variable names, macros & functions - not part of strings.
0
votes
0
answers
164
views
Error running timer ‘ac-update-greedy’: (void-variable org-link-types)
I very recently updated to Emacs 26.3 and Org 9.2.6, and am getting the above-mentioned error whenever I type "[[" in an org-mode buffer to type a hyperlink. Unsurprisingly, no error after turning off ...
0
votes
0
answers
64
views
helm-comint-input-ring - get error: shell-mode-map
windows 10, emacs 26.1, helm 3.0
I use C-c C-l (comint-dynamic-list-input-ring)
I get something like this:
But I don't like this. I want to use helm-comint-input-ring.
I want to get something like ...
0
votes
0
answers
93
views
Detect variable use in an elisp function at run time
I try to understand a piece of elisp source code, with many nested and conditional functions calls, and I would like to know if a particular variable is used (and, if so, where in the code) at run ...
0
votes
1
answer
207
views
How to install evil-snipe-enable-alternate-f-and-t-behaviors on Spacemacs?
I am trying to install "evil-snipe" with evil-snipe-enable-alternate-f-and-t-behaviors on Spacemacs.
The instruction on https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bvim/evil-snipe are ...