emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-mode and longlines-mode (especially tables)
@ 2007-03-18  1:43 Mark Aufflick
  2007-03-18  7:07 ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Aufflick @ 2007-03-18  1:43 UTC (permalink / raw)
  To: emacs-orgmode

Hi Everyone,

I am using longlines-mode with org-mode to do word wrapping. It is
useful in normal view to get wrapping at word boundaries, but it is
especially useful with vertical split windows (C-x 3) since they
default to not wrapping at all.

I have noticed a few wierd issues in org-mode related to the
pseudo-linebreaks managed by longlines mode.

The first issue is not really a big deal - if you are in an org list,
and are at the end of a wrapped line eg looks like:

 + adsf asdf adsf
asdf asdf{cursor here}

and you hit M-Enter, you get a heading of the most recent heading
level, not a new list entry. Presumably org-mode thinks the
longlines-mode soft-newline is a real newline

The second issue is bigger, relating to tables. If you make the first
line of a table and hit tab, eg:

|* col a *|* col b *|{TAB}

You get:

| * col a * | * col b * | |           |           |

so the newline that org-table-mode thinks it is inserting gets gobbled
by longlines-mode, or something like that.

Has anyone else noticed this? Is there a smarter way to get soft-word
wrapping in org-mode without using longlines-mode?

Mark.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-mode and longlines-mode (especially tables)
  2007-03-18  1:43 org-mode and longlines-mode (especially tables) Mark Aufflick
@ 2007-03-18  7:07 ` Carsten Dominik
  2007-03-19 12:46   ` Alan Dove
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2007-03-18  7:07 UTC (permalink / raw)
  To: Mark Aufflick; +Cc: emacs-orgmode


On Mar 18, 2007, at 2:43, Mark Aufflick wrote:

> Hi Everyone,
>
> I am using longlines-mode with org-mode to do word wrapping. It is
> useful in normal view to get wrapping at word boundaries, but it is
> especially useful with vertical split windows (C-x 3) since they
> default to not wrapping at all.
>
> I have noticed a few wierd issues in org-mode related to the
> pseudo-linebreaks managed by longlines mode.

I've taken only a brief look at longlines, but I can see not easy way
to make longlines work with org-mode.  Org-mode is strongly based
on plain text format with hard line breaks.

- Carsten

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-mode and longlines-mode (especially tables)
  2007-03-18  7:07 ` Carsten Dominik
@ 2007-03-19 12:46   ` Alan Dove
  2007-03-22 15:53     ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Dove @ 2007-03-19 12:46 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Hey, folks:

I've also been using org-mode with longlines-mode, and had noticed  
that the two occasionally conflict. I've just developed workarounds  
for the bugs that affect me, mostly inserting extra carriage returns  
here and there to ensure the right line breaks for org-mode. Carsten,  
if you have the option of minimizing these conflicts, that would be  
great. Otherwise, I'll just keep doing it manually - these two modes  
are both essential for my work now, so I'll do what it takes to make  
them get along locally.

           --Alan

--
Alan Dove, Ph.D.
alan.dove@gmail.com
917.273.0544
http://dovdox.com
Gizmo or Skype: alandove

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-mode and longlines-mode (especially tables)
  2007-03-19 12:46   ` Alan Dove
@ 2007-03-22 15:53     ` Carsten Dominik
  2007-03-25  1:51       ` Mark Aufflick
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2007-03-22 15:53 UTC (permalink / raw)
  To: Alan Dove; +Cc: emacs-orgmode


On Mar 19, 2007, at 13:46, Alan Dove wrote:

> Hey, folks:
>
> I've also been using org-mode with longlines-mode, and had noticed 
> that the two occasionally conflict. I've just developed workarounds 
> for the bugs that affect me, mostly inserting extra carriage returns 
> here and there to ensure the right line breaks for org-mode. Carsten, 
> if you have the option of minimizing these conflicts, that would be 
> great.

I think this is really really hard.  Basically, I would have to change
all places where Org-mode inserts newlines that should be hard.

Hmmm, maybe all newlines that org-mode inserts during internal commands 
should be hard?

In this case, a brute-force solution might do the trick.  This is not 
well tested,
but it does make tables work as long as they are not broader than fill 
column:

(defadvice insert (around make-org-mode-newlines-hard activate)
   "Make sure all org-mode functions insert hard newlines."
   (if (and (eq major-mode 'org-mode)
	   (boundp 'longlines-mode) longlines-mode
	   (equal "org-" (substring (symbol-name this-command) 0 4)))
       (let ((_beg (point)))
	ad-do-it
	(longlines-decode-region _beg (point)))
     ad-do-it))

(defadvice insert-before-markers (around make-org-mode-newlines-hard 
activate)
   "Make sure all org-mode functions insert hard newlines."
   (if (and (eq major-mode 'org-mode)
	   (boundp 'longlines-mode) longlines-mode
	   (equal "org-" (substring (symbol-name this-command) 0 4)))
       (let ((_beg (point)))
	ad-do-it
	(longlines-decode-region _beg (point)))
     ad-do-it))

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-mode and longlines-mode (especially tables)
  2007-03-22 15:53     ` Carsten Dominik
@ 2007-03-25  1:51       ` Mark Aufflick
  2007-03-26 15:34         ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Aufflick @ 2007-03-25  1:51 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Damn - defadvice is way cool! I do similar AOP-style things in Perl,
but nothing that clean or simple.

Having said that, it doesn't seem effective for me. It compiles fine
(in my .emacs), but there is no change in functionality. I tried with
org-mode 4.6.7 and then upgraded to .9. gnu emacs 22.0.94.1

I'm not familiar with the calling syntax of defadvice, so I'll keep playing.

Thanks very much for the code.

Mark.


On 3/23/07, Carsten Dominik <dominik@science.uva.nl> wrote:
>
> On Mar 19, 2007, at 13:46, Alan Dove wrote:
>
> > Hey, folks:
> >
> > I've also been using org-mode with longlines-mode, and had noticed
> > that the two occasionally conflict. I've just developed workarounds
> > for the bugs that affect me, mostly inserting extra carriage returns
> > here and there to ensure the right line breaks for org-mode. Carsten,
> > if you have the option of minimizing these conflicts, that would be
> > great.
>
> I think this is really really hard.  Basically, I would have to change
> all places where Org-mode inserts newlines that should be hard.
>
> Hmmm, maybe all newlines that org-mode inserts during internal commands
> should be hard?
>
> In this case, a brute-force solution might do the trick.  This is not
> well tested,
> but it does make tables work as long as they are not broader than fill
> column:
>
> (defadvice insert (around make-org-mode-newlines-hard activate)
>    "Make sure all org-mode functions insert hard newlines."
>    (if (and (eq major-mode 'org-mode)
>            (boundp 'longlines-mode) longlines-mode
>            (equal "org-" (substring (symbol-name this-command) 0 4)))
>        (let ((_beg (point)))
>         ad-do-it
>         (longlines-decode-region _beg (point)))
>      ad-do-it))
>
> (defadvice insert-before-markers (around make-org-mode-newlines-hard
> activate)
>    "Make sure all org-mode functions insert hard newlines."
>    (if (and (eq major-mode 'org-mode)
>            (boundp 'longlines-mode) longlines-mode
>            (equal "org-" (substring (symbol-name this-command) 0 4)))
>        (let ((_beg (point)))
>         ad-do-it
>         (longlines-decode-region _beg (point)))
>      ad-do-it))
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>


-- 
Mark Aufflick
 e: mark@pumptheory.com
 w: mark.aufflick.com
 p: +61 438 700 647
 f: +61 2 9436 4737

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-mode and longlines-mode (especially tables)
  2007-03-25  1:51       ` Mark Aufflick
@ 2007-03-26 15:34         ` Carsten Dominik
  2007-03-26 16:22           ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2007-03-26 15:34 UTC (permalink / raw)
  To: Mark Aufflick; +Cc: emacs-orgmode

Hmmmm, the other day I had a working version, but you are right, what I
posted does not work.  I don't understand yet why - I'll be back about 
this.

- Carsten

On Mar 25, 2007, at 3:51, Mark Aufflick wrote:

> Damn - defadvice is way cool! I do similar AOP-style things in Perl,
> but nothing that clean or simple.
>
> Having said that, it doesn't seem effective for me. It compiles fine
> (in my .emacs), but there is no change in functionality. I tried with
> org-mode 4.6.7 and then upgraded to .9. gnu emacs 22.0.94.1
>
> I'm not familiar with the calling syntax of defadvice, so I'll keep 
> playing.
>
> Thanks very much for the code.
>
> Mark.
>
>
> On 3/23/07, Carsten Dominik <dominik@science.uva.nl> wrote:
>>
>> On Mar 19, 2007, at 13:46, Alan Dove wrote:
>>
>> > Hey, folks:
>> >
>> > I've also been using org-mode with longlines-mode, and had noticed
>> > that the two occasionally conflict. I've just developed workarounds
>> > for the bugs that affect me, mostly inserting extra carriage returns
>> > here and there to ensure the right line breaks for org-mode. 
>> Carsten,
>> > if you have the option of minimizing these conflicts, that would be
>> > great.
>>
>> I think this is really really hard.  Basically, I would have to change
>> all places where Org-mode inserts newlines that should be hard.
>>
>> Hmmm, maybe all newlines that org-mode inserts during internal 
>> commands
>> should be hard?
>>
>> In this case, a brute-force solution might do the trick.  This is not
>> well tested,
>> but it does make tables work as long as they are not broader than fill
>> column:
>>
>> (defadvice insert (around make-org-mode-newlines-hard activate)
>>    "Make sure all org-mode functions insert hard newlines."
>>    (if (and (eq major-mode 'org-mode)
>>            (boundp 'longlines-mode) longlines-mode
>>            (equal "org-" (substring (symbol-name this-command) 0 4)))
>>        (let ((_beg (point)))
>>         ad-do-it
>>         (longlines-decode-region _beg (point)))
>>      ad-do-it))
>>
>> (defadvice insert-before-markers (around make-org-mode-newlines-hard
>> activate)
>>    "Make sure all org-mode functions insert hard newlines."
>>    (if (and (eq major-mode 'org-mode)
>>            (boundp 'longlines-mode) longlines-mode
>>            (equal "org-" (substring (symbol-name this-command) 0 4)))
>>        (let ((_beg (point)))
>>         ad-do-it
>>         (longlines-decode-region _beg (point)))
>>      ad-do-it))
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>
>
> -- 
> Mark Aufflick
> e: mark@pumptheory.com
> w: mark.aufflick.com
> p: +61 438 700 647
> f: +61 2 9436 4737
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-mode and longlines-mode (especially tables)
  2007-03-26 15:34         ` Carsten Dominik
@ 2007-03-26 16:22           ` Carsten Dominik
  0 siblings, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2007-03-26 16:22 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Turns out you cannot advise insert because the byte-compiler
treats it in a special way.  So this will only work if you do
not compile org.el to org.elc.  If you remove org.elc and also
any internal org.elc Emacs might be distributed with, then the
advice will work - but you have to pay a speed penalty in Org-mode.

- Carsten

On Mar 26, 2007, at 17:34, Carsten Dominik wrote:

> Hmmmm, the other day I had a working version, but you are right, what I
> posted does not work.  I don't understand yet why - I'll be back about 
> this.
>
> - Carsten
>
> On Mar 25, 2007, at 3:51, Mark Aufflick wrote:
>
>> Damn - defadvice is way cool! I do similar AOP-style things in Perl,
>> but nothing that clean or simple.
>>
>> Having said that, it doesn't seem effective for me. It compiles fine
>> (in my .emacs), but there is no change in functionality. I tried with
>> org-mode 4.6.7 and then upgraded to .9. gnu emacs 22.0.94.1
>>
>> I'm not familiar with the calling syntax of defadvice, so I'll keep 
>> playing.
>>
>> Thanks very much for the code.
>>
>> Mark.
>>
>>
>> On 3/23/07, Carsten Dominik <dominik@science.uva.nl> wrote:
>>>
>>> On Mar 19, 2007, at 13:46, Alan Dove wrote:
>>>
>>> > Hey, folks:
>>> >
>>> > I've also been using org-mode with longlines-mode, and had noticed
>>> > that the two occasionally conflict. I've just developed workarounds
>>> > for the bugs that affect me, mostly inserting extra carriage 
>>> returns
>>> > here and there to ensure the right line breaks for org-mode. 
>>> Carsten,
>>> > if you have the option of minimizing these conflicts, that would be
>>> > great.
>>>
>>> I think this is really really hard.  Basically, I would have to 
>>> change
>>> all places where Org-mode inserts newlines that should be hard.
>>>
>>> Hmmm, maybe all newlines that org-mode inserts during internal 
>>> commands
>>> should be hard?
>>>
>>> In this case, a brute-force solution might do the trick.  This is not
>>> well tested,
>>> but it does make tables work as long as they are not broader than 
>>> fill
>>> column:
>>>
>>> (defadvice insert (around make-org-mode-newlines-hard activate)
>>>    "Make sure all org-mode functions insert hard newlines."
>>>    (if (and (eq major-mode 'org-mode)
>>>            (boundp 'longlines-mode) longlines-mode
>>>            (equal "org-" (substring (symbol-name this-command) 0 4)))
>>>        (let ((_beg (point)))
>>>         ad-do-it
>>>         (longlines-decode-region _beg (point)))
>>>      ad-do-it))
>>>
>>> (defadvice insert-before-markers (around make-org-mode-newlines-hard
>>> activate)
>>>    "Make sure all org-mode functions insert hard newlines."
>>>    (if (and (eq major-mode 'org-mode)
>>>            (boundp 'longlines-mode) longlines-mode
>>>            (equal "org-" (substring (symbol-name this-command) 0 4)))
>>>        (let ((_beg (point)))
>>>         ad-do-it
>>>         (longlines-decode-region _beg (point)))
>>>      ad-do-it))
>>>
>>>
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>
>>
>>
>> -- 
>> Mark Aufflick
>> e: mark@pumptheory.com
>> w: mark.aufflick.com
>> p: +61 438 700 647
>> f: +61 2 9436 4737
>>
>>
>
> --
> Carsten Dominik
> Sterrenkundig Instituut "Anton Pannekoek"
> Universiteit van Amsterdam
> Kruislaan 403
> NL-1098SJ Amsterdam
> phone: +31 20 525 7477
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-03-26 18:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-18  1:43 org-mode and longlines-mode (especially tables) Mark Aufflick
2007-03-18  7:07 ` Carsten Dominik
2007-03-19 12:46   ` Alan Dove
2007-03-22 15:53     ` Carsten Dominik
2007-03-25  1:51       ` Mark Aufflick
2007-03-26 15:34         ` Carsten Dominik
2007-03-26 16:22           ` Carsten Dominik

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).