Skip to main content
11 votes

Smooth (mouse) scroll for inline images?

Since Emacs 26.1, the buffer can be scrolled by individual pixels instead of just lines which can be used to smoothly scroll over images using the mouse wheel. To achieve this I have used the ...
Matthew Palermo's user avatar
9 votes
Accepted

How can I scroll a half page on C-v and M-v?

I actually managed to find the equivalent functions. They are View-scroll-half-page-forward View-scroll-half-page-backward So, I've updated my dotfile's user-config section to contain (global-set-...
Violet's user avatar
  • 488
9 votes
Accepted

emulation of scroll-off?

The variable scroll-margin controls this behaviour: Number of lines of margin at the top and bottom of a window. Recenter the window whenever point gets within this many lines of the top or ...
Tyler's user avatar
  • 22.4k
9 votes

Automatically scroll *compilation* window, beside source-buffer window

This behaviour can be controlled by compilation-scroll-output. compilation-scroll-output is a variable defined in `compile.el'. Its value is `first-error' Original value was nil Documentation: Non-...
rpluim's user avatar
  • 5,365
8 votes
Accepted

Smooth scrolling by pixel-lines

M-x pixel-scroll-mode, available since Emacs 26, is all that's needed to have pixel scrolling. Credit to @db48x
Calaf's user avatar
  • 483
6 votes
Accepted

How to scroll to the beginning of the line in Emacs

The window has been scrolled left (scroll-left) for some reason. C-x < or C-<next> can get you into this state. C-x > or C-<prior> can get you out of this state. Note those commands ...
jue's user avatar
  • 4,636
4 votes

Scroll vertically while keeping horizontal position

I believe you're looking for something like: (setq scroll-preserve-screen-position 'always)
Stefan's user avatar
  • 26.5k
3 votes

How to autoscroll a window to always show the end of a growing buffer?

Does it help to customize option comint-scroll-to-bottom-on-output? C-h v tells us: comint-scroll-to-bottom-on-output is a variable defined in comint.el. Its value is nil This variable is an ...
Drew's user avatar
  • 78.1k
3 votes
Accepted

How to vertically center when opening a file:line from emacsclient?

You can always choose the --eval option of emacsclient to perform more complicated tasks: emacsclient --eval "(progn (find-file \"$FILE\") (goto-line $NUM) (forward-char $COL) (recenter))"
Tobias's user avatar
  • 33.4k
3 votes
Accepted

How to prevent org-mode from repositioning text in the window when cycling visibility?

The TAB key runs the command org-cycle, which does a whole bunch of stuff under the hood. In the context you're talking about, org-cycle cycles through the visibility of the buffer, hiding and ...
Dan's user avatar
  • 33.2k
3 votes
Accepted

Using ggtags tag lookup along with centered-cursor-mode

This worked. (add-hook 'ggtags-find-tag-hook #'ccm-position-cursor)
SFbay007's user avatar
  • 584
3 votes

How to scroll while using multiple cursor?

In Emacs, the points (cursor) is always on the visible portion of the file you are visiting. This coded deep down in the guts of the program, so you won't be able to change this without a great deal ...
Tyler's user avatar
  • 22.4k
3 votes

How can I scroll a half page on C-v and M-v?

I personally recommend you to use a package named golden-ratio-scroll-screen. You can add melpa to your package-list if you have not. (add-to-list 'package-archives '("melpa" . "https://melpa.org/...
cmal's user avatar
  • 775
3 votes

ansi-term scroll problem on fast output

Solved it by myself. Just needed to add the following lines to ~/.emacs.d/init.el: (eval-after-load "term" '(progn ;; ensure that scrolling doesn't break on output (setq term-scroll-to-...
space_voyager's user avatar
3 votes

Smooth (mouse) scroll for inline images?

The problem as I understand it is that the image is a single line. Changing how scrolling behaves won't solve the problem. The only solution I am aware of is to slice the image up so that there are ...
Ista's user avatar
  • 1,198
3 votes

Smooth (mouse) scroll for inline images?

How about this: ;; scroll one line at a time (less "jumpy" than defaults) (setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time (setq mouse-wheel-progressive-speed nil) ;; don't ...
C137's user avatar
  • 31
3 votes
Accepted

Is there a way to increase speed of scrolling when holding down C-n/C-p/C-f/C-b?

Turns out that this isn't really an emacs question, though perhaps there still is a way to do this in emacs. I'm using a Mac, and I went to System Preferences > Keyboard and increased "Key Repeat" to ...
user4601931's user avatar
3 votes
Accepted

How to scroll using mouse while keeping cursor on same line/position?

If you add the built-in scroll-lock-mode to your code, you should get behavior like what you want. Here's a slightly more-expansive update to your mode that fixes two other issues I found (the buffer-...
jirassimok's user avatar
3 votes

Fractional vertical scrolling

That's to be expected because this is the Emacs Lisp reference, not the Emacs manual. It explains how a developer can adjust the vertical scrolling in a fine-grained way. Emacs 26.1 introduced pixel-...
wasamasa's user avatar
  • 22.2k
3 votes

How can I get horizontal scrolling in PDFview to work?

I had the same problem and I also discovered the hard way that global-display-line-numbers-mode breaks image-forward-hscroll. I have the following workaround: (defun bugfix-display-line-numbers--turn-...
Tobias's user avatar
  • 33.4k
2 votes
Accepted

Temporarily disable scrolling

Scrolling causes the hook window-scroll-functions to be executed. That lets you know when scrolling happens, but as the manual says, Warning: don’t use this feature to alter the way the window is ...
Gilles 'SO- stop being evil''s user avatar
2 votes

Temporarily disable scrolling

Have you considered narrowing? (defun wh/narrow-to-visible-screen () "Narrow to the currently visible text in the current buffer." (interactive) (widen) ;; Get position of the beginning of ...
Wilfred Hughes's user avatar
2 votes

on Mac, scroll-down or scroll-up don't move point to very top/bottom

Scrolling doesn't move point, unless it has to because point would otherwise be outside the window. The Emacs manual, node Scrolling explains this and more. As you can see there, you can control how ...
Drew's user avatar
  • 78.1k
2 votes

How can I scroll a half page on C-v and M-v?

You can also write pretty simple elisp code to achieve this :- (defun scroll-half-page-down () "scroll down half the page" (interactive) (scroll-down (/ (window-body-height) 2))) (defun scroll-...
Chakravarthy Raghunandan's user avatar
2 votes
Accepted

Horizontal Scroll Wheel on Mouseover Buffer

No need to handroll it yourself. This is provided out of the box in emacs 27, and it probably was available for longer: This feature is off by default; the variable mouse-wheel-tilt-scroll turns it ...
dmvianna's user avatar
  • 392
2 votes
Accepted

get buffer scroll position and height (aka min and max on-screen buffer locations)

(line-number-at-pos (window-start)) should do what you asked.
siehe-falz's user avatar
2 votes
Accepted

Scroll only current line when truncating lines

Emacs 26 has a new feature to horizontal scroll the current line when the variable truncate-lines is also non-nil. The variable to control that new feature is auto-hscroll-mode and the relevant ...
lawlist's user avatar
  • 19.2k
2 votes
Accepted

How do I make a buffer automatically scroll to its end?

I found my answer: https://stackoverflow.com/questions/12663061/emacs-auto-scrolling-log-buffer Then do a (set (make-local-variable 'window-point-insertion-type) t) inside this log buffer. If the ...
HappyFace's user avatar
  • 840
2 votes

How to autoscroll a window to always show the end of a growing buffer?

Here the solution a use for my compilation log buffer (let ((buf (get-buffer "*Compile-Log*"))) (set-window-point (get-buffer-window buf) (buffer-size buf)))
djangoliv's user avatar
  • 3,254
2 votes
Accepted

How to autoscroll a window to always show the end of a growing buffer?

How about? (let ((temp-window (or (get-buffer-window "*test*") (split-window-below -10)))) (set-window-buffer temp-window "*test*") (select-window temp-window) (goto-...
lawlist's user avatar
  • 19.2k

Only top scored, non community-wiki answers of a minimum length are eligible