From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Mac emacs scroll bars Date: Fri, 09 Jul 2004 18:53:14 +0900 Organization: Faculty of Science, Chiba University Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <7627C10A-CF84-11D8-8F92-00050260B859@duke.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1089366833 1515 80.91.224.253 (9 Jul 2004 09:53:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Jul 2004 09:53:53 +0000 (UTC) Cc: Martin Otte , emacs-devel Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Jul 09 11:53:43 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bis4c-0003m9-00 for ; Fri, 09 Jul 2004 11:53:42 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bis4c-0006Cn-00 for ; Fri, 09 Jul 2004 11:53:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bis6m-0007CZ-EO for emacs-devel@quimby.gnus.org; Fri, 09 Jul 2004 05:55:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bis6j-0007AF-Fb for emacs-devel@gnu.org; Fri, 09 Jul 2004 05:55:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bis6h-00077O-5c for emacs-devel@gnu.org; Fri, 09 Jul 2004 05:55:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bis6h-00076l-2R for emacs-devel@gnu.org; Fri, 09 Jul 2004 05:55:51 -0400 Original-Received: from [133.82.132.2] (helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bis4E-00035c-Ve for emacs-devel@gnu.org; Fri, 09 Jul 2004 05:53:19 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 9377F1A63A4; Fri, 9 Jul 2004 18:53:14 +0900 (JST) Original-To: Steven Tamm In-Reply-To: User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25554 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25554 >>>>> On Thu, 8 Jul 2004 09:05:31 -0700, Steven Tamm said: > I'm not sure one can do it at the lisp level. The particular problem > is that holding down the mouse button doesn't generate the same kind > of events on the mac that holding down a key would (i.e. autorepeat > events). Because of the event model, read-event hangs until you > move the mouse. One can tell whether an event has been available by examining the return value of sit-for. Here is an example: (defun mac-scroll-down-line () (track-mouse (let ((done nil) event type) (while (not done) (scroll-down 1) (unless (sit-for mouse-delay) ;; possibly have initial and subsequent delays (setq event (read-event)) (setq type (event-basic-type event)) (cond ((eq type 'mouse-1) (setq done t)) ((eq type 'mouse-movement) ;; should do something ))))))) Maybe some subtle cases should be added to the above cond-expression. > I checked in a change similar to this. I forgot to add drag-mouse-1 > to the list of ignorable events, though. Perhaps the following is simpler. (I should have noticed that.) (defun mac-scroll-ignore-events () ;; Ignore confusing non-mouse events (while (not (eq (event-basic-type (read-event)) 'mouse-1)) nil)) YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp