From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: JohnF Newsgroups: gmane.emacs.help Subject: .emacs to keep cursor stationary when scrolling with mouse Date: Fri, 29 May 2015 02:19:41 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Message-ID: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1432866021 8121 80.91.229.3 (29 May 2015 02:20:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 May 2015 02:20:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 29 04:20: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 1Yy9uC-000513-D3 for geh-help-gnu-emacs@m.gmane.org; Fri, 29 May 2015 04:20:16 +0200 Original-Received: from localhost ([::1]:33126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yy9uB-0001TT-Fe for geh-help-gnu-emacs@m.gmane.org; Thu, 28 May 2015 22:20:15 -0400 Original-Path: usenet.stanford.edu!panix!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 53 Original-NNTP-Posting-Host: panix3.panix.com Original-X-Trace: reader1.panix.com 1432865981 9012 166.84.1.3 (29 May 2015 02:19:41 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Fri, 29 May 2015 02:19:41 +0000 (UTC) User-Agent: tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (NetBSD/6.1.5 (i386)) Original-Xref: usenet.stanford.edu gnu.emacs.help:212368 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:104652 Archived-At: I'm pretty clueless about emacs lisp, and have tried to set up an .emacs that emulates dumb editor behavior. That works mostly the way I want, except that when running under X and scrolling text with mouse (both scrolling with mouse wheel and dragging the text bar on the window's right-hand side), the cursor still jumps around. It remains stationary when scrolling with keyboard arrow-up/down and keyboard page-up/down, which is what I want. But I can't get the cursor to remain stationary when scrolling with the mouse. How's that done??? Thanks. Here's my complete .emacs... (setq major-mode 'text-mode) (setq auto-mode-alist '(("." . text-mode))) (setq make-backup-files nil) ;;; no backup files (setq auto-save-default nil) ;;; no auto saving (setq scroll-step 1) (setq scroll-margin 0) (setq scroll-preserve-screen-position 't) ;;; scroll without moving cursor (setq scroll-conservatively 10000) ;;; (0 or 10000 seems same) (setq auto-window-vscroll nil) (setq scroll-up nil) (setq scroll-down nil) (setq scroll-up-aggressively nil) (setq scroll-down-aggressively nil) (setq next-screen-context-lines 0) (mouse-wheel-mode 't) ;;; mouse-wheel enabled (setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;;; 1 line at a time (setq mouse-wheel-follow-mouse 't) ;;; scroll window under mouse (setq indent-tabs-mode nil) (setq blink-matching-paren nil) (setq column-number-mode 't) (setq size-indication-mode 't) ;;; open with single window (setq inhibit-startup-screen 't) (add-hook 'emacs-startup-hook 'delete-other-windows) ;;; initial frame width,height,position (set-frame-width (selected-frame) 80) ; #chars wide (set-frame-height (selected-frame) 52) ; #lines ling (set-frame-position (selected-frame) 10 10 ) ; x y from upper-left ;;; insert tab character (defun insert-tab () (interactive) (insert "\t")) (global-unset-key [tab]) (global-set-key (kbd "TAB") 'insert-tab) ;;; --- end-of-file --- Thanks again, -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )