Emacs 21 for Mac OS X
Latest News, FAQ, Files, Links, and other Resources.
Latest News

Introduction

Obtaining and Building Emacs

FAQ

Resources


Emacs Home Page

Emacs Project Page on Savannah

Emacs for Mac OS Classic Project Page


My OS X Programming Blog

    This is Emacs 21's Mac OS X maintainer's web page.

Mouse Clicks in Scroll Bar

Monday, September 1, 2003

Someone complained on gnu.emacs.bug that the scroll bar doesn't behave correctly when clicked. The following is my reply and fix.

[...] It was an attempt to auto-repeat mouse events in the scroll bar, which used to work. Perhaps it's better to do without the auto-repeat:

(defun mac-handle-scroll-bar-event (event)
  "Handle scroll bar EVENT on Mac OS."
  (interactive "e")
  (let* ((position (event-start event))
         (window (nth 0 position))
         (bar-part (nth 4 position)))
    (select-window window)
    (cond
     ((eq bar-part 'up)
      (read-event)			; discard mouse-1
      (scroll-down 1))
     ((eq bar-part 'above-handle)
      (read-event)
      (scroll-down))
     ((eq bar-part 'handle)
      (read-event)
      (scroll-bar-drag event))
     ((eq bar-part 'below-handle)
      (read-event)
      (scroll-up))
     ((eq bar-part 'down)
      (read-event)
      (scroll-up 1)))))

For now please add this to your startup file. I'll check this in to replace the old definition of the function in lisp/term/mac-win.el soon.

September 2003
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Aug  Oct


Copyright © 2003 Andrew Choi <akochoi-emacs at shaw.ca> Created with
BlogMax
emacs Made on a Mac