Skip to main content

Questions tagged [scrolling]

is for commands to move text up and down and sideways in a window. Scrolling forward moves the buffer text upwards and scrolling backward moves downwards. Horizontal scrolling moves the buffer text left or right. Emacs provides many functions, key bindings, and programming facilities for scrolling.

39 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
345 views

Why doesn't `scroll-margin` work? [Solved]

scroll-margin is 1 but Emacs still sometimes allows the cursor to stay at the 1st line of a window. Follow these steps to reproduce it (or see the GIF below): emacs -Q In buffer *scratch*, C-x C-e: ...
shynur's user avatar
  • 5,538
5 votes
1 answer
216 views

(progn (scroll-up 1) (goto-char 0)) is different from (scroll-up 1) then (goto-char 0)

In any buffer, try to eval-expression the expression (scroll-up 1) and then eval (goto-char 0). The window scrolls up, then point is moved to the beginning of the buffer. Now, try eval-ing (progn (...
jcarpenter2's user avatar
4 votes
2 answers
2k views

Terminal Emacs not receiving <wheel-up> or <wheel-down>?

From what I understand, I should be able to get mouse scrolling to work in emacs nox mode with the following: (require 'mouse) (xterm-mouse-mode t) (mouse-wheel-mode t) (global-set-key (kbd "<...
Zhro's user avatar
  • 359
4 votes
0 answers
221 views

How to actually scroll with popup-tip :scroll-bar t?

Following this blog post, I am interested in using popup.el for my own purposes. In the post, he mentions to add a scroll bar with the :scroll-bar argument. If I include the :scroll-bar t option in ...
wdkrnls's user avatar
  • 3,707
3 votes
0 answers
445 views

Prevent Emacs from scrolling past the last line

Obviously Emacs never scrolls "above" the first line of the buffer. By contrast, it shows a bunch of empty space after the document if you scroll to the last line: I want to make the bottom ...
Andrii Kozytskyi's user avatar
3 votes
0 answers
83 views

Hook variable for horizontal scrolling

There is the hook variable window-scroll-functions for functions to be called before redisplay after vertical scrolling. Is there a similar variable for horizontal scrolling?
Tobias's user avatar
  • 33.3k
3 votes
0 answers
86 views

Synchronised scrolling of HTML file and eww buffer

I am editing a HTML file. I have done C-x 3. Now, in the other split window, I want to open a browser, such as eww. And as I move in the HTML file, I want the browser window to show the ...
deshmukh's user avatar
  • 1,912
3 votes
0 answers
473 views

Scrolling in tmux in emacs

I'm using emacs to run ansi-term with an ssh'ed tmux inside. I can scroll using my prefix C-b + [ as per this thread, but I would like to be able to scroll with the mouse immediately. This seems to ...
Hatshepsut's user avatar
3 votes
0 answers
1k views

fast moving cursor?

What can I add to my .emacs to make the cursor move more quickly? Specifically, I'm looking for faster rates for (holding arrow-keys and C-arrow keys (ie skipping over whitespace with my current ...
djh's user avatar
  • 325
2 votes
1 answer
103 views

How to distinguish a scroll from a change of buffer in a function called from ‘window-scroll-functions’?

I've written a function that recenters the point each time it makes a long jump and I added it to the hook window-scroll-functions. The length of the jump is determined by comparing the return value ...
Arch Stanton's user avatar
  • 1,707
2 votes
0 answers
76 views

"Negative" scrolling, or: actually recentering first line

Usually, there's some extra "virtual" space shown at the bottom of a buffer, which makes the visual appearance of a file longer than it actually is. This is quite convenient, e.g., if you're trying ...
phipsgabler's user avatar
2 votes
0 answers
3k views

Set scroll-amount for mouse wheel in .emacs

What I've tried in .emacs (note: I don't know elisp, and just tried cobbling this stuff together from googling and from other people's stuff) is (mouse-wheel-mode 't) ;;; mouse-wheel enabled (setq ...
John Forkosh's user avatar
2 votes
0 answers
110 views

Is it possible to use the mouse wheel for company mode?

I'm using the Cocoa version of Emacs. When company mode presents a list of completions you can use the mouse to select one. It would seem natural to be able to use the mouse wheel to scroll through ...
Connor's user avatar
  • 1,611
1 vote
0 answers
390 views

With pixel scroll precision enabled in Emacs 29.1 RC1, is the following code still required?

I have the following code in my Emacs configuration to enhance the default scrolling behavior: (use-package mwheel :ensure nil :custom (mouse-wheel-scroll-amount '(1 ((shift) . 1))) (mouse-...
Zoli's user avatar
  • 441
1 vote
1 answer
71 views

Is there a library to make `'evil-goto-mark` restore the screen position of the marker?

I use emacs and evil. If I set a marker using 'evil-set-marker, scroll elsewhere in the file, and then execute 'evil-goto-mark or 'evil-goto-mark-line, the window will scroll back until the position I’...
emdash's user avatar
  • 86
1 vote
1 answer
342 views

mwheel-scroll bindings between GUI and terminal?

Using an Emacs daemon (28, pgtk branch) switching between GUI and terminal, I can't get mouse scrolling to work on both. They work on each individually, but the issue is with the mouse-wheel-{up,down}-...
radu242's user avatar
  • 11
1 vote
0 answers
139 views

Emacs 27 scrolling issue

In Emacs 27, in -nw mode at least which is what I use, I've found an issue with scrolling. If you open emacs to see two files at once: emacs -nw -q file1 file2, and then scroll down the left window ...
ABu's user avatar
  • 280
1 vote
0 answers
79 views

view-scroll-half-page-forward messes up scrolling

I have the following in my config (setq scroll-preserve-screen-position 1) ;;scroll window up/down by one line (global-set-key (kbd "s-n") (kbd "C-u 1 C-v")) (global-set-key (kbd &...
CD86's user avatar
  • 573
1 vote
0 answers
187 views

scroll-preserve-screen-position screws up evil-scroll-down (C-d) in evil

centered-cursor-mode has been extremely sluggish so I found that this setup achieves the same without the slowness: (setq scroll-preserve-screen-position t scroll-conservatively 0 maximum-...
SFbay007's user avatar
  • 584
1 vote
0 answers
374 views

org-mode and insert-sliced-image

I read in the Emacs manual online about using insert-sliced-image to create smooth scrolling with inline images. I would like to use this to override org-toggle-inline-images, so that I can get ...
Adam's user avatar
  • 1,907
1 vote
0 answers
810 views

How to scroll down/up by one full screen?

Is there a way to scroll down/up by one full screen? My keyboard doesn't have special purpose keys for this function. In other words, is there a single command that is equivalent to the following ...
Evan Aad's user avatar
  • 1,551
1 vote
0 answers
140 views

how to debug who move cursor

I have very annoying problem, after I run M-x compile time to time cursor jump from middle of buffer to the first line. I want to find out culprit (I found mode who responsible for this, but I want ...
fghj's user avatar
  • 193
1 vote
0 answers
115 views

Tabbar scrolling jumps back

I am using tabbar and some settings for smooth scrolling which seem to conflict with each other in a weird way. Here is a minimal init.el file: (package-initialize) (setq mouse-wheel-scroll-amount '(...
Pavel Galashin's user avatar
1 vote
0 answers
2k views

mouse-wheel-follow-mouse for horizontal scrolling?

I like having mouse-wheel-follow-mouse set to non-nil, so I can use the trackpad to scroll an inactive window. Unfortunately, it doesn't apply to horizontal scrolling, so if I try to scroll an ...
ivan's user avatar
  • 1,948
1 vote
0 answers
138 views

How can I prevent a setting in init.el from being overridden during startup?

Using emacs-mac-port, and I'm trying to configure horizontal scrolling with the trackpad. The following expressions work if I execute them manually via eval-last-sexp, (global-set-key [wheel-right] (...
ivan's user avatar
  • 1,948
1 vote
0 answers
837 views

scroll-preserve-screen-position causes cursor to move forward one character at screen boundary

I am using (setq scroll-preserve-screen-position t) as suggested at https://superuser.com/a/184421/39697, and it works well, except for me, when I scroll at the top of the screen using scroll-up-line,...
asmeurer's user avatar
  • 1,592
0 votes
0 answers
48 views

Doesn't automatically jump to different characters in both buffers

Emacs 27.1 I want to find differents between 2 buffers. I use command ediff-buffers Steps: Type the n in the Ediff Control Panel Again Type the n in the Ediff Control Panel And because the line is ...
a_subscriber's user avatar
  • 4,174
0 votes
0 answers
14 views

Setting `scroll-conservatively` to 101 causes `dired` buffer can not be recentered when revert

When I set scroll-conservatively to 101 as recommended from many scrolling packages. But I find that in a dired buffer containing many files, revert-buffer (g) will not recenter the point to center ...
Saddle Point's user avatar
0 votes
0 answers
12 views

Scroll margin in buffers list

Setting (setq smooth-scroll-margin 10) with the smooth-scrolling package enables the introduction of a scroll margin, which has the advantage of avoiding jumps when the cursor reaches the end of the ...
unvarnished's user avatar
0 votes
0 answers
106 views

recenter'ing a window that does not display current-buffer

I am facing a recurring problem with recenter in Emacs. Sometimes, when I execute recenter, it doesn't work and I get the following message: recenter'ing a window that does not display current-buffer. ...
Tokubara's user avatar
  • 209
0 votes
0 answers
98 views

Buffer divider staggered upon split window and scroll

Whenever I split windows or scroll with a split window, the buffer dividers and text end up staggered horizontally. Here is a screenshot of a file without the split window or issue shown. And here is ...
newuser1's user avatar
0 votes
0 answers
54 views

Reset horizontal scroll after line motion

I currently satisfice by disabling auto-hscroll-mode, but I want it back. I know you can make it hscroll only the current line by setting it to 'current-line. Doesn't fix the problem. Problem: it's ...
meedstrom's user avatar
  • 153
0 votes
1 answer
423 views

Touchpad vertical scroll gesture scrolls too much lines in GUI on Windows 10

How can I change that? I probably need something like fractional scrolling? Look at that video https://streamable.com/lfic9h
rofrol's user avatar
  • 206
0 votes
0 answers
112 views

Scroll by visual line in `centered-cursor-mode`?

Mouse scrolling with visual-line-mode in centered-cursor-mode is jumpy as anything when you're writing prose. A single line of text can be 10 or more visual lines. Editing in refill-mode or auto-fill-...
emacsscroller91's user avatar
0 votes
0 answers
412 views

Scrolling lag on Linux

Emacs scrolling is lagging for me on Linux but not on macOS. I'm using Ubuntu 20 and also tried Solus but behavior is the same. Faster system helps but not enough. What so special about emacs build on ...
albert200000's user avatar
0 votes
0 answers
120 views

mac-mwheel-scroll screws centered-positon-mode when using mouse pad on a macbook laptop

I am able to scroll using navigation buttons and external mouse on a Mac with this code that keeps the cursor at a specific line at all times. I am using this code since it is much faster than ...
SFbay007's user avatar
  • 584
0 votes
0 answers
391 views

Why is scrolling line-by-line so much slower compared to vi-mode?

I was wondering if anyone has faced this issue before or is just me loosing my mind? It seems that C-n and C-p are so slow and sluggish compared to the j and k keys when using evil-mode. Is there any ...
Kirk Walla's user avatar
0 votes
0 answers
43 views

Synchronizing the units in which horizontal scrolling is measured with buffer columns

The problem I am trying to solve is determining how many columns of the current buffer are hidden due to horizontal scrolling. The documentation states: The horizontal scroll position is measured ...
AlwaysLearning's user avatar
0 votes
0 answers
33 views

Adjust scrolling after font increase/decrease

After text-scale-decrease or text-scale-increase scrolling (e.g. with space, scroll-down) does not seem to take the text scaling into account. Is there a way to adjust the scroll commands to reflect ...
emacsomancer's user avatar
  • 1,041