From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vagn Johansen Newsgroups: gmane.emacs.help Subject: Re: org-mode with a custom binding on S-Up and no shift-select Date: Fri, 22 May 2009 11:23:43 +0200 Organization: SunSITE.dk - Supporting Open source Message-ID: References: <87ljotcwrq.fsf@dpt-info.u-strasbg.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1242985292 6569 80.91.229.12 (22 May 2009 09:41:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 May 2009 09:41:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 22 11:41:25 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 1M7RFl-0000bX-43 for geh-help-gnu-emacs@m.gmane.org; Fri, 22 May 2009 11:41:25 +0200 Original-Received: from localhost ([127.0.0.1]:40094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M7RFk-0003CW-Hm for geh-help-gnu-emacs@m.gmane.org; Fri, 22 May 2009 05:41:24 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (darwin) Cancel-Lock: sha1:UvZhSEtxgWtBtYSDV+2dlXWD2Cs= Original-Lines: 62 Original-NNTP-Posting-Host: 89.239.230.209 Original-X-Trace: news.sunsite.dk DXC=PQJ8PST1DSELCYW^HlPiL@YSB=nbEKnkKl2^feVC_<6F1]Odi5o\aCCgNbeFAXTM>E4X23ZgHoIACLIbBQDMe\EO?WmUNHj[WiO Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:169384 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:64623 Archived-At: Alain Ketterlin writes: > Hello, > > I've just started using org-mode and have a small problem with > and . I don't use shift-select-mode. My .emacs has: > > (global-set-key (kbd "S-") `(lambda () > (interactive) > (scroll-up 1))) I have the same bindings .. well it is (scroll-up 2) in my case. > and similar for . (BTW, is interactive of any use here? I copied > this somewhere, my elisp skills are almost non-existent.) > > Org-mode has special use for and . I would like to keep > my own bindings, except on timestamps. And the same problem. If often add priorities to tasks (#A,..) when I want to scroll down. I just cooked up the code below. I sets up the shift up/down to scrolling. IF in org-mode and NOT at the beginning of the line then the org shift functions are called. (require 'org) (global-set-key [S-up] 'vj-scroll-down-hook) (global-set-key [S-down] 'vj-scroll-up-hook) (defun vj-org-shift-keys-setup () (interactive) (local-set-key [S-up] 'vj-scroll-down) (local-set-key [S-down] 'vj-scroll-up)) (add-hook 'org-mode-hook 'vj-org-shift-keys-setup) (defun vj-scroll-up (&optional arg) "Vj scroll-up." (interactive) (if (and (equal major-mode 'org-mode) (not (bolp))) ;; In org-mode and not at beginning of line (org-shiftup arg) ;; else (scroll-up 2))) (defun vj-scroll-down (&optional arg) "Vj scroll-down." (interactive) (if (and (equal major-mode 'org-mode) (not (bolp))) ;; In org-mode and not at beginning of line (org-shiftdown arg) ;; else (scroll-down 2))) -- Vagn Johansen