Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
1 vote
0 answers
9 views

How to switch to a buffer from terminal with a unique partial name

I have a buffer with the name very-long-name-xyz-etc. This buffer is the only buffer whose name contains xyz. From terminal I can switch to that buffer using the following emacsclientw -cna runemacs --...
0 votes
0 answers
20 views

Is there workaround to mirror a buffer to a file (similar to indirect buffer)?

I am familiar with indirect buffer capability of emacs. From doc string: An indirect buffer shares the text of some other buffer, which is called the base buffer of the indirect buffer. In some ways ...
1 vote
1 answer
44 views

Strange issue with dired-subtree

This is my simple config: (use-package dired-subtree :ensure t :bind (:map dired-mode-map ("<tab>" . dired-subtree-toggle))) The first time the ...
16 votes
3 answers
2k views

Why is (point-min) much more popular than 1?

I searched accross all Emacs Lisp files in Emacs Git repo, and found (goto-char (point-min)) occurs 3621 times and (goto-char 1) occurs 31 times. Personally, I see lots of (point-min) but none 1, even ...
0 votes
0 answers
19 views

Why is clone-indirect-buffer-other-window not a clone?

I find that a clone created this way is not including the beginning of the buffer, probably because the buffer is large? Is there some setting that clones the entire buffer, without leaving parts of ...
1 vote
1 answer
266 views

Switching to temporary buffer

This function makes a temporary buffer, inserting text stored in msg. Hitting q will quit the temporary buffer. My problem is that The cursor does not move to the temporary buffer as is done with *...
0 votes
1 answer
51 views

Compiling .tex files seem to be tied to a username?

I'm working on multiple computers and compiling LaTeX document through AUCTeX. I've set up Evince as my external viewer and the synctex and back referencing work perfectly... ...as long as I've ...
6 votes
1 answer
469 views

How do i run zone (zone-when-idle) for all windows?

Zone Mode is awesome But when I run it using M-x zone, or by setting zone-when-idle variable it starts animating only one(selected) window. Is there any way to run it for all windows?
2 votes
2 answers
70 views

Colourize buffer names differently for the files located in different directories

I am working upon 2 projects that have similar structure. And sometimes occasionally modify a file in the wrong buffer. So I desided to set different colours for the files in the different projects: (...
1 vote
1 answer
212 views

Visual Glitch whenever loading emacs

I am running emacs on WSL, and whenever I load emacs I get the following screen: It goes away for a half second whenever I click on it, but then it comes back. Very new to this so am unsure what is ...
0 votes
2 answers
141 views

Include name in buffer name and file name

Currently I am using the function workbench. The function workbench-named introduces a name, which I want to include in buffer and file-name. Currently only workbench-prefix in being included with ...
1 vote
1 answer
29 views

Split the emacs screen into 2 windows side-by-side, with a different buffer in each window?

I'm trying to split the Emacs screen into two windows side-by-side (for example, the way that split-window-right does it), but I want a different buffer shown in each side. For example ... (get-buffer-...
0 votes
1 answer
37 views

How to prompt for a virtual buffer (recently killed file buffer) using Ido completion?

When ido-use-virtual-buffers is set to t, ido-switch-buffer shows, after the list of live buffers, a list of killed file buffers in chronological order, last killed first. Those are what Ido calls ...
2 votes
1 answer
85 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
1 answer
172 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 ...
0 votes
1 answer
48 views

How to enlarge the properties header buffer in image-dired

Some of my images contain a large comment (> 1000 chars). Yet the image-dired properties header shows only one line (count,size,tags,comment). How can I see the complete comment (alongside all tags)...
1 vote
1 answer
41 views

Opening multiple files: how to change default buffer order

When I run $ emacs file1 file2 file3 file4 in a Unix shell, this is the result (using C-x Left and C-x Right to switch buffers): file4 file3 file1 file2 *BufferList* *scratch* The starting buffer is ...
1 vote
1 answer
208 views

How to prevent a file show up for a second when emacsclient starts?

I am using emacs-daemon. When every I re-start my daemon and do C-x C-b my Buffer List seems always full. Later, when I start my emacsclient for a seconds(like a fast flash) it shows a file that ...
1 vote
1 answer
29 views

Make C-x C-b go back to last buffer even if open in another frame

If I have only one emacs frame, and I open files A, B, C, and then press C-x b and switch to A, then press again and switch to B, from then on every time I press C-x b ENTER, I will alternate between ...
10 votes
3 answers
2k views

How to persistently move the cursor in a buffer other than the current one?

NB: The post How to move point to the end of another buffer, using `with-current-buffer` and `goto-char`? presumably asks the same question as this one, but the answers given to it do not readily ...
0 votes
1 answer
33 views

What determines which buffer is current after kill-buffer?

Since moving to Doom emacs and Centaur tabs, I have an issue I can't seem to solve. If I have say two tabs/buffers open in the order A-B and am visiting A. I open another buffer C and am visiting it. ...
1 vote
3 answers
5k views

Removing buffers from buffer list

This is my first day on Emacs, and I am really liking it so far, but I cannot seem to be able to work correctly with buffers. I am trying to kill specific buffers with C-x k, however upon checking the ...
6 votes
1 answer
2k views

How to get a list of all the buffers in elisp?

I am trying to get a list of buffers through elisp. So I created the following function: (mapcar (function buffer-name) (buffer-list)) This works when I do something like: (minibuffer-message (mapcar ...
1 vote
1 answer
61 views

Re-visit a file whose buffer I just killed [duplicate]

I've not found any straightforward way to re-visit a file whose buffer I just killed. Sort of like undoing the killing of the buffer. I thought about getting the file's path from Ido's virtual buffers ...
1 vote
1 answer
74 views

Rename another buffer

There are buffers that prevent you from being able to execute interactive commands (by overriding the default M-x binding). For example, *ansi-term* buffer would do this. (I know you can do C-cM-x to ...
2 votes
1 answer
99 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
1 answer
75 views

How to make gdb show locals buffer in a different window?

Using gdb in emacs, gdb shows the source code to the right of the gdb prompt. According to the documentation, I can do M-x gdb-display-locals-buffer which displays the local variables. However, when I ...
0 votes
1 answer
90 views

Function to print list to specific buffers

I am using the following function to print a list to a specific buffer. For instance, I can use (print-list greek "*Messages*") to print in the *Messages* buffer. So I can print to a ...
1 vote
2 answers
140 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
1 answer
41 views

Is it possible to simultaneously scroll horizontaly two windows?

Emacs 27.1 If I want to simultaneously scroll vertically two windows I use M-x scroll-all-mode OK. But this scrolls windows vertically. But I need to scroll both windows horizontally. Is it possible?
1 vote
1 answer
159 views

window-configuration-change-hook false positives from desktop-mode

I'm trying to use window-configuration-change-hook in a package to perform some action when a buffer becomes visible for the first time. It works, however when starting Emacs, desktop-mode calls ...
0 votes
0 answers
10 views

send commands to other buffers which can be EXWM

How can I send commands to other buffers which are EXWM, say, URxvt? This works for generic emacs buffers: (with-current-buffer "local_machine.org" (insert "Hello")) I want to ...
4 votes
1 answer
89 views

Separate `*Help*` buffers for each topic

The built-in help functions like describe-{function,variable,face,...} all reuse one *Help* buffer. I would like it to instead create separate help buffers for each Help topic I visit, with clear and ...
2 votes
2 answers
52 views

Customizing name of "Help" buffer opening by package-menu-describe-package

Hitting RET with point on a package name in the *Packages* buffer opens a help buffer, named "Help", describing the package. RET here invokes package-menu-describe-package which in turn calls describe-...
1 vote
1 answer
106 views

How can I automatically swap frame buffers if the buffer is already open?

I've seen the https://www.emacswiki.org/emacs/buffer-move.el script, but I'm trying to something a bit different. Suppose I have a frame with a buffer from file A.h in it and A.cpp in another frame ...
1 vote
1 answer
48 views

What's an easy way to view a copy of a text buffer as a hexl buffer

I sometimes want to look at the hexl-mode view of a text file buffer in one window and in another window I want to keep the original text view. What's an easy procedure to do so? -- Due to the fact ...
0 votes
1 answer
20 views

Update content of a buffer in side window when a custom mode is on [duplicate]

I have following code which is supposed to clear existing content in a buffer and write new one. (defun display-file-dir (path) (text-mode) (if buffer-read-only (read-only-mode)) (erase-...
0 votes
1 answer
517 views

Why set-window-dedicated-p doesn't work with certain buffers?

I use emacs for latex, with pdf-tools. My layout is always a window with PDFView buffer on the right, any other buffer on the left. I always want the right window that cannot be touched by ...
1 vote
1 answer
54 views

Burying a buffer shows an already displayed buffer

ISTR that quit-window and bury-buffer made sure that the replacement/newly displayed buffer is not shown in any other window (at least that was my intention when I wrote quit-window many years ago). ...
0 votes
0 answers
34 views

How do I pass a variable from a calling buffer to a called buffer?

The process of tangling in org involves, according to https://orgmode.org/manual/Extracting-Source-Code.html, a calling buffer and a called buffer, each of which have their own hooks: org-babel-pre-...
0 votes
0 answers
65 views

Doom: Return to previous buffer after kill-buffer?

Recently switched to doom emacs and one behaviour I can't seem to get back is this: In buffer A, open new file in buffer B kill-buffer B (Cx-k) Back in buffer A Currently, after killing buffer B, it ...
1 vote
2 answers
388 views

Whitespace mode settings on per major mode basis

When I open the Linux Kernel code, my default indentation conflicts with the desired formatting of the Kernel. I use Emacs Prelude, so I added the settings from this link to my c-mode-common-hook. I ...
2 votes
2 answers
210 views

How to make buffer recognize file moved?

Here's a simple use case: I open bar/foo/file in a buffer and I'm working. In eshell, I do mv bar/foo/file bar/baz/foo/file. Now emacs can no longer recognize where to save and doesn't save it ...
37 votes
3 answers
8k views

How can I see the changes made to a modified buffer since the last save?

Given a modified buffer, how can I diff it with the file backing it on disk to see what I've changed?
2 votes
2 answers
611 views

Rename org buffers to org's +TITLE instead of filename

I have hundreds of org files in a single directory that I use as a personal knowledge base and use deft to quickly find and open them. Each file is automatically named based on the current time (yyyy-...
0 votes
0 answers
10 views

Emacs (maybe helm?) prefers buffers that aren't visible - how to change this?

When switching buffers, emacs seems to prefer buffers that aren't already visible. For example, normally when I'm editing and switch to another file, when I C-x b, the buffer I was last in is at the ...
1 vote
0 answers
68 views

How to keep buffers when closing only Emacs client?

I use Emacs 29.1. When I open Emacsclient, I do it with the following command: emacsclient -a -c --create-frame --no-wait This is bounded to a key combination to start the Emacsclient. To kill a ...
0 votes
1 answer
84 views

Emacs sometimes open window with warnings, how to prevent that? (see screenshot)

When I open a buffer, sometimes the window is getting split and another buffer opens up at side with a warning or message inside it. This is new behaviour. I am not been able to track consistently ...
0 votes
0 answers
32 views

How to select buffers for deletion [duplicate]

How can I delete multiple buffers from a buffer list? I can select the ones I want to delete using C-s, but can't figure if I can mark them for subsequent deletion. Is there a way?
0 votes
0 answers
16 views

How to save a new buffer to a new file with helm?

(It's likely a dumb question as I'm new to emacs buffer saving commands.) After creating and editing a new buffer (with a temp name "untitled"), I would like to save it to a new file (not ...

1
2 3 4 5
12