From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: Load specific files at startup? Date: Mon, 11 Aug 2008 03:19:05 -0700 (PDT) Organization: http://groups.google.com Message-ID: <26be1c22-2641-4ffb-b077-d981bac03e60@j1g2000prb.googlegroups.com> References: <5005c865-1513-4ac8-aabe-9e359480afc6@x35g2000hsb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1218451368 9248 80.91.229.12 (11 Aug 2008 10:42:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2008 10:42:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 11 12:43:39 2008 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 1KSUsC-0003Y4-V6 for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 12:43:37 +0200 Original-Received: from localhost ([127.0.0.1]:60298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSUrE-0003OT-HR for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 06:42:36 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!j1g2000prb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 69 Original-NNTP-Posting-Host: 24.6.97.120 Original-X-Trace: posting.google.com 1218449945 11429 127.0.0.1 (11 Aug 2008 10:19:05 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 11 Aug 2008 10:19:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j1g2000prb.googlegroups.com; posting-host=24.6.97.120; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:161102 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:56448 Archived-At: On Aug 8, 8:55 pm, ssecorp wrote: > How can I set emacs to open some specific files at startup, maybe even > split the windows for me? > > Can I save the state of shutdown so I can reopen and just continue > where I left off? > > This would be nice since I work with the same project almost the whole > time. > > Could this even be set as a menu where I could have different projects > that I could choose to load? Peter suggested sessions.el and desktop.el. I haven't used sessions.el, but am using desktop save mode. Here's what i know about your question. (desktop-save-mode t) ; enable the desktop save mode (desktop-save t) ; alwys save desktop ; save opened files every 10 min. So in case of system crash you still have it after restart (run-with-timer 600 600 'desktop-save "~/") About opening several predefined files, you can easily do it with elisp like this: (find-file filepath1) (find-file filepath2) (find-file filepath3) =2E.. Now if you want the above as one group of files of a project and want to open these with just a command, you can define it like this: (defun open-project-x () "open project X files" (interactive) (find-file filepath1) (find-file filepath2) (find-file filepath3) ) to assign a shortcut to the command, do (global-set-key (kbd "") 'open-project-x) i haven't looked at how you define a menu command, but it should be similar. Similarly you can define a function to close these files. I haven't looked at the proper way to close a buffer of a given file path... but here's a dumb solution should work: (defun close-project-x () "close project X files" (interactive) (find-file filepath1) (kill-buffer) (find-file filepath2) (kill-buffer) (find-file filepath3) (kill-buffer) ) Xah =E2=88=91 http://xahlee.org/ =E2=98=84