From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bev Newsgroups: gmane.emacs.help Subject: Re: Open Outline-mode file in collapsed state Date: Thu, 27 Mar 2008 12:15:26 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2f43d3a1-f6fb-4d2b-834c-99c60cbac7e5@s50g2000hsb.googlegroups.com> References: <86abkntrcs.fsf@timbral.net> <86od90b5wy.fsf@timbral.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1206646907 28216 80.91.229.12 (27 Mar 2008 19:41:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Mar 2008 19:41:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 27 20:42:18 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 1JexyY-0000ou-Jy for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Mar 2008 20:41:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jexxw-0003uw-Vo for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Mar 2008 15:40:49 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s50g2000hsb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-NNTP-Posting-Host: 67.164.66.199 Original-X-Trace: posting.google.com 1206645326 8233 127.0.0.1 (27 Mar 2008 19:15:26 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 27 Mar 2008 19:15:26 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s50g2000hsb.googlegroups.com; posting-host=67.164.66.199; posting-account=BmgeLAoAAAD1M9a8l4SdHemxlRwuAbRB User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 Firefox/1.0.7 SUSE/1.0.7-0.1,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:157380 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:52748 Archived-At: On Mar 27, 7:25 am, Evans Winner wrote: > bev writes: > > I'm not sure what you mean by that. Are you saying add that to the top > of every single outline file I have? (Hundreds). I don't want to do > that. I need a function that will simply run (hide-trees) every time I > open an outline file. I really can't take the time to go add a line to > hundreds of files. Also, I've never seen that before. Is that lisp > code? > > No, as I already said, this was a mistake on my part. I > thought the question was about org-mode. I am pretty sure > this will not work for outline mode. > > Maybe try putting in your .emacs something like > > (add-to-list 'outline-mode-hook (lambda (hide-sublevels 1))) > > I haven't tested it, but I think something like this would > be the answer. Ah, ok, sorry about not getting the org-mode mistake. That looks good. I'll try it. In the meantime I figured out one solution, which seems a little klugey, but it works: (add-hook 'outline-mode-hook '(lambda () (beginning-of-buffer) (outline-next-visible-heading 1) (hide-other) (hide-subtree))) Thanks for taking the time to reply to me. I appreciate it. I'll try your solution as it's more elegant, and seems much closer to THE RIGHT WAY to do it. Bev