Hot answers tagged

5

highlight-nonselected-windows is a variable defined in xdisp.c. Its default value is nil. A non-nil value means highlight region even in nonselected windows. You can customize this variable, e.g.: (setq highlight-nonselected-windows t)


5

You'll need to write your own function for doing this. You'll want to read up on the functions get-buffer-process and signal-process to learn about how to send the right signal to the ESS process. Here is an example: An interactive function that sends a SIGINT to a buffer of your choosing. You can modify this function to target whatever ESS buffer you ...


4

The irregular nature of those windows in your images and the lack of being able to manually resize them suggest you may be using a window-management minor mode such as golden-ratio (http://github.com/roman/golden-ratio.el) or zoom (http://github.com/cyrus-and/zoom). Further clues to check: Do the windows resize themselves to make the active window larger ...


4

I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key. (defun repeat-command (command) "Repeat COMMAND." (require 'repeat) (let ((repeat-previous-repeated-command command) (repeat-message-function #'ignore) (last-repeatable-command 'repeat)) (...


4

What Org emits here is a printed representation of an otherwise opaque window object. While you can serialize a window to a string, you cannot go back from the string to the window. You can recognize such data types by their printed representation looking like #<...>, see https://www.gnu.org/software/emacs/manual/html_node/elisp/Printed-...


3

I battled with this phenomenon for years and discovered that Emacs automatically recreates a scratch buffer if there are no other buffers. In addition, Emacs creates a scratch buffer on startup. There are a variety of factors that affect how buffers are displayed on startup, including, but not limited to the hard coded (baked-in) startup.el. The startup....


3

I don't think anyone has already implemented exactly this, but you might look into code folding. Folding allows you to hide and show parts of the buffer on command. There are implementations of code folding for specific languages, as well as some which are more generic. Some are keyed off of indentation, others off of syntax elements (such as curly braces or ...


3

hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around. (defhydra other-window (:color red :body-pre (other-window 1)) "other window" ("o" (other-window 1))) (global-set-key (kbd "C-x o") #'other-window/body)


3

You can do M-x ess-interrupt.


3

Opening Two Buffers on Startup You could add a function to emacs-startup-hook which switches to the first buffer you want, splits the window, moves to the next window, and switches the second buffer (this is exactly what the function below does). You didn't specify whether the buffers you wanted to display were file buffers or already existing buffers. Here ...


2

For Emacs 26 and later you can use emacs-maple-minibuffer or ivy-posframe if your are using ivy. Those packages let you configure to popup a minibuffer frame at any position, including the current window top/bottom. The docs of those packages describe how to set them up.


2

Sorry not sure how to paste this as a comment, this works for ESS: (defun my-interrupt-ess-buffer-process () "Send a SIGINT to script's iESS process." (interactive) (signal-process (ess-get-process-buffer) 'sigint))


2

Customize the variable ispell-choices-win-default-height, which has a default value of 2. The doc-string states: "The default size of the `*Choices*' window, including the mode line. Must be greater than 1."


2

One possible way: save the current window configuration to a register, maximize and then when you are done, restore the saved window configuration. E.g. to save it in register R: C-x r w R; then to restore: C-x r j R. These run the commands window-configuration-to-register and jump-to-register resp. You can look at the doc strings of these functions with C-h ...


2

The Elisp below defines a command my-delete-compilation-window that deletes the first compilation window in the window list. That should normally be the last selected compilation window. The command is bound to C-c w but you can modify that to your own liking. (defmacro with-compilation-window (&rest body) "Select first compilation window in `window-...


2

If you want to target whichever compilation (or similar) buffer is currently being used by next-error and previous-error, I would suggest this: (defun my-delete-compilation-window () "Delete all windows displaying the `next-error-find-buffer' buffer." (interactive) (when-let ((buf (next-error-find-buffer))) (delete-windows-on buf))) Or based on ...


2

C-hv window-min-height The minimum total height, in lines, of any window. The value has to accommodate one text line, a mode and header line, a horizontal scroll bar and a bottom divider, if present. A value less than ‘window-safe-min-height’ is ignored. The value of this variable is honored when windows are resized or split. I found this with M-x ...


2

If you use Icicles then you can use command icicle-select-window to switch to windows by name, using completion. icicle-select-window is an interactive compiled Lisp function in icicles-cmd1.el. (icicle-select-window) Select window by its name. With no prefix arg, candidate windows are those of the selected frame. With a prefix arg: ...


2

Try this: (defun olav-split-window-left () (interactive) (select-window (split-window-right)))


1

Would it suit your purpose if you had a command which searched for the next line in the buffer which has a number in it and then showed you just that line? (defun go-to-next-line-with-number () (interactive) (widen) (unless (bobp) (end-of-line)) (when (search-forward-regexp "[0-9]" nil 0) (save-excursion (narrow-to-region (...


1

The option magit-display-buffer allows you to control in great detail how buffers are displayed.


1

You can automatically have the *Help* window be selected when it is displayed, by customizing option help-window-select. help-window-select is a variable defined in help.el. Its value is t Original value was nil Documentation: Non-nil means select help window for viewing. Choices are: never (nil) -- Select help window only if ...


1

Have you tried the various code navigation bindings? I often set the mark to remember where I start and then do C-M-u repeatedly to go up in the code structure. Then C-x C-x gets me back to my mark (and C-g gets rid of the active region if necessary). There are other such bindings: C-M-f goes forward one statement at the same level and C-M-b goes back. So ...


1

Not too clear. Is what you want to open Emacs, from outside Emacs, to edit a file? If so, use program/command emacsclient or emacs followed by a file name. See the Emacs manual, node Action Arguments and perhaps node Emacs Server.


1

(/ (window-pixel-width) (window-font-width nil face)) will return the current window width for a given face.


1

Add the following to your init file: (winner-mode 1) Then whenever your window configuration is unexpectedly changed, or you simply want to go back to an earlier configuration, use C-c<left> to call winner-undo (which you can do repeatedly if necessary). Obviously if additional window config changes have happened since the window in question was ...


1

What troubles me here is that the totally nebulous computation that I removed did not affect anything. And for a reason. The temp-buffer-max-height variable does not have any effect unless another variable, namely temp-buffer-resize-mode, is set to t. Both variables are customizable. This is kind of documented with the temp-buffer-max-height variable help: ...


1

The customization I want is: (custom-set-variables '(one-buffer-one-frame-mode nil nil (aquamacs-frame-setup))) Instead of: (one-buffer-one-frame-mode t nil (aquamacs-frame-setup)))


1

along with a message about the desktop file already being in use Emacsclient does not attempt to process the desktop file, so you are clearly starting a new instance of Emacs. If emacsclient can't connect to the server, but you either passed it -a '' or --alternate-editor='' or else have the ALTERNATE_EDITOR environment variable set to an empty string, ...


1

You could write a function similar to text-scale-adjust. E.g. (defun mw-other-window-repeat (count &optional all-frames) "Wrapper around `other-window' to continue to jump to other with key o." (interactive "p") (other-window count all-frames) (message "Use o to jump to next window.") (set-transient-map (let ((map (make-sparse-keymap))) ...


Only top voted, non community-wiki answers of a minimum length are eligible