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
-2
votes
2answers
403 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 ...
1
vote
1answer
58 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 ...
5
votes
3answers
123 views

How can I kill buffers based on mode?

I know about kill-matching-buffers but that searches buffer names, I want instead to search buffer modes. For example, I might want to kill all buffers that have "notmuch-" or "[Notmuch]...
4
votes
3answers
916 views

Making it clearer I'm in god-mode

I've been using emacs for a while, but am being quite dismayed by some quite hectic pinky-pain, so have just started using Chris Done's god-mode, which is great, I like it so far. The problem is that ...
2
votes
1answer
32 views

force kill a buffer?

I have a buffer (belonging to ein mode that got into a bad state) that throws an elisp error every time I try to kill it (using ibuffer, M-x kill-this-buffer, etc.) Backtrace suggests that the buffer ...
1
vote
2answers
39 views

How to delete the contents of a buffer by name

For example in gdb mode, there is a buffer named *input/output of <program name>*, that I want to clear each time I press C-c l.
0
votes
1answer
27 views

Changing buffer name in emacs

How to change the buffer name in emacs to any given string? Useful if one has many shell buffers for various specific tasks and is merely seeing their order of creation.
0
votes
1answer
42 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 ...
0
votes
0answers
40 views

How to add a kill-buffer item at the beginning of the Buffers menu-bar menu?

When I want to kill a buffer and I have my hands on the keyboard it's simply C-x k RET but if I have already the right hand on the mouse the k RET part is a bit out of reach for my left hand… ...
1
vote
1answer
20 views

magit-diff jumps to insertion/deletion in already opened window (no overlay)

I have 2 windows open: One is the magit-diff of the current repo, the other is just source codes from that repo. In source codes (the right window), I have a file opened, say "sample.txt". In magit-...
0
votes
1answer
28 views

reverse buffer order

I open Emacs from the command line to inspect 10+ files, say like this: emacs *.java However, all the files are listed in reverse order. This is getting kind of annoying--I'd like to start with the ...
0
votes
1answer
38 views

Re-fill compilation-mode buffer from shell script

This might require more tricks than just Emacs-fu, but since Emacs is at the heart of it I hope to get some ideas on how to approach my need here. I use Emacs/Make/gcc as my development environment. ...
6
votes
1answer
221 views

Clone a buffer to see the same contents in an other mode

Suppose I'm working on a file in org-mode or enriched-mode or html-mode ..., and I wanted to see the same contents in an other window with an other mode, say text-mode, how to do that? I tried to ...
0
votes
1answer
42 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 ...
3
votes
1answer
68 views

How to disable changing the current buffer by clicking buffer name in mode line?

I find myself accidentally clicking the mode line when trying to focus a buffer with the mouse. This causes the buffer to change. I don't want that behavior. I want nothing to happen. The culprit ...
2
votes
1answer
54 views

How to search and replace in *open buffers*

I want to interactively search and replace in all (or, preferably, a regexp subset of) my buffers (not files). Scenario Being a pack-rat sort of guy, I never delete my buffers until I'm sure I don't ...
0
votes
1answer
29 views

How could “C-x 4 b ”which pop-up-window but display to the right?

In emacs -Q, I strike C-x 4 b which invoke (switch-to-buffer-other-window) and display the other window vertically as I reference it's source code (defun switch-to-buffer-other-window (buffer-or-...
1
vote
1answer
14 views

How to save and restore the association of a window to buffer across Emacs sessions?

I have a window layout with three windows and I would like Emacs to remember the buffers even if the buffers don't exist after restart. Context: I am using Spacemacs for Clojure development. In ...
3
votes
1answer
258 views

What is the *code-conversion-work* buffer

What is exactly the purpose of the *code-conversion-work* buffer and why is the variable default-directory in the *code-conversion-work* buffer set to the folder in which Emacs was built?
0
votes
0answers
8 views

Center the following buffer in next-error-follow-minor-mode

I am using next-error-follow-minor-mode to preview my search results. The problem is that the preview buffer doesn't center around the current line: Related
9
votes
3answers
2k views

how to name buffers (*shell*)

I'm interested in naming Emacs buffers. In particular I'd like to give names to shell buffers that I've started. That way I can easily tell them apart when switching buffers.
0
votes
1answer
37 views

An ivy function for recently opened files?

I know that setting ivy-use-virtual-buffers leads to recently opened files being shown in the ivy-switch-buffer completion. However, I don't want this. What I want is a separate function for opening ...
0
votes
2answers
24 views

Interactive function to convert Windows path to POSIX path

Here at 'dayjob I'm often sent paths from developers using Windows in Windows format: D:\Some\Path These paths can uniformly be converted to paths valid on at least some Linux machines at 'dayjob ...
1
vote
1answer
14 views

List of hooks inhibited by inhibit-modification-hooks

The documentation of inhibit-modification-hooks states Non-nil means don't run any of the hooks that respond to buffer changes. This affects before-change-functions and after-change-functions, as ...
0
votes
1answer
56 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 ...
0
votes
1answer
24 views

How to byte-compile a file in the background?

To cut time on untangling my org setup file, I now only compile on save. However it is somewhat annoying to have the compile buffer popup on every save. ;; Only untangle on a change/save (defun ...
1
vote
1answer
38 views

why is switch-to-buffer effect not visible immediately when called in a list with other functions?

I have a key bound to some program which prepares a buffer, switches to it via switch-to-buffer and afterwards calls some function which modifies the buffer (and can take a few seconds to execute). ...
1
vote
1answer
25 views

How to insert a piece of text in a new buffer?

I have the following code: (defconst cljs-test-report-buffer "*cljs-test-report*" "Buffer name in which to display test reports.") (defun cider-test-show-report () "Show the test report ...
0
votes
0answers
26 views

Opening a Remote Shell Renames Buffer Open to \*shell\*

here is a simple elisp program for opening a shell in a named buffer: (defun shell-make (dir buffer-name) (let* ((default-directory dir) (buffer (get-buffer-create buffer-name))) (set-...
12
votes
5answers
3k views

Revert all open buffers (and ignore errors)

When working on a project under version control with git, I often want to do some things in a shell that affect many of my open files, then revert every buffer that I have open to make sure that I don'...
1
vote
1answer
37 views

Check if a buffer's name ends with `.org`

I want to write a function to check if a buffer is an Org buffer. Here is my attempt. (defun org_bufferp (buffer) (if (bufferp buffer) ((setq buffer_name (buffer-file-name buffer)) ...
0
votes
0answers
29 views

How to find what is creating and killing so many buffers?

A bunch of creating and killing buffers in my setup and I can't track down what is it. Here is my debug code: (add-hook 'kill-buffer-hook (lambda() (message "Killed: %s / %s" major-mode (...
1
vote
1answer
30 views

Relationship between frame, buffer, and file

I am trying to check how frame, buffer, and file work. It seems to me that frame commands(C-x 5 ...) create a frame, whether a buffer or file exists or not. Here is what I am thinking: C-x 5 2 1. ...
73
votes
21answers
37k views

How do I switch buffers quickly?

In vanilla Emacs, I have to do C-x b and then manually type out the buffer name to switch. If I forget the name of the buffer, I have to hit TAB to list possible completions. Is there anything I can ...
0
votes
0answers
41 views

how can I re-use the window created by `display-buffer-in-side-window`?

I'm creating a window at the bottom of the frame with display-buffer-in-side-window and it displays a given buffer, I would like to have another buffer created but re-use that exact same window. How ...
0
votes
1answer
35 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 ...
17
votes
3answers
2k views

Kill process buffer without confirmation?

I have C-x C-k bound to kill-this-buffer. But when I enter into a buffer which is running a process like Python or MySQL, if I do C-x C-k it asks Buffer "*Python*" has a running process; kill it (...
0
votes
0answers
44 views

disable automatic python file scrolling if using blacken or yapfify

I am using blacken to automatically format my python files (use-package blacken :demand t :after python :init (add-hook 'python-mode-hook 'blacken-mode) ) (use-package python :mode ("\\.py\\'" ...
1
vote
1answer
35 views

How to create a function that have the functionality of helm-projectile-switch-to-buffer but with added opened org files?

I really like helm-projectile-switch-to-buffer as it shows buffers for the specific project I am working in (i have multiple projects open at the same time). But I also rely on org files for notes and ...
4
votes
2answers
915 views

How can I force “list-buffers” to use the other window

When I type C-x C-b (i.e. the command list-buffers), how can I force it to list buffers in the other window? i.e. I typically have my screen split into 2 buffers. I am editing one buffer. I want a ...
0
votes
2answers
57 views

query-replace{-regexp} fails in linux in a non-X terminal when I am in anything other than text mode

I am running emacs 26.1 under linux. It has been working fine for over a year. Recently, I upgraded a lot of packages on my machine, but I did not upgrade nor alter emacs in any way. Now, query-...
1
vote
1answer
51 views

How to configure a command to open in same-window unless already open in active frame?

I can use display-buffer-alist to configure a command to open in the same window: (add-to-list 'display-buffer-alist '("*grep*" display-buffer-same-window)) The problem in this case, however, is if ...
0
votes
2answers
38 views

Standard ML Emacs “real time” compilation?

I'm interested in configuring my Emacs environment to perform real-time compilation of a Standard ML buffer, on the event corresponding to a ";" character being entered (at the end of a line), such ...
0
votes
1answer
30 views

buffer-substring fails in linux in a non-X terminal when I am in anything other than text mode

NOTE: I was careless in evaluating this problem, and the data I posted here is not correct and does not reflect the actual issue that I am facing. Since there are already answers to this question, I ...
1
vote
1answer
54 views

ESS: display-buffer-alist reusable-frames does not work as expected

I'm trying to use the display-buffer-alist variable to control how Emacs displays spawned inferior shells (ess-r in particular). I'm using the display-buffer-alist value from ess doc: (setq display-...
2
votes
1answer
80 views

show top 5 used buffer at the bottom of buffer

I'm currently using helm-buffer, and I have bind my c-x b to (helm-buffers-list),however when I switch buffer, I still have to: 1. c-x b 2. type some works 3. enter sometimes, I probably just ...
1
vote
2answers
70 views

Change major mode for buffer without a corresponding file

I want to change the major mode from fundamental-mode to compilation-mode for a buffer which contains some generated output named for eg. *results*. I've tried to add an entry to auto-mode-alist but ...
0
votes
0answers
64 views

how to buffer video output from a .mp4 file?

Just like images and tetris game, I want to select a region preserved for buffering saved video files. The goal is to get a cool looking notebook that supports my vlogs.
41
votes
8answers
8k views

How do I find text across many open buffers?

Lets say I have 10 buffers open, and I want to find all occurrences of blah in all 10 buffers. How would I do this?
0
votes
3answers
169 views

Killing current buffer reliably

I try to add a nicer key binding to kill the current buffer. An obvious solution is to use kill-this-buffer, but often it does not work, or e.g. does not work the first time. The key binding for it ...

1
2 3 4 5
9