Re: indent-tabs-mode in org

2022-10-31 Thread Bastien Guerry
Hi Daniel and Ihor,

Daniel Kraus  writes:

> So that clarifies it for me and I do NOT indent with tabs in the
> future :)

We can progressively replace tab chars with spaces, thus re-indenting
correctly all files in the repository.

The Emacs convention is to *not* commit space-only changes as they may
create merge conflicts.

For files that do not have pending patches, we can do the replacement
with the next code-related change.

2 cts,

-- 
 Bastien



indent-tabs-mode in org (was: ob-clojure eval error when has comment at end of code line)

2022-10-29 Thread Daniel Kraus


Ihor Radchenko  writes:
> Daniel Kraus  writes:
>
>> - What should I use for indention? Looking in ob-clojure and org.el
>>   it seems that using tabs with tab-width 8 is standard but there's
>>   quite a few lines where it's spaces only.
> That is a good question. I guess, just Emacs default.
> Our code is not consistent here...
> Maybe Bastien can clarify better.

jFYI, because I was just wondering why the org
.dir-locals.el sets indent-tabs-mode to nil.
Luckily Kyle wrote a good commit message:

--cut--
.dir-locals.el: Set indent-tabs-mode to nil in Elisp sources

Despite .dir-locals.el having a catchall value of t for
indent-tabs-mode, Org's Elisp files are a mix of tabs and spaces.
Emacs has used a value of nil for indent-tabs-mode since 93d4412046
(Set indent-tabs-mode to nil in (most) Elisp sources, 2015-04-15).  Do
the same.

Ref: https://orgmode.org/list/87eejsg9vw@gnu.org
--cut--

So that clarifies it for me and I do NOT indent with tabs in the future :)

Cheers,
  Daniel



Re: [O] Disable indent-tabs-mode in org-src buffers if appropriate

2017-08-06 Thread Nicolas Goaziou
Hello,

Jonas Bernoulli  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



[O] Disable indent-tabs-mode in org-src buffers if appropriate

2017-07-26 Thread Jonas Bernoulli
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