help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs keybindings according to file type


From: Yuri Khan
Subject: Re: Emacs keybindings according to file type
Date: Wed, 23 Sep 2020 14:33:07 +0700

On Wed, 23 Sep 2020 at 13:33, Christopher Dimech <dimech@gmx.com> wrote:

> I wrote the following code to swap line for org files.
> Did not work after trying it. I need to have the thing work for
> org files and other files on whicn I call M-x org-mode.
>
>   ( defun Transpose-Org-Line ()
>       "Binds up and down keys to org-drag-line* commands"
>       (local-set-key (kbd "C-t l f") 'org-drag-line-forwarrd)
>       (local-set-key (kbd "C-t l b") 'org-drag-line-backward)
>   )
>
>   ( add-hook 'org-mode-hook 'Transpose-Org-Line )

Works for me in emacs -Q, except that you misspelled ‘forward’.

Also, org-mode already binds M-S-<up> and M-S-<down> to commands that
work the same way as org-drag-line-* unless you are in a table or on a
clock timestamp. It’s likely that you will want to drag a line more
than once in a row, so a repeatable binding (a key that you can hold
down) is better than a long sequence such as C-t l f.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]