[Top][All Lists]

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

Re: Emacs keybindings according to file type

From: Christopher Dimech
Subject: Re: Emacs keybindings according to file type
Date: Wed, 23 Sep 2020 09:44:33 +0200

Thank you for pointing the misspelling, it now works correctly.

In the meantime I have used the following

  ( org-defkey org-mode-map (kbd "C-t l f") 'org-drag-line-forward )
  ( org-defkey org-mode-map (kbd "C-t l b") 'org-drag-line-backward )

Concerning the repeatable binding, have you practiced, because I have not.
How do you go about it?  

> Sent: Wednesday, September 23, 2020 at 7:33 AM
> From: "Yuri Khan" <>
> To: "Christopher Dimech" <>
> Cc: "Eli Zaretskii" <>, "help-gnu-emacs" <>
> Subject: Re: Emacs keybindings according to file type
> On Wed, 23 Sep 2020 at 13:33, Christopher Dimech <> 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]