From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: insert default template when I create a new org buffer? Date: Wed, 01 Jul 2015 18:53:04 -0400 Message-ID: <87si97h4mn.fsf@kyleam.com> References: <877fqk1ieo.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAQsU-0008E9-5o for emacs-orgmode@gnu.org; Wed, 01 Jul 2015 18:53:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAQsO-0006eq-Am for emacs-orgmode@gnu.org; Wed, 01 Jul 2015 18:53:14 -0400 Received: from mail-qk0-f179.google.com ([209.85.220.179]:32838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAQsO-0006eQ-6o for emacs-orgmode@gnu.org; Wed, 01 Jul 2015 18:53:08 -0400 Received: by qkhu186 with SMTP id u186so40567229qkh.0 for ; Wed, 01 Jul 2015 15:53:06 -0700 (PDT) In-Reply-To: (Matt Price's message of "Wed, 1 Jul 2015 18:37:59 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matt Price Cc: Org Mode Matt Price wrote: > I have the notion I should be able to have emacs just insert the > template for me when the buffer is created. Maybe what I need is > "auto-insert-mode" but I can't quite figure out how to have it run a > function. Was hoping someone else had figured it out already! Perhaps you could add it to find-file-hook (not tested): #+begin_src elisp (defun org-export-insert-latex-template () (when (and (derived-mode-p 'org-mode) (and (bobp) (eobp))) (org-export-insert-default-template 'latex))) (add-hook 'find-file-hook #'org-export-insert-latex-template) #+end_src -- Kyle