* no blank lines in org file opened in Emacs on Windows
@ 2007-04-19 21:18 Scott Jaderholm
2007-04-20 6:52 ` Carsten Dominik
0 siblings, 1 reply; 5+ messages in thread
From: Scott Jaderholm @ 2007-04-19 21:18 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 782 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 884 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: no blank lines in org file opened in Emacs on Windows
2007-04-19 21:18 no blank lines in org file opened in Emacs on Windows Scott Jaderholm
@ 2007-04-20 6:52 ` Carsten Dominik
2007-04-20 14:59 ` Scott Jaderholm
0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2007-04-20 6:52 UTC (permalink / raw)
To: Scott Jaderholm; +Cc: emacs-orgmode
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.
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.
- Carsten
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: no blank lines in org file opened in Emacs on Windows
2007-04-20 6:52 ` Carsten Dominik
@ 2007-04-20 14:59 ` Scott Jaderholm
2007-04-20 16:47 ` Carsten Dominik
0 siblings, 1 reply; 5+ messages in thread
From: Scott Jaderholm @ 2007-04-20 14:59 UTC (permalink / raw)
To: Carsten Dominik; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 3653 bytes --]
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'
> 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 whole
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 "\b [outline-level levels
outline-show-heading] 2] run-hooks] 4 ("c:/Program
Files/Emacs/emacs/lisp/outline.elc" . 28111) (list (cond (current-prefix-arg
(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
>
>
[-- Attachment #1.2: Type: text/html, Size: 5054 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: no blank lines in org file opened in Emacs on Windows
2007-04-20 14:59 ` Scott Jaderholm
@ 2007-04-20 16:47 ` Carsten Dominik
2007-04-20 19:54 ` Scott Jaderholm
0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2007-04-20 16:47 UTC (permalink / raw)
To: Scott Jaderholm; +Cc: emacs-orgmode
On Apr 20, 2007, at 16:59, Scott Jaderholm wrote:
> (run-hooks 'outline-view-change-hook))
>
> (add-hook 'outline-mode-hook 'hide-sublevels)
This is a misunderstanding, sorry for not being clearer:
I meant:
(add-hook 'outline-mode-hook
(lambda ()
(defun hide-sublevels ......
where the defun .... is the full definition of hide-sublevels from the
emacs 21 outline. This to override the new definition *after*
loading the old one.
Remember that this is only a hack - maybe a better solution would be to
use org-cycle-hook and to show those empty lines with a function in
there.
- Carsten
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: no blank lines in org file opened in Emacs on Windows
2007-04-20 16:47 ` Carsten Dominik
@ 2007-04-20 19:54 ` Scott Jaderholm
0 siblings, 0 replies; 5+ messages in thread
From: Scott Jaderholm @ 2007-04-20 19:54 UTC (permalink / raw)
To: Carsten Dominik; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 420 bytes --]
On 4/20/07, Carsten Dominik <dominik@science.uva.nl> wrote:
> Remember that this is only a hack - maybe a better solution would be to
> use org-cycle-hook and to show those empty lines with a function in
> there.
>
Carsten,
This hack didn't work for me. How hard would it be to do the second option
and add an option the user could set whether or not to show blank lines in
content and overview views?
Thanks,
Scott
[-- Attachment #1.2: Type: text/html, Size: 795 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-04-20 20:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-19 21:18 no blank lines in org file opened in Emacs on Windows Scott Jaderholm
2007-04-20 6:52 ` Carsten Dominik
2007-04-20 14:59 ` Scott Jaderholm
2007-04-20 16:47 ` Carsten Dominik
2007-04-20 19:54 ` Scott Jaderholm
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).