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
37
votes
8answers
7k 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
63 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 ...
0
votes
0answers
33 views

Work in indirect-buffer faster than in original?

When I read the org-manual which are about 12,000 lines long, it's slow to edit such a large file. Then I invoke "narrow-to-substree" and read "2.Documents Structure" in a indirect-buffer. At this ...
0
votes
0answers
35 views

Always open buffer in a new frame instead of a window

I found this question which suggested that setting pop-up-frames to a non-nil value should enable this behaviour. However when I added (setq pop-up-frames t) to my emacs init only some of the buffers ...
1
vote
1answer
49 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-...
1
vote
1answer
24 views

How to stop (aquamacs) emacs opening all new buffers in new (gui) window/emacs frame?

I've just upgraded my aquamacs installation and a bunch of packages, and now emacs is opening every new buffer in a new (gui) window (aka emacs frame). I don't like this. I want to have every buffer ...
0
votes
1answer
31 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 ...
3
votes
1answer
29 views

How to know if the buffer returned by a function is newly opened?

I'm using a command that reverts a diff chunk in a buffer (linked question), however I don't know if the buffer is newly opened - or if an existing buffer is used. While I could make a list of all ...
4
votes
1answer
257 views

How to give user free rein to edit a buffer in the middle of lisp code?

I'm trying to run some code, a little like this: (defun myfun () (message "one") (user-does-things) (message "two") I would like the code to do this: display "one" let the user edit in ...
11
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'...
4
votes
1answer
55 views

How to replace the buffer without slowing down the undo system?

Say I have a command that operates on the entire buffer. The simple solution is to: Run the command taking the entire buffer as input. Store the output. Clear the current buffer. Insert the new ...
0
votes
2answers
54 views

How to cycle among all live buffers?

Emacs 26.2 M-C-L is bound to switch-to-next-buffer. I have many files open but it's simply flopping between two. On my old XEmacs the same key cycled through all of them (and S-M-C-L did so ...
7
votes
4answers
10k views

Spacemacs: kill buffer and kill window in one command?

Is there a spacemacs command that both closes the window and kills the buffer? In other words, the equivalent of Vim's :q?
0
votes
0answers
18 views

Fringe value not taking effect until I switch buffers

I'm not quite sure how best to describe what's going on. I have the following lines on my init.el file. (setq-default left-fringe-width 40) (setq-default right-fringe-width 40) I expect this to ...
1
vote
1answer
56 views

How to always show buffer in the new created frame?

My workflow is: I initialize emacs with a shortcut (in my ~/.i3/config I have a line like this bindcode $mod+49 exec emacsclient -c -n -q -a=''. I use i3wm.org) By default it goes to temp.org, in ....
1
vote
1answer
36 views

How to bury *Ibuffer* when switching to another buffer?

M-x ibuffer Select a buffer Kill that buffer The *Ibuffer* buffer re-appears. How can I get it to behave more like a *Help* buffer, which is buried (dropped to the end of the "recently used" list) ...
0
votes
1answer
26 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
1answer
64 views

Assign buffer-name to variable

I'd like to write Elisp code that compares text character by character between two buffers. To do that, I need to first assign buffer names to the variables source-buffer and target-buffer ...
1
vote
1answer
52 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 ...
0
votes
2answers
63 views

Create many buffers, name properly, silently

I am trying to avoid using the desktop save mode 1 option in my .emacs file. We sudo a shared service account, so my buffers may differ from my colleagues buffers. I launch Emacs from GNU/Linux with ...
1
vote
1answer
28 views

Left margin grows while typing

My buffer slips to the right while editing a file. Whenever I press a button, left margin area grows one character. This isn't happening for all files. My buffer normally looks like this: line with ...
0
votes
1answer
27 views

move focus between sub-windows (or buffers?) with ctrl-tab?

Currently using GNU Emacs 23.1.1. I've used xemacs since the late 90s and am only now switching to proper emacs. If I had my xemacs window split into a top buffer and bottom buffer, I could move the ...
0
votes
1answer
163 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 ...
70
votes
18answers
33k 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 ...
2
votes
1answer
33 views

How to ignore case when switching buffers?

I want to open a buffer called Echo.md and switch-buffer (C-x b) does not auto-complete it when I type echo because of the case. But find-file does auto-complete from lower-case to upper-case. The ...
1
vote
2answers
199 views

switching from tmux + terminal emacs to Emacs only

I am thinking of switching from tmux + terminal emacs (emacs -nw) to just pure emacs. The only thing that is holding me back is tmux offer switching between sessions without switching the terminal ...
6
votes
1answer
156 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
2answers
82 views

How select and kill desire many buffers in ido mode?

Emacs 26.1. ido, smex If I want to kill one buffer I use command C-x k Here result: As result I can kill ONE desire buffer. But suppose I need to kill the next buffers: build.gradle, approfile....
2
votes
1answer
64 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
1answer
46 views

get the full path (path + filename) of the currently editing file in to the OS clipboard

when editing a file (for example a .pl file) Whats the quickest way to get the full path (path + filename) of the currently editing file in to the OS clipboard. I'm on macOS, where echo "hello" | ...
0
votes
2answers
171 views

Multiple buffers for same file

The find-file command automatically selects and uses a preexisting buffer that is visiting the same file. My problem is, when using the same buffer in multiple frames, the frames will lag ...
1
vote
1answer
305 views

Kill initial buffers

I want to kill some buffers created by default, such as the GNU Emacs, but putting: (kill-buffer "*GNU Emacs*") On the .emacs doesn't work. I guess this code is called before the initial buffers are ...
2
votes
5answers
283 views

Replacing buffer content without losing point

I looking into extending atomic-chrome to work with text areas that can be modified from the server side, such as site providing collaborative LaTeX editing. The plugin provides updates containing the ...
6
votes
2answers
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.
1
vote
1answer
30 views

Next buffer command change when in the terminal window

I am totally new to Emacs and on this first day I am trying to do very basic stuff in emacs. I am stuck at switching buffers when there is a terminal window open (by using M-x term). The next buffer ...
1
vote
1answer
81 views

how to enable pager like behavior in a shell buffer?

I can't believe I'm saying this, but one thing that is "nice" about windows cmd is the pager. When I do man grep in a bash shell inside emacs buffer it spits out the entire content at once. Is there a ...
15
votes
1answer
3k views

Get content of a buffer

So buffer-string gets the content of the current buffer. But it doesn't allow specifying other buffers. How can I get around that? Do I need something like save-window-excursion to make it work?
0
votes
1answer
35 views

Multiple initial buffers in different windows

I have Emacs set up to open an initial org mode buffer on startup by (setq initial-buffer-choice "~/Directory/Subdirectory/inital_buffer1.org") Ideally on start up, I would like to open 2 buffers in ...
1
vote
1answer
113 views

Do not open “GNU Emacs” buffer when launching Emacs [duplicate]

"GNU Emacs" buffer is opened automatically when launching Emacs(both terminal and GUI), and I have to kill that buffer everytime. It's boring. How to turn "GNU Emacs" buffer off autimatically when ...
0
votes
0answers
33 views

setting left margin to particular buffer

I have buffer called *mydashboard* which is simply an org file. I want to set the left margin of this buffer to 20 chars. I am planning to use this as my dashboard where I can pin my links to other ...
0
votes
0answers
26 views

Tabs on windows with custom buffers

I am new to Emacs and I am trying to set up a decent workflow for projects I already have. What I want to do is to be able to have tabs of buffers on each window (not frame). What I want ...
0
votes
0answers
27 views

Is there a way to split-window-right and switch-to-buffer / find-file in single command?

As described in question title. Closest solution that I can find is to use ido-find-file-other-window orido-switch-buffer-other-windew, but these create a horizontal split by default, and if a ...
0
votes
1answer
48 views

Emacs freeze with async command

Emacs 27.0.50. Windows 10. This function works finely when the line is commented: (defun Pfedj/write-async-file () (interactive) (async-start (lambda () (setq path "~/org/file....
1
vote
1answer
27 views

How to set setting for one mode only?

I currently have the hook below for displaying tabs when in text mode: (add-hook 'text-mode-hook (lambda () (standard-display-ascii ?\t "!---"))) I only want that setting to apply in text ...
0
votes
0answers
23 views

How to silence *Org Preview LaTeX Output* buffer?

Every time I preview a math segment, this buffer pops up with the following text: This is /path/to/bin/dvipng (dvipng (TeX Live)) 1.15 Copyright 2002-2015 Jan-Ake Larsson [1] Is there a way I can ...
0
votes
1answer
30 views

Making resize-mini-windows buffer-local while locally let-bound

Upon striking C-x s (save-some-buffers) or C-x C-c, it report errorsin mini-buffer Making resize-mini-windows buffer-local while locally let-bound. Search the above errors but return no helpful ...
0
votes
0answers
26 views

goto-last-change for multiple buffers

Is there a way to move the cursor to the place of the last change when working with multiple buffers? For working with a single buffer, the command goto-last-change can do the job. My question is for ...
1
vote
1answer
34 views

Disaable the prompts to save files

Every time, I save files, it prompts that save files ..? (y, n !) There are few cases that saving files are mistake operations. How could disable the confirmation prompts?
0
votes
0answers
15 views

emacs breaks down text snippet copied from another X Window application

When I select with a mouse a block of text in Firefox or VIM for example, copy it and then try to paste in Emacs, it gets pasted, but unaligned, meaning that beginning of the lines shift away to the ...
0
votes
0answers
13 views

When scrolling a list of buffer, can the buffer content be shown in a second window?

When using dired and peep together, I can scroll up (C-p) or down (C-n) the dired file list in the left window, and see the content of each file in the right window. This is a very practical ...