25

M-x scroll-all-mode does exactly that. You can also refer to the emacs wiki on scroll-all-mode and how to make synchronized scrolling work with mouse scrolling.


12

You can try setting scroll-preserve-screen-position to always: (setq scroll-preserve-screen-position 'always) From the documentation (C-h v scroll-preserve-screen-position): Controls if scroll commands move point to keep its screen position unchanged. A value of nil means point does not keep its screen position except at the scroll margin or window ...


11

There is a new package available on GNU ELPA called scroll-restore that attempts to remedy this problem. There are a handful of different behaviors to choose from, but the way I have configured it for myself (see below) causes the cursor to turn invisible during scrolling commands, and then jump back to its original location when I start typing again. So ...


8

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 following configuration: ;;; Scrolling. ;; Good speed and allow scrolling through large images (pixel-scroll). ;; Note: Scroll lags when point must be moved but ...


8

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-key (kbd "C-v") 'View-scroll-half-page-forward) (global-set-key (kbd "M-v") 'View-scroll-half-page-backward) and this seems to work fine!


7

@legosia's answer is the usual one, and probably what you want. But be aware that there is an alternative Isearch behavior that lets you scroll the buffer being searched without exiting Isearch. If you set (or bind) option isearch-allow-scroll to non-nil then you can scroll without exiting Isearch, as long as the current match is still on screen. This has ...


7

The answer is here. You probably have a buffer-list open somewhere, and version 24.3 has a bug in tabulated-list-mode which causes the periodic recentering. If you close that buffer-list, behaviour reverts back to normal. How to stop it permanently This bug was fixed in Emacs 24.5, so you need to install that, or something more recent. Currently, 24.5 is ...


6

The simplest way to do this is: (defadvice isearch-update (before my-isearch-reposite activate) (sit-for 0) (recenter 1)) A better but more complicated: (defadvice isearch-update (before my-isearch-update activate) (sit-for 0) (if (and ;; not the scrolling command (not (eq this-command 'isearch-other-control-char)) ;; not the ...


5

For Isearch, you can set option isearch-allow-scroll to non-nil. That lets you scroll the buffer you are searching, without exiting Isearch. And note that "scrolling" here includes C-l, which recenters the text (repeat C-l to put the current search hit at the top, middle, bottom of the window).


5

You can use (count-screen-lines &optional beg end count-final-newline window) (manual page) to find the number of lines shown between two points. You can do the following to re-create the point's position on the screen: (let ((lines-down (count-screen-lines nil (point) t)) (lines-from-top-of-window (count-screen-lines (window-start) (point) t)) ...


5

Yes. The functions in window-scroll-functions are called just before a redisplay that would cause scrolling. Each function returns two arguments, the window window and the new window start position new-start. You can call (window-start window) to get the current window start position, (window-end window) to get the current window end position, and (window-...


5

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 bottom of the window. You can customize this variable. By default, it is set to 0, but if you set it to 7 you'll get the behaviour you're describing.


4

The method that I always use is to set the mark where I want to jump back to, and then when I am done perusing the buffer, I pop the mark using C-u C-SPC. Even when I forget to set the mark before wandering off, I find that popping the mark usually lands me pretty close to where I came from. This is due partly to the fact that some commands (like isearch ...


4

Here is an alternative function that respects the major mode and works with window-size-change-functions: (defun reposition-buffer (frame) (when (eq major-mode 'fundamental-mode) ; Substitute name of your major-mode here (save-excursion (let* ((current-line (line-number-at-pos (point))) (offset (mod current-line 3))) (cond ((...


4

I believe you're looking for something like: (setq scroll-preserve-screen-position 'always)


4

M-x pixel-scroll-mode, available since Emacs 26, is all that's needed to have pixel scrolling. Credit to @db48x


3

The best a user can achieve -- without forcing a redisplay or without modifying the C-source code -- is use the window-end function with the optional second argument set to t in conjunction with the window-scroll-functions hook that takes two arguments -- https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Hooks.html#Window-Hooks [NOTE: ...


3

Adjust option scroll-margin to your liking. (You might also want to look at option scroll-step.) 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 bottom of the window.


3

After scrolling down, hit C-s twice. That will restart the search, using the search string from the previous time you used C-s.


3

It's easy enough to set the horizontal position of the current window. (defun hscroll-cursor-left () "Scroll horizontally to bring the cursor to the leftmost visible column. Similar to Vim's `zs'." (interactive "@") (set-window-hscroll (selected-window) (current-column))) (defun hscroll-cursor-right () "Scroll horizontally to bring the cursor to ...


3

The following function checks a window to see if it's top line is a multiple of three, and scrolls if needed to make it so: (defun first-window-line-in-threes (&optional window) "Make sure that the first line in the window is a multiple of three (0-based rather than 1-based). Scroll if necessary, but leave point where it is." (interactive) (let ((...


3

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/packages/")) and then M-x package-list-packages, search for golden-ratio-, or go to https://github.com/jixiuf/golden-ratio-scroll-screen to get it. It will ...


3

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-bottom-on-output t)))


3

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 showing the entries. Long story short, org-cycle runs org-cycle-hook. The first part of the docstring reads: Documentation: Hook that is run after org-cycle ...


3

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 of effort. As a work around, you can use C-v and M-v to navigate back and forth from one multiple-cursor selection to the next. You can also hide all lines that ...


3

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-nil to scroll the *compilation* buffer window as output appears. Setting it causes the Compilation mode commands to put point at the end of their output window ...


3

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-scroll-mode which demonstrates this capability.


2

You didn't post your config file. But instead of posting it, do this: Start from emacs -Q, that is, with no init file. If you do not see the problematic behavior, then do this: Recursively bisect your init file (by commenting-out blocks of code), until you narrow the problem down to find just what is causing it. You can use comment-region to comment out ...


2

You can set the vertical scroll parameter of your current window (and other windows, too) with pixel precision: (set-window-vscroll nil 300 t) This will however not work with any value greater than the frame height though. I've had to hand in a bug where Emacs hangs up for certain display engine configurations upon doing this even.


2

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 technically many shorter images. This can be done using insert-sliced-image.


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