Subject: bug#4127 closed by Chong Yidong <[email-masked]> (Re: bug#4124: 23.1; mwheel in --daemon mode)

From: [email-masked] (Emacs bug Tracking System)
Date: Sun, 16 Aug 2009 06:00:05 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#4124: 23.1; mwheel in --daemon mode

It has been closed by Chong Yidong <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Chong Yidong <[email-masked]> by
replying to this email.

-- 
4124: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4124
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#4124: 23.1; mwheel in --daemon mode
From: Chong Yidong <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: John Prevost <[email-masked]>, [email-masked], Dan Nicolaescu <[email-masked]>
Date: Sun, 16 Aug 2009 01:56:19 -0400

> > No.  The essential problem is that in 'x', the mouse wheel events are
> > 'mouse-4' and 'mouse-5', while in 'ns' and 'w32', the mouse wheel
> > events are 'wheel-up' and 'wheel-down'. 
>
> Indeed.  We should remap mouse-4/5 to wheel-up/down in term/x-win.el
> via function-key-map... So basically, I'd like to extend the
> function-key-map facilities so that you can have entries that remap a
> whole set of events, but it's still on the todo list.

In the meantime, we can just test for the `ns-win' and `w32-win'
features (or, equivalently, the system-type variable, but I think the
former are more to the point).  I checked in a fix to mwheel.el along
these lines.

Subject: 23.1; mwheel in --daemon mode
From: John Prevost <[email-masked]>
To: [email-masked]
Date: Tue, 11 Aug 2009 13:34:08 -0400

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the [email-masked] mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

When emacs is started in --daemon mode, the window-system variable is
initially 'nil'.  In mwheel.el, mouse-wheel-down-event and
mouse-wheel-up-event are bound with defcustom declarations like the
following:

(defcustom mouse-wheel-down-event
  ;; In the latest versions of XEmacs, we could just use mouse-%s as well.
  (if (memq window-system '(w32 ns))
      'wheel-up
    (intern (format (if (featurep 'xemacs) "button%s" "mouse-%s")
		    mouse-wheel-down-button)))
  "Event used for scrolling down."
  :group 'mouse
  :type 'symbol
  :set 'mouse-wheel-change-button)

Since these run before any terminal is created in the --daemon case,
window-system may not be set to anything at all.

It is possible that this is a bug in mwheel, and that mwheel (and other
packages) should take care not to make use of the window-system variable
until startup.  (This may be particularly important if it's possible for
a single emacs binary to have support for multiple window systems.)

It is possible that a better solution to the problem that mwheel solves
above would be for either term/x-win.el to define-key mouse-4 and
mouse-5 to wheel-up and wheel-down, or for term/w32-win.el and
term/ns-win.el to define-key wheel-up and wheel-down to mouse-4 and
mouse-5, so that mwheel and other packages can use the same symbol on
all window systems.

Either way, the current state of the world is that --daemon results in a
non-functional mouse wheel on w32 and ns.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/Users/prevost1/Documents/src/emacs-23.1/nextstep/Emacs.app/Contents/Resources/etc/DEBUG for instructions.

In GNU Emacs 23.1.1 (i386-apple-darwin9.7.0, NS apple-appkit-949.46)
 of 2009-08-07 on TELPERION.WV.CC.CMU.EDU
Windowing system distributor `Apple', version 10.3.949
configured using `configure  '--prefix=/opt/emacs-23.1' '--with-ns''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  diff-auto-refine-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  global-auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> s-x r e p o r t M-x r e p o t <backspace> 
r t - e m <tab> <return>

Recent messages:
Loading /Users/prevost1/Documents/src/elisp/nxml-mode/rng-auto.el (source)...done
Loading /Users/prevost1/Documents/src/elisp/mercurial.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Terminal setup done
kill-region: The mark is not set now, so there is no region