Hot answers tagged

9

You need to change the option shell-file-name. (setenv "SHELL" "/bin/bash") This doesn't work since Emacs is already running thus it's too late, Emacs initializes shell-file-name according to SHELL during startup. Something like $ SHELL=/bin/bash emacs should work. (setq explicit-shell-file-name "/bin/bash") This is for M-x shell, not M-x shell-...


5

I've argued the same thing for a long time: delete-selection-mode should be turned on by default. I argued for turning on transient-mark-mode by default, and after decades that eventually happened. The main reason delete-selection-mode is not on by default is inertia, aka tradition, I think. It is expected by most users of editors and other applications ...


5

Let's say you already did a query-replace of thing1 with thing2. Here is how it goes if you want to use thing1 as the first argument again. It is not automatic but you don't have to type in the whole thing1 either. The benefit of this approach is more more when doing query-replace-regexp and you need to repeat a very complex regexp. Call query-replace or ...


3

Personally, I want all Menlo all the time. I achieve this in Aquamacs with: (when window-system (setq initial-frame-alist nil) ;; Undo Aquamacs forced defaults (setq default-frame-alist nil) ;; Undo Aquamacs forced defaults (aquamacs-autoface-mode -1) ;; Use one face (font) everywhere (set-frame-font "Menlo-12") ;; Set the default font ...


3

In the general case, what you want cannot be achieved. This is because several utilities and modes in Emacs store their read-completion history in different variables, not in one location. You can manually set those history variables to nil (for your C-x r t example, (setq string-rectangle-history nil)), but it doesn't scale. It's also not easy to ...


3

Don't use C-x r t (string-rectangle), use C-x r k (kill-rectangle) instead.


2

Please see the documentation for "Reading File Names" with elisp. There you can read that normally read-file-name and therefore interactive with the code letter F provides the default-directory as initial input. You get the default file name if you press the down-arrow button. Nevertheless, you can also insert some initial file name for read-file-name with ...


2

option 1: (better) edit .spacemacs: inside: (defun dotspacemacs/user-load ()) and: (setq shell-default-shell 'eshell) option 2: You can try go directly into $HOME/.emacs.d/layers/+tools/shell/config.el and edit last points: (defvar shell-default-shell (if (eq window-system 'w32) 'eshell 'ansi-...


2

It wasn't a naming issue, it was a dependency issue possibly related to me using Red Hat Fedora. I was missing the liboft-dev library emacs needs to read .otf files, which are separate from the liboft libraries in Red Hat. When looking at the ./configuration output, it stated: Does Emacs use -lfreetype? no Does Emacs use -lm17n-...


2

It's possible to use your keys much more efficiently when the mark is active than simply binding all of them to delete the region. lispy is a nice example of this: When the region is active, all keys a through z are bound to different commands. When the region isn't active, all keys a through z self-insert. Here's a simple example: (global-set-key (kbd "...


2

The code below uses a new feature in 26.1 called variable-watcher. It allows a function to observe changes in some variable's value. But more or less the same could be achieved by using hooks and/or advices covering all standard functions which are changing the directory (e.g. find-file-hook). There may be unforeseen consequences to this. ;; -*- lexical-...


1

The dired section of the Emacs manual says: The usual history and completion commands can be used in the minibuffer; in particular, ‘M-n’ puts the name of the visited file (if any) in the minibuffer (*note Minibuffer History::). So, typing M-n at the minibuffer prompt will fill out the name and allow you to change it.


1

Are you sure that the default is to truncate long lines? This is controlled by the value of the variable truncate-lines whose default is nil. So by default any buffer that does not modify that value should be wrapped at window edge. Check with C-h v truncate-lines RET to see what the default value is. Here for example is what I get in a c-mode buffer: ...


1

You ask, "assuming the local variable takes precedence, why would changing the default value have an effect, but not changing the local value?" If you use setq in your init file, and if the variable is buffer-local in the buffer that is current when your init file is evaluated, then only the value in that buffer gets set. Probably the problem is that the ...


1

I have the function now working to my satisfaction, as below, but am open to suggestions if I'm not doing things optimally. In the solution below, I use function read-file-name to prompt the user, and use condition-case to trap a user response of C-g, the quit signal, so that the default buffer file name is set for the buffer. (defun my-write-test () (...


1

You can use library narrow-indirect.el to help here. Use command ni-narrow-to-region-indirect-other-window (I bind it to C-x 4 n n) to open an indirect buffer that shows just the current region (e.g. of Devanagari text). There, you can use your (face-remap-add-relative 'default :family "Lohit Devanagari") to change that buffer's font, for Devanagari. The ...


1

@Tobias answers most of what your question asks. This bit was missing, however: why do you see a directory name inserted after the prompt for a file name, in the minibuffer? That is controlled by user option insert-default-directory. C-h v tells you: insert-default-directory is a variable defined in minibuffer.el. Its value is t Documentation: ...


1

Solved. Looks like the relevant attribute I was looking for was arglist-cont-nonempty. Added this to my .emacs file: ;; adjust open list indentation (add-hook 'java-mode-hook (lambda () (c-set-offset 'arglist-cont-nonempty 8)))


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