From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darlan Cavalcante Moreira Subject: Re: Something like SETUPFILE, but in .emacs? Date: Sun, 13 Feb 2011 12:53:50 -0300 Message-ID: <4d57fe92.0aeb640a.669a.4f21@mx.google.com> References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from [140.186.70.92] (port=47067 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoeGu-0001gR-5N for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 10:54:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoeGs-0003Y8-Io for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 10:53:59 -0500 Received: from mail-yx0-f169.google.com ([209.85.213.169]:33404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoeGs-0003Xc-BV for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 10:53:58 -0500 Received: by yxl31 with SMTP id 31so1943293yxl.0 for ; Sun, 13 Feb 2011 07:53:57 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Gary Oberbrunner Cc: emacs-orgmode@gnu.org You can use auto-insert for this. Put something like this in your .emacs file --8<---------------cut here---------------start------------->8--- (require 'autoinsert) (auto-insert-mode t) ;;; Adds hook to find-files-hook ;;; Set directory containing the auto-insert templates (Trailing slash is ;;; important) Change this directory to whatever you want (setq auto-insert-directory "~/Dropbox/Dotfiles/.emacs.d/auto-insert-templates/") (setq auto-insert-query nil) ;;; nil If you don't want to be prompted ;;; before insertion ;;; Define an auto-insert template for org files (define-auto-insert "\.org" "my-orgfile-template.org") --8<---------------cut here---------------end--------------->8--- Now create the file "my-orgfile-template.org" inside the auto-insert-directory with what you want and whenever you create a new org file the content in my-orgfile-template.org will be inserted. I like to have a heading with the configuration and leave only title, author and email at the beggining of the file. The template I use is --8<---------------cut here---------------start------------->8--- #+TITLE:Put The Title Here #+AUTHOR:Authors Name #+EMAIL:something@somethingElse * Some Header * Org-File Setup #+STARTUP: odd #+OPTIONS: toc:nil #+OPTIONS: ^:{} #+LINK: google http://www.google.com/search?q=%s #+LINK: nautilus elisp:(browse-dir "%s") #+LINK: sftp elisp:(browse-dir-sftp "%s") #+LINK: tomboy elisp:(tomboy-simple-open-note "%s") #+LINK: calibre file:~/Calibre Library/%s #+LINK: mendeley file:~/Mendeley_Desktop/%s #+STARTUP: logdone #+STARTUP: logreschedule #+STARTUP: logredeadline #+DRAWERS: PROPERTIES CLOCK LOGBOOK HIDDEN #+COLUMNS: %41ITEM(Task) %TODO %5Effort %5CLOCKSUM --8<---------------cut here---------------end--------------->8--- -- Darlan At Thu, 10 Feb 2011 16:40:44 -0500, Gary Oberbrunner wrote: > > [1 ] > [1.1 ] > First time poster on this list, but old-school Emacs user since 1982. And I > have to say, org-mode is amazing. I'm running current git master on emacs > 24.0.50.1 on Windows. > > I've put all my org-mode export template stuff into a setup file in my home > dir, and I make all my org-mode files use it by putting > #+SETUPFILE: ~/my-setup.org > > My question is can I make this totally automatic, so every .org file I load > gets that setupfile automatically? > > btw, here's my settings in my setup file in case anyone's interested. > Mostly export stuff for HTML and LaTeX so the output comes out nice. > > ## Emacs org-mode settings. Include into a .org file at the end like this: > ## #+SETUPFILE: ~/emacs-org-mode-setup.org > #+AUTHOR: me > #+EMAIL: garyo@example.org > #+DATE: > #+DESCRIPTION: > #+KEYWORDS: > #+LANGUAGE: en > #+OPTIONS: H:2 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t > author:nil email:nil creator:nil timestamp:nil > #+OPTIONS: TeX:t LaTeX:auto skip:nil d:nil todo:t pri:nil tags:not-in-toc > #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path: > http://orgmode.org/org-info.js > #+EXPORT_SELECT_TAGS: export > #+EXPORT_EXCLUDE_TAGS: noexport > #+LINK_UP: > #+LINK_HOME: > # Page formatting, use full page w/ less whitespace: > #+LaTeX_HEADER: \usepackage[cm]{fullpage} > #+LaTeX_HEADER: \usepackage[compact]{titlesec} > # Snug up lists: > #+LaTeX_HEADER: \usepackage{paralist} > #+LaTeX_HEADER: \let\itemize\compactitem > #+LaTeX_HEADER: \let\description\compactdesc > #+LaTeX_HEADER: \let\enumerate\compactenum > # Colors: > #+LaTeX_HEADER: \usepackage{color} > > > -- > -- Gary > [1.2 ] > > [2 ] > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode