Question about the usage of package autoinsert
Questions tagged [auto-insert]
11 questions
8
votes
1 answer
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: indent
#+LANGUAGE: en
#+OPTIONS: toc:nil num:0
and…

c-o-d
- 910
- 9
- 19
4
votes
1 answer
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 completion without with quitting the entire…

Sean Allred
- 6,861
- 16
- 85
3
votes
1 answer
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 insert some text and enable sh-mode. Some other…

Skeletor
- 33
- 4
2
votes
1 answer
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.
(eval-after-load 'autoinsert
'(define-auto-insert
…

Vladimir Zolotykh
- 123
- 4
1
vote
1 answer
Using auto-insert and yasnippet to insert variables into template
I've been reading this and this, trying to figure out how to have an org-mode in-buffer settings template such as this:
# # -*- mode: org -*-
# # -*- coding: utf-8 -*-
#+TITLE: $1
#+AUTHOR: `(user-full-name)`
#+DATE: `(format-time-string "%e %B…

147pm
- 2,907
- 1
- 18
- 39
1
vote
2 answers
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 package for this? I tried auto-insert which comes…

halloleo
- 1,215
- 9
- 23
1
vote
0 answers
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-mode))
(progn
(sh-mode)
…

Robin Green
- 949
- 7
- 16
1
vote
0 answers
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 to time, asking me twice, it results in :
/** …

user3593232
- 383
- 1
- 8
1
vote
1 answer
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 (x86_64-w64-mingw32)
compiled from Harroogan…

ReneFroger
- 3,855
- 22
- 63
0
votes
1 answer
Auto insert include guard in cpp header when inside projectile project
I am currently learning C++ and I came across include guards to avoid double inclusion.
Now I would like to use the google's style convention like this :
// project/src/app.hpp
#ifndef PROJECT_SRC_APP_HPP_
#define PROJECT_SRC_APP_HPP_
...
#endif …

johhnry
- 31
- 3
0
votes
1 answer
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 script " \n
"# file: " (file-name-nondirectory…

Krisselack
- 131
- 6