[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs
From: |
Theodor Thornhill |
Subject: |
Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs |
Date: |
Thu, 16 Feb 2023 16:53:58 +0100 |
On 16 February 2023 16:38:54 CET, Dmitry Gutov <dgutov@yandex.ru> wrote:
>On 16/02/2023 17:19, Eli Zaretskii wrote:
>>> Date: Thu, 16 Feb 2023 14:51:09 +0200
>>> Cc: emacs-devel@gnu.org
>>> From: Dmitry Gutov <dgutov@yandex.ru>
>>>
>>>> We could at least discuss that, sure. Is there a list of
>>>> inconsistencies between those modes available anywhere?
>>>
>>> From past discussions and looking at 'C-h m':
>>>
>>> - "electric" behaviors: CC Mode's commands vs. electric-indent-mode and
>>> electric-pair-mode.
>>> - c-subword-mode vs subword-mode
>>> - c-display-defun-name vs which-function-mode
>>> - c-indent-exp vs prog-indent-sexp
>>> - c-indent-defun/c-fill-paragraph vs prog-fill-reindent-defun
>>> - c-indent-line-or-region vs indent-for-tab-command and indent-region.
>>
>> These don't exist in c-ts-mode, with the single exception of the
>> electric behavior of '#' (which is a must in C).
>
>Could it work by adding ?# to electric-indent-chars?
>
Yes, I have a patch for this ready to go :)
>> So I think we are
>> already there, no?
>
>We are at a crossroads. I think. To the left lies the approach I described. To
>the right -- adding more stuff from CC Mode verbatim, simply because a lot of
>people are already used to it.
>
>>> Curious how c-indent-line-or-region doesn't mind depending on
>>> transient-mark-mode being on.
>>
>> It does:
>>
>> (c-indent-line-or-region &optional ARG REGION)
>>
>> Indent active region, current line, or block starting on this line.
>> In Transient Mark mode, when the region is active, reindent the region.
>> Otherwise, with a prefix argument, rigidly reindent the expression
>> starting on the current line.
>> Otherwise reindent just the current line.
>
>Does the description mean that using the prefix will force a "rigid
>reindentation" of the region?
>
>>>> The next question, of course, is how to go about reducing the
>>>> inconsistencies. What you proposed here is simply drop the
>>>> keybinding,
>>>
>>> I also suggested, alternatively, that transient-mark-mode, when turned
>>> off, creates a global binding for comment-region (also with 'C-c C-c').
>>
>> I'm not sure this is a good idea. I'd rather we used the prefix
>> argument to M-; in some creative way, like if its value is zero or
>> negative.
>
>Could be a decent option. The meaning of C-u is already taken (to kill the
>comment), but 'C-u C-u' could do something different. As long as users with
>t-m-m=off think 'C-u C-u M-;' is a bearable substitute to 'C-c C-c'.
>
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, (continued)
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Eli Zaretskii, 2023/02/15
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Dmitry Gutov, 2023/02/15
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Eli Zaretskii, 2023/02/15
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Dmitry Gutov, 2023/02/15
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Eli Zaretskii, 2023/02/16
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Dmitry Gutov, 2023/02/16
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Eli Zaretskii, 2023/02/16
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Dmitry Gutov, 2023/02/16
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Eli Zaretskii, 2023/02/16
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Dmitry Gutov, 2023/02/16
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs,
Theodor Thornhill <=
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Eli Zaretskii, 2023/02/16
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Dmitry Gutov, 2023/02/16
- Re: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs, Eli Zaretskii, 2023/02/16