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

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
1answer
19 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
24 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 ...
0
votes
1answer
27 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 ...
1
vote
1answer
16 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
8 views

Limit the length of emacs-w3m buffer names

How can I limit the length of emacs-w3m buffer names?
0
votes
1answer
20 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
20 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
50 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
0answers
63 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
33 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
47 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
15 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
59 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
26 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
45 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.
0
votes
0answers
29 views

Deactivate features according to buffer size

Is there a way to deactivate linum and line wrapping when the buffer is smaller than the fill-column?
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
51 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
22 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
29 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
21 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
43 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
56 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
48 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
52 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
8 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
7 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
38 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
54 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
29 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
84 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
7 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
94 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
81 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
44 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
45 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
19 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
18 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 ...
0
votes
1answer
109 views

Enable .dir-locals.el variables inside just opened buffer

I'm programmtically create a new buffer as a result of shell command (defun jira-ticket-view (&optional jira-ticket) "Open Jira Ticket Inside Emacs" (interactive) (setq jiraURL (get-jira-...
0
votes
1answer
114 views

Create a new file in a new folder

In Ivy, it can not to create directly a new file in a new folder (as type C-x C-f, then write a file path /current_path/new_fold/new_file). If there is a better way to do it, how to use the key ...
1
vote
1answer
32 views

How can I enable key-binding in a temporary-buffer?

I have a large number of org files that are created to store some specific information, that wont change. I am trying to create a function to go find that file and insert it into a temporary buffer so ...
0
votes
1answer
34 views

Minimap avoiding change window

Recently I started using minimap-mode, but it has been a bit buggy as sometimes when I split the window and open two different buffers, it won't let me go back to a buffer with code (and minimap). So ...
0
votes
1answer
63 views

Emacs daemon multiple buffers for same file

When running Emacs as a daemon, function find-file automatically selects and uses a preexisting buffer that is visiting the same file. My problem is, when using the same buffer in multiple frames ...
2
votes
1answer
42 views

How do I kill all buffers that were opened from browsing rgrep results?

I had a set of buffers open that I want to keep. Then I started a search with M-x rgrep (SPC f g on Spacemacs). While browsing results with n and p, each file containing a result is opened in a new ...
1
vote
1answer
31 views

Can I exit the second client without closing the first client's buffers that were opened in the second client?

First I ran emacs --daemon. Then in one shell, I ran emacsclient -nw and open several files in the buffer. Then in another shell, I did the same thing. At the same time I found that the file buffers ...
1
vote
1answer
274 views

Was org-iswitchb removed, and what is it's closest replacement?

Just getting started getting comfortable with Org. Part of my initial configuration was copied from the GNU manual: (global-set-key "\C-cb" 'org-iswitchb) That didn't work ever; for posterity and ...
0
votes
0answers
30 views

Bury gnuplot buffer for good

When I work with gnuplot from emacs, I open up a file buffer write the commands there and occasionally evaluate the entire buffer using C-c C-b sequence. Unfortunately, whenever I C-c C-b, the ...
0
votes
0answers
43 views

End of buffer in COMMIT_EDITMSG buffer when i space

I keep hitting a strange issue with the COMMIT_EDITMSG buffer on some occasions I can not insert a space, I can type all other alpha numeric characters just not insert a space between words. When i ...
1
vote
1answer
39 views

disable async new buffer question

When I give a new async command with an interactively called async-shell-command, it gives a message "A command is running in the default buffer. Use a new buffer? (y or n)". I think this behaviour ...