49

In Emacs we can scroll inactive window using certain commands

But not all details are listed in the manual.

C-M-v can scroll down the other window

my intention is to scroll up the other window, how could I do that ?

1
  • I think there is a confusion in this question between scroll up and scroll down actions. From help (C-h k C-M-v): C-M-v runs the command scroll-other-window (found in global-map), ... It is bound to M-<next>, C-M-v and ESC <next>. (scroll-other-window &optional LINES) Scroll next window upward LINES lines; or near full screen if no ARG. See ‘scroll-up-command’ for details. Also Emacs C-h C-M-S-v seems not to catch the Shift key and opens the same page as above. C-M-S-v does not work, but it should as: gnu.org/software/emacs/manual/html_node/emacs/Other-Window.html Commented Dec 29, 2024 at 13:28

7 Answers 7

59

Try C-M-S-v, which is scroll-other-window-down.

You can find such key bindings by doing C-h b (describe-bindings) which populates the *Help* buffer with a list of all the key bindings and associated commands for the current buffer. A quick search through that for scroll-other showed the binding you mentioned, as well as the one I listed.

Sign up to request clarification or add additional context in comments.

5 Comments

I tried command + meta + shift + v and the other window does not scroll up. I'm using emacs 24.3 in the terminal (mac os x). The original poster wanted to know how to scroll the other window up, not down.
Well it looks like in the terminal (iterm2 to be exact) you can't get the command shift meta v to work, although this is the correct answer. On a mac I had to use function + up_arrow to scroll the other window up. function + down_arrow also scrolls the other window down.
Thanks @user798719 I was having exactly the same problem.
Did you guys bind function + <arrows> for the terminal. By default it is not working on macOS default terminal.
@user798719 Try C-u - C-M-v. See: stackoverflow.com/a/60497723
37

On many terminals you can do M-PageUp and M-PageDn to scroll the other window. It's nice if you're already used to using PageUp/PageDn for scrolling.

2 Comments

Best option so far
FWIW, the default bindings for M-PageUp (i.e. M-<prior>) and M-PageDown (i.e. M-<next>) are scroll-other-window and scroll-other-window-down. See this to learn how to rebind: gnu.org/software/emacs/manual/html_node/emacs/…
10

You can alternatively give a negative argument to C-M-v. Negative arguments can be given with almost any modifier combination. In that case you can type C-M-- C-M-v.

1 Comment

The negative argument has to be given each time for e.g. if scrolling more than a page. It's a bit more to type.
4

I use this (everyday) :

(define-key global-map [(meta up)] '(lambda() (interactive) (scroll-other-window -1))) (define-key global-map [(meta down)] '(lambda() (interactive) (scroll-other-window 1))) 

1 Comment

Yes, very practical. I've bound those lambda on C-M-<next> and C-M-<prior> as scroll-other-window and scroll-other-window-down are already bound to C-M-<prior> and M-<prior> and M-up and M-down are reused by org-mode.
3

scroll down, (scroll-other-window)

scroll up, (scroll-other-window '-)

scroll-other-window is the native C API of Emacs, so it should work out of the box. Check its documentation.

Feel free to assign hot key for them

Comments

2

You could do C-u - C-M-v (i.e. scroll-other-window with ARG -) if C-M-S-v (i.e. scroll-other-window-down) does not work for you, as could happen when using Emacs in a terminal.

Excerpt from C-h f scroll-other-window:

Negative ARG means scroll downward. If ARG is the atom '-', scroll downward by nearly full screen.

Comments

0
  • M-<prior> runs the command scroll-other-window-down (fn option up-arrow on Mac)
  • M-<next> runs the command scroll-other-window (fn option down-arrow on Mac)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.