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.

35 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
5 votes
0 answers

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 ...
Robin Tournemenne's user avatar
4 votes
0 answers

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 ...
shynur's user avatar
  • 5,174
4 votes
1 answer

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:/...
Leu_Grady's user avatar
  • 2,460
2 votes
0 answers

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 ...
cidra's user avatar
  • 139
2 votes
0 answers

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.
izkon's user avatar
  • 1,858
1 vote
0 answers

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 ...
HappyFace's user avatar
  • 830
1 vote
0 answers

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 ...
Balto's user avatar
  • 11
1 vote
0 answers

.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' ....
stigma's user avatar
  • 113
1 vote
1 answer

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?
John DeBord's user avatar
1 vote
0 answers

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 ...
Webdev Tory's user avatar
1 vote
3 answers

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-...
Caleb Jay's user avatar
  • 289
1 vote
0 answers

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-...
Mittenchops's user avatar
1 vote
0 answers

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 ...
mmw's user avatar
  • 111
1 vote
0 answers

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 ....
shackra's user avatar
  • 2,772
0 votes
0 answers

Better Static Analysis

What options are there for enhancing static analysis of emacs lisp code? Either via builtin flags or third party packages? I'm mainly referring to unused packages/modules and requires. I'm aware of ...
Nordlöw's user avatar
  • 497
0 votes
0 answers

(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 ...
Enrico Pirani's user avatar
0 votes
0 answers

Emacs Mode for Reddit, (void-variable hierarchy--make)

Trying to add md4rd, using this: (use-package md4rd :ensure t :config (add-hook 'md4rd-mode-hook 'md4rd-indent-all-the-lines) (setq md4rd-subs-active '(emacs lisp+Common_Lisp prolog clojure)) ...
Jason Hunter's user avatar
0 votes
0 answers

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 ...
user129393192's user avatar
0 votes
0 answers

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 ...
RenatoP's user avatar
  • 121
0 votes
2 answers

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 ...
baezacaljo's user avatar
0 votes
0 answers

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 ...
Tobias's user avatar
  • 33.1k
0 votes
0 answers

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 ...
ivan golotin's user avatar
0 votes
0 answers

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-...
mclear's user avatar
  • 1,535
0 votes
0 answers

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 ...
BuddhiLW's user avatar
  • 277
0 votes
0 answers

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 #&...
Arch Stanton's user avatar
  • 1,627
0 votes
0 answers

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-...
alper's user avatar
  • 1,350
0 votes
0 answers

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 ...
gavenkoa's user avatar
  • 3,412
0 votes
0 answers

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 ...
Webdev Tory's user avatar
0 votes
0 answers

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-...
alper's user avatar
  • 1,350
0 votes
0 answers

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

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 ...
granti128's user avatar
0 votes
0 answers

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 ...
a_subscriber's user avatar
  • 4,012
0 votes
0 answers

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 ...
Lgen's user avatar
  • 1,410
0 votes
1 answer

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 are ...
wolfv's user avatar
  • 1,393