3

I'm having an issue with formatting in that when I'm in emacs, the formatting looks fine:

enter image description here

but when the file is viewed with a different text editor, the spaces are different.

enter image description here

this only occurs in the let: form that I've defined. all the other forms seems to work okay.

Is there anything I'm missing? My emacs config is here: https://github.com/zcaudate/etude. It looks different there from the previous two examples.

3

Could it be that you have TAB characters in your indentation (whitespace)? What happens if you use C-u M-x untabify on your existing code? That changes all TAB chars to an appropriate number of SPC chars.

To prevent Emacs from using TAB chars for indentation, you can put this in your init file:

(setq-default indent-tabs-mode  nil)

You can check whether a given whitespace character is a TAB char by putting your cursor just before it and doing C-x =. That tells you what the character is at point.

  • yes it worked. thanks for that. what's the difference between setq-default and setq? – zcaudate Sep 25 '18 at 17:19
  • C-h f setq-default, C-h f setq. The former sets the default value for all buffers. Individual buffers can have buffer-local values of a variable. – Drew Sep 25 '18 at 17:46

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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