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.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 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
1answer
23 views

How to use header-args variables to fill cell values of a table

I have an org-mode file as such: * Header level 1 :header-args: :var filename="somefile.csv" ** Header level 2 :header-args: :var foo="bar" #+begin_src emacs-lisp foo #+end_src #+...
1
vote
1answer
27 views

Is there a tagged union/sum type in elisp? If not, what to use instead?

In many programming languages, if one wants a variable that can take a discrete number of values, one has the capacity to define the permissible values in advance, using something like an enum. Does ...
0
votes
0answers
15 views

Symbol's value as variable is void: org-format-latex-options [duplicate]

I am trying to set :scale 2.0 in org-format-latex-options with the follows line in my .emacs file: (plist-put org-format-latex-options :scale 2.0) However I get the error: Symbol's value as variable ...
2
votes
1answer
29 views

storing string in variable fails to work in `early-init.el`

Putting the following code in my early-init.el causes my emacs not to startup. (require 'cl-lib) (defvar void-initial-frame-font (cl-find-if (lambda (font) (find-font (font-spec :name font))) ...
0
votes
0answers
36 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 ...
2
votes
0answers
37 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.
0
votes
0answers
15 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 ...
1
vote
1answer
27 views

How to add more default face highlight colors

Using (highlight-symbol-at-point) at some point the highlight start repeating colors. I find the variable that holds the default face highlight color values in Emacs is: hi-lock-face-defaults It ...
1
vote
1answer
48 views

Modify value of a variable by applying a function to it?

Suppose one of the customizable variables in a package is var, and its default value is a list, list. I understand I can change the value of var to mylist using (setq var mylist) in my init.el. ...
0
votes
1answer
22 views

Can't save safe variables for further

When I start Emacs it asks me if I want to allow "unsafe" variables which I agree and press '!' to save them for the future. Despite that, it still keeps asking me about it on every launch. ...
0
votes
2answers
73 views

Change $PATH once emacs is running

In my shell (Bash), I can switch among several LaTeX distros setting the $PATH variable. E.g.: export PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH or export PATH=/usr/local/texlive/2018/bin/...
0
votes
0answers
71 views

org-capture-template “:created” property

Studying the variable org-capture-template I found several configurations where a certain :created t property is used. One example is here In my help buffer (help:org-capture-templates) I could not ...
0
votes
0answers
24 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-...
2
votes
1answer
862 views

Symbol’s function definition is void

I am trying to make an interactive toggle in emacs 27.0.90 When I eval-region no warnings or errors are shown. However, when I do (helm/toggle-frame) in ielm it throws Symbol’s function definition is ...
1
vote
2answers
324 views

Is there a way to spread a list like in Typescript or Golang?

I have a variable with some common values between dap-mode debug templates and I want to use that variable along with other cons elements for :environment-variable in languages like Golang or ...
0
votes
3answers
82 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
1answer
24 views

How to change a variable value in the current buffer?

I spent a long time looking for this and kept getting reference to M-x customize. But, that didn't give me access to certain variables like comment-start. I couldn't access comment-start with M-x ...
0
votes
1answer
26 views

Add element to org-refile-targets

I am keeping a common init.el for work and private on separate machines. So dependent on my machine I have common settings and machine dependent settings. How do I get to add an element to the org-...
0
votes
0answers
35 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
1answer
40 views

Wrong type argument: symbolp, 10

I would like create function that ask me how length I want the Pomodoro but it say wrong type argument. (defun changePomoLength () (interactive) (set-variable org-pomodoro-length (read-string "...
2
votes
1answer
26 views

Giving faces compliant names

The description of defface in (info "(elisp) Defining Faces") says that the name of a face should not end in -face. But most faces declared in font-lock.el do use the suffix -face. How does this fit ...
2
votes
1answer
122 views

How can I get the effect of buffer-local symbol plist property values?

Does Emacs have a way to set buffer-local properties on symbols? It's well-known that there are buffer-local variables. But a property belongs to a symbol, not to a variable. Hence, if I have ...
0
votes
1answer
49 views

How to set a variable that matches different type of strings?

I have these strings: First Type: arXiv:1234.56789 arXiv:1234.56789v1 Second type: hep-th/123456789 hep-th.AB/12345689 hep-th/123456789v1 hep-th.AB/12345689 Belong to the second type even strings ...
0
votes
2answers
41 views

Make/unmake a variable globally buffer-local depending on another variable

I have a package with the variable my-package--my-var that needs to be buffer-local when my-package-buffer-only is t but global if my-package-buffer-only is nil. This is what I have so far: (...
6
votes
1answer
157 views

What's really behind an assignment in Emacs lisp?

[Warning : these are noob questions.] I'm a beginner in Emacs Lisp and I would like to be sure that I understand well what I'm really doing when I set a value to a variable with setq or let. Here is ...
1
vote
1answer
55 views

Get value of a variable from another session in org-mode

How to share variables' values in org-mode between different sessions? Simple example: in session one I create _gpg_tmpdir #+name: make_temporary_directories #+begin_src bash :session *one* ...
1
vote
1answer
99 views

Keep ivy-initial-inputs-alist nil after counsel loaded

I want to keep the alist ivy-initial-inputs-alist nil after ivy and counsel are loaded. Therefore, I have the following configuration: (use-package ivy :ensure t :config ;; some keybindings ...
1
vote
1answer
32 views

Evaluate allows for combinations whose operators are compound expressions

I find the amazing power of scheme in sicp Exercise 1.4. Observe that our model of evaluation allows for combinations whose operators are compound expressions. Use this observation to describe ...
1
vote
0answers
47 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
1answer
84 views

Regular expression gives different results as variable and as literal

In the Emacs *scratch* buffer, I get different results when I use the same regular expression as a variable compared to a literal: (setq splitter-string "9:20") "9:20" (string-match "[0-9]?[0-9]:[0-...
0
votes
1answer
34 views

eval-expression on (setq helm-debug t) does not change describe-variable output

I'm running this version of Emacs: GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.11) of 2019-09-23, modified by Debian Installed on Ubuntu 19.10 via apt, and not built from source. ...
0
votes
0answers
97 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 ...
2
votes
2answers
99 views

Treat all numbers as floats

Is there a way to get elisp to automatically treat all numeric variables as floating points without having to repeatedly use the float function? For example to a division function that outputs the "...
2
votes
1answer
205 views

Check whether buffer is in org-mode

I want to programmatically check whether the current buffer is in org mode. I know that major modes should usually define the variable <modename>-mode, i.e., org-mode should be a defined ...
0
votes
1answer
52 views

Is variable assignment an atomic operation in elisp?

I have a situation in a mode I'm writing that saves a portion of the output of a long-running asynchronous process to a variable at intermittent intervals. I need to access this data periodically. My ...
0
votes
2answers
101 views

Unusual behavior when overriding `calculate-lisp-indent'

I've modified calculate-lisp-indent as a better solution to the indentation questions here, here and here. By "modified" I mean I overrode the function with advice. After doing this when I restarted ...
0
votes
1answer
105 views

How to check whether an optional param was input?

I have a command with an optional argument whose value is a number. I need: If no input argument then use default value (1000) else use input arg. (random t) (defun insert-random-number-at-point(&...
3
votes
3answers
474 views

How to modify a string without altering its text properties

If I propertize a string and save it to a variable, how can I change the string within that variable without altering its text properties? For example: (setq myvar (propertize "testing" ...
6
votes
1answer
144 views

Surprisingly persistent local variable

A local variable keeps coming back, and I know not whence. In a certain buffer, TeX-command-extra-options is "--synctex=1", even after I have removed this from my init.el and restarted Emacs. I tried ...
2
votes
2answers
146 views

Accessing the global value of a locally altered variable

Is it possible to access the global value of a variable that has been changed locally? (setq foo 2) (let ((foo 3)) ;; can I access the original value here? )
5
votes
1answer
63 views

Can a symbol have a function, variable, and class?

Q: can one symbol refer to a function, a variable, and a class? Elisp is a Lisp-2 in which a symbol can have separate function and variable values. So, for example, I can define the following ...
0
votes
1answer
188 views

Wrong type argument: symbolp, possible mismatched parenteses in .spacemacs

I am trying to apply a fix to make it easier to change todo status in org mode. The code is the following: '( (org :variables org-want-todo-bindings t) ) from https://github.com/syl20bnr/...
1
vote
1answer
27 views

How best to define nullable integer customizable variables?

I would like to define a variable using defcustom so that it can be customized by users of an emacs package. The variable is an integer (let's call it spam-override), and its function is to override ...
2
votes
1answer
338 views

Find variable definition and uses in emacs-lisp files?

Is it possible to find/jump/point to where an Emacs LISP variable is used/defined within the current file? I know about find-variable, describe-variable and find-symbol, but those all seem to work ...
0
votes
0answers
18 views

Definition and usage of colors [duplicate]

I'm trying to define a color set (from material color) in order to be able to easily change the set I want to use. I think I've managed to define them but then, I'm not able to use them properly. I ...
0
votes
1answer
159 views

defun removes function in spacemacs config

I re-defined the function org-archive-subtree to call another function as described in the function below. I did this in spacemacs/user-config, now I can't call org-archive-subtree and C-h v (describe ...
2
votes
1answer
453 views

Setq doesn't work [duplicate]

Glad that the title got your attention :D I have this little snippet that's driving me crazy: (defvar cache '(nil . nil)) (defun init-cache () (setq cache '(nil . nil))) (defun save (value) (...
1
vote
1answer
120 views

Why does :command argument of make-process not work when string passed as a variable? [duplicate]

This works fine: (make-process :name "my-proc2" :buffer " *my-proc2*" :command '("sh" "-c" "echo \"hi\"\nsleep 10\necho \"there\"") :connection-type 'pipe :...
0
votes
0answers
40 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 ...