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
0 votes
0 answers
19 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 ...
Name's user avatar
  • 7,871
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 ...
Jason Hunter's user avatar
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-...
HippoMan's user avatar
  • 616
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)...
jjk's user avatar
  • 744
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 ...
Ness's user avatar
  • 177
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 ...
Joseph Garvin's user avatar
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 ...
Arch Stanton's user avatar
  • 1,667
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 ...
Arch Stanton's user avatar
  • 1,667
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?
a_subscriber's user avatar
  • 4,124
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 ...
Alexander Mirnyy's user avatar
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. ...
PLK's user avatar
  • 111
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 ...
mtraceur's user avatar
  • 356
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 ...
halloleo's user avatar
  • 1,345
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-...
Suren Shrestha's user avatar
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). ...
sds's user avatar
  • 6,124
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-...
shintuku's user avatar
  • 121
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 ...
PLK's user avatar
  • 111
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 ...
John Graham's user avatar
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 ...
Dogalon Bruno's user avatar
1 vote
0 answers
67 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 ...
ReneFroger's user avatar
  • 3,880
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 ...
ReneFroger's user avatar
  • 3,880
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?
balanga's user avatar
  • 135
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 ...
AhLeung's user avatar
  • 1,083
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 ...
Peter Petigru's user avatar
0 votes
2 answers
37 views

How to troubleshoot: `other-buffer` suddenly begins to ignore some buffers

With increasing frequency, my Emacs session's function other-buffer begins to malfunction. Specifically, at some point, and for no reason I can discern, other-buffer stops "seeing" some ...
kjo's user avatar
  • 3,247
0 votes
1 answer
15 views

shuffling between a set of open source files

What would be the easiest way of shuffling between a few source files, usually of the same type, say .py or .js. C-x C-b and selecting gets a little tedious once your open buffers list grows. I ...
Ajaneesh Rajashekharaiah's user avatar
1 vote
1 answer
54 views

How to create separate buffers from the ouput of grep?

Is there any way to create separate buffers for each file grep locates when running something like grep 'blabla' *.c
balanga's user avatar
  • 135
0 votes
1 answer
94 views

why does emacs open an empty buffer named "BLANK" on startup?

When I start emacs, it opens an empty buffer named BLANK. I have no idea where this comes from and would like to not have it there, since there's nothing in it and it clutters up the buffer list. I do ...
Dan Drake's user avatar
  • 625
0 votes
0 answers
15 views

After running bs-cycle-next, the changed value of bs-current-configuration goes back to being files

The default value of bs-current-configuration is "files". That being one of the elements in bs-configurations. I have the following configuration(s) in debug.el and run emacs -Q -l debug.el: ...
scribe's user avatar
  • 1,035
0 votes
0 answers
45 views

Using org-goto across multiple files

Is there a way to use org-goto with opened buffer files (and maybe agenda files), just like org-refile does through org-refile-targets? I have configured org-refile to show the options to choose with ...
NandKN's user avatar
  • 73
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 ...
user129393192's user avatar
1 vote
1 answer
40 views

Cannot switch to buffer

When I hit C-x b to switch to buffer I receive: Symbol's function definition is void: help--symbol-class. I'm on Linux with Emacs 27.1 (build 1 - GTK 3.24.24)
mcp's user avatar
  • 67
0 votes
1 answer
34 views

Prevent temporary buffer from overwriting main buffer

I am encountering a strange behavior where any temporary buffer overwrites the main buffer content. Using org time-stamp for example; the expected behavior is: Invoke org time-stamp from within an ...
David Cooper's user avatar
1 vote
2 answers
109 views

How to enable `fill-paragraph` command to be executed every time ChatGPT replies via gptel package?

I have been using this cool Emacs package called gptel. However, it is annoying for me how lengthy the ChatGPT answers look on the screen. When I want to improve readability, I keep executing the fill-...
Pedro Delfino's user avatar
2 votes
2 answers
209 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 ...
user129393192's user avatar
-2 votes
1 answer
75 views

Changing the major mode of a named buffer

How can I construct a function that changes the major mode of a named buffer ? (defun change-buffer-mode (mode buffer) )
Dilna's user avatar
  • 1
0 votes
1 answer
30 views

Robust way to write text to a buffer

What would be a robust way to write to a buffer. The buffer might not exist, and there might be a need to specify the buffer rather than assuming that one is writing in the current buffer (although ...
Dilna's user avatar
  • 1
0 votes
0 answers
23 views

Printed in named buffer with text matching pattern getting coloured

I have the following function that prints some text in the *Messages* buffer. I want to change this so the text gets printed to a named buffer instead. (defconst tika-outlshow-details " Show-...
Dilna's user avatar
  • 1
0 votes
2 answers
38 views

kill-buffer ERROR: wrong-type-argument - can't programatically kill buffers

I'm trying to kill buffers after selecting them from buffer-list: (kill-buffer (cl-remove-if-not (lambda (b) (and (string-match-p "ein" (buffer-...
Daniel Krajnik's user avatar
0 votes
2 answers
29 views

How do you filter buffer list in a script? [duplicate]

Let's say there are three buffers: "buffer1.py" "buffer2.rb" "buffer3.ipynb" How do you filter/glob that list to select a specific buffer aka (switch-to-buffer "*....
Daniel Krajnik's user avatar
1 vote
1 answer
33 views

Trouble maintaining buffer position when using re-builder

I am having trouble maintaining my current location in a document while running the re-builder command in Emacs. In a long document the buffer moves to the top of the document whenever I run the re-...
Edman's user avatar
  • 1,229
4 votes
1 answer
145 views

Buffer Name Surrounded by Asterisks (*)

For example, *scratch*, *Messages*. Is this some kind of convention? If so, what does it mean?
shynur's user avatar
  • 5,318
0 votes
0 answers
23 views

Lexical-binding and multiple buffers [duplicate]

I want to use a function that is taking advantage of lexical-binding: (defun comp (funcs) "Function composition" (let (f0 ff) (if (not funcs) (lambda (x &rest args) ...
dmw64's user avatar
  • 187
0 votes
0 answers
90 views

Make the most recently visited buffer on top of the Buffers list with switch-to-buffer under helm

When I do C-x b under helm the topmost buffer in the list is the most recently visited buffer except if another window is currently visiting that buffer. How can I make the topmost buffer be the most ...
Tom Ellis's user avatar
  • 111
0 votes
0 answers
88 views

New windows open below (horizontal split) by default

Before, I used to have that windows would open on the right of my current window for things like M-x man and M-x shell. Now I have that they open below. All I've done is uninstall and reinstall my ...
user129393192's user avatar
0 votes
0 answers
37 views

How to open multiple files from multiple org-links?

* Headline 1 - [[https://orgmode.org/][Org-Mode]] - [[https://www.gnu.org/software/emacs/][GNU Emacs]] * Headline 2 - [[~/tmp/file1.org][First file]] - [[~/tmp/file2.org][Second file]] When the ...
crocefisso's user avatar
  • 1,353
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 ...
Ink blot's user avatar
  • 101
0 votes
1 answer
75 views

How to automatically trigger a function according to an option mentioned in an org file header?

Suppose I want to create an option called #+buffername:, so that each time the option is mentioned in an org buffer, Emacs trigger a function according to its value. For example, if I create a file ...
crocefisso's user avatar
  • 1,353
0 votes
4 answers
280 views

Is there a way to specify names of tabs?

I'm using denote, which produces quite long file names. E.g. 20230410T021830--title-i-gave-to-the-org-file__tag1_tag2_tab3_tag4.org. I also use tabs to navigate between buffers (mainly org files). The ...
crocefisso's user avatar
  • 1,353
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: (...
user4035's user avatar
  • 1,069

1
2 3 4 5
12