Questions tagged [elisp]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
370 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 ( ...
yury10578's user avatar
  • 111
2 votes
1 answer
226 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 ...
Pablo Marin-Garcia's user avatar
0 votes
0 answers
698 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 ...
tinlyx's user avatar
  • 1,500
0 votes
2 answers
166 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 ...
Spenser Truex's user avatar
1 vote
0 answers
520 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, ...
godblessfq's user avatar
1 vote
1 answer
111 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 ...
Daniel's user avatar
  • 1,142
1 vote
1 answer
85 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!
godblessfq's user avatar
2 votes
2 answers
863 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 ...
godblessfq's user avatar
3 votes
0 answers
740 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 ...
godblessfq's user avatar
1 vote
1 answer
442 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-...
Sean Allred's user avatar
  • 1,232
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,...
gsl's user avatar
  • 227
4 votes
1 answer
403 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-...
xwinus's user avatar
  • 143
1 vote
1 answer
179 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$" ...
xuhdev's user avatar
  • 1,781
1 vote
1 answer
1k 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-...
Kirill's user avatar
  • 262
2 votes
1 answer
429 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 ...
Kirill's user avatar
  • 262
1 vote
0 answers
179 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 ...
Squidly's user avatar
  • 610
0 votes
1 answer
509 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-...
gsgx's user avatar
  • 1,033
0 votes
1 answer
312 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 ...
raco's user avatar
  • 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: ~/...
MostlyHarmless's user avatar
0 votes
1 answer
137 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 ...
lawlist's user avatar
  • 1,377
1 vote
0 answers
684 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 ...
Andrew Larned's user avatar
3 votes
1 answer
2k 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 ...
lawlist's user avatar
  • 1,377
1 vote
1 answer
461 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 [#...
lawlist's user avatar
  • 1,377
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 ...
user281739's user avatar
1 vote
1 answer
59 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).
djk's user avatar
  • 11
1 vote
1 answer
202 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-...
pnj's user avatar
  • 157
12 votes
2 answers
10k 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" ...
Dox's user avatar
  • 497
2 votes
1 answer
2k 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 ...
CodeKingPlusPlus's user avatar
-1 votes
1 answer
313 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
128 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 ...
Arne's user avatar
  • 829
1 vote
0 answers
249 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 ...
Hut8's user avatar
  • 235
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 ...
Hongxu Chen's user avatar
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 ...
Hongxu Chen's user avatar
2 votes
1 answer
125 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 ...
Steen's user avatar
  • 148
1 vote
1 answer
232 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 ... ...
MostlyHarmless's user avatar
0 votes
1 answer
445 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 ...
z_axis's user avatar
  • 101
1 vote
1 answer
621 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 ...
Dror's user avatar
  • 1,908
3 votes
1 answer
71 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-...
Kinshuk's user avatar
  • 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 ...
mkomitee's user avatar
  • 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 ...
rfcoder89's user avatar
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 ...
David Nehme's user avatar
7 votes
2 answers
2k 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 ...
bneil's user avatar
  • 2,077
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>". ...
qazwsx's user avatar
  • 8,849
4 votes
1 answer
513 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 ...
Brad Wright's user avatar
14 votes
1 answer
6k 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 ...
Flow's user avatar
  • 1,428
1 vote
1 answer
222 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 ...
justingordon's user avatar
  • 1,583
0 votes
1 answer
370 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 ...
ggg's user avatar
  • 91
11 votes
2 answers
5k 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 ...
Micah R Ledbetter's user avatar
2 votes
1 answer
370 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.
Loren's user avatar
  • 357
3 votes
2 answers
744 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 ...
Anton Tarasenko's user avatar