Skip to main content

Questions tagged [auto-insert]

Question about the usage of package autoinsert

Filter by
Sorted by
Tagged with
9 votes
1 answer
5k 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: [email protected] #+STARTUP: ...
c-o-d's user avatar
  • 930
4 votes
1 answer
634 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 ...
Sean Allred's user avatar
  • 6,921
3 votes
1 answer
1k 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 ...
Skeletor's user avatar
2 votes
1 answer
389 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. (...
Vladimir Zolotykh's user avatar
1 vote
2 answers
132 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 ...
halloleo's user avatar
  • 1,341
1 vote
1 answer
310 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 (...
ReneFroger's user avatar
  • 3,880
1 vote
1 answer
438 views

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-...
147pm's user avatar
  • 2,969
1 vote
0 answers
48 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-...
Robin Green's user avatar
1 vote
0 answers
92 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 ...
user3593232's user avatar
0 votes
1 answer
554 views

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 ...
johhnry's user avatar
  • 31
0 votes
1 answer
42 views

Move cursor down on auto-insert

#+SETUPFILE: ~/.emacs.d/org-templates/level-2.org I have the above line auto-inserted on new org files. Is there a way to make the cursor move to the next line? Now it stays at the beginning of the ...
zeynel's user avatar
  • 371
0 votes
1 answer
252 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 ...
Krisselack's user avatar