all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* .emacs to keep cursor stationary when scrolling with mouse
@ 2015-05-29  2:19 JohnF
  2015-05-29  8:26 ` Damien Wyart
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: JohnF @ 2015-05-29  2:19 UTC (permalink / raw)
  To: help-gnu-emacs

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 )


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-05-31 13:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29  2:19 .emacs to keep cursor stationary when scrolling with mouse JohnF
2015-05-29  8:26 ` Damien Wyart
2015-05-29 11:03   ` JohnF
2015-05-29 14:03     ` Damien Wyart
2015-05-30  3:25       ` JohnF
2015-05-30  9:45         ` Damien Wyart
2015-05-31  4:03           ` JohnF
2015-05-29 19:44 ` Jorge A. Alfaro-Murillo
     [not found] ` <mailman.3927.1432928671.904.help-gnu-emacs@gnu.org>
2015-05-30  3:43   ` JohnF
2015-05-30  6:26     ` tomas
     [not found]     ` <mailman.3945.1432967181.904.help-gnu-emacs@gnu.org>
2015-05-30  7:48       ` JohnF
2015-05-30 13:04         ` tomas
     [not found]         ` <mailman.3970.1432991100.904.help-gnu-emacs@gnu.org>
2015-05-31  4:34           ` JohnF
     [not found]           ` <<mke31e$k7h$1@reader1.panix.com>
2015-05-31 13:20             ` Drew Adams
2015-05-31  1:18     ` Jorge A. Alfaro-Murillo
     [not found]     ` <mailman.4015.1433035116.904.help-gnu-emacs@gnu.org>
2015-05-31  5:04       ` JohnF

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.