help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cua-mode clobbers S-<cursor>


From: Joe Casadonte
Subject: Re: cua-mode clobbers S-<cursor>
Date: 14 Jan 2003 09:20:30 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2

On Sun, 05 Jan 2003, Kai Großjohann wrote:

> lawrence mitchell <wence@gmx.li> writes:
>
>> Kai Grossjohann wrote:
>>
>>> I think I might like cua-mode a lot.  Alas, I have my own bindings
>>> for S-<up> and S-<down> (they scroll by one line), which I need to
>>> move elsewhere.  Alas, I can't think of another nicely mnemonic
>>> keybinding for them.
>>
>> Hmm, now I'm intrigued as to what <up> and <down> do.  Scroll by
>> page?
>
> <up> and <down> do like C-p and C-n, respectively.

Do you mean then that you scroll the window up and down by one line,
but the cursor stays the on the same line?  If so, I have something
similar (I'd be interested to see yours), and I bind them to
<kp-subtract> and <kp-add>.  I know they're not necessarily next to
the cursor keys as you asked for, but they are quite easy to find for
me, as they are on the corner of the keyboard.

Obviously, I don't do a lot of number crunching, as those keys are now
useless unless overridden (as they are in calculator-mode).

In case anyone's interested, here's my version:

(defun scroll-in-place (scroll-up)
  "Scroll window up (or down) without moving point (if possible).

SCROLL-Up is non-nil to scroll up one line, nil to scroll down."
  (interactive)
  (let ((pos (point))
                (col (current-column))
                (up-or-down (if scroll-up 1 -1)))
        (scroll-up up-or-down)
        (if (pos-visible-in-window-p pos)
                (goto-char pos)
          (if (or (eq last-command 'next-line)
                          (eq last-command 'previous-line))
                  (move-to-column temporary-goal-column)
                (move-to-column col)
                (setq temporary-goal-column col))
          (setq this-command 'next-line))))

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]