4

Title is basically the question. If I hold down C-n, C-p, etc., for a second or two, the speed at which it scrolls is too slow for my liking. Is there a way to make it scroll faster if I hold one of the combinations?

user4601931
  • 161
  • 6
  • 1
    Yes ... try with zero user-configuration and see how fast it is. Then try with your full configuration and see if there is a difference. I'm not sure when the variable fast-but-imprecise-scrolling was introduced in Emacs, but if you have it, then try setting that to t. And, then start eliminating things that might be causing the slow-down. Type C-h m and see all the minor modes that are active -- try disabling one at a time and see if there is a speed increase. You can also try running the profiler with M-x profiler-start , M-x-profiler-report, M-x profiler-stop. – lawlist Dec 10 '18 at 06:40
  • Turning off visual-line-mode might help. – Drew Dec 10 '18 at 14:37
  • Individual command needs time to completed and holding down C-n is still C-n C-n C-n .... The same goes for Down/Up/etc in other applications like web browser. You should use mouse wheel or scroll bar instead, graphical Emacs supports them as well. Besides, you can scroll by larger block such as paragraph and page. – xuchunyang Dec 10 '18 at 17:37
  • @xuchunyang Right. What I'm asking, I guess, is if there is a way to make holding down C-n perform the repeated C-n C-n C-n ... in a faster fashion. I would rather not use a mouse. – user4601931 Dec 10 '18 at 17:44
  • @user4601931 I am not sure, but I guess that is not possible, I think scroll one line by one line via C-n/C-p simply can't be as fast as mouse, since mouse can scroll multiple lines once. – xuchunyang Dec 10 '18 at 17:54

2 Answers2

2

The following doesn't answer your question, but might be useful (and the effect looks interesting to me), it defines a command to run the last command repeatedly per 0.1 second

(defun repeat-constantly ()
  "Repeat last command constantly."
  (interactive)
  (while (not (input-pending-p))
    (repeat nil)
    (sit-for 0.1)))

Then C-n M-x repeat-constantly looks faster than holding down C-n.

xuchunyang
  • 14,527
  • 1
  • 19
  • 39
2

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 the fastest setting, and "Delay Until Repeat" to the shortest setting. This was kind of what I wanted ("kind of" because this obviously changes the behavior outside of emacs, too).

user4601931
  • 161
  • 6