Emacs Lisp, a dialect of Lisp embedded in the Emacs editor.

learn more… | top users | synonyms

0
votes
1answer
60 views

Adding syntax highlighting for a comment section in Emacs

I have the following (defun add-c-syntax-highlighting () (font-lock-add-keywords nil '( ("\\<\\(\\-+\\)" 1 font-lock-warning-face prepend) ("\\<\\(FIXME\\):" 1 ...
1
vote
3answers
64 views

How to programmatically create a new Emacs frame with a given name?

I need to be able to create frames and to refer to them programmatically. How can one create a new Emacs frame with a given name, so that he can refer to it later on? I know how to create new ...
3
votes
1answer
47 views

Emacs - move cursor back after mark-whole-buffer & indent-region

I'm Emacs newbie and for automatic re-formating of my source codes in Emacs I've created simple macro using mark-whole-buffer and indent-region commands, mapped to C-j shortcut: (fset ...
0
votes
1answer
31 views

Emacs: dolist doesn't work with dot

I'm new to Emacs. I intend to use sh-mode for a few for file name patterns, so I added the following lines to ~/.emacs.d/init.el: (dolist (pattern '("\\.zsh$" "\\.?zshrc$" ...
1
vote
1answer
74 views

Emacs: make debug-on-error catch errors

When I open an empty haskell file, which activates haskell-mode, I get the message user-error: No items suitable for an index found in this buffer If I do the same thing, but call ...
1
vote
1answer
45 views

Highlighting all compilation errors in emacs

Is there a good way to highlight all compilation errors in emacs, specifically in haskell-mode? The function next-error (C-x `) highlights only a single error, but it doesn't set match-data to the ...
1
vote
0answers
41 views

How can I make emacs ignore bell when recording macros?

Currently, emacs will halt the recording of a macro when the bell rings. This is extremely useful for things like halting when C-s fails to get a new match. However, when I'm recording a macro, and ...
0
votes
1answer
74 views

Don't show tabs in Emacs whitespace mode

Normally, I use spaces for indentation, but for a specific project I'm working on the convention is tabs for indentation. So I've made a .dir-locals.el file that looks like this: ((nil . ...
0
votes
1answer
44 views

how to cd to pwd of emacsclient when exiting

Can someone provide a hook to change directory into the current directory of emacsclient when exiting emacsclient? I often navigate to some files via terminal, pop open emacsclient to edit some ...
1
vote
2answers
350 views

How to load emacs org-mode settings during startup?

I'm trying to use a custom setup for org-mode 8.2 on Windows 7, but it does not work as expected. My ┬┤Emacs`version: GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) of 2012-08-29 on MARVIN What I tried: ...
0
votes
1answer
49 views

Emacs / OSX / Calendar-Mode: Ideas for more spacing between dates

I'm looking for some ideas please to get some more spacing between dates in calendar-mode using Emacs on OSX 10.6.8 (Snow Leopard). Also, any suggestions regarding how to make this buffer-local (if ...
1
vote
0answers
103 views

In Emacs, a combination of visual-line-mode and toggle-truncate-lines makes C-e not go to the end of the line. How do I fix that

With visual-line-mode enabled in Emacs, long lines wrap at natural breaks in the text, allowing me to see all of the text on any given line. Wrap appears in my status bar. Sometimes I want to the ...
3
votes
1answer
120 views

Emacs — packages that provide vertical line column indicators [closed]

In emacs, are there any packages available for displaying vertical lines at every tab stop, or at pre-defined column positions. If possible, I'd like to have multiple thin vertical lines that are for ...
1
vote
1answer
74 views

How to highlight-string and unhighlight-string in buffer — make-overlay

I'm presently combing isearch.el to find out how to highlight-string and unhighlight-string in the buffer. This is needed when highlight-regexp will not work -- e.g., a string like this: ** Active ...
0
votes
2answers
115 views

any hierarchical list editor (Vim / MS Word / LaTeX / Lisp / ..) [closed]

We have hierarchically ordered items stored in a textfile and idented with tabulator. colorsredgreenbluecomputersLinuxMacWindowsnumbersonetwothree It must have guiding lines on the side, because we ...
1
vote
1answer
15 views

What function is M-. (for following functions through TAGs) bound to in emacs?

What function is M-. (for following functions through TAGs) bound to in emacs? I want to bind it to a shortcut (F2, for consistency with IDEs like RStudio and QtCreator).
1
vote
1answer
86 views

get-buffer-window-list throws error in Emacs 24 if name not found

I have code which looks for an open window with one of three commonly used names, "*shell*", "*stata*", "stata". I am running the following elisp code to check for each name: (setq stata-win ...
2
votes
2answers
589 views

Loading all org files on a folder to agenda

I found an org tutorial where it is explained how to load org files from a folder, using (setq org-agenda-files (list "~/org/work.org" "~/org/school.org" ...
2
votes
1answer
319 views

configuring slime in emacs

I am in the process of configuring slime for emacs. So far I have read about basic functionality for common lisp such as C-c C-q which invokes the command slime-close-parens-at-point which places the ...
-1
votes
1answer
100 views

Emacs - Specific Bracket Behavior Customization

In emacs, I prefer the electric-pair-mode behavior for parentheses and brackets as opposed to what seems like the "jumpy" default behavior. However, I currently use auto-newline and like the ...
4
votes
1answer
40 views

Can I customize Emacs via the command line, during startup?

Is it possible to set a customizable variable when I start Emacs? E.g. I have a project name variable, which I usually set interactively using M-x customize-variable, but I'd like to set it already ...
1
vote
0answers
64 views

Emacs TRAMP not activated with Dired

I've been using TRAMP for a few days now. It works very well for the most part. I can load a remote shell using M-x shell, and ido-mode with find-file works very well remotely as well, which was ...
5
votes
1answer
874 views

How to make emacsclient uses differnt themes in terminal and X window?

Sometimes I use emacsclient -t -a '' in xterm, and sometimes I use emacsclient -c as a GUI application. What annoys me is that the font settings and color-theme are initialized when emacs server ...
3
votes
2answers
2k views

Is there an extension that previews markdown instantly?

In vim, there is a plugin called vim-instant-markdown that displays markdown output; and it supports GFM! In emacs, I know there is a markdown-mode that can be used when we write markdown, and we can ...
2
votes
1answer
61 views

Showing file permission bits in the modeline?

I have found myself switching between Emacs and a shell several times today, just to check the file permissions before saving the file I have open in Emacs. Needless to say, this is suboptimal and ...
1
vote
1answer
91 views

Emacs org-mode: how to apply a change in configuration file to agenda?

I'm using GNU Emacs 24.1.1 (i386-mingw-nt6.1.7601) with org-mode 7.9.3d on Windows 7. I'm currently testing new agenda settings and I have my agenda settings like (setq org-agenda-custom-commands ... ...
0
votes
1answer
120 views

Can we integrate the radio into EMMS playlist?

The EMMS uses mplayer to play mp3 files in ~/music. It works great. Sometimes we need to use mplayer to listen radio, i.e. "mplayer mms://livexwb.cri.com.cn/am846.wsx > /dev/null". Can we integrate ...
1
vote
2answers
144 views

Font lock face in emacs

Using M-x customize-face RET RET when the cursor is on a type name (this opens the customization of font-lock-type-face) in a c++ code, I managed to make the face of type names bold. Next, when I ...
3
votes
1answer
47 views

How to open a file whose name is given within another file in Emacs

For example, if my A.txt contains the following line: summary is at: /summary/is/at/summary.txt how can I open summary.txt without having to copy-paste the path, or write the whole path after C-x ...
5
votes
2answers
676 views

Combining two operators in Evil-mode Emacs

In vim I've remapped > and < when in visual mode to >gv and <gv respectively, like so: vnoremap > >gv vnoremap < <gv Since my target for this question are folks experienced ...
1
vote
1answer
170 views

How to replace a keymap in emacs?

I'm currently in the process of changing my emacs configuration quite extensively. I'm not comfortable with the default key-bindings for a lot of the major and minor modes and my configuration ...
3
votes
2answers
196 views

restarting shell process in buffer

In emacs, I often have multiple shell buffers open and use rename-buffer to keep track of them. Sometimes I inadvertently close the shell by hitting too many ^D's, or I'm on a system that ...
2
votes
2answers
365 views

Emacs modify quit-window to delete buffer not just bury it

I'd like to make emacs not just bury a buffer but kill it too when i press "q" in a *Completions*/*Help*/etc buffer. I cant get the substitute-key-definition function to work. I'm running emacs24 on ...
3
votes
2answers
500 views

How to define a shortcut (key combination) to insert “<tag></tag>” in Emacs?

I want to define a shortcut to enter XML tag pairs. Pressing key combination key1-key2 which should prompt for entering a tag name, .e.g. "foo", and automatically insert "<foo></foo>". ...
3
votes
0answers
182 views

With ERC in Emacs, how can I automatically alias server buffer names?

I use ZNC to connect to IRC, and since ZNC seems to have the unfortunate characteristic of making me create a new "login" for each server I want to connect to (i.e Freenode and Quakenet), when erc ...
3
votes
1answer
470 views

How can I write a emacs command that inserts a text with a variable string at the current cursor position?

I would like to write an elisp emacs command that inserts a fixed string that contains a variable part at the current cursor position: \label{$STRING} \index{\nameref{$STRING}} where the command ...
1
vote
1answer
182 views

How to override ctl-tab keybinding in textmate.el minor mode

I'm playing around with textmate.el: https://github.com/defunkt/textmate.el. A little confusing at first if you've never tried textmate, but pretty cool! I'd like to override a binding in the minor ...
0
votes
1answer
202 views

How to stop Emacs from opening binary files

How can I make Emacs give me a warning if I am about to open a file that does not contain text? Example: When I edit a c++ source code in file test.cpp and compile it as an executable test in the ...
5
votes
2answers
332 views

Is there a way to print the definition of an existing function in Emacs?

I want to see the definition of an existing function in Emacs. Is this possible? I've tried C-h d function-name RET, but it only returns the documentation string for the function, not the actual ...
1
vote
1answer
103 views

How to prevent delete confirmation in Emacs Dired?

I type d followed by x, and I am prompted to confirm yes/no. I would like it to just delete, not ask for confirmation.
3
votes
2answers
208 views

Emacs face mode in local file variables

I tired to explicitly set a custom face for a file using local file variables: # Local Variables: # buffer-face-mode-face:'(:family "DejaVu Sans Mono") # End: Emacs catches up these variables, not ...
0
votes
1answer
246 views

Emacs: cannot turn on auto-revert-mode by default

There's this emacs minor-mode called "auto-revert-mode" which automatically reverts the file buffer every 5 seconds. In my .emacs file I just have the line (auto-revert-mode 1) and nothing else, but ...
3
votes
2answers
284 views

Disallow closing last Emacs window via Window-Manager close button

I like to start Emacs as part of a login script and leave it running for the duration of my login session (which is typically weeks). I have scripts to call emacs-client which will allow me to use a ...
3
votes
1answer
881 views

Setting default Emacs window margins

I'm trying to emulate some behavior of the darkroom-mode Emacs mode -- specifically the margins setup. I've figured out one piece of the puzzle -- specifically, to change window margins, I can eval ...
1
vote
1answer
251 views

How to disable ecb and cedet when running emacs in terminal?

I call emacs within the terminal to do quick editing of files, and would like to bypass the long load times.
5
votes
2answers
933 views

How do I get emacs to insert text into an arbitrary file?

I'm trying to create a function that inserts text into an arbitrary file without switching to that file's buffer. I know this could be done with echo, but is there a way to do it using only elisp?
2
votes
1answer
405 views

emacs smart html syntax highlighting

Is there a syntax highlighting mode for xml/html which supports highilghting of markup associated with given (just like for parentheses)? For example if I select 'div' markup - this 'div' and ...
1
vote
1answer
184 views

How do I get Dired to not display certain files?

To start I'd like all *~ files to not be displayed in Dired. EDIT: The below worked: (add-hook 'dired-load-hook (lambda () (load "dired-x") ;; Set dired-x global variables ...
0
votes
1answer
74 views

How do I bind CMD+W to kill the current buffer in Emacs on OSX?

How do I bind CMD+W to kill the current buffer in Emacs on OSX? C-x k RET is unnatural and a comparatively lengthy binding compared to CMD+W.
1
vote
2answers
43 views

Copy/Yank entire Lisp form in Slime

Is there a way to copy/yank a whole a form in Slime/Emacs? For instance, if I have the following function: (myfunc (lst) (myotherfunc lst)) I'd like to yank/copy: (myotherfunc lst) by ...