From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jean Magnan de Bornier Newsgroups: gmane.emacs.help Subject: Re: LaTeX templates (or just templates in general) Date: Sat, 16 May 2009 14:52:32 +0200 Organization: Guest of ProXad - France Message-ID: <87my9ddxbj.fsf@bornier.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1242481255 30241 80.91.229.12 (16 May 2009 13:40:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 May 2009 13:40:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 16 15:40:49 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M5K88-0003ju-Hh for geh-help-gnu-emacs@m.gmane.org; Sat, 16 May 2009 15:40:48 +0200 Original-Received: from localhost ([127.0.0.1]:42786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M5K87-000526-Ss for geh-help-gnu-emacs@m.gmane.org; Sat, 16 May 2009 09:40:47 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!de-l.enfer-du-nord.net!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-b.proxad.net!nnrp18-1.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) Cancel-Lock: sha1:YU70G2mMhSLoOQCiy85jMyQe58Y= Original-Lines: 47 Original-NNTP-Posting-Date: 16 May 2009 14:52:30 MEST Original-NNTP-Posting-Host: 81.56.145.104 Original-X-Trace: 1242478350 news-3.free.fr 666 81.56.145.104:54424 Original-X-Complaints-To: abuse@proxad.net Original-Xref: news.stanford.edu gnu.emacs.help:169228 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64490 Archived-At: Orri wrote : | I am rather new to emacs. > | I have used the editor TextMate on mac and it has a very nice feature I like | and was wondering how I can acheive a similar thing in emacs. > | When I am in latex mode in textmate and write temp[tabkey], I can choose | from a list of code segments to insert to the current file (or buffer). I | often use this to insert frequently used code segments (3-10 lines) to | achieve tasks I frequently do. These segments are stored in a folder named | ~/Library/Applications Support/LaTeX/Templates > | I know I can use [C-x i], But it takes so much time to write the correct | path every single time. | So I am looking for something like [C-x i] except it by default starts in | specified directory (rather than the current directory). > | I know I can of course, in every latex project directory specify a symbolic | link (with a short name) to this directory, but I find it to be too much of | dirty hack. > | Does anyone have any suggestions about how to acieve this? Hi, I have several elisp functions defined in my .emacs file to help me the way you think: here is one to add a frame to a beamer document: ..................... (defun addframe () "Ouvre une frame dans beamer" (interactive) (insert "\\begin{frame} \\frametitle{} \\end{frame}") (backward-char 13) (indent-for-tab-command) ) (global-set-key (kbd "C-c f") 'addframe) .................... You can write many of those to your needs... -- Jean