Questions tagged [elisp]

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

69 questions
20
votes
5 answers

How do I complete file paths in emacs?

Say for instance I'm editing a config file and I want to type in a path. Is there a plugin for emacs that lets you complete a file path in that buffer? I've searched for this and there's like a bazillion completion plugins out there.
Jason Baker
  • 8,932
14
votes
1 answer

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 should query for $STRING and insert the whole text.
Flow
  • 1,556
12
votes
2 answers

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" "~/org/home.org")) Question Is…
Dox
  • 497
12
votes
2 answers

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 function itself. I'm thinking something similar to…
11
votes
1 answer

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 (set-window-margins nil
tariqk
  • 241
9
votes
6 answers

Emacs + git: auto commit every 5 minutes

How can I set up emacs to automatically git commit every time I save an open file or periodically?
Tanami
  • 113
8
votes
3 answers

How to get emacs to highlight and link file paths

Is there some emacs lisp code that would automatically find /nfs file paths in the buffer and highlight/link to them? So clicking on them would open that file? Example path: /nfs/foo/bar/file.txt
Gregory
  • 200
8
votes
5 answers

Is there any way to convert camel-cased names to use underscores in emacs?

For instance, I want to convert "CamelCasedName" to "camel_cased_name". Is there a way to do this in emacs?
Jason Baker
  • 8,932
7
votes
3 answers

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 starts up so the window-system test doesn't take…
7
votes
2 answers

Combining two operators in Evil-mode Emacs

In vim I've remapped > and < when in visual mode to >gv and >gv vnoremap < and < do is indent/dedent visually selected…
mkomitee
  • 596
7
votes
2 answers

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 OSX. Here's what I…
bneil
  • 2,137
6
votes
4 answers

How can I apply a color-scheme (.el file) in emacs?

I have downloaded zenburn.el that is a color-scheme for Emacs, but I don´t know how I can apply it to emacs. I am a beginner in emacs. How do I apply my .el file to emacs? Can I do some linking from my .emacs-file? I am using emacs23 on Linux Mint…
Jonas
  • 28,660
5
votes
2 answers

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 when starting Emacs. I.e. so I can choose a project…
Arne
  • 889
5
votes
2 answers

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 automatically times-out inactive shells. Is there a way to…
5
votes
2 answers

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?
chd
  • 85
1
2 3 4 5