emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* tabs turned into space when going into Org Src...?
@ 2020-12-23  7:05 Greg Minshall
  2020-12-23 11:28 ` Diego Zamboni
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Minshall @ 2020-12-23  7:05 UTC (permalink / raw)
  To: org-mode-email

hi.  it seems going into Org Src, at least from a "makefile" source
block, changes the tabs (the the base org mode added for me) into
spaces, and leaves them as spaces when i merge back into the main .org
file (and, so, make(1) complains, "missing separator").

is this intentional?

#+begin_src makefile
  all:
	echo all done
#+end_src

note that the first character of the "echo" line is a <TAB> (or, was,
when i composed this message, sigh).  do a C-', and note that in the Org
Src buffer, the "echo" line will start with a string of spaces.

cheers, Greg

ps -- is there some way i should escape/mime'ify such source blocks in
e-mail (to this list, at least)?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: tabs turned into space when going into Org Src...?
  2020-12-23  7:05 tabs turned into space when going into Org Src...? Greg Minshall
@ 2020-12-23 11:28 ` Diego Zamboni
  2020-12-23 12:34   ` Greg Minshall
  0 siblings, 1 reply; 3+ messages in thread
From: Diego Zamboni @ 2020-12-23 11:28 UTC (permalink / raw)
  To: Greg Minshall; +Cc: org-mode-email

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]

Greg,

I just did a quick test and I cannot reproduce this, the tabs remain on
entering, modifying and exiting block-edit mode.

One question: do you see "Makefile" as the mode when you are editing the
source block? Otherwise I imagine tab-to-space conversion might be taking
place.

--Diego


On Wed, Dec 23, 2020 at 8:05 AM Greg Minshall <minshall@umich.edu> wrote:

> hi.  it seems going into Org Src, at least from a "makefile" source
> block, changes the tabs (the the base org mode added for me) into
> spaces, and leaves them as spaces when i merge back into the main .org
> file (and, so, make(1) complains, "missing separator").
>
> is this intentional?
>
> #+begin_src makefile
>   all:
>         echo all done
> #+end_src
>
> note that the first character of the "echo" line is a <TAB> (or, was,
> when i composed this message, sigh).  do a C-', and note that in the Org
> Src buffer, the "echo" line will start with a string of spaces.
>
> cheers, Greg
>
> ps -- is there some way i should escape/mime'ify such source blocks in
> e-mail (to this list, at least)?
>
>

[-- Attachment #2: Type: text/html, Size: 1581 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: tabs turned into space when going into Org Src...?
  2020-12-23 11:28 ` Diego Zamboni
@ 2020-12-23 12:34   ` Greg Minshall
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Minshall @ 2020-12-23 12:34 UTC (permalink / raw)
  To: Diego Zamboni; +Cc: org-mode-email

Diego,

thanks for looking at it.  i apologize for not having looked at an
"emacs -Q" (and, thanks to Ihor for, a few days ago, having pointed out
how to "emacs -Q" with one's "normal" org version).

: emacs -Q -L ~/.emacs.d/elpa/org-20201012/ -l org

exhibits *half* of the behavior i am mentioning.
----
#+begin_src makefile
  a:
	echo foo
#+end_src
----
a leading tab is converted to spaces in the Org Src buffer.  but, in
this vanilla configuration, when i return the source to the .org file,
the spaces have been converted back into a tab.

it turns out, this (in my ~/.emacs) is the culprit:
: (setq-default indent-tabs-mode nil)
when indent-tabs-mode is nil, the recovered contents of the source block
have had the tab converted into spaces.

i guess i'm at the same question: is it likely a bug, or a feature?

Greg


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-23 12:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23  7:05 tabs turned into space when going into Org Src...? Greg Minshall
2020-12-23 11:28 ` Diego Zamboni
2020-12-23 12:34   ` Greg Minshall

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).