1

I just installed Arch (Arcolinux) and everything works fine except emacs which refuses indentation in Org mode files with the Alt-left-arrow (M-<left>)or the Alt-right-arrow (M-<right>) key. I never had this problem before. Even if I start in console mode with the command emacs -q the problem remains the same. The version of emacs is GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.17.6) of 2023-01-02.

I am unable to find a clue that allows me to solve the problem.

11
  • There is no key labeled Alt-arrow on my keyboard. Can you explain what key(s) you press? Do you mean Alt in combination with an arrow key (up, down, left, right)? If so, which one?
    – NickD
    Jan 26, 2023 at 3:11
  • Yes it is the left Alt Key with the right and left arrow. I use to indent my headers in org mode with this combinaison.
    – XunilMC
    Jan 26, 2023 at 17:34
  • You must have had that set up in a customization that you have now lost. M-<right> e.g. is bound to right-word by default: it does not do indentation (I tried fundamental mode, as well as c-mode).
    – NickD
    Jan 26, 2023 at 17:41
  • Well, that's the part I don't understand. I still use the same init.el...
    – XunilMC
    Jan 26, 2023 at 17:54
  • I just noticed that you mentioned Org mode in your comment: that is crucial information that you need to add to your question, instead of hiding it in a comment.
    – NickD
    Jan 26, 2023 at 19:04

2 Answers 2

1

In one of your comments you say: “If I do C-h c and M- nothing appear after ''Describe the following key, mouse click, or menu item:''”.

This is a big clue that your operating system is intercepting this keyboard shortcut for its own use. You may want to configure your desktop environment (which appears after a quick Google search to be XFCE4) not to use it for anything.

1
  • My English is not very good. You are right about demoting, that's what I was trying to say. C-h c M-<right> doesn't do anything in fundamental mode (if I did it correctly). C-h v major-mode open a windows where the major mode is define. My desktop environment is Cinnamon.
    – XunilMC
    Feb 3, 2023 at 22:20
0

In Org mode, M-<right> is bound to org-metaright by default. Check that that is the case for you wiht C-h c M-<right>. The docstring of org-metaright (C-h f org-metaright) says:

org-metaright is an interactive Lisp closure in ‘org.el’.

It is bound to M-<right> and ESC <right>.

(org-metaright &optional ARG)

Demote heading, list item at point or move table column right.

In front of a drawer or a block keyword, indent it correctly.

Calls ‘org-do-demote’, ‘org-indent-item’, ‘org-table-move-column’,
‘org-indent-drawer’ or ‘org-indent-block’ depending on context.
With no specific context, calls the Emacs default ‘forward-word’.
See the individual commands for more information.

This function runs the hook ‘org-metaright-hook’ as a first step,
and returns at first non-nil value.

so it should indent drawers and blocks "correctly" but it does a lot of other things too, depending on the context. If the key is bound to this function, then everything is as it should be. If you are expecting something other than what this function does according to its description, then it may be that there is a bug, or it may be that you are misunderstanding something. In order to figure out which, we need a detailed description of what you are doing: an example Org mode file, where the cursor is when you press M-<right>, what you expect to happen and what actually happens. You can add all this to this question or close this question and open a new, much more detailed one with all the information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.