unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to go to next line on the screen instead of going to next line in the text?
@ 2008-05-31  1:09 xz
  2008-05-31  5:34 ` Giorgos Keramidas
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: xz @ 2008-05-31  1:09 UTC (permalink / raw)
  To: help-gnu-emacs

In emacs, if you hit the down arrow key, the cursor will go to next
line in the text, i.e., the part after the first next '\n'.

However, sometimes when the line is long and is wrapped into several
lines on the screen, I wanna move between the screen lines, instead of
the text lines, just like what happens when you hit the down arrow key
in gedit or the notepad in Windows.

How to do that?


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

* Re: How to go to next line on the screen instead of going to next line in the text?
  2008-05-31  1:09 How to go to next line on the screen instead of going to next line in the text? xz
@ 2008-05-31  5:34 ` Giorgos Keramidas
  2008-06-03 16:35   ` xz
  2008-05-31 19:29 ` B. T. Raven
  2008-06-02 11:16 ` Sébastien Vauban
  2 siblings, 1 reply; 14+ messages in thread
From: Giorgos Keramidas @ 2008-05-31  5:34 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, 30 May 2008 18:09:41 -0700 (PDT), xz <zhang.xi.cn@gmail.com> wrote:
> In emacs, if you hit the down arrow key, the cursor will go to next
> line in the text, i.e., the part after the first next '\n'.
>
> However, sometimes when the line is long and is wrapped into several
> lines on the screen, I wanna move between the screen lines, instead of
> the text lines, just like what happens when you hit the down arrow key
> in gedit or the notepad in Windows.
>
> How to do that?

Check out `longlines-mode'.  I think you'll like it :)



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

* Re: How to go to next line on the screen instead of going to next line in  the text?
  2008-05-31  1:09 How to go to next line on the screen instead of going to next line in the text? xz
  2008-05-31  5:34 ` Giorgos Keramidas
@ 2008-05-31 19:29 ` B. T. Raven
  2008-06-02 11:16 ` Sébastien Vauban
  2 siblings, 0 replies; 14+ messages in thread
From: B. T. Raven @ 2008-05-31 19:29 UTC (permalink / raw)
  To: help-gnu-emacs

xz wrote:
> In emacs, if you hit the down arrow key, the cursor will go to next
> line in the text, i.e., the part after the first next '\n'.
> 
> However, sometimes when the line is long and is wrapped into several
> lines on the screen, I wanna move between the screen lines, instead of
> the text lines, just like what happens when you hit the down arrow key
> in gedit or the notepad in Windows.
> 
> How to do that?

The best way I know is to use isearch (C-s) for two or three characters 
before the one you want the cursor moved to and then isearch-exit which 
I have bound to M-s. (I use a Dvorak layout so you may want to bind to 
some other keychord) M-s is center-line in textmode but this is 
overridden in the context of isearch.

Ed


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

* Re: How to go to next line on the screen instead of going to next line in the text?
  2008-05-31  1:09 How to go to next line on the screen instead of going to next line in the text? xz
  2008-05-31  5:34 ` Giorgos Keramidas
  2008-05-31 19:29 ` B. T. Raven
@ 2008-06-02 11:16 ` Sébastien Vauban
  2 siblings, 0 replies; 14+ messages in thread
From: Sébastien Vauban @ 2008-06-02 11:16 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Hi,

> In emacs, if you hit the down arrow key, the cursor will go to next
> line in the text, i.e., the part after the first next '\n'.
>
> However, sometimes when the line is long and is wrapped into several
> lines on the screen, I wanna move between the screen lines, instead of
> the text lines.
>
> How to do that?

--8<---------------cut here---------------start------------->8---
;; point motion by screen lines (as opposed to text lines)
;; TODO screen lines mode enabled by default for all buffers
(when (require 'screen-lines)
    ;; following lines commented out for keeping the original `kill-line'
    ;; in `screen-lines' minor mode
    (add-hook 'screen-lines-load-hook
              (lambda ()
                (ad-disable-advice 'kill-line 'around 'screen-lines)
                (ad-activate 'kill-line)))

    ;; nothing should appear in the mode line, when the `screen-lines' mode
    ;; is enabled in a buffer
    (setq screen-lines-minor-mode-string ""))
--8<---------------cut here---------------end--------------->8---

Seb

-- 
Sébastien Vauban


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

* Re: How to go to next line on the screen instead of going to, next line in the text?
@ 2008-06-02 16:41 Lorenzo Isella
  0 siblings, 0 replies; 14+ messages in thread
From: Lorenzo Isella @ 2008-06-02 16:41 UTC (permalink / raw)
  To: zthjwsqqafhv; +Cc: help-gnu-emacs

Message: 4
Date: Mon, 02 Jun 2008 13:16:02 +0200
From: S?bastien Vauban <zthjwsqqafhv@spammotel.com>
Subject: Re: How to go to next line on the screen instead of going to
	next	line in the text?
To: help-gnu-emacs@gnu.org
Message-ID: <87k5h8ytn1.fsf@mundaneum.com>
Content-Type: text/plain; charset=utf-8

Hi,


> > In emacs, if you hit the down arrow key, the cursor will go to next
> > line in the text, i.e., the part after the first next '\n'.
> >
> > However, sometimes when the line is long and is wrapped into several
> > lines on the screen, I wanna move between the screen lines, instead of
> > the text lines.
> >
> > How to do that?
>   

--8<---------------cut here---------------start------------->8---
;; point motion by screen lines (as opposed to text lines)
;; TODO screen lines mode enabled by default for all buffers
(when (require 'screen-lines)
    ;; following lines commented out for keeping the original `kill-line'
    ;; in `screen-lines' minor mode
    (add-hook 'screen-lines-load-hook
              (lambda ()
                (ad-disable-advice 'kill-line 'around 'screen-lines)
                (ad-activate 'kill-line)))

    ;; nothing should appear in the mode line, when the `screen-lines' mode
    ;; is enabled in a buffer
    (setq screen-lines-minor-mode-string ""))
--8<---------------cut here---------------end--------------->8---

Seb

-- Sébastien Vauban


Hello Sebastien,
I tried out your suggestion (I basically cut and pasted your small code 
into my .emacs file), but there must be something that emacs does not like.
First of all, was I supposed to simply introduce those lines in my 
.emacs file? Any position in the emacs file can do?
I installed  emacs 22.1 with gtk from the standard Debian testing 
repositories and I have my own .emacs file for some simple 
customization. In the following, I report the error message returned by 
emacs.
Cheers

Lorenzo


("emacs22-gtk")
Loading 00debian-vars...done
Loading /etc/emacs/site-start.d/20apel.el (source)...done
Loading /etc/emacs22/site-start.d/50auctex.el (source)...
Loading /usr/share/emacs/22.2/site-lisp/auctex.el (source)...
Loading /usr/share/emacs/22.2/site-lisp/tex-site.el (source)...done
Loading /usr/share/emacs/22.2/site-lisp/auctex.el (source)...done
Loading /usr/share/emacs/22.2/site-lisp/preview-latex.el (source)...done
Loading /etc/emacs22/site-start.d/50auctex.el (source)...done
Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el 
(source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el 
(source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...done
Loading /etc/emacs/site-start.d/50ess.el (source)...
Loading regexp-opt...done
Loading /etc/emacs/site-start.d/50ess.el (source)...done
Loading /etc/emacs/site-start.d/50flim.el (source)...done
Loading /etc/emacs/site-start.d/50maxima-emacs.el (source)...done
Loading /etc/emacs/site-start.d/50noweb.el (source)...done
Loading /etc/emacs/site-start.d/50nowebm.el (source)...done
Loading /etc/emacs/site-start.d/50psvn.el (source)...done
Loading /etc/emacs/site-start.d/50pymacs.el (source)...done
Loading /etc/emacs/site-start.d/50python-mode.el (source)...done
Loading /etc/emacs/site-start.d/50slime.el (source)...
Loading /usr/share/emacs22/site-lisp/slime/slime-autoloads...done
Loading /etc/emacs/site-start.d/50slime.el (source)...done
Loading /etc/emacs/site-start.d/50w3m-el.el (source)...done
Loading /etc/emacs/site-start.d/60cltl.el (source)...done
Loading advice...done
Loading paren...done
Loading time...done
Loading delsel...done


An error has occurred while loading `/home/iselllo/.emacs':

File error: Cannot open load file, screen-lines

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

For information about GNU Emacs and the GNU system, type C-h C-a.





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

* Re: How to go to next line on the screen instead of going to, next line in the text?
       [not found] <mailman.12563.1212424885.18990.help-gnu-emacs@gnu.org>
@ 2008-06-03 13:49 ` Sébastien Vauban
  0 siblings, 0 replies; 14+ messages in thread
From: Sébastien Vauban @ 2008-06-03 13:49 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Hi Lorenzo,

>>> [...] When the line is long and is wrapped into several
>>> lines on the screen, I wanna move between the screen lines,
>>> instead of the text lines. How to do that?
>>
>> ;; point motion by screen lines (as opposed to text lines)
>> ;; TODO screen lines mode enabled by default for all buffers
>> (when (require 'screen-lines)
>>     ;; following lines commented out for keeping the original `kill-line'
>>     ;; in `screen-lines' minor mode
>>     (add-hook 'screen-lines-load-hook
>>               (lambda ()
>>                 (ad-disable-advice 'kill-line 'around 'screen-lines)
>>                 (ad-activate 'kill-line)))
>>
>>     ;; nothing should appear in the mode line, when the `screen-lines' mode
>>     ;; is enabled in a buffer
>>     (setq screen-lines-minor-mode-string ""))
>
> I tried out your suggestion (I basically cut and pasted your
> small code into my .emacs file), but there must be something
> that emacs does not like.
>
> First of all, was I supposed to simply introduce those lines
> in my .emacs file?

Yes.


> Any position in the emacs file can do?

Yes and no. Normally yes. But depends a bit on the rest of the
`.emacs' file: sometimes, badly written code can override (or
conflict) with other declarations elsewhere.


> I installed emacs 22.1 with gtk from the standard Debian
> testing repositories and I have my own .emacs file for some
> simple customization. In the following, I report the error
> message returned by emacs.
>
> [...]
>
> An error has occurred while loading `/home/iselllo/.emacs':
>
> File error: Cannot open load file, screen-lines

In fact, this message is quite clear: Emacs does not find the
file `screen-lines(.el)', as requested by the `require' command.

So, in order to get that chunk of code working, you need to
download the package `screen-lines.el' and put that file into
a directory that's in your load-path (same directory as your
`.emacs' file would do, for example).

Get the package from there:

    http://homepage1.nifty.com/bmonkey/emacs/elisp/screen-lines.el

Best regards,
  Seb

-- 
Sébastien Vauban


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

* Re: How to go to next line on the screen instead of going to next  line in the text?
  2008-05-31  5:34 ` Giorgos Keramidas
@ 2008-06-03 16:35   ` xz
  2008-06-04 13:24     ` Kevin Rodgers
       [not found]     ` <mailman.12656.1212585897.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: xz @ 2008-06-03 16:35 UTC (permalink / raw)
  To: help-gnu-emacs

On May 31, 12:34 am, Giorgos Keramidas <keram...@ceid.upatras.gr>
wrote:
> On Fri, 30 May 2008 18:09:41 -0700 (PDT), xz <zhang.xi...@gmail.com> wrote:
> > In emacs, if you hit the down arrow key, the cursor will go to next
> > line in the text, i.e., the part after the first next '\n'.
>
> > However, sometimes when the line is long and is wrapped into several
> > lines on the screen, I wanna move between the screen lines, instead of
> > the text lines, just like what happens when you hit the down arrow key
> > in gedit or the notepad in Windows.
>
> > How to do that?
>
Thank you for your reply

> Check out `longlines-mode'.  I think you'll like it :)

I think this is what I want.
But one more question, how to turn on this mode automatically every
time when I launch emacs?
Should I simply put the following line in the .emacs file? Or what
else should I do?

(longlines-mode)





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

* Re: How to go to next line on the screen instead of going to,,   next line in the text?
       [not found] <48456c51.131e640a.2218.2323SMTPIN_ADDED@mx.google.com>
@ 2008-06-03 23:34 ` Lorenzo Isella
       [not found] ` <mailman.12640.1212536111.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Lorenzo Isella @ 2008-06-03 23:34 UTC (permalink / raw)
  To: help-gnu-emacs


 >In fact, this message is quite clear: Emacs does not find the
 >file `screen-lines(.el)', as requested by the `require' command.

 >So, in order to get that chunk of code working, you need to
 >download the package `screen-lines.el' and put that file into
 >a directory that's in your load-path (same directory as your
 >`.emacs' file would do, for example).

 >Get the package from there:

 >http://homepage1.nifty.com/bmonkey/emacs/elisp/screen-lines.el

 >Best regards,
 >Seb
>  
>
>   



Hello,
I think I did everything properly; I introduced the code chunk in my 
.emacs file and put the screen-lines.el package in 
/usr/share/emacs/site-lisp/ .
I do not have any warnings, but emacs does not do what I'd like [when it 
folds a long line, if I use the arrow, I jump directly past the folded 
long line, I do not proceed screen line after screen line].
As to another suggestion the long lines mode, the problem for me is that 
is screws up emacs highlighting and the text may become difficult to read.
Where did I go wrong?
Cheers

Lorenzo




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

* Re: How to go to next line on the screen instead of going to, , next line in the text?
       [not found] ` <mailman.12640.1212536111.18990.help-gnu-emacs@gnu.org>
@ 2008-06-04  6:42   ` Sébastien Vauban
  0 siblings, 0 replies; 14+ messages in thread
From: Sébastien Vauban @ 2008-06-04  6:42 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Hello Lorenzo,

> I think I did everything properly; I introduced the code chunk
> in my .emacs file and put the screen-lines.el package in
> /usr/share/emacs/site-lisp/ . I do not have any warnings, but
> emacs does not do what I'd like [when it folds a long line, if
> I use the arrow, I jump directly past the folded long line, I
> do not proceed screen line after screen line].

Maybe try to load it explicitly in a session by running:

    M-x load-library RET screen-lines RET

and see what it does then.

Best regards,
  Seb

-- 
Sébastien Vauban


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

* Re: How to go to next line on the screen instead of going to next line in the text?
  2008-06-03 16:35   ` xz
@ 2008-06-04 13:24     ` Kevin Rodgers
       [not found]     ` <mailman.12656.1212585897.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Kevin Rodgers @ 2008-06-04 13:24 UTC (permalink / raw)
  To: help-gnu-emacs

xz wrote:
> On May 31, 12:34 am, Giorgos Keramidas <keram...@ceid.upatras.gr>
> wrote:
>> Check out `longlines-mode'.  I think you'll like it :)
> 
> I think this is what I want.
> But one more question, how to turn on this mode automatically every
> time when I launch emacs?
> Should I simply put the following line in the .emacs file? Or what
> else should I do?
> 
> (longlines-mode)

Long Lines mode is a minor mode, local to each buffer.  So you'll
need to turn it on in every buffer where you want it, which can be
done 2 ways: via major mode hooks or via file visiting hooks.

Here's the first way:
(add-hook 'text-mode-hook 'longlines-mode)
...
(add-hook 'foo-mode-hook 'longlines-mode)

Here's the second way:
(add-hook 'find-file-hook 'longlines-mode)
(add-hook 'find-file-not-found-functions 'longlines-mode)

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: How to go to next line on the screen instead of going to next  line in the text?
       [not found]     ` <mailman.12656.1212585897.18990.help-gnu-emacs@gnu.org>
@ 2008-06-04 14:48       ` xz
  2008-06-04 14:53         ` xz
  0 siblings, 1 reply; 14+ messages in thread
From: xz @ 2008-06-04 14:48 UTC (permalink / raw)
  To: help-gnu-emacs

On Jun 4, 8:24 am, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> xz wrote:
> > On May 31, 12:34 am, Giorgos Keramidas <keram...@ceid.upatras.gr>
> > wrote:
> >> Check out `longlines-mode'.  I think you'll like it :)
>
> > I think this is what I want.
> > But one more question, how to turn on this mode automatically every
> > time when I launch emacs?
> > Should I simply put the following line in the .emacs file? Or what
> > else should I do?
>
> > (longlines-mode)
>
> Long Lines mode is a minor mode, local to each buffer.  So you'll
> need to turn it on in every buffer where you want it, which can be
> done 2 ways: via major mode hooks or via file visiting hooks.
>
> Here's the first way:
> (add-hook 'text-mode-hook 'longlines-mode)
> ...

> (add-hook 'foo-mode-hook 'longlines-mode)
which means, if I only want turn on this longlines-mode when editing
latex/tex file, then I add the following to .emacs:
(add-hook 'tex-mode-hook 'longlines-mode)

Is that correct?
But it seems not working......

>
> Here's the second way:
> (add-hook 'find-file-hook 'longlines-mode)
> (add-hook 'find-file-not-found-functions 'longlines-mode)
>
> --
> Kevin Rodgers
> Denver, Colorado, USA



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

* Re: How to go to next line on the screen instead of going to next  line in the text?
  2008-06-04 14:48       ` xz
@ 2008-06-04 14:53         ` xz
  2008-06-05  5:41           ` Kevin Rodgers
       [not found]           ` <mailman.12677.1212644531.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: xz @ 2008-06-04 14:53 UTC (permalink / raw)
  To: help-gnu-emacs

~~~
> which means, if I only want turn on this longlines-mode when editing
> latex/tex file, then I add the following to .emacs:
> (add-hook 'tex-mode-hook 'longlines-mode)
>
> Is that correct?
> But it seems not working......
>

I mean it works when I add
(add-hook 'text-mode-hook 'longlines-mode)

while it does work if I only add
(add-hook 'tex-mode-hook 'longlines-mode)


>
>
> > Here's the second way:
> > (add-hook 'find-file-hook 'longlines-mode)
> > (add-hook 'find-file-not-found-functions 'longlines-mode)
>
> > --
> > Kevin Rodgers
> > Denver, Colorado, USA



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

* Re: How to go to next line on the screen instead of going to next line in the text?
  2008-06-04 14:53         ` xz
@ 2008-06-05  5:41           ` Kevin Rodgers
       [not found]           ` <mailman.12677.1212644531.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Kevin Rodgers @ 2008-06-05  5:41 UTC (permalink / raw)
  To: help-gnu-emacs

xz wrote:
> ~~~
>> which means, if I only want turn on this longlines-mode when editing
>> latex/tex file, then I add the following to .emacs:
>> (add-hook 'tex-mode-hook 'longlines-mode)
>>
>> Is that correct?
>> But it seems not working......
>>
> 
> I mean it works when I add
> (add-hook 'text-mode-hook 'longlines-mode)
> 
> while it does work if I only add
> (add-hook 'tex-mode-hook 'longlines-mode)
> 
> 
>>
>>> Here's the second way:
>>> (add-hook 'find-file-hook 'longlines-mode)
>>> (add-hook 'find-file-not-found-functions 'longlines-mode)

Many text-editing (major) modes besides Text mode call text-mode-hook,
including Plain Tex, LaTex, and SliTex modes (try `M-x
apropos-documentation RET text-mode-hook RET').  And the various Tex
modes then call tex-mode-hook, and then their specific mode hook
(e.g. plain-tex-mode-hook).

Since longlines-mode toggles Long Lines (minor) mode, having the
function on both text-mode-hook and tex-mode-hook turns it on and then
off in a Tex buffer.

So if you only want it on in Tex modes, put longlines-mode on
tex-mode-hook only.  Or if you want it on in all text editing modes
(including Tex modes), put longlines-mode on text-mode-hook only.

If you'd rather avoid having to remember all that, it's better to use a
function on those hooks that unconditionally turns it on.  Many minor
modes have turn-on-foo-mode and turn-off-foo-mode convenience functions
for that purpose, but you can fake it with an anonymous function:

     (add-hook 'text-mode-hook (lambda () (longlines-mode 1)))
     (add-hook 'tex-mode-hook (lambda () (longlines-mode 1)))

or define your own convenience function and use that instead:

     (defun turn-on-longlines-mode ()
       "Turn on Long Lines mode."
       (longlines-mode 1))
     (add-hook 'text-mode-hook 'turn-on-longlines-mode)
     (add-hook 'tex-mode-hook 'turn-on-longlines-mode)

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: How to go to next line on the screen instead of going to next  line in the text?
       [not found]           ` <mailman.12677.1212644531.18990.help-gnu-emacs@gnu.org>
@ 2008-06-05 15:05             ` xz
  0 siblings, 0 replies; 14+ messages in thread
From: xz @ 2008-06-05 15:05 UTC (permalink / raw)
  To: help-gnu-emacs

On Jun 5, 12:41 am, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> xz wrote:
> > ~~~
> >> which means, if I only want turn on this longlines-mode when editing
> >> latex/tex file, then I add the following to .emacs:
> >> (add-hook 'tex-mode-hook 'longlines-mode)
>
> >> Is that correct?
> >> But it seems not working......
>
> > I mean it works when I add
> > (add-hook 'text-mode-hook 'longlines-mode)
>
> > while it does work if I only add
> > (add-hook 'tex-mode-hook 'longlines-mode)
>
> >>> Here's the second way:
> >>> (add-hook 'find-file-hook 'longlines-mode)
> >>> (add-hook 'find-file-not-found-functions 'longlines-mode)
>
> Many text-editing (major) modes besides Text mode call text-mode-hook,
> including Plain Tex, LaTex, and SliTex modes (try `M-x
> apropos-documentation RET text-mode-hook RET').  And the various Tex
> modes then call tex-mode-hook, and then their specific mode hook
> (e.g. plain-tex-mode-hook).
>
> Since longlines-mode toggles Long Lines (minor) mode, having the
> function on both text-mode-hook and tex-mode-hook turns it on and then
> off in a Tex buffer.
>
thanks for your reply.

> So if you only want it on in Tex modes, put longlines-mode on
> tex-mode-hook only.
This was what I did.
If I only put  (add-hook 'tex-mode-hook 'longlines-mode) and there is
no sentence like (add-hook 'text-mode-hook 'longlines-mode),
then nothing happened: the longlines-mode is not turned on.

> Or if you want it on in all text editing modes
> (including Tex modes), put longlines-mode on text-mode-hook only.
>
> If you'd rather avoid having to remember all that, it's better to use a
> function on those hooks that unconditionally turns it on.  Many minor
> modes have turn-on-foo-mode and turn-off-foo-mode convenience functions
> for that purpose, but you can fake it with an anonymous function:
>
>      (add-hook 'text-mode-hook (lambda () (longlines-mode 1)))
>      (add-hook 'tex-mode-hook (lambda () (longlines-mode 1)))
>
> or define your own convenience function and use that instead:
>
>      (defun turn-on-longlines-mode ()
>        "Turn on Long Lines mode."
>        (longlines-mode 1))
>      (add-hook 'text-mode-hook 'turn-on-longlines-mode)
>      (add-hook 'tex-mode-hook 'turn-on-longlines-mode)
>
> --
> Kevin Rodgers
> Denver, Colorado, USA



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

end of thread, other threads:[~2008-06-05 15:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-31  1:09 How to go to next line on the screen instead of going to next line in the text? xz
2008-05-31  5:34 ` Giorgos Keramidas
2008-06-03 16:35   ` xz
2008-06-04 13:24     ` Kevin Rodgers
     [not found]     ` <mailman.12656.1212585897.18990.help-gnu-emacs@gnu.org>
2008-06-04 14:48       ` xz
2008-06-04 14:53         ` xz
2008-06-05  5:41           ` Kevin Rodgers
     [not found]           ` <mailman.12677.1212644531.18990.help-gnu-emacs@gnu.org>
2008-06-05 15:05             ` xz
2008-05-31 19:29 ` B. T. Raven
2008-06-02 11:16 ` Sébastien Vauban
  -- strict thread matches above, loose matches on Subject: below --
2008-06-02 16:41 How to go to next line on the screen instead of going to, " Lorenzo Isella
     [not found] <mailman.12563.1212424885.18990.help-gnu-emacs@gnu.org>
2008-06-03 13:49 ` Sébastien Vauban
     [not found] <48456c51.131e640a.2218.2323SMTPIN_ADDED@mx.google.com>
2008-06-03 23:34 ` How to go to next line on the screen instead of going to,, " Lorenzo Isella
     [not found] ` <mailman.12640.1212536111.18990.help-gnu-emacs@gnu.org>
2008-06-04  6:42   ` How to go to next line on the screen instead of going to, , " Sébastien Vauban

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