Questions tagged [buffers]

The text you are editing in Emacs resides in an object called a buffer. Each time you visit a file, a buffer is used to hold the file's text. Each time you invoke Dired, a buffer is used to hold the directory listing.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 views

How to prevent org-id-update-id-locations from opening all files?

From what I am experiencing, org-id-update-id-locations opens all files in my org-directory and more that it knows of, and if inlineimages is set even loads the images in that process. This creates a ...
0
votes
1answer
27 views

How to know (in Elisp) what buffer was current when a command is invoked?

I want to give an arbitrary command some buffer-local behavior without advising it. (I can do it by advising, but I want to also be able to do it without advising.) E.g., just looking at some ...
2
votes
1answer
27 views

How to switch windows to specific visible buffer?

Is there a command that allows me to have my cursor switch windows to a specified buffer? Something that looks like (switch-to-specific-window-command "buffer-name")
0
votes
1answer
30 views

How can I sort a list of buffers according to a buffer-local variable?

I am setting a buffer-local variable called my/tab-order in (some) of my buffers. I have written the following function to return a list of buffers only where my/tab-order has been set and is greater ...
0
votes
1answer
45 views

How can I jump beginning of the buffer under import section in python-mode

I am using beginning-of-buffer to the jump beginning of a buffer. Is it possible to achive same behavior but to the first line under the import or from` section in the Python mode. In this example I ...
0
votes
1answer
33 views

How to make buffer order in tab-line persistent?

I'm using global-tab-line-mode, and I would like the order of tabs to persist. Say my buffer/tab order is: | a.el | b.el | c.el | and b.el is the current buffer. If I call (find-file "a.el") ...
1
vote
2answers
36 views

How to ask for confirmation before killing any new modified buffer?

What's the best way to prompt for confirmation before killing any modified buffer, including new buffers created by evil-buffer-new, which creates a buffer without an associated filename. Modified ...
0
votes
2answers
56 views

Filter text of buffer in a grep-like way

I want to filter the text of an emacs buffer, a bit like you can filter text with grep. Sounds simple, but I tried googling it and I only get results from people who want to search in a buffer or to ...
0
votes
0answers
15 views

Close buffer switching to next buffer without leaving or closing the window

I am using the Emacs-terms here. I want to close the current file/buffer. But I do not want to leaver or close the current emacs-window. In the current window there should just appear the next open ...
4
votes
1answer
56 views

Automatically Uniquify Certain Buffers

Emacs does a wonderful job of disambiguating buffer names when I have several files with the same name open. That is, if I open a single main.cpp, the buffer is simply called main.cpp, but if I open ...
0
votes
1answer
55 views

Key chord for org refresh buffer?

Due to my Ubuntu 21.04 Wayland being flaky (I suspect), I can't always get the org menu to drop down properly, and I like to do a "Refresh setup current buffer" often. How could I do this ...
2
votes
1answer
45 views

preview and edit side-by-side, maybe by syncronizing buffers?

Many major modes provide a function to switch between editing and preview rendering a file. I am specifically looking at ps-mode but an answer that applies to others would be nice. I can open the same ...
0
votes
0answers
30 views

How can a buffer be programmatically moved to be the second most recent buffer in the buffer-list, so just behind the current buffer?

Is there a simpler way to do this than manipulating the buffer list itself directly?
0
votes
0answers
14 views

Org-mode agenda custom commands settings not persistent when enable org-agenda-sticky

I want to switch between multiple agenda buffers quickly and have enabled org-agenda-sticky. I set different configs like org-agenda-prefix-format and org-agenda-archives-mode in different custom ...
2
votes
0answers
30 views

global-auto-revert-mode with confirmation first?

I know I can use (global-auto-revert-mode 1) to automatically revert a buffer if the buffer has been changed in another editor. However, when Emacs detects (automatically) that the buffer has changed, ...
1
vote
1answer
42 views

Create a new named buffer with a function

I want to create a keyboard shortcut that will prompt me for a string and then open a new ansi-term buffer with that string as the buffer name. How would I do this?
1
vote
1answer
16 views

How to resolve key-binding conflict between Icicles and `super-save-mode`?

I noticed that if Icicles is loaded then super-save-mode doesn't save a buffer when you switch to another buffer, though switching frames works. Icicles seems so technically advanced, yet there is no ...
0
votes
1answer
21 views

terraform tfls server always asks if restart when edit a .tf file in spacemacs

When I use terraform layer with spacemacs, after operate a .tf file, at the status bar it always notices the message below: Server tfls:3869 exited with status exit(check corresponding stderr buffer ...
1
vote
1answer
58 views

How to quickly cycles through buffers of the same major mode as current one?

I'd like to find a way to cycle through all buffers that use the same major mode as the current buffer. For all major modes, including the special buffers. Use case example: when refactoring code I ...
1
vote
1answer
83 views

Using Shackle to manage WoMan buffers

I would like shackle.el to manage the buffers created by WoMan. Here's the configuration I'm using: (use-package shackle :config (setq shackle-rules '((woman-mode :select t :align below :size 0.5))...
1
vote
2answers
72 views

How to kill all buffers except the buffer current one and *other*?

I use this: (defun kill-other-buffers () "kill all other buffers." (interactive) (mapc 'kill-buffer (delq (current-buffer) (buffer-list)))) I need to add one more buffer
0
votes
0answers
19 views

Split window horizontally when calling switch-to-buffer-other-window the first time

When calling switch-to-buffer-other-window interactive function the first time, the window is split horizontally. I would like the window to split vertically instead of horizontally by default. Is it ...
0
votes
2answers
47 views

Switch to the most recently selected buffer in the current window

I am looking for a command that would switch to the buffer I most recently selected in the current window. The command mode-line-other-buffer will switch to the most recently selected buffer not ...
0
votes
0answers
19 views

'(auto-revert-tail-mode t t) - duplicate content of buffer in git folder

Linux Mint 20 Emacs 27.2 In my init.el I has: '(auto-revert-tail-mode t t) And as result when I open file that in git repository (in folder with .git folder) then content of file is duplicate. When ...
1
vote
1answer
70 views

How to switch to `flycheck-list-errors` buffer/window/minibuffer?

For starters I use Doom Emacs. Here's the scenario: I have a python/perl/js buffer and flycheck-mode activated. Flycheck does its job and tells me that there are some errors that need attention. I go ...
1
vote
1answer
39 views

Switch to most recent buffer in a given mode

I am trying to create a function that switches to the most recent buffer in major mode major-mode. An answer to a related question supplies a function that should require the smallest of tweaks to ...
0
votes
0answers
67 views

How to switch to the compilation buffer automatically after compile?

Once you run compile you get a little buffer with the compilation output *compilation*. But, Emacs does not switch to it automatically and you remain in the file you compiled. How can I automatically ...
1
vote
0answers
38 views

magit status buffer disappears

Magit status used to create a buffer with the buffer name magit: repo name. I recently upgraded Spacemacs and the Magit status buffer started to disappear whenever its window was not visible, and it ...
0
votes
0answers
10 views

Is there a way to set different background colors based on buffer name / file path?

I'd like to have a visual marker that is impossible to miss to show when I am viewing a file under a particular directory. Just having the path in the modeline is not enough to avoid confusion ...
0
votes
0answers
13 views

Ibuffer add an action to be executed on a group of buffers

So, below is what I have so far. It works to the extent of being able to delete single entry in the *Ibuffer* buffer. But, I would like it to work on all files marked with F. There's something I'm ...
0
votes
1answer
26 views

`pop-to-buffer` in other frame if file is already visited

Say I have two frames open. Frame A is visiting a file foo.org. Calling (pop-to-buffer "foo.org") in the other frame (B) opens foo.org in frame B instead of moving the focus to frame A where ...
2
votes
1answer
20 views

Why does `next-error` change my buffer as keyboard macro, but not in lisp code?

My goal is to use grep to find other Org files, use next-error to switch to those files, copy the link to the grep match, then go back and paste that link. It worked for a long time as a macro, but ...
0
votes
0answers
30 views

Remove stale buffers after switching to a different branch

This is the scenario: Switch to a new git branch Open some "new files" in that branch Switch back to an older branch that doesn't have these "new files" I want these opened ...
1
vote
1answer
28 views

Storing some text from a buffer into a variable

What is the "standard" way to store some text obtained from a buffer into a variable? The only way I could think of was to use something along the lines of (let ((beg (point))) (end-of-line) ...
0
votes
1answer
50 views

How to prompt to save the modified buffer before switching?

Vim prompts to save the buffer before switching if no other window is holding it. In other words, it prompts to save the buffer before putting it in background. How can I get the same behavior in ...
3
votes
1answer
719 views

Why do many buffer switching commands in Doom Emacs skip over buffers that aren't visiting files? How can it be prevented?

In Doom Emacs many commands that replace the buffer in the current window with a different buffer will automatically select the most recent buffer that you have had open in a window. But buffers that ...
1
vote
1answer
18 views

How to widen all live buffers?

I'd like to apply e.g. widen to all active buffers, rather than the current one. How can I do this?
1
vote
1answer
41 views

How to distinguish a scroll from a change of buffer in a function called from ‘window-scroll-functions’?

I've written a function that recenters the point each time it makes a long jump and I added it to the hook window-scroll-functions. The length of the jump is determined by comparing the return value ...
0
votes
0answers
54 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 #&...
1
vote
2answers
45 views

How to make the current window display the buffer it was displaying before the current one?

For example, imagine I have two windows and three buffers. Both windows are displaying buffer 1 and I do the following, in window 1, switch to buffer 2; in window 2, switch to buffer 3, then to ...
1
vote
2answers
36 views

How can I display a buffer in a whole frame, removing the rest in the act?

Basically that. I need a function that would do this when I open a buffer in a frame with many other windows. Maybe Emacs has one by default.
0
votes
0answers
135 views

How do I split a side window?

I am using the org-roam package, which, while great, uses up the entire side window of my main emacs frame. I would like to use some of that side window to display something else, ideally an eaf ...
0
votes
0answers
30 views

create orgmode buffer without name in specific directory

I want to create a function that creates a new orgmode buffer where I could type and at the end save in a predefined directory. If this is not possible, then create the buffer with a name in a ...
2
votes
1answer
65 views

What techniques or functions can help manage hundreds of buffers? [duplicate]

After several months of work, my Emacs easily accumulates 400 or 500 buffers. This makes restoring from desktop-mode irritatingly slow. I'd love to be able to delete buffers in bulk, ideally from ...
1
vote
1answer
60 views

How do I make C-x b (switch-to-buffer) ignore some buffers?

I want C-x b (i.e. switch-to-buffer) to ignore some buffers. For example, I want to ignore *Ibuffer*. In other words, when I press C-x b, I should not see Switch to buffer (default *Ibuffer*): . *...
0
votes
1answer
97 views

How can I evaluate a Python buffer, switch to it, see its results, then switch back?

Suppose, we have a buffer with Python code in it. I want to evaluate it, switch to Python buffer and see the results. Then easily switch back to code buffer. I tried the following: (defun my-python-...
1
vote
0answers
18 views

How to show all split window titles in the X11 window title?

If I split an Emacs frame (one X11 window) into multiple Emacs windows (with C-x 2 and C-x 3) and open different Emacs buffers in different Emacs windows, Emacs frame title (X11 window title) displays ...
0
votes
1answer
64 views

Remove zombie buffers from recentf

I want to get rid of invalid recentf entries, that is buffers that no longer exist on disk, because I renamed or just plain deleted them ; I just did a M-x recentf-cleanup and apparently lost all my ...
4
votes
1answer
133 views

How to make "M-x man" buffers use all the available width of the screen?

The problem When opening man in a terminal emulator, man tries to use as much width as possible. However, when opening man inside emacs, man doesn't use all the width (even after Man-update-manpage ...
2
votes
3answers
376 views

Toggle between most recent buffers

I'm using doom Emacs in case that's relevant. I want a key binding to go back to the most recently used buffer in the window. When I'm in that buffer and hit the key binding, it should go back to the ...

1
2 3 4 5
10