Stack Exchange Network

Stack Exchange network consists of 174 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.

4
votes
0answers
27 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
43 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
19 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
13 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
41 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
50 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
51 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
20 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
34 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
44 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
43 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
23 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
52 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
34 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
53 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
26 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
27 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
23 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
55 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
76 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
35 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
113 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
16 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
67 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
32 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
56 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
38 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
54 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
26 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
27 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
32 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
22 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
2
votes
1answer
75 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
58 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
64 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
72 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 ?
1
vote
0answers
13 views

Flycheck error buffer empty for python files in the {package-name}/bin/ directory

I have this odd problem when I run flycheck on the python files inside the {package-name}/bin directory of my git repository. When I attempt to run flycheck on these files, the buffer with the ...
0
votes
0answers
9 views

Is it possible to make layouts-ts buffers not to overlap?

I usually use many layouts-ts in my emacs client. In first layout (say, default one, 0) there are buffers that actually belong to (were opened in) another layouts-ts. Is it possible to make buffers ...
2
votes
0answers
41 views

Calculate current-column including display properties

I am trying to calculate the width of text within either a buffer or a string after it has been displayed, i.e. after taking into account the width of any display properties, such as embedded images, ...
1
vote
1answer
56 views

Compare if the file content is changed on the buffer

I want to do something like if the "buffer-changed" but "content-not-changed", reverted the buffer. When I work on the checking if the content changed, I tested the following code, but it can't ...
1
vote
1answer
33 views

Place the current buffer at the end of the buffer list without switching buffers in the frame

Is it possible to place the current buffer at the end of the buffer list without switching buffers in the window? I would like to write a wrapper function for ibuffer that modifies the buffer list so ...
2
votes
1answer
90 views

How to get xemacs-like Buffers menu entry in emacs?

xemacs has a nicely organized Buffers entry in its built-in menu. As you can see from the snapshot, it's sorted alphabetically and grouped by modes: I can't find how to make emacs do the same. menu-...
0
votes
0answers
9 views

Not work package “buffer-move” - Symbol's value as variable is void: closed

Windows 10, Emacs 25.1 After install from Melpa and set in my init.el (require 'buffer-move) I restart Emacs and get error: Symbol's value as variable is void: closed When I evaluate (require '...
1
vote
2answers
124 views

How fast swap between buffers?

Windows 10, Emacs 25.1 I have 4 open buffers. Here To switch from buffer "file_1.txt" to buffer "file_2.txt" I use standard command windmove-right. It is bound to <M-right>. To switch from ...
5
votes
1answer
90 views

Edit simultaneously many buffers and save all of them after edit

Windows 10, Emacs 25.1, Helm I open 3 different files: I need: Edit simultaneously all buffers. Add text "customer/" to the node "bodyFileName"in all buffers. After edit save all buffers, Here ...
4
votes
1answer
50 views

Smarter behaviour for “rename-uniquely”?

I am starting to use "rename-uniquely" for help buffers so I can see multiple function helps at the same time. However, what I get is: *Help* *Help*<2> *Help*<3> etc What I would ...
1
vote
1answer
56 views

Don't allow emacs to save a buffer

So this is probably a weird question but out of muscle memory I tend to save files constantly. This becomes a slight inconvenience when I have a compilation buffer then accidentally save that. I was ...
0
votes
1answer
22 views

Launch term in command-line-default-directory

Currently, I have following key binding defined in my init.el: (global-set-key (kbd "C-c C-SPC") (lambda() (interactive) (term (getenv "SHELL"))...
0
votes
0answers
20 views

Enable Evil jump to work across all panes instead of only active pane

Is there a way to enable evil-jump-forward and evil-jump-backward to use the jump list of all panes instead of only the active pane? In the gif below, here's what happens: Start on left pane at ...