unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* request a change to electric.el
@ 2022-08-27 20:19 MICHAEL J MCCLENNEN
  2022-08-28  8:10 ` Philip Kaludercic
  2022-08-28 15:08 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: MICHAEL J MCCLENNEN @ 2022-08-27 20:19 UTC (permalink / raw)
  To: emacs-devel@gnu.org

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

Hello,

This is directed at either K. Shane Hartman or else whoever is currently in charge of maintaining electric.el. Could you please make the following change to this module? The effect is to adapt electric-indent-mode to people like me who use indented lines instead of completely blank lines between their statements. Since I made this change in my own installation, electric-indent-mode has been much more satisfactory for me. The way I wrote this patch, it will have no effect unless somebody sets the electric-indent-preserve-whitespace locally.

If this is not the proper way for me to submit such a request, please tell me what you would like me to do instead.

Thank you for your time,

  Michael McClennen


233a234,237
> (defvar-local electric-indent-preserve-whitespace nil
>   "If non-nil, whitespace will not be removed from a line that is reindented
> after a newline.")
>
282c286
<               (when (eolp)
---
>               (when (and (eolp) (not electric-indent-preserve-whitespace))


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

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

* Re: request a change to electric.el
  2022-08-27 20:19 request a change to electric.el MICHAEL J MCCLENNEN
@ 2022-08-28  8:10 ` Philip Kaludercic
  2022-08-28 15:08 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Philip Kaludercic @ 2022-08-28  8:10 UTC (permalink / raw)
  To: MICHAEL J MCCLENNEN; +Cc: emacs-devel@gnu.org

MICHAEL J MCCLENNEN <mmcclenn@geology.wisc.edu> writes:

> Hello,

Hi,

> This is directed at either K. Shane Hartman or else whoever is
> currently in charge of maintaining electric.el. Could you please make
> the following change to this module? The effect is to adapt
> electric-indent-mode to people like me who use indented lines instead
> of completely blank lines between their statements. Since I made this
> change in my own installation, electric-indent-mode has been much more
> satisfactory for me. The way I wrote this patch, it will have no
> effect unless somebody sets the electric-indent-preserve-whitespace
> locally.

This feature could be generalise a bit further, so that features like
whitespace-cleanup don't break the intended formatting.

> If this is not the proper way for me to submit such a request, please tell me what you would like me to do instead.

If you have a local git checkout of emacs.git, read through the
CONTRIBUTE file to see what you have to do.  The end result should be a
.patch file.

> Thank you for your time,
>
>   Michael McClennen
>
>
> 233a234,237
>> (defvar-local electric-indent-preserve-whitespace nil
>>   "If non-nil, whitespace will not be removed from a line that is reindented
>> after a newline.")
>>
> 282c286
> <               (when (eolp)
> ---
>>               (when (and (eolp) (not electric-indent-preserve-whitespace))



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

* Re: request a change to electric.el
  2022-08-27 20:19 request a change to electric.el MICHAEL J MCCLENNEN
  2022-08-28  8:10 ` Philip Kaludercic
@ 2022-08-28 15:08 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2022-08-28 15:08 UTC (permalink / raw)
  To: MICHAEL J MCCLENNEN; +Cc: emacs-devel@gnu.org

MICHAEL J MCCLENNEN [2022-08-27 20:19:40] wrote:
> This is directed at either K. Shane Hartman or else whoever is currently in
> charge of maintaining electric.el. Could you please make the following
> change to this module? The effect is to adapt electric-indent-mode to people
> like me who use indented lines instead of completely blank lines between
> their statements.

`electric-indent-mode` was mainly designed for modes where almost all
lines are indented and blank lines between statements have no particular
significance, so I don't understand what you mean.

Can you give a concrete example of the behavior you want to avoid (and
please clarify in which major mode you're doing it)?

My crystal ball suggests that maybe you're working in `text-mode` and
that what you're really looking for is `indented-text-mode`.

> 233a234,237
>> (defvar-local electric-indent-preserve-whitespace nil
>>   "If non-nil, whitespace will not be removed from a line that is reindented
>> after a newline.")

Which whitespace is this affecting?  The one at the beginning of the
line?  at the end of the line?  both?  something else?  Does it affect
only the line that is after an newline inserted newline (as the "after
a newline" suggests)?  Or rather the line before that newline?

Have you tried to set `electric-indent-inhibit`?


        Stefan




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

end of thread, other threads:[~2022-08-28 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-27 20:19 request a change to electric.el MICHAEL J MCCLENNEN
2022-08-28  8:10 ` Philip Kaludercic
2022-08-28 15:08 ` Stefan Monnier

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

	https://git.savannah.gnu.org/cgit/emacs.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).