all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 23.0.60; customize or whatever to disable gpm-mouse-mode
@ 2008-06-01 22:44 Kevin Ryde
  2008-06-10 21:14 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Ryde @ 2008-06-01 22:44 UTC (permalink / raw
  To: emacs-pretest-bug

I had some trouble disabling gpm-mouse-mode, which is on by default in
the recent cvs.

I tried M-x customize-variable gpm-mouse-mode and saving, which turned
it off, but on the next startup it was enabled again.  Then I tried
"(gpm-mouse-mode 0)" in my .emacs, but that didn't have any effect at
all.

I suspect terminal-init-linux is forcibly turning it on after .emacs and
customizations have run.

I wonder if a saved customize could work in the next session.  Or
alternatively have some guidance in the docstring or manual on
disabling.  (I got what I wanted for the moment under term-setup-hook.
I like the gpm/kernel default selection stuff and get fairly annoyed by
programs that take it over with their own ideas :-).

I saw frames.texi mentions t-mouse-mode, perhaps it could have a couple
of words about it being enabled by default now, if that's going to be
the case (still as/when available, of course).




In GNU Emacs 23.0.60.1 (i586-pc-linux-gnu, GTK+ Version 2.12.9)
 of 2008-06-01 on blah.blah
configured using `configure  'CFLAGS=-O -g' '--prefix=/down/emacs/b/inst' '--with-x-toolkit=gtk''

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: en_AU
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  file-name-shadow-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
ESC x r e p o r t - e m a TAB RET

Recent messages:
("/down/emacs/b/src/emacs")




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

* Re: 23.0.60; customize or whatever to disable gpm-mouse-mode
  2008-06-01 22:44 23.0.60; customize or whatever to disable gpm-mouse-mode Kevin Ryde
@ 2008-06-10 21:14 ` Stefan Monnier
  2008-06-13 20:53   ` bug#406: " Kevin Ryde
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2008-06-10 21:14 UTC (permalink / raw
  To: Kevin Ryde; +Cc: emacs-pretest-bug

> I had some trouble disabling gpm-mouse-mode, which is on by default in
> the recent cvs.

> I tried M-x customize-variable gpm-mouse-mode and saving, which turned
> it off, but on the next startup it was enabled again.  Then I tried
> "(gpm-mouse-mode 0)" in my .emacs, but that didn't have any effect at
> all.

  (defalias 'gpm-mouse-mode 'ignore)

will do the trick.  But no, this is not the way it should be, I agree.
Can you try the patch below to see if it works more like what you'd expect?


        Stefan


Index: lisp/t-mouse.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/t-mouse.el,v
retrieving revision 1.21
diff -u -r1.21 t-mouse.el
--- lisp/t-mouse.el	6 May 2008 07:57:53 -0000	1.21
+++ lisp/t-mouse.el	10 Jun 2008 21:12:51 -0000
@@ -41,6 +41,27 @@
 ;; Prevent warning when compiling in an Emacs without gpm support.
 (declare-function gpm-mouse-start "term.c" ())
 
+(defun gpm-mouse-enable ()
+  "Try to enable gpm mouse support on the current terminal."
+  (let ((activated nil))
+    (unwind-protect
+        (progn
+          (unless (fboundp 'gpm-mouse-start)
+            (error "Emacs must be built with Gpm to use this mode"))
+          (when gpm-mouse-mode
+            (gpm-mouse-start)
+            (set-terminal-parameter nil 'gpm-mouse-active t)
+            (setq activated t)))
+      ;; If something failed to turn it on, try to turn it off as well,
+      ;; just in case.
+      (unless activated (gpm-mouse-disable)))))
+
+(defun gpm-mouse-disable ()
+  "Try to disable gpm mouse support on the current terminal."
+  (when (fboundp 'gpm-mouse-stop)
+    (gpm-mouse-stop))
+  (set-terminal-parameter nil 'gpm-mouse-active nil))
+
 ;;;###autoload
 (define-obsolete-function-alias 't-mouse-mode 'gpm-mouse-mode "23.1")
 ;;;###autoload
@@ -52,21 +73,14 @@
 This allows the use of the mouse when operating on a GNU/Linux console,
 in the same way as you can use the mouse under X11.
 It relies on the `gpm' daemon being activated."
-  :global t :group 'mouse
-  (let ((activated nil))
-    (unwind-protect
-        (progn
-          (unless (fboundp 'gpm-mouse-start)
-            (error "Emacs must be built with Gpm to use this mode"))
-          (when gpm-mouse-mode
-            (gpm-mouse-start)
-            (setq activated t)))
-      ;; If the user asked to turn it off do that.
-      ;; If something failed to turn it on, try to turn it off as well,
-      ;; just in case.
-      (when (and (fboundp 'gpm-mouse-stop) (not activated))
-        (setq gpm-mouse-mode nil)
-        (gpm-mouse-stop)))))
+  :global t :group 'mouse :init-value t
+  (dolist (terminal (terminal-list))
+    (when (and (eq t (terminal-live-p terminal))
+               (not (eq gpm-mouse-mode
+                        (terminal-parameter terminal 'gpm-mouse-active))))
+      ;; Simulate selecting a terminal by selecting one of its frames ;-(
+      (with-selected-frame (car (frames-on-display-list terminal))
+        (if gpm-mouse-mode (gpm-mouse-enable) (gpm-mouse-disable))))))
 
 (provide 't-mouse)
 
Index: lisp/term/linux.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term/linux.el,v
retrieving revision 1.13
diff -u -r1.13 linux.el
--- lisp/term/linux.el	7 Jun 2008 02:42:21 -0000	1.13
+++ lisp/term/linux.el	10 Jun 2008 21:12:51 -0000
@@ -9,7 +9,7 @@
   ;; It can't really display underlines.
   (tty-no-underline)
 
-  (ignore-errors (gpm-mouse-mode 1))
+  (ignore-errors (if gpm-mouse-mode (gpm-mouse-enable)))
 
   ;; Make Latin-1 input characters work, too.
   ;; Meta will continue to work, because the kernel




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

* bug#406: 23.0.60; customize or whatever to disable gpm-mouse-mode
  2008-06-10 21:14 ` Stefan Monnier
@ 2008-06-13 20:53   ` Kevin Ryde
  2008-06-13 22:00     ` bug#409: " Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Ryde @ 2008-06-13 20:53 UTC (permalink / raw
  To: Stefan Monnier; +Cc: emacs-pretest-bug

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
> Can you try the patch below to see if it works more like what you'd expect?

Seems no longer enabled on startup at all.

I think it may have to load t-mouse, which the ignore-errors hides.
Perhaps a message on failing to enable too (the usual one being the
server not running).



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: linux.el.gpm.diff --]
[-- Type: text/x-diff, Size: 718 bytes --]

*** linux.el	12 Jun 2008 09:11:07 +1000	1.14
--- linux.el	13 Jun 2008 16:04:09 +1000	
***************
*** 9,15 ****
    ;; It can't really display underlines.
    (tty-no-underline)
  
!   (ignore-errors (if gpm-mouse-mode (gpm-mouse-enable)))
  
    ;; Make Latin-1 input characters work, too.
    ;; Meta will continue to work, because the kernel
--- 9,19 ----
    ;; It can't really display underlines.
    (tty-no-underline)
  
!   (when gpm-mouse-mode
!     (require 't-mouse)
!     (condition-case err
!         (gpm-mouse-enable)
!       (error (message "gpm-mouse-mode: %s" (error-message-string err)))))
  
    ;; Make Latin-1 input characters work, too.
    ;; Meta will continue to work, because the kernel

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

* bug#409: 23.0.60; customize or whatever to disable gpm-mouse-mode
  2008-06-13 20:53   ` bug#406: " Kevin Ryde
@ 2008-06-13 22:00     ` Stefan Monnier
  2008-07-01  4:10       ` bug#409: marked as done (23.0.60; customize or whatever to disable gpm-mouse-mode) Emacs bug Tracking System
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2008-06-13 22:00 UTC (permalink / raw
  To: Kevin Ryde; +Cc: emacs-pretest-bug

>> Can you try the patch below to see if it works more like what you'd expect?
> Seems no longer enabled on startup at all.
> I think it may have to load t-mouse, which the ignore-errors hides.

Indeed, sorry.

> Perhaps a message on failing to enable too (the usual one being the
> server not running).

Since it's enabled by default, it should fail silently by default as
well, I think.  Use gpm-mouse-mode interactively to get better feedback.


        Stefan






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

* bug#409: marked as done (23.0.60; customize or whatever to  disable gpm-mouse-mode)
  2008-06-13 22:00     ` bug#409: " Stefan Monnier
@ 2008-07-01  4:10       ` Emacs bug Tracking System
  0 siblings, 0 replies; 5+ messages in thread
From: Emacs bug Tracking System @ 2008-07-01  4:10 UTC (permalink / raw
  To: Glenn Morris

[-- Attachment #1: Type: text/plain, Size: 831 bytes --]


Your message dated Tue, 1 Jul 2008 00:04:02 -0400
with message-id <18537.44210.247017.980417@fencepost.gnu.org>
and subject line #409
has caused the Emacs bug report #409,
regarding 23.0.60; customize or whatever to disable gpm-mouse-mode
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
409: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=409
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 2809 bytes --]

From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Kevin Ryde <user42@zip.com.au>
Cc: emacs-pretest-bug@gnu.org
Subject: Re: 23.0.60; customize or whatever to disable gpm-mouse-mode
Date: Fri, 13 Jun 2008 18:00:58 -0400
Message-ID: <jwvej719ewk.fsf-monnier+emacs@gnu.org>

>> Can you try the patch below to see if it works more like what you'd expect?
> Seems no longer enabled on startup at all.
> I think it may have to load t-mouse, which the ignore-errors hides.

Indeed, sorry.

> Perhaps a message on failing to enable too (the usual one being the
> server not running).

Since it's enabled by default, it should fail silently by default as
well, I think.  Use gpm-mouse-mode interactively to get better feedback.


        Stefan



[-- Attachment #3: Type: message/rfc822, Size: 1519 bytes --]

From: Glenn Morris <rgm@gnu.org>
To: 409-done@emacsbugs.donarmstrong.com
Subject: #409
Date: Tue, 1 Jul 2008 00:04:02 -0400
Message-ID: <18537.44210.247017.980417@fencepost.gnu.org>


See also: http://lists.gnu.org/archive/html/emacs-devel/2008-06/msg00030.html

2008-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>

        * term/linux.el (terminal-init-linux): Use gpm-mouse-enable.

        * t-mouse.el (gpm-mouse-enable, gpm-mouse-disable): New functions.
        (gpm-mouse-mode): Make it into a proper global minor mode.


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

end of thread, other threads:[~2008-07-01  4:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-01 22:44 23.0.60; customize or whatever to disable gpm-mouse-mode Kevin Ryde
2008-06-10 21:14 ` Stefan Monnier
2008-06-13 20:53   ` bug#406: " Kevin Ryde
2008-06-13 22:00     ` bug#409: " Stefan Monnier
2008-07-01  4:10       ` bug#409: marked as done (23.0.60; customize or whatever to disable gpm-mouse-mode) Emacs bug Tracking System

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.