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
1
vote
2answers
97 views

How to get emacs to prompt when a new buffer is changed on save?

for background, I am an emacs newbie and long time unix user... What I am trying to do is to work in emacs in a pattern that is familiar to someone who has used a windows, linux, mac text editor such ...
16
votes
3answers
1k views

Set column widths in `ibuffer`

Is there a way to customize the widths of the columns in ibuffer? Specifically, I want to widen the Name column to be able to read more of the buffer names before they get truncated. I have tried ...
3
votes
2answers
286 views

The difference between save-current-buffer and save-selected-window

Consider: (defun test() (interactive) (save-selected-window (switch-to-buffer-other-window "Test buffer."))) When test is run interactively while in a buffer visiting a file, the buffer is ...
3
votes
2answers
2k views

Working with LaTeX in Spacemacs: can PDFs be seen in a buffer, rather than via external PDF reader?

I have been using the latest version of Spacemacs, with AUCTeX. However, when I compile the .tex file into a .pdf file, it opens in my default external PDF viewer software. Is there a way to make ...
4
votes
1answer
496 views

How to insert a formatted string into a specific buffer?

I am looking for a way to insert a formatted text into a specific buffer (not the active buffer). As it seems to me, the only way to do so is to use a snippet as shown below: (insert (propertize (...
3
votes
2answers
242 views

Show the matching line in the center of the screen instead of the bottom when opening a grep result

When I grep something inside emacs and click to open one of the matching files. The matching line is always displayed at the bottom of the screen, and I have to scroll it up for a better view. Is it ...
1
vote
1answer
490 views

disable auto-completion for all buffers by default in spacemacs

Is there a way to keep auto-completion enabled as a layer, but have it disabled by default in spacemacs? For example, I want to have the auto-completion layer enabled in dotspacemacs-configuration-...
4
votes
1answer
53 views

Prevent specific parts of buffer from being editable

I wonder if it is possible to prevent specific parts of a buffer from being editable. For example, when I have outlined my document in an org-mode file, I would like to prevent any accidental changes ...
1
vote
0answers
114 views

Sending an s-expression to another buffer

I'm currently working in Clojure with Arcadia, which is requiring me to use a REPL that doesn't have support with Cider. This has been giving me some trouble given how I usually code, so I'd like to ...
0
votes
0answers
33 views

emacs: leaving buffer in terminal emacs

After opening a file with emacsclient -nw foo.txt I see When done with a buffer, type C-x # in the minibuffer. I however habitually do C-x C-c instead of C-x # Is there a practical difference ...
3
votes
1answer
343 views

org mode not showing all the text in my file?

I am new to Emacs and struggling to learn it. I have a test.org file: * Heading ** Sub-Heading *** Third-level When I open the file, the buffer just displays: * Heading... Where did all the ...
0
votes
0answers
80 views

Numbered buffers

I think when I was using Vim buffers were numbered and very easy to switch between (4gt etc.?). Is there nothing like this in Emacs? With ido and an evil leader binding, <space>bn<cr> (if ...
0
votes
4answers
333 views

elisp pattern for handling region || buffer || file

summary Elisp newbie has been given interactive code (aka commands, called with M-x whatever) that "does stuff" on the currently-selected region in the current buffer. What is an/the "elispish way" ...
2
votes
1answer
252 views

Helm-ag result buffer disappears

After doing a helm-ag search there is an option to 'save results in buffer'. My issue is that the result buffer disappears if another buffer or file is opened. Is there some way to prevent the buffer ...
9
votes
4answers
2k views

How to check whether a buffer is visiting a file?

I'd like to check whether some (say, current) buffer is visiting a file or not. I could say: (if (buffer-file-name) ...) but it seems to be not very elegant - what I'm interested in is only the ...
20
votes
3answers
3k views

How do I clear a buffer completely with elisp?

If I want to delete everything in a buffer with elisp, how do I do that?
2
votes
1answer
116 views

can other-buffer in split windows select a visible buffer?

I often swap 2 most latest buffers back and forth with (switch-to-buffer (other-buffer)). This works just fine in most situations. However, when I have 2 split windows, and the other window is ...
35
votes
6answers
4k views

How to reopen just killed buffer, like C-S-t in Firefox Browser?

Sometimes I accidentally kill a buffer and want to reopen it, just like C-S-t to undo closed tab in Firefox, but there is no built-in command in Emacs, the defun undo-kill-buffer in http://www....
3
votes
2answers
175 views

Problem with save-current-buffer and find-file

I have a list of files that I want to successively visit with find-file and then return to the first buffer. I thought that save-current-buffer would help me to achieve this. However, with the ...
0
votes
2answers
225 views

Make the emacs command history size unlimited so I can keep track of files?

I'd like to make the size of the emacs command history unlimited. I open and edit too many files in many different folders and I need a way to keep track of them. The emacs command history looks ...
2
votes
0answers
101 views

Emacs shell and telnet buffer auto jumps to end of buffer while browsing buffer contents

Was recently required to update to RHEL 7.x and with that came a newer release of Emacs (24.3.1). With emacs I am a big user of shells and telnet sessions within emacs so that I can easily browse the ...
7
votes
3answers
229 views

How can I have multiple *Help* buffers with different content?

Using C-h f and C-h v shows usefull help. Sometimes I want to compare information. So it would be useful to have more than one *Help* buffer, with different content, visible at the same time. But ...
1
vote
1answer
45 views

Change buffer displayed in window after x amount of time

I find myself switching between buffers constantly to double check activity in other buffers. Is it possible for windows to display different buffers after x amount of time? In other words can I get "...
0
votes
1answer
110 views

How to show *terminal* buffers in C-x C-b menu

Currently, buffers with *names like this* do not bloat my C-x C-b menu, but now that I'm using multi-term it's important to be able to see these buffers and be able to select them (only the ones with ...
6
votes
0answers
216 views

ivy preview buffer without buffer creation

When searching in a project using a counsel-ag, I want to implement a preview, similar to the counsel-grep. Now I use copy-paste from counsel-ag with :update-fn (lambda () (counsel-grep-...
2
votes
2answers
514 views

How can I run a command on several buffers / files?

I'm working on some code that is spread across several files. I keep finding myself doing whitespace-cleanup and indent-region (on the whole file), and having to do it on each of the six files. Any ...
3
votes
1answer
105 views

is there some sort of namespace(or filter) for files and buffers per frame available?

Using emacs in daemon mode is fine, because you only pay startup time once. But after a while the buffer and file list is getting filled. So is there a way to see only files which belong to the actual ...
1
vote
1answer
100 views

Want to select asterisk buffers after killing the current buffer

I am facing the question about the buffer selected after killing the current buffer. When I kill the current buffer, the recent file buffer is selected ignoring asterisk buffers. Unless there are no ...
4
votes
1answer
131 views

buffer menu unsort entries

Where can I handle how the control + left-click menu displays entries? This is how it looks when it is displayed the way I want, i.e. with no fancy sorting by file type: And this is how it looks ...
1
vote
0answers
27 views

ANSI coloring in emacs start-process output buffer [duplicate]

I am running a process from within emacs which uses ANSI color codes in its output. I'm using start-process to create the process, and provided a custom buffer name for the process's output (start-...
5
votes
0answers
200 views

Rename buffer in Ibuffer

A buffer can be renamed with rename-buffer command. Is it possible to rename buffers from IBuffer? A use case is to rename a bunch of Term buffers from Ibuffer. The default name for Term buffers is *...
3
votes
0answers
92 views

show full file path in helm-buffers-list and helm-mini

I'd like to show the full file path (if available) for Buffers in helm-buffers-list and helm-mini, just like it shows in the Recentf section of helm-mini. How can I do this? The reason is that I ...
2
votes
1answer
48 views

How do I prevent emacsclient --tty FILE from flashing the other frame's buffer before loading FILE

With emacs -Q if you M-x server-start, then open a buffer, then back in the terminal emacsclient --tty SOMEOTHERFILE a new frame will be created, but it will initially show the buffer shown in the ...
1
vote
2answers
48 views

Reload single file in every window

I have this function that reload a file but it don't work when I have same buffer opened in 2 different windows: (defun reload () "Reload a file it will kill buffer, open file again and jump to ...
0
votes
1answer
20 views

Calling previous-buffer does not update the buffer-list so it breaks other functions that depends on other-buffer

I have a lisp function that relies on other-buffer which refers to buffer-list. Calling previous-buffer on a window does not update the buffer-list so it breaks the function. How do make it so ...
2
votes
0answers
25 views

Is it possible to select a buffer by the line at point?

I'm not entirely clear that this is a good idea... but it feels like it might be. To avoid having to think about "which buffer contains what" it might be nice to be able to select buffers by recently ...
1
vote
1answer
141 views

helm-find-files (and others): how to prevent C-j from creating buffer when no match

When hitting C-j in the minibuffer while executing helm-find-files and no match is possible, helm creates a new buffer with the name of the completion. E.g. I do M-x helm-find-files, type foo there is ...
4
votes
2answers
300 views

Save *Messages* history

Many procedures in Emacs write to the *Messages* buffer. I usually kill it from time to time. My problem is that the content gets deleted once the buffer get killed. Is there a way to preserve the ...
1
vote
1answer
145 views

Large blank space between menu-bar and buffer window

There is a large blank space between the top of the buffer and the bottom of the menu-bar in my Emacs 24 on Ubunutu 16.10 that doesn't want to go away. I've tried Googling but can't really find ...
4
votes
2answers
239 views

Something like save-excursion that saves the complete buffer state?

[This question is related to, but not a duplicate of, the question copy contents of current buffer in a temp buffer and operate on that. Besides other incidental things (e.g., the question itself is ...
0
votes
1answer
115 views

M-RET to open buffer in new frame in helm-mini?

Is it possible to add a key binding M-RET to helm-mini which would open the selected buffer in a new frame instead of in the current window?
3
votes
2answers
153 views

How can I create a new buffer for the second run of grep, to avoid overwriting the results of the first run of grep?

When I run grep by M-x grep, I get results in a buffer. When i run grep again M-x grep, the new results overwrite the previous ones in the same buffer. How can I create a new buffer for the second ...
2
votes
1answer
47 views

How modify this function, that it will detect the visibile buffers in all windows?

I found a function, that will kill all buffers except the current buffer that's open. (defun kill-other-buffers () "Kill all buffers but the current one. Doesn't mess with special buffers." (...
3
votes
1answer
522 views

how to restore last helm session?

Is there a way to reopen the last helm buffer including minibuffer content and cursor position ? This would be especially convenient, when using helm-find-files to navigate remote filesystems.
3
votes
4answers
359 views

Only enable auto-revert-mode for the current buffer

I use auto-revert-mode and ideally I would like the auto-revert-interval to be very small, e.g. 0.5 seconds or less. But I am concerned about performance problems when I have many buffers open, ...
3
votes
2answers
505 views

Next/previous buffer in arbitrary order

How to move to previous or next buffer in a fixed & arbitrary order? I am using C-<left> and C-<right> but they move in a variable order, depending on the last viewed buffer, but if I ...
13
votes
2answers
2k views

How to kill a buffer when it causes Emacs to stop responding? [duplicate]

I use Emacs Dired to manage files. Accidentally, I hit Enter on an image file, Emacs tries to open the image and stop response. Is there a way to kill this process? (Since I am running other ...
4
votes
1answer
185 views

How to revert a buffer without changing active modes?

M-x revert-buffer resets the active minor modes to the defaults for the underlying file. How can I preserve the minor modes active while reverting the buffer? My attempt so far: (defun revert () (...
1
vote
0answers
138 views

how to prevent buffer menu from folding

Is there a way to prevent emacs from folding the buffer menu? Example, when I Control + 'right click' on a buffer I see a menu like this: Buffer Menu ----------- JavaScript > XQuery > Custom &...
7
votes
2answers
447 views

How to always kill dired buffer when deleting a folder?

If I'm in dired and have a subfolder with another dired buffer (a common situation when navigating up/down directory) and want to delete a folder, I hit Dx to mark for deletion, then execute. Emacs ...

1 3 4 5 6 7 9