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
0
votes
0answers
14 views

Emacs python-mode language formatting does not reapply on buffer on newly typed text

When I open a .py file for the first time the formatting is perfect, colors match special words as expected in Python But when I type new text in the buffer, it inherits the color of the same ...
1
vote
1answer
44 views

Force one window when opening multiple files

Any time I open multiple files I'd like emacs to only show me one buffer. I do not want any split windows. This would save me a keystroke every time. I learned I could do away with the buffer list ...
0
votes
0answers
30 views

How can I get a listing of all buffers and the frames displaying them?

I want to get a list of all the windows and their frames, so I can jump directly to the frame and window. If a buffer is not open in a window then the command should still jump to the last frame in ...
0
votes
0answers
26 views

Rename another buffer

There are buffers that prevent you from being able to execute interactive commands (by overriding the default M-x binding). For example, *ansi-term* buffer would do this. (I know you can do C-cM-x to ...
0
votes
1answer
31 views

Why does this function (that uses save-excursion) leave me at another buffer [duplicate]

I'm trying to write a command that allows me to search for an org-mode entry and inserts a link to it at point (using its id). Here's the code: (defun org-link-to-entry () (interactive) (let ...
0
votes
0answers
35 views

Python C-c C-c closes all other buffers

I am working with some python code and using C-c C-c to run one specific buffer while other python source files are open. As soon as it is launched, the other buffers are closed. This is highly ...
4
votes
2answers
153 views

How to move the cursor to a newly opened buffer only when the newly opened buffer can be closed with q?

Some buffers can be closed by being in them and pressing q such as the help buffer, doing C-h k M-x will open a help buffer describing the keybinding M-x. Although, the cursor will stay in the ...
0
votes
0answers
27 views

helm-ag (or equivalent) open selection in existing window?

If you run helm-ag (I typically do this with helm-projectile-ag, but I think it should be similar) and select a match, the file / buffer opens in the last used window. My question is this: If a you ...
0
votes
0answers
27 views

Buffer switching only on file buffers [duplicate]

How to make the commands next-buffer and previous-buffer ignoring buffer that does not display files? The problem is when I am on the last buffer of the list I have for example the *completion* and *...
1
vote
1answer
36 views

How to enable org mode and evil mode for untitled buffer when creating a new frame

The code below creates a new frame with an untitled buffer, how to make this buffer default with org-mode and evil-mode? (global-set-key (kbd "s-n") 'new-empty-frame) (defun new-empty-frame ...
0
votes
0answers
38 views

Setting up Emacs as an external editor on windows 10

Apologies if this has been asked multiple times already, haven't found a useful answer. I am trying to use Emacs as an external editor on two separate applications in windows 10, one is a notes app (...
6
votes
3answers
197 views

How can I kill buffers based on mode?

I know about kill-matching-buffers but that searches buffer names, I want instead to search buffer modes. For example, I might want to kill all buffers that have "notmuch-" or "[Notmuch]...
2
votes
1answer
46 views

force kill a buffer?

I have a buffer (belonging to ein mode that got into a bad state) that throws an elisp error every time I try to kill it (using ibuffer, M-x kill-this-buffer, etc.) Backtrace suggests that the buffer ...
1
vote
2answers
60 views

How to delete the contents of a buffer by name

For example in gdb mode, there is a buffer named *input/output of <program name>*, that I want to clear each time I press C-c l.
0
votes
1answer
33 views

Changing buffer name in emacs

How to change the buffer name in emacs to any given string? Useful if one has many shell buffers for various specific tasks and is merely seeing their order of creation.
0
votes
0answers
42 views

How to add a kill-buffer item at the beginning of the Buffers menu-bar menu?

When I want to kill a buffer and I have my hands on the keyboard it's simply C-x k RET but if I have already the right hand on the mouse the k RET part is a bit out of reach for my left hand… ...
0
votes
1answer
45 views

reverse buffer order

I open Emacs from the command line to inspect 10+ files, say like this: emacs *.java However, all the files are listed in reverse order. This is getting kind of annoying--I'd like to start with the ...
0
votes
1answer
41 views

Re-fill compilation-mode buffer from shell script

This might require more tricks than just Emacs-fu, but since Emacs is at the heart of it I hope to get some ideas on how to approach my need here. I use Emacs/Make/gcc as my development environment. ...
1
vote
1answer
21 views

magit-diff jumps to insertion/deletion in already opened window (no overlay)

I have 2 windows open: One is the magit-diff of the current repo, the other is just source codes from that repo. In source codes (the right window), I have a file opened, say "sample.txt". In magit-...
3
votes
1answer
85 views

How to disable changing the current buffer by clicking buffer name in mode line?

I find myself accidentally clicking the mode line when trying to focus a buffer with the mouse. This causes the buffer to change. I don't want that behavior. I want nothing to happen. The culprit ...
3
votes
1answer
73 views

How to search and replace in *open buffers*

I want to interactively search and replace in all (or, preferably, a regexp subset of) my buffers (not files). Scenario Being a pack-rat sort of guy, I never delete my buffers until I'm sure I don't ...
0
votes
0answers
12 views

Center the following buffer in next-error-follow-minor-mode

I am using next-error-follow-minor-mode to preview my search results. The problem is that the preview buffer doesn't center around the current line: Related
0
votes
1answer
63 views

Why set-window-dedicated-p doesn't work with certain buffers?

I use emacs for latex, with pdf-tools. My layout is always a window with PDFView buffer on the right, any other buffer on the left. I always want the right window that cannot be touched by ...
0
votes
1answer
128 views

An ivy function for recently opened files?

I know that setting ivy-use-virtual-buffers leads to recently opened files being shown in the ivy-switch-buffer completion. However, I don't want this. What I want is a separate function for opening ...
1
vote
1answer
14 views

List of hooks inhibited by inhibit-modification-hooks

The documentation of inhibit-modification-hooks states Non-nil means don't run any of the hooks that respond to buffer changes. This affects before-change-functions and after-change-functions, as ...
0
votes
2answers
27 views

Interactive function to convert Windows path to POSIX path

Here at 'dayjob I'm often sent paths from developers using Windows in Windows format: D:\Some\Path These paths can uniformly be converted to paths valid on at least some Linux machines at 'dayjob ...
0
votes
1answer
24 views

How to byte-compile a file in the background?

To cut time on untangling my org setup file, I now only compile on save. However it is somewhat annoying to have the compile buffer popup on every save. ;; Only untangle on a change/save (defun ...
1
vote
1answer
42 views

why is switch-to-buffer effect not visible immediately when called in a list with other functions?

I have a key bound to some program which prepares a buffer, switches to it via switch-to-buffer and afterwards calls some function which modifies the buffer (and can take a few seconds to execute). ...
1
vote
1answer
30 views

How to insert a piece of text in a new buffer?

I have the following code: (defconst cljs-test-report-buffer "*cljs-test-report*" "Buffer name in which to display test reports.") (defun cider-test-show-report () "Show the test report ...
1
vote
1answer
25 views

How to save and restore the association of a window to buffer across Emacs sessions?

I have a window layout with three windows and I would like Emacs to remember the buffers even if the buffers don't exist after restart. Context: I am using Spacemacs for Clojure development. In ...
1
vote
1answer
41 views

Check if a buffer's name ends with `.org`

I want to write a function to check if a buffer is an Org buffer. Here is my attempt. (defun org_bufferp (buffer) (if (bufferp buffer) ((setq buffer_name (buffer-file-name buffer)) ...
0
votes
0answers
28 views

Opening a Remote Shell Renames Buffer Open to \*shell\*

here is a simple elisp program for opening a shell in a named buffer: (defun shell-make (dir buffer-name) (let* ((default-directory dir) (buffer (get-buffer-create buffer-name))) (set-...
0
votes
0answers
29 views

How to find what is creating and killing so many buffers?

A bunch of creating and killing buffers in my setup and I can't track down what is it. Here is my debug code: (add-hook 'kill-buffer-hook (lambda() (message "Killed: %s / %s" major-mode (...
1
vote
1answer
32 views

Relationship between frame, buffer, and file

I am trying to check how frame, buffer, and file work. It seems to me that frame commands(C-x 5 ...) create a frame, whether a buffer or file exists or not. Here is what I am thinking: C-x 5 2 1. ...
0
votes
1answer
45 views

How could “C-x 4 b ”which pop-up-window but display to the right?

In emacs -Q, I strike C-x 4 b which invoke (switch-to-buffer-other-window) and display the other window vertically as I reference it's source code (defun switch-to-buffer-other-window (buffer-or-...
0
votes
1answer
67 views

How to prevent a file show up for a second when emacsclient starts?

I am using emacs-daemon. When every I re-start my daemon and do C-x C-b my Buffer List seems always full. Later, when I start my emacsclient for a seconds(like a fast flash) it shows a file that ...
0
votes
0answers
58 views

how can I re-use the window created by `display-buffer-in-side-window`?

I'm creating a window at the bottom of the frame with display-buffer-in-side-window and it displays a given buffer, I would like to have another buffer created but re-use that exact same window. How ...
0
votes
0answers
60 views

disable automatic python file scrolling if using blacken or yapfify

I am using blacken to automatically format my python files (use-package blacken :demand t :after python :init (add-hook 'python-mode-hook 'blacken-mode) ) (use-package python :mode ("\\.py\\'" ...
1
vote
1answer
73 views

How to configure a command to open in same-window unless already open in active frame?

I can use display-buffer-alist to configure a command to open in the same window: (add-to-list 'display-buffer-alist '("*grep*" display-buffer-same-window)) The problem in this case, however, is if ...
0
votes
2answers
61 views

query-replace{-regexp} fails in linux in a non-X terminal when I am in anything other than text mode

I am running emacs 26.1 under linux. It has been working fine for over a year. Recently, I upgraded a lot of packages on my machine, but I did not upgrade nor alter emacs in any way. Now, query-...
0
votes
1answer
30 views

buffer-substring fails in linux in a non-X terminal when I am in anything other than text mode

NOTE: I was careless in evaluating this problem, and the data I posted here is not correct and does not reflect the actual issue that I am facing. Since there are already answers to this question, I ...
0
votes
2answers
45 views

Standard ML Emacs “real time” compilation?

I'm interested in configuring my Emacs environment to perform real-time compilation of a Standard ML buffer, on the event corresponding to a ";" character being entered (at the end of a line), such ...
1
vote
1answer
75 views

ESS: display-buffer-alist reusable-frames does not work as expected

I'm trying to use the display-buffer-alist variable to control how Emacs displays spawned inferior shells (ess-r in particular). I'm using the display-buffer-alist value from ess doc: (setq display-...
1
vote
2answers
73 views

Change major mode for buffer without a corresponding file

I want to change the major mode from fundamental-mode to compilation-mode for a buffer which contains some generated output named for eg. *results*. I've tried to add an entry to auto-mode-alist but ...
0
votes
0answers
81 views

how to buffer video output from a .mp4 file?

Just like images and tetris game, I want to select a region preserved for buffering saved video files. The goal is to get a cool looking notebook that supports my vlogs.
1
vote
1answer
38 views

How to create a function that have the functionality of helm-projectile-switch-to-buffer but with added opened org files?

I really like helm-projectile-switch-to-buffer as it shows buffers for the specific project I am working in (i have multiple projects open at the same time). But I also rely on org files for notes and ...
0
votes
3answers
290 views

Killing current buffer reliably

I try to add a nicer key binding to kill the current buffer. An obvious solution is to use kill-this-buffer, but often it does not work, or e.g. does not work the first time. The key binding for it ...
0
votes
0answers
41 views

Work in indirect-buffer faster than in original?

When I read the org-manual which are about 12,000 lines long, it's slow to edit such a large file. Then I invoke "narrow-to-substree" and read "2.Documents Structure" in a indirect-buffer. At this ...
0
votes
0answers
139 views

Always open buffer in a new frame instead of a window

I found this question which suggested that setting pop-up-frames to a non-nil value should enable this behaviour. However when I added (setq pop-up-frames t) to my emacs init only some of the buffers ...
2
votes
1answer
144 views

Rename org buffers to org's +TITLE instead of filename

I have hundreds of org files in a single directory that I use as a personal knowledge base and use deft to quickly find and open them. Each file is automatically named based on the current time (yyyy-...

1
2 3 4 5
9