From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Scott Jaderholm" Subject: Re: no blank lines in org file opened in Emacs on Windows Date: Fri, 20 Apr 2007 08:59:26 -0600 Message-ID: References: <3a1bfc164968651192935a29ea98ea08@science.uva.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0143807968==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HeufD-00067v-H9 for emacs-orgmode@gnu.org; Fri, 20 Apr 2007 11:04:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HeufC-00067U-FL for emacs-orgmode@gnu.org; Fri, 20 Apr 2007 11:04:42 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HeufC-00067R-CF for emacs-orgmode@gnu.org; Fri, 20 Apr 2007 11:04:42 -0400 Received: from an-out-0708.google.com ([209.85.132.246]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Heua7-0000Zb-5J for emacs-orgmode@gnu.org; Fri, 20 Apr 2007 10:59:27 -0400 Received: by an-out-0708.google.com with SMTP id b8so904517ana for ; Fri, 20 Apr 2007 07:59:26 -0700 (PDT) In-Reply-To: <3a1bfc164968651192935a29ea98ea08@science.uva.nl> 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: Carsten Dominik Cc: emacs-orgmode@gnu.org --===============0143807968== Content-Type: multipart/alternative; boundary="----=_Part_147629_775089.1177081166389" ------=_Part_147629_775089.1177081166389 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 4/20/07, Carsten Dominik wrote: > > You probably have Emacs 21 under Linux and Emacs 22 under Windows. > This is a difference in the implementation of `outline-hide-sublevels' > between these versions, and Org-mode simply calls this function. Thanks Carsten, you're right on. I really like the emacs21 behavior a lot more than that of emacs 22. I believe you could take the Emacs 21 definition of this function and > overwrite the Emacs 22 one by placing the definition into > outline-mode-hook, but I have not tested this. I found a hide-sublevels in outline.el but never found any outline-hide-sublevels, so I assume they're they same. (defun hide-sublevels (levels) "Hide everything but the top LEVELS levels of headers, in whole buffer." (interactive "p") (if (< levels 1) (error "Must keep at least one level of headers")) (setq levels (1- levels)) (let (outline-view-change-hook) (save-excursion (goto-char (point-min)) ;; Keep advancing to the next top-level heading. (while (or (and (bobp) (outline-on-heading-p)) (outline-next-heading)) (let ((end (save-excursion (outline-end-of-subtree) (point)))) ;; Hide everything under that. (outline-flag-region (point) end t) ;; Show the first LEVELS levels under that. (if (> levels 0) (show-children levels)) ;; Move to the next, since we already found it. (goto-char end))))) (run-hooks 'outline-view-change-hook)) (add-hook 'outline-mode-hook 'hide-sublevels) I gave this a try but it didn't work automatically, and I don't know where to go from here. Debugger entered--Lisp error: (wrong-number-of-arguments #[(levels) [A whol= e bunch of special characters here] [levels outline-view-change-hook beg end 1 error "Must keep at least one level of headers" nil outline-on-heading-p t outline-next-heading outline-flag-region outline-map-region #[nil "=08 [outline-level levels outline-show-heading] 2] run-hooks] 4 ("c:/Program Files/Emacs/emacs/lisp/outline.elc" . 28111) (list (cond (current-prefix-ar= g (prefix-numeric-value current-prefix-arg)) ((save-excursion (beginning-of-line) (looking-at outline-regexp)) (funcall outline-level)) (= t 1)))] 0) Thanks, Scott On Apr 19, 2007, at 23:18, Scott Jaderholm wrote: > > > On Linux I can have org open a file and display it like this: > > > > * Local Settings... > > > > * Projects > > ** Foo > > > > * Something > > > > Notice that it's nice about letting me having blank lines between my > > top level headings, even though they are to some degree compacted. I > > think my setting is "content" for how expanded it should be. > > > > When I open the same file in Emacs on Windows, with the same > > configuration files, I get this: > > > > * Local Settings... > > * Projects > > ** Foo > > * Something > > > > There are no blank lines at all, but if I use S-Tab to expand it all > > out there are plenty of blank lines. > > > > The file does say it's in Unix mode and I suspect this problem is more > > likely caused by a setting I have wrong than a bug. Has anyone seen > > this before or have an idea what is causing this behavior? > > > > Thanks, > > Scott > > > > > > _______________________________________________ > > Emacs-orgmode mailing list > > Emacs-orgmode@gnu.org > > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > > -- > Carsten Dominik > Sterrenkundig Instituut "Anton Pannekoek" > Universiteit van Amsterdam > Kruislaan 403 > NL-1098SJ Amsterdam > phone: +31 20 525 7477 > > ------=_Part_147629_775089.1177081166389 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 4/20/07, Carsten Dominik <dominik@science.uva.nl> wrote:
You probably have Emacs 21 under Linux and Emacs 22 under Windows.
This = is a difference in the implementation of `outline-hide-sublevels'
be= tween these versions, and Org-mode simply calls this function.

 Thanks Carsten, you're right on. I really like the emacs= 21 behavior a lot more than that of emacs 22.

I believe you could take the Emacs 21 definition of this function and
ov= erwrite the Emacs 22 one by placing the definition into
outline-mode-hoo= k, but I have not tested this.

 I found a hide-su= blevels in=20 outline.el but never found any outline-hide-sublevels, so I assume they'= ;re they same.
 
(defun hide-sublevels (levels)
  &qu= ot;Hide everything but the top LEVELS levels of headers, in whole buffer.&q= uot;
  (interactive "p")
  (if (< levels 1)
 &= nbsp;    (error "Must keep at least one level of header= s"))
  (setq levels (1- levels))
  (let (outline-view-= change-hook)
    (save-excursion
   &nb= sp;  (goto-char (point-min))
      ;; Keep advancing to the next top-level = heading.
      (while (or (and (bobp) (outline-= on-heading-p))
         (outline-next= -heading))
    (let ((end (save-excursion (outline-end-of= -subtree) (point))))
      ;; Hide everything under that.
  &nb= sp;   (outline-flag-region (point) end t)
     = ;; Show the first LEVELS levels under that.
      (= if (> levels 0)
          (sh= ow-children levels))
      ;; Move to the next, sinc= e we already found it.
      (goto-char end)))))
  (run-hooks '= ;outline-view-change-hook))

(add-hook 'outline-mode-hook 'hi= de-sublevels)

I gave this a try but it didn't work automatically= , and I don't know where to go from here.

Debugger entered--Lisp error: (wrong-number-of-arguments #[(levels)= [A whole bunch of special characters here]
 [levels outline-view-c= hange-hook beg end 1 error "Must keep at least one level of headers&qu= ot; nil outline-on-heading-p t outline-next-heading outline-flag-region out= line-map-region #[nil "=08  [outline-level levels outline-show-he= ading] 2] run-hooks] 4 ("c:/Program Files/Emacs/emacs/lisp/outline.elc= " . 28111) (list (cond (current-prefix-arg (prefix-numeric-value curre= nt-prefix-arg)) ((save-excursion (beginning-of-line) (looking-at outline-re= gexp)) (funcall outline-level)) (t 1)))] 0)

Thanks,
Scott
 

On Apr 19, 2007, at 23:18, Scott Jaderholm = wrote:

> On Linux I can have org open a file and display it like this:<= br>>
> * Local Settings...
>
> * Projects
> ** F= oo
>
> * Something
>
> Notice that it's nice ab= out letting me having blank lines between my
> top level headings, even though they are to some degree compacted.= I
> think my setting is "content" for how expanded it shou= ld be.
>
> When I open the same file in Emacs on Windows, with = the same
> configuration files, I get this:
>
> * Local Settings.= ..
> * Projects
> ** Foo
> * Something
>
> Th= ere are no blank lines at all, but if I use S-Tab to expand it all
> = out there are plenty of blank lines.
>
> The file does say it's in Unix mode and I suspect this= problem is more
> likely caused by a setting I have wrong than a bug= . Has anyone seen
> this before or have an idea what is causing this = behavior?
>
> Thanks,
> Scott
>
>
> ____________= ___________________________________
> Emacs-orgmode mailing list
&= gt; Emacs-orgmode@gnu.org
> http:/= /lists.gnu.org/mailman/listinfo/emacs-orgmode
>

--
Cars= ten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Unive= rsiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

<= /blockquote>
------=_Part_147629_775089.1177081166389-- --===============0143807968== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0143807968==--