Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] scrolling in emacs



>>>>> "HA" == Hector Akamine <hector_aka@example.com> writes:

    HA> Hi,
    HA> While editing a file in emacs, if I go past the last
    HA> line that is shown on the editing window, the window
    HA> scrolls down several lines at once. I would like emacs
    HA> to scroll just one line at a time. Is there any
    HA> setting that I can put in .emacs to make it happen?

I've got the following piece in my .emacs. You may want to customize
the last part (key bindings).

HTH
Viktor


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; O'REILLY'S BOOK "GNU Emacs Extensions"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;
;; scrolling
;;

(defalias 'scroll-ahead 'scroll-up)
(defalias 'scroll-behind 'scroll-down)
(defalias 'scroll-other-window-ahead 'scroll-other-window)
(defalias 'scroll-other-window-behind 'scroll-other-window-down)

(defun scroll-one-line-ahead ()
  "Scroll ahead one line."
  (interactive)
  (scroll-ahead 1))

(defun scroll-other-window-one-line-ahead ()
  "Scroll other window ahead one line."
  (interactive)
  (scroll-other-window-ahead 1))

(defun scroll-one-line-behind ()
  "Scroll ahead one line."
  (interactive)
  (scroll-behind 1))

(defun scroll-other-window-one-line-behind ()
  "Scroll other window ahead one line."
  (interactive)
  (scroll-other-window-behind 1))

(global-set-key [end] 'scroll-one-line-ahead)
(global-set-key [home] 'scroll-one-line-behind)
(global-set-key [C-end] 'scroll-other-window-one-line-ahead)
(global-set-key [C-home] 'scroll-other-window-one-line-behind)
(global-set-key [C-next] 'scroll-other-window)
(global-set-key [C-prior] 'scroll-other-window-down)


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links