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
8 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
0 votes
1 answer
44 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
0 votes
0 answers
31 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,808
0 votes
1 answer
38 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,808
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
  • 115
0 votes
0 answers
11 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
26 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
34 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,207
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
52 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
  • 115
0 votes
1 answer
59 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
  • 573
0 votes
0 answers
8 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
  • 990
0 votes
0 answers
34 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
0 votes
0 answers
21 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
37 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
28 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
60 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
1 vote
2 answers
155 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
64 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
28 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
22 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
24 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
23 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
0 votes
0 answers
13 views

How to save/revert changes to only parts of a buffer?

I'd love a partial save-buffer and/or revert-buffer (if I have one, I think I could easily enough implement the other). Perhaps where I select a region and have only changes within that region get ...
mtraceur's user avatar
  • 256
1 vote
1 answer
32 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,177
4 votes
1 answer
112 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
  • 4,638
0 votes
0 answers
21 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
  • 175
0 votes
0 answers
64 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
  • 101
0 votes
0 answers
60 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
32 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,220
0 votes
1 answer
36 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
64 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,220
0 votes
4 answers
194 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,220
2 votes
2 answers
59 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,059
0 votes
1 answer
112 views

How to access the elisp code of an Emacs BUFFER object? [closed]

The Emacs documentation does not to cover easy observable aspects of the in a window displayed buffer and the short explanation what a buffer is: 28 Buffers A buffer is a Lisp object containing text ...
Claudio's user avatar
  • 420
0 votes
1 answer
67 views

How to save what I see in an 'Emacs window'?

There is a nice concept of 'WYSIWYG' meaning 'What You See Is What You Get', but it seems that it is hard to get what I can see in an 'Emacs window' ('Emacs window' is what would in common sense be ...
Claudio's user avatar
  • 420
1 vote
1 answer
32 views

Why does other-window-for-scrolling ignores variable other-window-scroll-buffer?

According to the documentation of other-window-for-scrolling we should be able to specify the "other window" by setting the variable other-window-scroll-buffer: other-window-for-scrolling ...
FKG's user avatar
  • 48
0 votes
0 answers
19 views

Crux Rename Buffer (wrong type argument on Emacs-30)

I updated to Emacs 30 and now I get this when I try to rename the buffer Debugger entered--Lisp error: (wrong-type-argument commandp crux-rename-file-and-buffer) call-interactively(crux-rename-file-...
Jason Hunter's user avatar
0 votes
1 answer
88 views

How to change default buffer when opening new frame

When I create a new frame with make-frame-command, it automatically opens the currently open buffer in the new frame. Is it possible to change this to open the scratch buffer instead? I'm using ...
NewToEmacs's user avatar
2 votes
1 answer
108 views

Multiple Independent Views of the Same File

I can C-x 2 to view the same file in two buffers, but if I for example do this with an org file, then collapse the top heading, this also messes with the first buffer;) Can I open an independent view ...
Jason Hunter's user avatar
-1 votes
2 answers
35 views

interactively prompt for a list (or regex) rather than just a single item

I have a function to kill buffers matching a given regex: ;; Like kill-matching-buffers, but doesn't prompt every time. ;; TODO: get this to use vertico (defun kill-matching-buffers-just-do-it () &...
firstname gklsodascb's user avatar
1 vote
1 answer
24 views

Aggregating org files in a single buffer, optionally grouping by common headings. Which building blocks could be used in emacs?

If possible, what APIs or emacs features would be suitable to implement a "view" ("computed") buffer that would: allow aggregating content from multiple buffers in a single buffer ...
Valer's user avatar
  • 111
1 vote
1 answer
33 views

How can I make a window always show the same file buffer?

How can I force Emacs to keep a certain file in a particular window? For example, if I am editing a LaTeX file and there is a compile error, I want to inspect the error in another window. I ...
user5728491's user avatar
1 vote
1 answer
483 views

How to define display-buffer-alist, to keep every buffer in the frame it is currently?

I work with different Emacs frames on the same desktop. When I run compile Emacs splits the current frame and creates a clone of the buffer *compilation*, although the compilation buffer is already ...
ceving's user avatar
  • 1,338
0 votes
0 answers
115 views

How to persistently disable the "Buffer ... modified; kill anyway? (y or n)" prompt for specific buffers?

I often work with buffers that have auto-save enabled. I can install in kill-buffer-hook a function that identifies such buffers, and invokes do-auto-save, thereby automatically saving any lingering ...
kjo's user avatar
  • 3,207
0 votes
1 answer
74 views

Decide which window the slime buffer opens in?

I usually have emacs open in 4 sections code slime code terminal When I am setting up, and i open slime with M-x Slime, it opens up in one of the other buffers. Question -- How do I control which ...
Vinn's user avatar
  • 283
1 vote
1 answer
38 views

How to programmatically find buffer visiting specific directory

I'm looking for something similar to (find-buffer-visiting FILENAME &optional PREDICATE) that would find a dired-mode buffer visiting a specified directory. Something like: (find-buffer-visiting-...
PRouleau's user avatar
  • 786
1 vote
2 answers
76 views

Window Point Reset After Update

I have a buffer which is updated periodically using run-at-time, and in order to maintain the point in each window I use set-window-point, but I find that in sometimes when something is interrupted ...
C4ffeine Add1ct's user avatar
1 vote
1 answer
71 views

Why I cannot quit the window using `quit-window`?

Say I have two existing files named "file1.el" and "file2.el". Then I perform the following steps: I open a file named "file1.el" C-x C-f a file named "file2.el&...
absuu's user avatar
  • 149
1 vote
0 answers
83 views

How to switch buffers (prev & next) with minimal buffer list order modification?

How to switch buffers (prev & next) with minimal buffer list order modification? To be succinct and without getting into the weeds of particular details, the best way to explain what I am trying ...
David's user avatar
  • 126

1
2 3 4 5
12