emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Disable indent-tabs-mode in org-src buffers if appropriate
@ 2017-07-26 14:37 Jonas Bernoulli
  2017-08-06  9:32 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Jonas Bernoulli @ 2017-07-26 14:37 UTC (permalink / raw)
  To: emacs-org list

Me again,

For the most part Org now honors the file-local value of
`indent-tabs-mode' as set in an Org file.  When that value is `nil' and
a buffer used to edit a source block from that file contains lines that
begin with tabs, then those tabs are being replaced with spaces before
the text is written back into the Org file.

So far so good.  Unfortunately inside the buffer used to edit the source
block `indent-tabs-mode' is not disabled when appropriate.  That doesn't
matter that much since it is just a transient buffer, but it is still
distracting.

I suggest that you fix that by adding the following at the appropriate
place in `org-src--edit-element':

  (when (= source-tab-width 0)
    (setq indent-tabs-mode nil))

Thanks,
Jonas

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

* Re: Disable indent-tabs-mode in org-src buffers if appropriate
  2017-07-26 14:37 Disable indent-tabs-mode in org-src buffers if appropriate Jonas Bernoulli
@ 2017-08-06  9:32 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-08-06  9:32 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: emacs-org list

Hello,

Jonas Bernoulli <jonas@bernoul.li> writes:

> For the most part Org now honors the file-local value of
> `indent-tabs-mode' as set in an Org file.  When that value is `nil' and
> a buffer used to edit a source block from that file contains lines that
> begin with tabs, then those tabs are being replaced with spaces before
> the text is written back into the Org file.
>
> So far so good.  Unfortunately inside the buffer used to edit the source
> block `indent-tabs-mode' is not disabled when appropriate.  That doesn't
> matter that much since it is just a transient buffer, but it is still
> distracting.

I'm not sure it should be changed. Remote editing buffer usually its own
major modes. `indent-tabs-mode' should obey to that mode, not to the one
from the source buffer.

Also, tabs are not always being replaced with spaces before the text is
written back into the Org file, e.g., when indentation is preserved.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2017-08-06  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26 14:37 Disable indent-tabs-mode in org-src buffers if appropriate Jonas Bernoulli
2017-08-06  9:32 ` Nicolas Goaziou

Code repositories for project(s) associated with this public 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).