From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: TomSW Newsgroups: gmane.emacs.help Subject: Re: binding a key for keyword completion in all modes Date: Wed, 4 Mar 2009 15:17:54 -0800 (PST) Organization: http://groups.google.com Message-ID: <8a1d6edd-aff2-44ad-997e-5b755bde33ea@v6g2000vbb.googlegroups.com> References: <8b351a00-6fa4-45f3-b240-eb7d53ed2d4c@e18g2000yqo.googlegroups.com> <87wsbdwr81.fsf@thinkpad.tsdh.de> <87skm012ln.fsf@mundaneum.com> <87r61j62k0.fsf@thinkpad.tsdh.de> <58e57903-4b47-443c-b84d-e41662071482@e36g2000prg.googlegroups.com> <87ocwkavg0.fsf@thinkpad.tsdh.de> <23f18594-f0c7-4050-ba73-fd94c0dc43fa@v5g2000prm.googlegroups.com> <238ec42a-c6ee-4661-9b11-6e3b1ca58a35@u18g2000pro.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1236210054 25592 80.91.229.12 (4 Mar 2009 23:40:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Mar 2009 23:40:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 05 00:42:11 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lf0j0-0002GW-Ar for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Mar 2009 00:42:06 +0100 Original-Received: from localhost ([127.0.0.1]:41001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf0hf-0006rS-3D for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Mar 2009 18:40:43 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v6g2000vbb.googlegroups.com!not-for-mail Original-Newsgroups: comp.emacs,gnu.emacs.help Original-Lines: 20 Original-NNTP-Posting-Host: 94.224.218.138 Original-X-Trace: posting.google.com 1236208674 3257 127.0.0.1 (4 Mar 2009 23:17:54 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 4 Mar 2009 23:17:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v6g2000vbb.googlegroups.com; posting-host=94.224.218.138; posting-account=gXCEPAoAAACaHNwa63AHlGuSCIcCahgr User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009022714 Ubuntu/9.04 (jaunty) Firefox/3.0.6, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu comp.emacs:97927 gnu.emacs.help:167301 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62592 Archived-At: On Mar 4, 11:18=A0pm, Xah Lee wrote: > just to make message more clear and independent of the thread, what i > wanted is to set Ctrl+Tab for command completion that works in all > major modes, and avoding adding a custome hook to each and every mode. It depends what you call a "custom hook". The code to rebind C-tab works whatever the mode, but it still needs to be run for every new buffer: in my experience most worthwhile modes need a bit of tweaking so adding an extra function call to emacs-mode-hook, nxml-mode-hook, etc. isn't a big deal. I believe the best solution will involve local-set-key and a suitable hook: maybe you can find a hook called for every new buffer after the major mode has loaded. Another possibility is to define a global minor mode that just applies your keybinding changes: I think this will be invoked after any major mode but I'm not certain. Regards, Tom