From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: key to yank text at point into minibuffer? Date: Thu, 16 Feb 2006 10:16:09 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1140133475 1763 80.91.229.2 (16 Feb 2006 23:44:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Feb 2006 23:44:35 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 17 00:44:32 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F9snT-0005C1-8s for ged-emacs-devel@m.gmane.org; Fri, 17 Feb 2006 00:44:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F9smr-0006CG-ES for ged-emacs-devel@m.gmane.org; Thu, 16 Feb 2006 18:43:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F9mkt-0008Lx-Ra for emacs-devel@gnu.org; Thu, 16 Feb 2006 12:17:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F9mks-0008Ko-Sj for emacs-devel@gnu.org; Thu, 16 Feb 2006 12:17:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F9mks-0008Kk-OL for emacs-devel@gnu.org; Thu, 16 Feb 2006 12:17:22 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1F9mq3-0007mA-2d for emacs-devel@gnu.org; Thu, 16 Feb 2006 12:22:43 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1F9mkM-0005Oy-LY for emacs-devel@gnu.org; Thu, 16 Feb 2006 18:16:50 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Feb 2006 18:16:50 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Feb 2006 18:16:50 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 43 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: 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: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:50633 Archived-At: Drew Adams wrote: > > I think ffap.el should instead have a minor mode with its own keymap. > > Is it as simple as this: > (defvar ffap-mode-map > (let ((map (make-sparse-keymap))) > (define-key map [S-mouse-3] 'ffap-at-mouse) > ... > map)) > (defvar ffap-mode-hook nil "Hook run by `ffap-mode'.") > (define-minor-mode ffap-mode > "Toggle `ffap' bindings in every buffer. > \\{ffap-mode-map}" > :global t :lighter "" > (run-hooks 'ffap-mode-hook)) > > Yes, I think so. > > However: > > . Does "" for :lighter act the same as nil? I'm not sure - the doc only > speaks of nil. Logically, I guess "" would display an empty string when the > mode is on and display nothing when it is off ;-). I guess so, too. The difference is that an entry isn't added to minor-mode-alist for :lighter nil. > . Isn't it good practice to show the mode name in the lighter? Shouldn't > people see whether or not they are in ffap mode? I don't know. I figure the global minor modes I'm familiar with (auto-compression, font-lock, and mouse-wheel) don't show up in the mode line so I'd leave it out. But then, those modes don't override default keybindings either. What does everyone think? There's also a bug above: define-minor-mode already arranges for ffap-mode-hook (and either ffap-mode-on-hook or ffap-mode-off-hook) to be run, so calling run-hooks is redundant at best. -- Kevin Rodgers