From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: Shift-Arrow Pass Through for windmove? Date: Fri, 23 Apr 2010 18:12:25 +0200 Message-ID: <87ochaqhau.fsf@gmx.de> References: <87633jb57w.wl%ded-law@ddoherty.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O5LUc-0002Gr-6t for emacs-orgmode@gnu.org; Fri, 23 Apr 2010 12:12:38 -0400 Received: from [140.186.70.92] (port=55623 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O5LUa-0002Ft-3y for emacs-orgmode@gnu.org; Fri, 23 Apr 2010 12:12:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O5LUY-0003vy-Hv for emacs-orgmode@gnu.org; Fri, 23 Apr 2010 12:12:36 -0400 Received: from mail.gmx.net ([213.165.64.20]:33817) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1O5LUY-0003vk-6o for emacs-orgmode@gnu.org; Fri, 23 Apr 2010 12:12:34 -0400 In-Reply-To: <87633jb57w.wl%ded-law@ddoherty.net> (Daniel E. Doherty's message of "Thu, 22 Apr 2010 15:30:11 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Daniel E. Doherty" Cc: "emacs-orgmode@gnu org" --=-=-= Daniel E. Doherty writes: > All, > > I make *very* frequent use of the shift-arrow keys to move from window > to window inside emacs via windmove. It is probably the most frequent > key combination I access. > > Anyway, is there a way to make org-mode friendlier to it by passing the > key along whenever org-mode would otherwise throw an error. For > example, when not on a heading, when in the agenda, and wherever else? > > I really like Carsten's use of the arrow keys for structure editing and > don't want to lose that, just whenever org-mode can't make use of the > keys. > > Regards, And here all the arrow keys. It's somewhat inelegant, since you always need to keep track of new useful org-bindings. I would find an org-internal solution helpfull too. I use windmove. Actually, your email made hack this together :) --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline Content-Transfer-Encoding: quoted-printable (defun my/org-windmove-right-maybe (&optional arg) (interactive "P") (if (and (not (org-on-heading-p)) (not (org-at-item-p))) (windmove-right arg) (org-shiftright arg))) (defun my/org-windmove-left-maybe (&optional arg) (interactive "P") (if (and (not (org-on-heading-p)) (not (org-at-item-p))) (windmove-left arg) (org-shiftleft arg))) (defun my/org-windmove-up-maybe (&optional arg) (interactive "P") (if (and (not (org-on-heading-p)) (not (org-at-timestamp-p)) (not (org-at-item-p))) (windmove-up arg) (org-shiftup arg))) (defun my/org-windmove-down-maybe (&optional arg) (interactive "P") (if (and (not (org-on-heading-p)) (not (org-at-timestamp-p)) (not (org-at-item-p))) (windmove-down arg) (org-shiftdown arg))) ;; and bind it in org-mode-hook: (add-hook 'org-mode-hook (lambda () (define-key org-mode-map [(shift right)] 'my/org-windmove-right-maybe) (define-key org-mode-map [(shift left)] 'my/org-windmove-left-maybe) (define-key org-mode-map [(shift up)] 'my/org-windmove-up-maybe) (define-key org-mode-map [(shift down)] 'my/org-windmove-down-maybe))) --=-=-= Sebastian --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--