dot-emacs

How to save a list of all the installed packages in Emacs 24?

别来无恙 提交于 2019-12-02 14:17:20
I am using prelude as a base Emacs configuration. I have installed lots of packages from the package manager, and I want to use my settings on another machine. I don't want to carry the installed packages and also I don't want to create a list manually. What is the way of saving a list all the installed packages into prelude-package.el or any other file so that when I take this configuration to my other machine, they automatically get installed there on first use? ataylor You can get a list of currently installed packages (excluding built in packages) from the variable package-activated-list .

How do I byte-compile everything in my .emacs.d directory?

非 Y 不嫁゛ 提交于 2019-12-02 13:47:43
I have decided to check out Emacs, and I liked it very much. Now, I'm using the Emacs Starter Kit , which sort of provides better defaults and some nice customizations to default install of Emacs. I have customized it a little, added some stuff like yasnippet , color-themes , unbound , and other stuff. I've set up a github repository where I keep all of the customizations so I can access them from multiple places or in case something goes bad and I lose my .emacs.d directory. All of this is very nice, but there is a problem: Emacs takes about 1-2 seconds to load. AFAIK I can compile individual

How set colors for a specific mode?

给你一囗甜甜゛ 提交于 2019-12-02 06:42:27
问题 I'm trying Emacs. I would like to set colors for Eshell. I tried that first with set-foreground-color. But it affects my other modes too. (add-hook 'eshell-mode-hook (lambda ( default ((t (:foreground "#BD8700")))))) But that's not working either. Or it's affecting the colors on other modes/ scratch too. Have anyone a suggestion? This is not a duplicate question, because the other answers change the colors of other buffers as well. 回答1: Here is a link to the documentation regarding remapping

How set colors for a specific mode?

瘦欲@ 提交于 2019-12-02 05:34:52
I'm trying Emacs. I would like to set colors for Eshell. I tried that first with set-foreground-color. But it affects my other modes too. (add-hook 'eshell-mode-hook (lambda ( default ((t (:foreground "#BD8700")))))) But that's not working either. Or it's affecting the colors on other modes/ scratch too. Have anyone a suggestion? This is not a duplicate question, because the other answers change the colors of other buffers as well. Here is a link to the documentation regarding remapping faces: http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html (defun my-eshell-mode

change emacs ruby-mode indent to 4 spaces

蹲街弑〆低调 提交于 2019-12-01 16:02:42
From a previous post I got Ruby mode working in emacs. This is working great. Setting up .emacs file for mac ruby development Our company uses 4 spaces for indents though instead of the default 2. I am having difficulty getting this to work. Here is my .emacs file (add-to-list 'load-path "~/rdoc-mode.el") (require 'ruby-mode) (setq indent-tabs-mode nil) ; always replace tabs with spaces (setq-default tab-width 4) ; set tab width to 4 for all buffers Does anyone see what I am doing wrong? Thanks! Pär Wieslander The tab-width setting only controls the width of a tab character, i.e. how many

How to add a tool-bar button in emacs?

你离开我真会死。 提交于 2019-12-01 11:05:08
I try to add a button in the tool-bar but that doesn't works. how to do that, i check in Emacs wiki and i find nothing. I used emacs 24.3.1. The toolsbar are displayed but not my new item. I can run it with eval-buffer but not with my .emacs or find another solution to resolve that. When i add it with eval-buffer my button leave my toolbar after a scroll. (defun omar-hotel () "another nonce menu function" (interactive) (message "hotel, motel, holiday inn")) (define-key global-map [tool-bar omar-button] '(menu-item "Hotel" omar-hotel :image (image :type xpm :file "/usr/share/emacs/24.3/etc

How to add a tool-bar button in emacs?

别来无恙 提交于 2019-12-01 07:54:36
问题 I try to add a button in the tool-bar but that doesn't works. how to do that, i check in Emacs wiki and i find nothing. I used emacs 24.3.1. The toolsbar are displayed but not my new item. I can run it with eval-buffer but not with my .emacs or find another solution to resolve that. When i add it with eval-buffer my button leave my toolbar after a scroll. (defun omar-hotel () "another nonce menu function" (interactive) (message "hotel, motel, holiday inn")) (define-key global-map [tool-bar

Delete a word without adding it to the kill-ring in Emacs

故事扮演 提交于 2019-11-30 08:46:44
When switching files using the minibuffer (C-x C-f), I often use M-Backspace to delete words in the path. Emacs automatically places what I delete into the kill ring. This can be annoying, as sometime I am moving to another file to paste something, and I end up pasting part of the file path. I know there are workarounds, and the other code is still in the kill ring, etc, but I would just like to disable this functionality. Emacs doesn't have a backward-delete-word function, but it's easy enough to define one: (defun backward-delete-word (arg) "Delete characters backward until encountering the

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

对着背影说爱祢 提交于 2019-11-30 07:20:09
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 crack at it myself. Instead of: (require 'clojure-mode) (require 'tpl-mode) I have this: (defun lazy

Restore Emacs Session/Desktop

耗尽温柔 提交于 2019-11-30 05:15:07
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 . This only seems to restore files that are open, not shells or anything else running within buffers. I