emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C-j considered harmful (not really)


From: Per Starbäck
Subject: Re: C-j considered harmful (not really)
Date: Mon, 23 Nov 2009 12:11:02 +0100

2009/11/23 Juri Linkov <address@hidden>:
>> > Evidently <S-return> is used to insert newlines in lots of programs.
>> > I've just searched for "shift-return" and "shift-enter" on the web and
>> > seen many examples.
>> >
>> > After reconsidering this I then suggest just that <S-return> should be
>> > usable as an alternative to C-j.
>>
>> So you suggest
>>
>>   (define-key function-key-map [S-return] [?\C-j])
>>
>> ?
>
> I guess the initial suggestion was rather:
>
>  (define-key minibuffer-local-map [S-return] 'newline)

I changed my mind, so my current suggestion is the function-key-map
thing. I realized that
this alternative to a real linefeed key would be useful elsewhere too, for
newline-and-indent and other functions that are "natural" for a linefeed key.
Also I think it makes sense in general to have
keys-that-can't-be-typed-everywhere
be aliases for something that can be typed everywhere instead of doing
their own thing.

> I guess I could live with that.  But you'd still need to prefix it with
> C-q in minibuffer prompts, wouldn't you?  So we'd need more changes,
> e.g. making LF in minibuffer input not exit the minibuffer.  I've never
> used an LF key, so I could live with that, but I don't know what other
> people think about it.

Right. I'd like to see that as another question (regardless of whether
S-return = C-j or not),
that it's unnecessary to have both RET and C-j for
minibuffer-complete-and-exit, so it would
be better to have C-j do newline there. Probably some people are used to using
C-j there? So then I suggest an option for that, with the default
being that C-j does newline,
to make it easier for new users.

I think this would be useful even for very casual new users, at least
with replace-string.
And I think it would be useful for all current users who only use RET
for minibuffer-complete-and-exit
(like myself).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]