From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) Newsgroups: gmane.emacs.help Subject: Re: Can I use 'C-x o o o o o' instead of C-x o C-x o C-x o C-x o C-x o? Date: Tue, 28 Apr 2015 09:50:07 -0400 Message-ID: <87oam8fjlc.fsf@yale.edu> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1430229108 14119 80.91.229.3 (28 Apr 2015 13:51:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Apr 2015 13:51:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 28 15:51:41 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1Yn5v6-0005D9-GQ for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Apr 2015 15:51:28 +0200 Original-Received: from localhost ([::1]:33481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn5v4-0001uD-ES for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Apr 2015 09:51:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn5uI-0001Ov-FG for help-gnu-emacs@gnu.org; Tue, 28 Apr 2015 09:50:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yn5uD-0007IF-A0 for help-gnu-emacs@gnu.org; Tue, 28 Apr 2015 09:50:38 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:40645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn5uD-0007I2-12 for help-gnu-emacs@gnu.org; Tue, 28 Apr 2015 09:50:33 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Yn5tw-0004QW-0f for help-gnu-emacs@gnu.org; Tue, 28 Apr 2015 15:50:16 +0200 Original-Received: from nat-130-132-173-151.central.yale.edu ([130.132.173.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Apr 2015 15:50:15 +0200 Original-Received: from jorge.alfaro-murillo by nat-130-132-173-151.central.yale.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Apr 2015 15:50:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nat-130-132-173-151.central.yale.edu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:quyfFJo8yDuDHXCPnnpb6Q8/+mU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104027 Archived-At: 張國良 writes: > Scenario 1 - I split many windows. - I wish to switch to some > other windows. - I type C-x o, C-x o, C-x o repeatedly until > the cursor landed on the desired window. Is there a way to use > C-x o o o instead? > > I aware that I can use C-u num C-x o, if I know the desired > window is num step away. But there are times that I do not know > 'num'. > > Scenario 2 - I use the windmove package. - I bind the > windmove-up/down/left/right to C-o i, C-o k, C-o j, C-o l > respectively. Now, if I want to windmove to up-left, I type C-o > i, C-o j. Is there a way to use C-o i j instead? You could try something like: #+BEGIN_SRC emacs-lisp (defvar your-extended-keymap (make-sparse-keymap)) (define-key your-extended-keymap (kbd "o") 'other-window) (advice-add 'other-window :after (lambda () (set-transient-map your-extended-keymap))) #+END_SRC > > Many thanks. > Best, -- Jorge.