unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Mouse Scroll.
@ 2007-03-29  0:57 Daniel
  2007-03-29 18:48 ` Robert Thorpe
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Daniel @ 2007-03-29  0:57 UTC (permalink / raw)
  To: help-gnu-emacs

Hi All,

I want to scroll just one line when I spin the mouse wheel. I know I
can do it with SHIFT key, but it is tedious to hold SHIFT every time.

I have found mwheel.el, and modified like this:

(defcustom mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control) .
nil))

Also, I byte-compile-file mwheel.el, but it does not seem to work.

In addition, I added this in ~/.emacs
;; Scroll
(defun up-slightly () (interactive) (scroll-up 5))
(defun down-slightly () (interactive) (scroll-down 5))
(global-set-key [S-mouse-4] 'down-slightly)
(global-set-key [S-mouse-5] 'up-slightly)

(defun up-one () (interactive) (scroll-up 1))
(defun down-one () (interactive) (scroll-down 1))
(global-set-key [mouse-4] 'down-one)
(global-set-key [mouse-5] 'up-one)


(defun up-a-lot () (interactive) (scroll-up))
(defun down-a-lot () (interactive) (scroll-down))
(global-set-key [C-mouse-4] 'down-a-lot)
(global-set-key [C-mouse-5] 'up-a-lot)

But, it does not work also.

What I want is just to scroll only one line when I spin the wheel. How
can I do this?

(BTW, why emacs is so hard to use? It is very less intuitive to use.)

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

* Re: Mouse Scroll.
  2007-03-29  0:57 Mouse Scroll Daniel
@ 2007-03-29 18:48 ` Robert Thorpe
  2007-03-30  2:42   ` Daniel
  2007-03-30 14:17   ` jmg3000
  2007-03-30  7:00 ` Thien-Thi Nguyen
  2007-03-31 18:40 ` Chris F.A. Johnson
  2 siblings, 2 replies; 9+ messages in thread
From: Robert Thorpe @ 2007-03-29 18:48 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 29, 1:57 am, "Daniel" <hanm...@gmail.com> wrote:
> Hi All,
>
> I want to scroll just one line when I spin the mouse wheel. I know I
> can do it with SHIFT key, but it is tedious to hold SHIFT every time.
>
> I have found mwheel.el, and modified like this:
>
> (defcustom mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control) .
> nil))
>
> Also, I byte-compile-file mwheel.el, but it does not seem to work.

Have you put (mwheel-install) in your .emacs?

> What I want is just to scroll only one line when I spin the wheel. How
> can I do this?

I think the reason your code doesn't work is that, using Emacs 21.3,
[mouse-4] and [mouse-5] only represent the wheel on X11, not on MS
Windows.  On MS Windows the signal is different.

On the current CVS version of Emacs this inconsistency has been
removed and your code would work fine.

> (BTW, why emacs is so hard to use? It is very less intuitive to use.)

Sigh, It's a long story.

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

* Re: Mouse Scroll.
  2007-03-29 18:48 ` Robert Thorpe
@ 2007-03-30  2:42   ` Daniel
  2007-03-30 14:17   ` jmg3000
  1 sibling, 0 replies; 9+ messages in thread
From: Daniel @ 2007-03-30  2:42 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 29, 11:48 am, "Robert Thorpe" <rtho...@realworldtech.com>
wrote:
> On Mar 29, 1:57 am, "Daniel" <hanm...@gmail.com> wrote:
>
> > Hi All,
>
> > I want to scroll just one line when I spin the mouse wheel. I know I
> > can do it with SHIFT key, but it is tedious to hold SHIFT every time.
>
> > I have found mwheel.el, and modified like this:
>
> > (defcustom mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control) .
> > nil))
>
> > Also, I byte-compile-file mwheel.el, but it does not seem to work.
>
> Have you put (mwheel-install) in your .emacs?

- No, I am using Ubuntu 6.10 (Edgy), and using apt-get, I installed
emacs-snapshot (version 22.0.50.1).

>
> > What I want is just to scroll only one line when I spin the wheel. How
> > can I do this?
>
> I think the reason your code doesn't work is that, using Emacs 21.3,
> [mouse-4] and [mouse-5] only represent the wheel on X11, not on MS
> Windows.  On MS Windows the signal is different.

- As I said, I am not using MS Windows.

>
> On the current CVS version of Emacs this inconsistency has been
> removed and your code would work fine.
>
> > (BTW, why emacs is so hard to use? It is very less intuitive to use.)
>
> Sigh, It's a long story.

- Yeah, long story. However, I am trying to use it for work. Thanks.

Daniel.

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

* Re: Mouse Scroll.
  2007-03-29  0:57 Mouse Scroll Daniel
  2007-03-29 18:48 ` Robert Thorpe
@ 2007-03-30  7:00 ` Thien-Thi Nguyen
  2007-04-01 16:20   ` Daniel
  2007-03-31 18:40 ` Chris F.A. Johnson
  2 siblings, 1 reply; 9+ messages in thread
From: Thien-Thi Nguyen @ 2007-03-30  7:00 UTC (permalink / raw)
  To: help-gnu-emacs

() "Daniel" <hanmoai@gmail.com>
() 28 Mar 2007 17:57:59 -0700

   What I want is just to scroll only one line when I
   spin the wheel. How can I do this?

you found the right variable but you did not find how
to set it.  try placing in ~/.emacs something like:

(setq
 mouse-wheel-scroll-amount
 '(1                       ; no mod
   ((shift) . 5)           ; fast
   ((control) . nil)))     ; screen

then move the cursor after the close paren and type
`C-x C-e'.  alternatively, that particular variable
can be set using the customization interface.

   (BTW, why emacs is so hard to use? 
   It is very less intuitive to use.)

emacs is disciplined; discipline is hard.

thi

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

* Re: Mouse Scroll.
  2007-03-29 18:48 ` Robert Thorpe
  2007-03-30  2:42   ` Daniel
@ 2007-03-30 14:17   ` jmg3000
  2007-04-02  9:55     ` Robert Thorpe
  1 sibling, 1 reply; 9+ messages in thread
From: jmg3000 @ 2007-03-30 14:17 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 29, 2:48 pm, "Robert Thorpe" <rtho...@realworldtech.com> wrote:
> On Mar 29, 1:57 am, "Daniel" <hanm...@gmail.com> wrote:
>
> > (BTW, why emacs is so hard to use? It is very less intuitive to use.)
>
> Sigh, It's a long story.

Just curious, what do you mean? Seems to me that, for a terminal-based
app, Emacs is pretty easy to use -- you just need to remember or else
look up a number of key-combos. The docs are good, the integrated help
is good. Haven't really tried elisp though.

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

* Re: Mouse Scroll.
  2007-03-29  0:57 Mouse Scroll Daniel
  2007-03-29 18:48 ` Robert Thorpe
  2007-03-30  7:00 ` Thien-Thi Nguyen
@ 2007-03-31 18:40 ` Chris F.A. Johnson
  2007-04-01 16:25   ` Daniel
  2 siblings, 1 reply; 9+ messages in thread
From: Chris F.A. Johnson @ 2007-03-31 18:40 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-03-29, Daniel wrote:
> Hi All,
>
> I want to scroll just one line when I spin the mouse wheel. I know I
> can do it with SHIFT key, but it is tedious to hold SHIFT every time.
>
> I have found mwheel.el, and modified like this:
>
> (defcustom mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control) .
> nil))

   I use this; just change two/2 to one/1:

(defun down-two ()
  (interactive)
  (scroll-down 2)
)

(defun up-two ()
  (interactive)
  (scroll-up 2)
)

(global-set-key [(mouse-4)]  'down-two)
(global-set-key [(mouse-5)]  'up-two)
(global-set-key [(mouse-6)]  'down-two)
(global-set-key [(mouse-7)]  'up-two)

...

> (BTW, why emacs is so hard to use? It is very less intuitive to use.)

   It is not hard to use.

-- 
   Chris F.A. Johnson                      <http://cfaj.freeshell.org>
   ========= Do not reply to the From: address; use Reply-To: ========
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)

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

* Re: Mouse Scroll.
  2007-03-30  7:00 ` Thien-Thi Nguyen
@ 2007-04-01 16:20   ` Daniel
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel @ 2007-04-01 16:20 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 30, 12:00 am, Thien-Thi Nguyen <t...@gnuvola.org> wrote:
> () "Daniel" <hanm...@gmail.com>
> () 28 Mar 2007 17:57:59 -0700
>
>    What I want is just to scroll only one line when I
>    spin the wheel. How can I do this?
>
> you found the right variable but you did not find how
> to set it.  try placing in ~/.emacs something like:
>
> (setq
>  mouse-wheel-scroll-amount
>  '(1                       ; no mod
>    ((shift) . 5)           ; fast
>    ((control) . nil)))     ; screen
>
> then move the cursor after the close paren and type
> `C-x C-e'.  alternatively, that particular variable
> can be set using the customization interface.
>
>    (BTW, why emacs is so hard to use?
>    It is very less intuitive to use.)
>
> emacs is disciplined; discipline is hard.
>
> thi

Thanks, thi,

It really help. Thank you. I didn't even know about 'C-x C-e' .

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

* Re: Mouse Scroll.
  2007-03-31 18:40 ` Chris F.A. Johnson
@ 2007-04-01 16:25   ` Daniel
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel @ 2007-04-01 16:25 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 31, 11:40 am, "Chris F.A. Johnson" <cfajohn...@gmail.com>
wrote:
> On 2007-03-29, Daniel wrote:
> > Hi All,
>
> > I want to scroll just one line when I spin the mouse wheel. I know I
> > can do it with SHIFT key, but it is tedious to hold SHIFT every time.
>
> > I have found mwheel.el, and modified like this:
>
> > (defcustom mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control) .
> > nil))
>
>    I use this; just change two/2 to one/1:
>
> (defun down-two ()
>   (interactive)
>   (scroll-down 2)
> )
>
> (defun up-two ()
>   (interactive)
>   (scroll-up 2)
> )
>
> (global-set-key [(mouse-4)]  'down-two)
> (global-set-key [(mouse-5)]  'up-two)
> (global-set-key [(mouse-6)]  'down-two)
> (global-set-key [(mouse-7)]  'up-two)
>
> ...
>
> > (BTW, why emacs is so hard to use? It is very less intuitive to use.)
>
>    It is not hard to use.
>
> --
>    Chris F.A. Johnson                      <http://cfaj.freeshell.org>
>    ========= Do not reply to the From: address; use Reply-To: ========
>    Author:
>    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)

Thanks, Johnson,

But, in my case, it seems that my global-key for mouse wheel is prior
to the .emacs. That was weird, but now I think I solved. Thanks.

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

* Re: Mouse Scroll.
  2007-03-30 14:17   ` jmg3000
@ 2007-04-02  9:55     ` Robert Thorpe
  0 siblings, 0 replies; 9+ messages in thread
From: Robert Thorpe @ 2007-04-02  9:55 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 30, 3:17 pm, jmg3...@gmail.com wrote:
> On Mar 29, 2:48 pm, "Robert Thorpe" <rtho...@realworldtech.com> wrote:
>
> > On Mar 29, 1:57 am, "Daniel" <hanm...@gmail.com> wrote:
>
> > > (BTW, why emacs is so hard to use? It is very less intuitive to use.)
>
> > Sigh, It's a long story.
>
> Just curious, what do you mean? Seems to me that, for a terminal-based
> app, Emacs is pretty easy to use -- you just need to remember or else
> look up a number of key-combos. The docs are good, the integrated help
> is good. Haven't really tried elisp though.

If you want to use it as it comes out of the box then it's very easy
to use, it works like the editors that come with common operating
systems.  It's just much more powerful and has slightly different
keys.  Writing elisp and adding support for new features isn't even
that hard either, if you're OK with learning another language.

There are problems though.  Keymaps currently present a small problem,
since the only way to modify them is through elisp.  This isn't hard
in simple cases but often the exact specifics of how they should be
used are difficult.

Most users I think act like myself when they get a new program, they
use the keys that it uses, another small group of users immediately
start rearranging the keys.  I think the OP is one of this second
group who end up wondering why everything is so hard.  Loads of the
enquiries from newbies on this newsgroup are from trying to rearrange
keys.

All that said, I can't complain, if I was really bothered I'd write
some code to make it simpler.

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

end of thread, other threads:[~2007-04-02  9:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-29  0:57 Mouse Scroll Daniel
2007-03-29 18:48 ` Robert Thorpe
2007-03-30  2:42   ` Daniel
2007-03-30 14:17   ` jmg3000
2007-04-02  9:55     ` Robert Thorpe
2007-03-30  7:00 ` Thien-Thi Nguyen
2007-04-01 16:20   ` Daniel
2007-03-31 18:40 ` Chris F.A. Johnson
2007-04-01 16:25   ` Daniel

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