Lisp HUG Maillist Archive

next-line-add-newlines?

Does the LW editor have the equivalent of a statement like

  (setq next-line-add-newlines nil)

in GNU Emacs? I'm particularly interested in having such a feature in
an editor-pane belonging to a delivered application. It can be quite
annoying when pressing the down-arrow adds newlines behind your back
which change the semantics of what you've typed (in this particular
case).

Thanks,
Edi.


Re: next-line-add-newlines?

* Edi Weitz wrote:
> Does the LW editor have the equivalent of a statement like
>   (setq next-line-add-newlines nil)

I'm really mystified now.  My editor (the actual LW editor not a pane
in an application) doesn't add newlines on C-n at the end of the
buffer, but I can't find anywhere that I set it!  Very mysterious.

--tim


RE: next-line-add-newlines?

> -----Original Message-----
> From: Tim Bradshaw [mailto:tfb@cley.com] 
> Sent: Mittwoch, 12. März 2003 22:08
> To: Edi Weitz
> Cc: lisp-hug@xanalys.com
> Subject: Re: next-line-add-newlines?
> 
> 
> * Edi Weitz wrote:
> > Does the LW editor have the equivalent of a statement like
> >   (setq next-line-add-newlines nil)
> 
> I'm really mystified now.  My editor (the actual LW editor not a pane
> in an application) doesn't add newlines on C-n at the end of the
> buffer, but I can't find anywhere that I set it!  Very mysterious.

I'm on Windows right now (LW 4.2.7 pro) and for me it adds exactly one
newline if I press down-arrow or C-n - in the editor itself as well as
in editor-panes. Only one but still too much for my task... :)

Edi.


Re: next-line-add-newlines?

Unable to parse email body. Email id is 953

RE: next-line-add-newlines?

> -----Original Message-----
> From: owner-lisp-hug@xanalys.com 
> [mailto:owner-lisp-hug@xanalys.com] On Behalf Of David Fox
> Sent: Donnerstag, 13. März 2003 15:15
> To: edi@agharta.de
> Cc: tfb@cley.com; lisp-hug@xanalys.com
> Subject: Re: next-line-add-newlines?
>
> You could use this variant of "Next Line" which warns instead of
> adding the newline, when on the last line in the buffer:
> 
> (editor:defcommand "Edi Next Line" (p)
>      "Moves the current point to the next line. Warns the 
> user when invoked on the last line. Ignores the prefix argument."
>      "Moves the current point down one line, except at the last line."
>   (declare (ignore  p))
>   (editor:next-line-command 1))

It works. Thanks!

Edi.


Re: next-line-add-newlines?

* David Fox wrote:

> Tim - is your buffer actually writable?

Yes.  I wonder what on earth I'm doing.

Oh.  Wait, I may have misunderstood.  If I type C-N in a *new* file it
will add a newline.  But only one.  It's not like the emacs behaviour
where by default it does (or used to, it's so long since I turned it
off I'm not sure if it still does).

My guess (without src...) is that this is something to do with the
should-a-newline-be-added-on-write thing?  If the file already ends in
a newline will it add an extra one?

--tim



Re: next-line-add-newlines?

Unable to parse email body. Email id is 957

Re: next-line-add-newlines?

* David Fox wrote:
> No. Is that the difference here, that you were trying C-N in a buffer
> that already ends with a newline?

Yes, I was, and it doesn't add one then.  Sorry for being confused!

--t


Re: next-line-add-newlines?

* I wrote:
> Oh.  Wait, I may have misunderstood.  If I type C-N in a *new* file it
> will add a newline.  But only one.  It's not like the emacs behaviour
> where by default it does (or used to, it's so long since I turned it
> off I'm not sure if it still does).

Erm.  I meant `where by default it ... adds a newline each time you
say next-line at the end of the buffer'.  Sorry, I need a new brain.

--tim



Updated at: 2020-12-10 09:00 UTC