Questions tagged [auto-insert]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
55 views

How to increase a magic number in a file buffer on each save

I want to change a magic number (or a time stamp) in a file buffer on each save. The position of the magic number in the buffer can be given through a regex with a keyword or similar. Is there any ...
1
vote
1answer
88 views

Autoinsert a python skeleton

I start my python files (.py) with #!/usr/bin/env python3 and sometimes if __name__ == '__main__': somefunc() having done it some hundreds of time manually I decided to automate it in Emacs. (...
0
votes
1answer
121 views

auto-insert mode switch to new file

I managed to insert a template to certain sripts with autocomplete. Example: (auto-insert-mode) (setq auto-insert-query nil) (setq auto-insert-alist '(((ess-mode . "R script") nil "# R ...
1
vote
0answers
28 views

Both set mode and insert in auto-insert-alist lambda

I have the following as a member of auto-insert-alist: (("/home/robin/.local/bin/.*[^/]\\'" . "Shell-Script mode magic number") lambda nil (if (eq major-mode (default-value 'major-...
1
vote
0answers
59 views

Autoinsert inserts template twice

I want to use autoinsert with C and headers, the code from http://www.emacswiki.org/emacs/AutoInsertMode works well so I made my own template for header in an elisp funtion, but the insertion repeat ...
1
vote
1answer
243 views

Why is autoheader crashing with web-mode?

I got a situation here, that I couldn't get resolved with the maintainer of web-mode. So I'm asking here, if anyone knows a good suggestion. Ok, what I have here: GNU Emacs GUI (version 24.4.51.1 (...
3
votes
1answer
350 views

How can I quit entering keywords when I auto-insert with Helm?

When I M-x find-file RET file.el RET and then run M-x auto-insert, I am eventually presented with a list of keywords that Helm will complete for me. Trouble is, I have no idea how to finish the Helm ...
6
votes
1answer
2k views

Best way to make org-mode reload in-buffer settings

I am using auto-insert so that I can get the usual things I use for org mode when opening a new .org file, example: #+AUTHOR: Edgar Aroutiounian #+EMAIL: edgar.factorial@gmail.com #+STARTUP: ...
3
votes
1answer
779 views

auto-insert a skeleton and run a function when creating a new file

auto-insert-alist by default matches files created in .../bin/ directories and enables sh-mode. There are examples on the wiki showing how to use a skeleton to insert some text, but I want to both ...