Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
2answers
21 views

cycling between minibuffer and last window|buffer

I'd like to cycle between an active minibuffer window and the last recent buffer. 1 (defun cycle-to-minibuffer-window () 2 (interactive) 3 (when (active-minibuffer-window) 4 (if (...
0
votes
2answers
40 views

Sort lines in a string

Given I have a string that maybe came from a buffer, or a clipboard, or wherever; how do I sort-lines in it? Given that sort-lines only works with a region, I assume I have to put it to a temporary ...
1
vote
0answers
35 views

Do buffers have the notion of a “parent”? [closed]

Often times, when I'm done a task, I'd like to close out of all buffers I was using for it. However, I usually don't, because I think it'd be a pain. What I'd like is to be able to kill all buffers ...
1
vote
1answer
21 views

How to change font size only for the buffer *Org Export Dispatcher*?

I'm using emacs with a large font, however I do not need the font to be too large on certain buffers and/or modes. For example, when I use neotree I use a different font and a smaller size, I do that ...
0
votes
0answers
21 views

Display annotation contents horizontally in pdf-tools *with* live-preview

When looking at annotations with the pdf-annot-list-annotations command from the pdf-tools package, I prefer to preview my annotation contents in a separate buffer, which is the default behavior. ...
0
votes
0answers
21 views

Emacs flashes when changing buffer with `ido-switch-buffer`

When I change buffer via ido-switch-buffer and enter a python buffer my entire Emacs flashes visually for a second. If I handle other files the same way, it does not. What can be the reason for that? ...
0
votes
0answers
22 views

buffer opens in window below if font size is changed

In my config file I changed the line (set-face-attribute 'default nil :height 100) to (set-face-attribute 'default nil :height 90) and suddenly, when I try to open a file in a separate vertical ...
0
votes
0answers
47 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 ...
0
votes
1answer
60 views

Killing a window without killing the associated buffer

I have a weirdly specific way I like to organize my windows when working with C, and where emacs opens the compilation window really bugs me. I try to close it and switch another window to the *...
0
votes
2answers
63 views

How to redirect output from eshell to any open buffer in Emacs?

I have my eshell opened in a window and in another window I have *Scratch* as a open buffer. I want to redirect the output of a command like say ls to *Scratch*. Is it possible? If yes, then how can I ...
0
votes
1answer
42 views

Identify buffer by part of its name

Is there a way to select a buffer by part of its name using elisp? For instance, the ag package may create a buffer called *ag search text:MyPtyhonClass dir:c:/projects/my_module/* or the realgud ...
1
vote
3answers
65 views

Static Buffer List

I'd like to use emacs more, but I'm still used to some of my previous workflows I know from most modern IDEs. What my emacs lacks most is a static list of the open buffers or files. By static I mean: ...
0
votes
2answers
66 views

What does the prompt mean for `has changed since visited or saved. Save anyway?`

When I try to save a buffer back to a file: install-packages.sh has changed since visited or saved. Save anyway? (yes or no) I don't know why it happens, but I also see #install-packages.sh# ...
5
votes
0answers
64 views

Why is cloning of file buffers prohibited?

Why does clone-buffer not work on file buffers. I can make it work by the following advice: (advice-add 'clone-buffer :around (lambda (oldfun &rest args) "Allow cloning file buffers." ...
1
vote
5answers
61 views

Copy-paste text among Split Window Buffers

Say I have split my main Emacs Window into 2 : LEFT and RIGHT. My cursor is currently in LEFT. How do I copy some text from LEFT to RIGHT without going to the RIGHT window?
2
votes
1answer
34 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 ...
0
votes
1answer
23 views

Avoid spurious buffers with helm-find-file

I have C-x C-f bound to helm-find-files. Mostly this works really well, but if I hit TAB when there are no completions for an item (most often because I've fumble-fingered the directory or filename ...
0
votes
1answer
44 views

Eshell command in another window keeping focus in the working one

Ho can I run an eshell command in another window keeping focus in the working one? Let's say I'm scanning a buffer searching for a regexp (to be precise an URL) and every time I find it I want to ...
1
vote
0answers
56 views

migrated from emacs 25 to 26.1: cannot force find-file/counsel-projectile-find-file to always open buffer in current window

Recently I migrated from emacs 25 to 26.1. Before I reached the window behaviour, where I could always open a file at the window at point. The most simple case to illustrate undesired behaviour: I ...
0
votes
1answer
65 views

How to open the same file as two separate buffers so that modifying one does not modify the other?

I am debugging an ocaml program with M-x camldebug while adding comments to the source code and the debugger shows incorrect positions in my tuareg/merlin window. It shows the positions as present in ...
-1
votes
1answer
24 views

Function that outputs changes made in buffer

Is there any function that would tell me what changes were made to buffer? I know i can use change hooks to detect changes, but i can't find how to get output of changes. More specifically I would ...
2
votes
0answers
78 views

Force new window to open to the left or right

I have two frames open with the following window splits: Frame 1 Frame 2 |---+---+ |------| |a |b | |d | | | | | | |---+---+ | | |c | | | |---+---+ |------| Say that ...
0
votes
1answer
58 views

Reuse help window

How to set up Emacs so that once one "help" window (e.g. describe, info, man) is displayed, all subsequent "help" buffers open in the same window? For example, if I open a describe-function buffer ...
4
votes
1answer
66 views

What is the correct way to pop up a window with a message, and locally bind a key in that buffer?

What would be the proper way to pop up a window (preferably in the current frame),with a message? I also want to locally (in that buffer only) the q key to a function that will kill the buffer and the ...
0
votes
1answer
25 views

Getting characters from current position to end of line as a substring

Is there a standard Elisp function which can return as a substring (without any of the text-properties) the characters from the current position of point to the last nonwhite space character on that ...
2
votes
1answer
70 views

Help needed to debug (very) slow markdown-mode

I come back to emacs after an eternity without using it. I used it before but now that I'm a grown up I'd like to understand what I do and how to do stuff. I use emacs mainly for markdown edit at the ...
0
votes
1answer
47 views

Create a read-only buffer but which can be written to by Emacs-Lisp code

Is there a standard function to create an Emacs buffer in which we cannot type anything in (i.e. cannot be edited) but any running Elisp code can make changes to the buffer The following code does ...
1
vote
1answer
65 views

How to alias a buffer name?

Is it possible to provide an alias (e.g. m or mes) for a name like *Messages*? Ideally, I'd like to be able to write some kind of hook that gets called when a buffer doesn't exist and resolves to ...
3
votes
2answers
29 views

how can I unit test my font-face rules?

I would like to unit test my font-face keyword rules against some source code data sets. It sounds like it should be quite easy: open the source file, enable the mode, force fontification, dump out ...
0
votes
0answers
9 views

Limit the length of emacs-w3m buffer names

How can I limit the length of emacs-w3m buffer names?
0
votes
1answer
39 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
26 views

How to bind mouse click to kill an inactive window, but not the buffer

I'm trying to create a binding to kill windows (but not buffers) when they're being pressed by a middle mouse click in their header lines. (Just to note, all windows in my setup have header lines.) ...
1
vote
2answers
58 views

Count the number of paragraphs

There are plenty of ways to count lines, words, and characters in Emacs. For instance, invoking M-= (AKA count-words-region) does that very thing on a given region. However, I am having trouble ...
6
votes
1answer
92 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
36 views

Write to a buffer without visiting it? [duplicate]

I am looking for a solution where i can write a string to a Buffer without actually visiting it. I want to achieve this purely through an elisp function. Is it possible ?
0
votes
1answer
172 views

How to edit and return value of string in Emacs Lisp?

Here is what I wish to achieve: (defun rcd-edit-value (value) (let ((file (make-temp-file "rcd-db-" nil ".txt" value))) (find-file file) (string-from-file))) (defun string-from-...
1
vote
1answer
20 views

How to disable buffer movement in a particular window in emacs?

I am trying to figure out if we can disable a particular window from switching the buffer it contains. If anyone has achieved that please share.
2
votes
1answer
102 views

How to automatically save buffer after each modification without using packages

I'm using Emacs and Windows 10 and I am fairly new to both Emacs and elisp (and I am not a programmer). I'm looking for a way to automatically save a buffer immediately after any modification ...
-1
votes
1answer
36 views

how to get region start and region end from the whole buffer as variables to call another func

(defun buffer-to-shell() (let (buffer mark-whole-buffer))) (shell-command-on-region start end "sed s/foo/bar/") ;; start, end not defined ) As you might see there are undefined variables start ...
1
vote
1answer
64 views

How to make man replace the same buffer?

Instead of open many buffers I wish to have the same buffer for all calls to the man.
1
vote
1answer
40 views

Read-only text stops working after a while

This is a very strange issue and its cause is hard to determine. I often leave Emacs open for days, or even weeks at a time. My current emacs-uptime is 9 and a half days. That's pretty normal and ...
1
vote
1answer
65 views

Scrollbar only on selected buffer

I'm using toggle-scroll-bar to show scrollbar on my frame. But is there a way to show scrollbar only on the selected buffer? I think I can use focus-in-hook to detect when a buffer is active, but I ...
0
votes
0answers
27 views

how would I be able to get a list of files that has been worked on the longest

Instead of recentf which returns a list of files that have been opened, how would I create a function that records the time (active buffer) that I've spent on a given file and returns the list (to a ...
1
vote
0answers
35 views

How to fix a buffer to a pane

I have my emacs in 2 by 2 configuration. When debugging, certain actions triggered the opening of another file. The newly opened file could be in a specific window pane and covers originally opened ...
0
votes
1answer
37 views

is there a way to kill buffers when using the `switch-to-buffer` view

when using C-x b followed by TAB, a list of buffers are brought up. Is there a way to quickly kill the buffers that are not needed (by pressing <delete> or d) on the selected buffer?
1
vote
1answer
26 views

showing buffer list whilst moving through buffer list

Is there a way to show the list of buffers whilst moving through them? ie. next buffer would ideally also pop up a list of buffers to show the buffers that are coming up next
3
votes
1answer
138 views

How to force new `shell` to appear in current buffer?

Whenever I run M-x shell, a buffer appears almost randomly somewhere - splitting current buffers as it sees fit. I cannot work out the logic behind it. The docstring says: (shell &optional ...
2
votes
1answer
60 views

What is the difference between switch-to-next-buffer and next-buffer?

To go to the next/prev buffer I use the commands next-buffer / prev-buffer. This works well and is very comfortable. But there are also two other commands switch-to-next-buffer / switch-to-prev-buffer ...
3
votes
1answer
92 views

How to skip some buffers when use prev-buffer/next-buffer? [duplicate]

windows 10, emacs 26.1 Suppose I open 10 buffers. If I can use prev-buffer (C-x left) / next-buffer (C-x right) to go to prev/next buffers. It's very comfortable. But I need when I do this to skip ...
1
vote
1answer
127 views

How hide helm buffers in *Buffer-List*?

windows 10, emacs 26.1, helm 3.0 Here my buffer list: How I can hide all helm buffers? I'm don't want to Emacs to show them in Buffer List ?