emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Miquel" <sebastien.miquel@posteo.eu>
To: Greg Minshall <minshall@umich.edu>
Cc: org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: extra space at the end of lines in source
Date: Tue, 22 Jun 2021 21:00:03 +0000	[thread overview]
Message-ID: <3a1162f9-1898-ceac-1aec-be17707c5982@posteo.eu> (raw)
In-Reply-To: <2681710.1624389697@apollo2.minshall.org>

For the record, the original issue is that with 
`org-src-tab-acts-natively' set
to t (which is the new default) you couldn't use tab to indent an empty 
line, and
electric-indent-mode wouldn't work properly.

Greg Minshall writes:
> i don't know what
> would be involved to keep the fix for the original problem (which i was
> also seeing), without adding these extra spaces.  but, i suspect it
> would be worth it, if feasible.

I think the only way would be to change 
`org-src--contents-for-write-back' to
keep track of where the point was in the edit buffer, and clean up spaces in
other lines. Doesn't seem difficult ; maybe you could replace the 
`buffer-string`
call by two calls, to get the part before point and the one after, then work
with that.

> it's long-term emacs behavior to eliminate spaces
> at the end of lines, at least in programming modes.
As for the `org-src--content-indentation' spaces, they are quite 
peculiar. Note
that they are removed when you call =C-c '= and when you tangle (they 
should,
but I haven't tested it), so strictly speaking, they are removed in 
programming
modes. What if your org block itself is indented, do you also expect 
blank lines
to be entirely empty ?

As for additional indentation in a blank line, it will indeed never get 
cleaned
up by org, which isn't ideal. But then, spaces at the end of non blank lines
don't get cleaned up either (I think) and never were. It's up to the user to
remove them, in the appropriate language mode.

Despite these arguments, I have no opinion on the matter.

Regards,

-- 
Sébastien Miquel



  reply	other threads:[~2021-06-22 21:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 11:35 extra space at the end of lines in source Greg Minshall
2021-06-22 13:45 ` Sébastien Miquel
2021-06-22 19:21   ` Greg Minshall
2021-06-22 21:00     ` Sébastien Miquel [this message]
2021-06-23  4:08       ` Greg Minshall
2021-06-23  6:08         ` Tim Cross
2021-06-23 17:29         ` [PATCH] " Sébastien Miquel
2021-06-24  8:55           ` Greg Minshall
2021-06-26  8:37             ` Sébastien Miquel
2021-06-26 15:53               ` Greg Minshall
2021-07-10 14:27               ` Greg Minshall
2021-09-26  5:48               ` Bastien
2021-09-26 13:40                 ` Greg Minshall
2021-06-22 23:56     ` Tim Cross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a1162f9-1898-ceac-1aec-be17707c5982@posteo.eu \
    --to=sebastien.miquel@posteo.eu \
    --cc=emacs-orgmode@gnu.org \
    --cc=minshall@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).