Questions tagged [elisp]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
184 views

how to use pre-defined variables or constants in (custom-theme-set-faces) in emacs

I'd like to use pre-defined variable or constant of string type in (custom-theme-set-faces), so it would go like (setq Blue128 "#000080") (custom-theme-set-faces 'thename '(default ((t ( ...
  • 111
2 votes
1 answer
191 views

Emacs config lisp code that changes electric-indent-mode before and after pasting from clipboard

Starting at Emacs 24.4 (I think), c-j and ret have been swapped, so indent is now called after ret.  And those indents in text mode are indent-relative, so, when you paste indented code, the code is ...
0 votes
0 answers
510 views

How to config Emacs to fit screen size on startup?

My Emacs often extends outside the visible range of a screen on startup, e.g. on a virtual machine, as shown below. This becomes a problem because the status line is invisible (and it's tedious to ask ...
  • 1,410
0 votes
2 answers
125 views

emacs remove spaces to the edge of the page

I often find myself needing to delete a lot of whitespace to the edge of the page when working in emacs. How can remove it in a quick keystroke? I looked around in the "deleting whitespace" emacs ...
1 vote
0 answers
482 views

yasnippet and evil mode : how to switch to normal mode without exiting the snippet environment

The problem is when I am in a snippet expansion, I hit escape to switch to normal mode, and the snippet is escaped. How can I make it to behave like this: one escape only switch to evil normal mode, ...
1 vote
1 answer
100 views

Emacs major mode key map definition fails

So, I've tried to write a simple major mode (report-mode) using as an example. I seem to have everything working except that the keymap doesn't actually seem to map. If I do C-h f report-mode I ...
  • 1,112
1 vote
1 answer
78 views

how to set a kill string length criterion for storing in kill ring

Is there a way to tell emacs ignore kill that are less than 4 characters long? It is quite annoying to have a lot of single character kills in evil mode. Thank you!
2 votes
2 answers
808 views

How to enable tab complete only in term-line-mode

I have company-mode installed. When I press tab in term-mode, it always calls company-complete. I tried to disable company-mode with (global-company-mode '(not (equal major-mode 'term-mode))) Also ...
2 votes
0 answers
655 views

how to set outline-minor-mode heading levels in outline-regexp

I am trying to add a custom heading to program mode, and I want it to be on the highest level and move all other levels down, so I can add more structure to my long script. For example, for python ...
1 vote
1 answer
390 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 font-lock-warning-...
  • 1,152
2 votes
3 answers
1k 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 frames,...
  • 217
4 votes
1 answer
343 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 'format-...
  • 143
1 vote
1 answer
167 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,721
1 vote
1 answer
893 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 toggle-debug-on-...
  • 252
2 votes
1 answer
366 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 ...
  • 252
1 vote
0 answers
152 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 ...
  • 590
0 votes
1 answer
477 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 . ((indent-...
  • 1,013
0 votes
1 answer
301 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
1 vote
2 answers
2k 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
1 answer
129 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,347
1 vote
0 answers
566 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
1 answer
1k 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,347
1 vote
1 answer
440 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 [#...
  • 1,347
0 votes
2 answers
186 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
1 answer
28 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).
  • 11
1 vote
1 answer
191 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 (get-...
  • 157
12 votes
2 answers
9k 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" ...
  • 497
2 votes
1 answer
1k 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
1 answer
287 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 ...
user avatar
5 votes
2 answers
101 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 ...
  • 739
1 vote
0 answers
221 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 ...
  • 225
7 votes
3 answers
3k 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
2 answers
3k 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
1 answer
104 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 ...
  • 148
1 vote
1 answer
193 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
1 answer
370 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 ...
  • 101
1 vote
1 answer
567 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 ...
  • 1,880
3 votes
1 answer
69 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 C-...
  • 33
7 votes
2 answers
1k 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 ...
  • 596
1 vote
1 answer
1k 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 ...
5 votes
2 answers
1k 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 ...
7 votes
2 answers
1k 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 can't get the substitute-key-definition function to work. I'm running Emacs24 on ...
  • 1,847
3 votes
2 answers
1k 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>". ...
  • 8,349
4 votes
1 answer
476 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 ...
14 votes
1 answer
5k 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,292
1 vote
1 answer
219 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 ...
  • 1,523
0 votes
1 answer
337 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 ...
  • 91
11 votes
2 answers
4k 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 ...
2 votes
1 answer
343 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.
  • 347
3 votes
2 answers
695 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 ...