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.

2
votes
1answer
28 views

Can flymake or flycheck mark in dired (or in buffer lists) files with errors?

It would be nice if, in addition to flymake/flycheck marking errors in particular files, they could somehow mark files with errors in dired (or maybe just in the open-buffers list). The goal would be ...
3
votes
3answers
87 views

User command to reload file-local variables

How can I easily reload file-local variables, after I have changes their values in the file buffer? I know a work around Save and close the file and re-open. But this is pretty cumbersome.
0
votes
1answer
16 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 ...
1
vote
0answers
25 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 ....
2
votes
3answers
37 views

How to get the argument from previous use of `command-execute`?

I want to automatically rename the buffer name of compilation mode. The default name is *compilation*. Let's call my new compilation command my-compile. So supposing we run my command like this: M-x ...
1
vote
1answer
37 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
45 views

Save place in files but don't move the cursor to the saved position automatically

I'd like to have a command that moves the cursor to the last position it was in when I left the buffer (either by killing it or by killing Emacs). I know I can use saveplace.el to save the position ...
0
votes
0answers
41 views

How to show the output of a command in a quick-fix window?

If I have a command that runs and generates the following output. /path/to/file.rst:1 /another/path/to/file.rst:42 How would I call the command so a buffer is opened and clicking on the line jumps ...
0
votes
0answers
35 views

Force opening file in new buffer

Is there a way in emacs to open a file (or a dired directory) in a new buffer, even if there's a buffer with the same file (or directory)? find-file and find-alternate-file always return the open ...
1
vote
1answer
36 views

Set the major mode of a new buffer interactively

When creating a new buffer via: C-x b NonExistentBufferName RET RET I would like Emacs to ask me what major mode this buffer is going to use upon opening. Moreover, I want Emacs to infer the major ...
0
votes
0answers
10 views

How to use helm-locate (or similar) when saving a buffer?

When opening a file, I often use helm-locate to quickly access any file anywhere. But when saving a new buffer, I navigate through the directory structure to get the location I need. Is there a way to ...
1
vote
1answer
33 views

How to make *Shell Command Output* buffer scroll to the end?

I often execute shell commands via M-! and their output is then shown in the buffer *Shell Command Output*. How can I make this buffer display the end (rather than the beginning) so that I can see ...
1
vote
1answer
33 views

desktop-save-mode: prevent emacs from showing each buffer on start-up

If you use desktop-save-mode, and have several hundred buffers saved, when you start emacs, emacs cycles through these buffers and shows each of them for a split second. Can this be prevented?
1
vote
1answer
22 views

emacs 25: display-buffer-other-window behavior change, how to tune for the old way?

I have a number of macros for browsing source code for many emacs versions. I wrote this in 2009 and it's been solid until upgrading to U18.04. I know it worked in U16.04: (defun get-file-from-...
1
vote
1answer
31 views

Select *Input History* buffer

The Emacs *shell* has a nice command history accessible via C-c C-l (comint-dynamic-list-input-ring). However, in classic Emacs fashion, the *Input History* buffer which displays the history is not ...
0
votes
1answer
32 views

Treat symbolic-link as separate files while visiting

Is there a way to make Emacs visit already visited file(with active buffer) via symbolic-link as a different file? I want them(links/file paths) to be visited by different buffers. It will be best if ...
0
votes
1answer
18 views

What does it mean in ebib when a field of an entry is preceeded with an asterisk '*'?

When viewing entries in a database in ebib, some fields of some entries are marked with an asterisk (*). In my case, these are usually year or month field. I don't see a rhyme or reason to the types ...
1
vote
2answers
25 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
41 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
37 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
34 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
26 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
25 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
24 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
57 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
82 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
82 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
49 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
89 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
88 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
76 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
77 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
46 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
39 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
52 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
59 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
74 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
114 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
63 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
118 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
27 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
85 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
56 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
68 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
51 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
60 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 ...