Questions tagged [eval-expression]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
2answers
90 views

How to replace the expression with evaluation result using Elisp interpreter?

When I do bulk calculations in a scratch buffer, it is annoying to have to delete the actual expressions after they are evaluated (I want them to be deleted on evaluation). Example: (+ 2 2) ...
6
votes
2answers
550 views

Quickly Evaluate Infix Math Expression?

Is there a way to highlight and quickly evaluate a simple math expression without using elisp notation? For example, we can already evaluate the elisp expression (+ 1 1) in the following text snippet ...
7
votes
4answers
1k views

Result of arithmetic evaluation in buffer, not echo area

Windows 10, Emacs 25.1 I want to do some arithmetic operation I do this: The result is in the echo area, but I want the result to be in cursor place in the buffer. Something like this: How do I do ...
3
votes
1answer
175 views

How to direct `M-:`'s value to the current buffer?

According to the Emacs manual, M-: evaluates an Emacs Lisp expression and prints the value in the echo area. How can I direct the value to the current buffer instead?
4
votes
2answers
412 views

Insert a string from eval-expression without the quotes

I want to use C-u M-:, then (format-time-string "%m/%d/%Y") to insert a customized date string. But it is inserted into the current buffer with double quotes. Any trick to remove these quotes?
1
vote
1answer
702 views

emacsclient --eval command to bring a background emacs window to front

Suppose I already opened a emacs but its in the background. So, is there an emacsclient eval option that I can type in the shell like: emacsclient --eval "(bring-existing-emacs-window-to-front)" To ...
5
votes
1answer
1k views

emacs --eval of multiple functions on command line

How do I evaluate multiple functions simultaneously using emacs --eval on command line? For example I want to combine the followings in a single command: emacs --eval "(toggle-frame-maximized)" emacs ...
1
vote
1answer
61 views

Weird (point) and (point-max) values in IELM

When I open IELM and type in (point) or (point-max) in the interpreter, it always returns 710 (#o1306, #x2c6, ?ˆ) and 64292 (#o175444, #xfb24, ?ﬤ) respectively. If I eval these functions via eval-...
4
votes
1answer
624 views

From an external script, open file and run some simple expression whether emacs already running or not

Context / initial need (works fine) I wrote and use a script that generates a file and uses emacsclient to edit it in an existing or new instance of emacs, in a new window. Similar to Set up Emacs ...
1
vote
4answers
1k views

How do I eval a multiple line elisp expression inside the current buffer?

I am trying to delete all HTML style comments from my current buffer. I found a solution in "Function to delete all comments from a buffer, without moving them to kill ring", but since it is more ...
5
votes
0answers
143 views

Stopping pdf-tools from resetting to the beginning of an open PDF when I eval-buffer my config file

I'm using pdf-tools to read PDFs in Emacs, and am pretty happy so far. However, I've found when I modify, and then eval-buffer my configuration file, the PDFs I opened earlier with pdf-tools get put ...
5
votes
1answer
281 views

What does “(#o4, #x4, ?\C-d)” mean here?

I use m-x eval-expression to evaluate a very simple lisp code: ( + 1 3) And I got my result like this What does the symbols (#o4, #x4, ?\C-d) mean in this context?
1
vote
1answer
38 views

How to make icicle-pp-eval-expression use eldoc like eval-expression?

In recent Emacs versions, eval-expression makes use of global-eldoc-mode in a quite intelligent way, using the modeline to display hints. However, icicle-pp-eval-expression, which is Icicles' variant ...
1
vote
1answer
72 views

both keywordp and macrop then eval from a functionp

'Hope it won't bother my using defmacros named in the style of keywords (colon-prefixed, e.g., :set-this or :get-that): it apparently tricks ELisp from otherwise requiring quoted symbols (') or ...
7
votes
2answers
987 views

Saving open file list and buffer command history in between sessions

I've discovered desktop-save-mode which allows Emacs to be closed and when it reopens, it appears with the same files that were open before. I want to take this a bit further and I was wondering if I ...
2
votes
1answer
72 views

Input-methods in the insert eval expressions

I can activate the input method french-azerty by M-x set-input-method RET french-azerty. Then by a qwerty keyboard I can type like an azerty one. Thus typying q in the buffer gives a. But when I do M-:...
6
votes
2answers
185 views

Is there a variable to toggle Emacs 24.4 elisp return “noise”?

In Emacs 24.4, every time I evaluate a form in ielm or using C-x C-e it prints a lot of extraneous output that while useful, sometimes gets in the way. As an example, (+ 1 1) ;=> 2 (#o2, #x2, ?\C-...