1

I need to set the buffer-variable bidi-display-reordering in all the buffers... for some reason, its default value isn't correct. It's a pain to do it in each and every buffer I open, so I tried to put the following line in the file .emacs.d/init.el:

(setq bidi-display-reordering nil)

I then exited Emacs and re-started it, but it didn't work. What's the correct way to do it?

Drew
  • 29,895
  • 7
  • 74
  • 104
Arik
  • 159
  • 6
  • The default value certainly *is* correct. As the docstring says, "Setting this to nil is intended for use in debugging the display code. Don’t set to nil in normal sessions, as that is not supported." – phils Jun 27 '21 at 12:43

1 Answers1

0

Instead of setq you need to use setq-default. From C-h f setq-default:

(setq-default [VAR VALUE]...)

Set the default value of variable VAR to VALUE. VAR, the variable name, is literal (not evaluated). VALUE is an expression: it is evaluated and its value returned. The default value of a variable is seen in buffers that do not have their own values for the variable.

It has the same syntax as setq, so just put instead:

(setq-default bidi-display-reordering nil)
Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • ... but as @phils points out in a comment, setting `bidi-display-reordering` to `nil` is a *BAD* idea (except in the *very* unlikely case that the OP is debugging display code). So although the answer is technically correct, it is not clear that it would *help* the OP - in fact, the opposite is the more likely scenario. – NickD Jun 28 '21 at 13:27
  • Thanks for the answer. But if setting this variable is a BAD idea, as the comments say, how then should I solve my problem? my files have both English and right-to-left text, and this text is shown backward (each word is spelled backward). – Arik Jul 01 '21 at 09:54