dot-emacs

Reload .emacs for all active buffers

故事扮演 提交于 2019-11-30 05:02:09
A question already has been asked how to reload a .emacs file after changing it . The proposed solutions were to use M-x load-file or M-x eval-region RET on the changed region. Neither of these solutions affect other open buffers for me. Is there a way to reload the .emacs file for all open buffers? I should also note that the M-x load-file does not have the desired effect for reasons outlined in the comments to that answer . Your .emacs file is a global configuration that gets evaluated once only. It does not get applied to each buffer individually. How you actually achieve what you want is

When using two frames in emacs, how do I prevent the compilation buffer from showing up in both?

一个人想着一个人 提交于 2019-11-29 20:58:27
I work with two monitors, and often use emacs with two frames open; one for each monitor. each frame is split into two side-by-side windows, like so: a | b <-- frame 1 in monitor 1 ------- c | d <-- frame 2 in monitor 2 When I hit my 'compile' button while in window a, the compilation buffer opens in the buffer next to it. So far so good: a | compilation ----------------- c | d However, if I then move to window c to edit some stuff, then hit compile again, window d visits the compilation buffer as well: a | compilation ------------------ c | compilation So now I have half of my screen real

How can I emulate Vim's * search in GNU Emacs?

天大地大妈咪最大 提交于 2019-11-29 20:56:31
In Vim the * key in normal mode searches for the word under the cursor. In GNU Emacs the closest native equivalent would be: C-s C-w But that isn't quite the same. It opens up the incremental search mini buffer and copies from the cursor in the current buffer to the end of the word. In Vim you'd search for the whole word, even if you are in the middle of the word when you press *. I've cooked up a bit of elisp to do something similar: (defun find-word-under-cursor (arg) (interactive "p") (if (looking-at "\\<") () (re-search-backward "\\<" (point-min))) (isearch-forward)) That trots backwards

Tips for profiling misbehaving Emacs Lisp?

佐手、 提交于 2019-11-29 20:08:58
I customize Emacs a lot. Recently, I added something to my .emacs configuration that sporadically pegs my CPU at 100%, but I really don't know what it is. If I press C-g a bunch of times, eventually I'll get a message below the minibuffer asking me if I want to auto save my files and then if I want to abort emacs entirely. If I keep saying no and keeping pressing C-g, eventually I can get back to running emacs as normal. An hour or so later it will happen again. I could keep going about like I am, commenting out various things I've added recently, restarting emacs, trying to narrow down the

How to have Emacs auto-refresh all buffers when files have changed on disk?

亡梦爱人 提交于 2019-11-29 18:49:48
I have a non-emacs global search and replace function that causes my disk files to become more up-to-date than my emacs buffers (en masse). Is there any way to tell emacs to refresh all the buffers from disk in one fell swoop, instead of having to do each one individually by reloading the file? Thanks! D Ashwin (global-auto-revert-mode t) in your .emacs . Here is an alternative if you are using Emacs GUI (Mine is GNU Emacs 25.1.1 on Windows 7): Click "Options" in menubar Select "Customize Emacs" Select "Saved Options" Then you should see a search field where you enter "global-auto-revert-mode"

How to execute emacs grep-find link in the same window?

与世无争的帅哥 提交于 2019-11-29 10:02:10
When I use grep - find it opens another window (area in the frame) with a list of results that I can select. When I select one it opens the target file in a different window than grep - find is in. How can I get the target file to open in the same window as the grep results (replacing the grep results window with what I am actually looking for). How can I keep grep-find from opening a separate window (have it so it opens in the current window). My goal is I look for something, I find it, I go to it, all within the same window. I would like to add this to my .emacs file. It doesn't look like

Emacs: Best-practice for lazy loading modes in .emacs?

时间秒杀一切 提交于 2019-11-29 08:46:44
问题 Is there a best practice around lazily loading modes when encountering a relevant file extension? At this point I have roughly 25 different Emacs modes installed, and startup has become slow. For example, although it's great to have clojure-mode at the ready, I rarely use it, and I want to avoid loading it at all unless I open a file with extension .clj. Such a "lazy require" functionality seems like the right way do mode configuration in general.. I found nothing online, so I've taken a

Disable Carbon Emacs scroll beep

大城市里の小女人 提交于 2019-11-29 08:43:34
问题 I've been looking into adopting Carbon Emacs for use on my Mac, and the only stumbling block I've run into is the annoying scroll beep when you try to scroll past the end of the document. I've looked online but I can't seem to find what I should add to my .emacs that will stop it from beeping when scrolling. I don't want to silence it completely, just when scrolling. Any ideas? 回答1: (setq visible-bell t) This makes emacs flash instead of beep. 回答2: Using the hints from the Emacs wiki

Restore Emacs Session/Desktop

こ雲淡風輕ζ 提交于 2019-11-29 02:45:55
问题 I've been searching for how to restore an emacs session, with no luck. I'm looking to restore all previously open buffers, some of which might contain erc, shells, directory listings, files, etc. Every time I open emacs, I spend a considerable amount of time arranging my buffers; splitting them into rows and columns, opening a shell, arranging irc channels. It takes a while to get onto work. I've tried adding the following to my init.el (desktop-save-mode 1) And then using M-x desktop-save .

Programmatically setting Emacs frame size

ぃ、小莉子 提交于 2019-11-28 16:43:14
My emacs (on Windows) always launches with a set size, which is rather small, and if I resize it, it's not "remembered" at next start-up. I've been playing with the following: (set-frame-position (selected-frame) 200 2) ; pixels x y from upper left (set-frame-size (selected-frame) 110 58) ; rows and columns w h which totally works when I execute it in the scratch buffer. I put it in my .emacs, and although now when I start the program, I can see the frame temporarily set to that size, by the time *scratch* loads, it resets back to the small default again. Can anyone help me fix up the above