From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Where the menu should be appeared when C-mouse-3 is triggered (Was: [patch v3] showing menu bar temporarily when f10 is pressed) Date: Thu, 19 Jul 2012 17:32:53 +0900 (JST) Organization: Red Hat Japan, Inc. Message-ID: <20120719.173253.1324462371913652728.yamato@redhat.com> References: <20120620.151738.1783513864733342718.yamato@redhat.com> <20120718.202901.2035363502190339372.yamato@redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1342686789 19984 80.91.229.3 (19 Jul 2012 08:33:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 19 Jul 2012 08:33:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 19 10:33:09 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SrmAV-0006s3-6T for ged-emacs-devel@m.gmane.org; Thu, 19 Jul 2012 10:33:07 +0200 Original-Received: from localhost ([::1]:39684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrmAU-0004Q0-Ak for ged-emacs-devel@m.gmane.org; Thu, 19 Jul 2012 04:33:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrmAO-0004Ps-C4 for emacs-devel@gnu.org; Thu, 19 Jul 2012 04:33:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrmAN-0004Y1-3k for emacs-devel@gnu.org; Thu, 19 Jul 2012 04:33:00 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:32839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrmAM-0004Xt-Qd for emacs-devel@gnu.org; Thu, 19 Jul 2012 04:32:59 -0400 Original-Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6J8Wvw9012067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 19 Jul 2012 04:32:57 -0400 Original-Received: from localhost (dhcp-193-19.nrt.redhat.com [10.64.193.19]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6J8Wrdx030981; Thu, 19 Jul 2012 04:32:56 -0400 In-Reply-To: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151752 Archived-At: Thank you for reviewing. I'll revise my patch and submit it again. >>>> Why do you need the menu-bar? Why not pop up the menu usually bound to >>>> C-mouse-3? >>> To be honest, I didn't know that. >>> I've just tried C-mouse-3; and found some advantages of C-mouse-3 >>> comparing with f10 for KEYBOARD USER. > > While I agree we should also support the f10 behavior (so your current > patch is acceptable), I think the problem you point out for the > C-mouse-3 behavior could/should be fixed. > >>> 1. With C-mouse-3, the menu is pop up where mouse pointer is. > > That should be easy to fix so that the menu is popped up at point. > >>> 2. With C-mouse-3, the contents of menu is chosen based >>> on the window where the mouse pointer is. > > Same here. I don't this is easy to fix. For KEYBOARD USER it is nice to popped up at point. Howto, it is not nice for MOUSE USER. Emacs has many useful commands(mouse oriented commands) which are expected to be triggered from MOUSE. Some of them, including C-mouse-3, are not suitable for keyboard operatoin. I've been thinking about this gap between mouse operation and keyboard operation in emacs. I'd like to introduce `bring-mouse-to-point' for fill the gap. Its behavior is too tricky, so I'd like to introduce is after f10 patch is accepted. The behavior of f10 patch is a bit tricky. `bring-mouse-to-point' is for for keyboard user, who don't want to use mouse but want to use mouse oriented commands from key board. As the name shown, `bring-mouse-to-point' moves the mouse cursor to the point. So you can do what Stefan suggests with following key sequence: \C-. C-mouse-3 (Here I bind \C-. to `bring-mouse-to-point' privately. I know \C-. is reserved to user customization.) If you are using note-PC, this is enough useful because mouse-[123] are near keyboard. After invoking \C-. C-mouse-3, you can type \C-. again. In that case the mouse cursor moves somewhere far away from point; mouse-avoidance-banish is called. It means the behavior or \C-. is toggle. How do you think `bring-mouse-to-point'? I hope this is included to emacs officially. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Taken from avoid.el ;; (require 'avoid) (defun point-position () (let ((edges (window-inside-edges)) (x-y (posn-x-y (posn-at-point)))) (cons (selected-frame) (cons (+ (car edges) (/ (car x-y) (frame-char-width))) (+ (car (cdr edges)) (/ (cdr x-y) (frame-char-height))))))) (defun bring-mouse-to-point (avoiding) (interactive "P") (let ((op (mouse-position)) (np (point-position))) (if (or avoiding (equal op np)) (mouse-avoidance-banish) (set-mouse-position (car np) (cadr np) (cddr np))))) (define-key global-map [(control .)] 'bring-mouse-to-point) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Masatake YAMATO