From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Damien Wyart Newsgroups: gmane.emacs.help Subject: Re: .emacs to keep cursor stationary when scrolling with mouse Date: Sat, 30 May 2015 11:45:34 +0200 Organization: Serveur de News Free Message-ID: <556986bf$0$3339$426a74cc@news.free.fr> References: <556822a6$0$3333$426a74cc@news.free.fr> <556871ca$0$3055$426a74cc@news.free.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1432979418 12218 80.91.229.3 (30 May 2015 09:50:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 May 2015 09:50:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 30 11:50:18 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YydPF-0008Oo-Oe for geh-help-gnu-emacs@m.gmane.org; Sat, 30 May 2015 11:50:17 +0200 Original-Received: from localhost ([::1]:38900 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YydPF-00058Y-1Z for geh-help-gnu-emacs@m.gmane.org; Sat, 30 May 2015 05:50:17 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!cleanfeed1-a.proxad.net!nnrp6-1.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 Original-Lines: 22 Original-NNTP-Posting-Date: 30 May 2015 11:45:35 CEST Original-NNTP-Posting-Host: 213.41.145.138 Original-X-Trace: 1432979135 news-2.free.fr 3339 213.41.145.138:35670 Original-X-Complaints-To: abuse@proxad.net Original-Xref: usenet.stanford.edu gnu.emacs.help:212395 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104679 Archived-At: > [...] This is what it does with keyboard. Mouse wheel and drag bar > always scroll text, but point gets dragged along with the scrolling > text, and jumps back towards center when it nears window top/bottom. > Instead, I'd like point to just remain stationary on screen, as yexy > scrolls "underneath" it. I could get what you want for the wheel by using this: (global-set-key (kbd "") 'scroll-down-command) (global-set-key (kbd "") 'scroll-up-command) Can you confirm this is OK? About the scrollbar, I do not use it myself (many users of emacs use "(scroll-bar-mode -1)" in their .emacs and only use keyboard and mouse wheel), but looking at the code this is more difficult to get the exact behavior you want. When testing, this seems most of the time to do what you want, but a few jumps apear from time to time, depending on the content of the buffer. -- DW