reddit / emacs
What is it that is allegedly confusing about upcase-region?
ebriose · 2022-02-13 22:27
I feel like I must be missing something because it seems like "converts the text between the pointer and the mark to uppercase" is pretty straightforward. Is there some caveat I'm missing out on? Or is it just disabled because the potential for information loss is huge in situations where case is significant?
p7e9W8itt1tYayZn · 2022-02-13 23:04
Are you being serious right now?
Isn't it obvious why it's super dangerous?
LemonBreezes · 2022-02-13 23:19
I once ruined a ten thousand line Emacs config by somehow upcasing random characters throughout the file.
crawsphi · 2022-02-13 23:23
NEWS.19 says this:
> C-x C-u (upcase-region) and C-x C-l (downcase-region) are now disabled by default; these commands seem to be often hit by accident, and can be quite destructive if their effects are not noticed immediately.
A reply at [this Emacs.SE post with the same question](https://emacs.stackexchange.com/questions/41094/what-is-confusing-about-upcase-region) offers that it may be because of confusion around _inactive_ regions, which seems plausible to me.
[deleted] · 2022-02-13 23:28
[deleted]
Rimbosity · 2022-02-14 00:41
no
MereInterest · 2022-02-14 00:43
"Dangerous" is not the same as "confusing". If you run `C-x C-u` on a stock installation of emacs, the warning displayed starts as follows.
You have typed C-x C-u, invoking disabled command upcase-region.
It is disabled because new users often find it confusing.
00-11 · 2022-02-14 02:09
Yeah, that's not a good message. What's confusing is what a new user should wonder is meant by the message saying (only) that new users often find it confusing. *What* is the confusion?
The *why* is missing from the message, and presumably that's what should be drawn attention to: what the command does that you might not expect that it does.
MereInterest · 2022-02-14 04:24
If I were to speculate wildly on it, I'd guess that the functionality and error message were initially written for commands that would be genuinely confusing to a new user. (E.g. `C-x n n` runs `narrow-to-region`, which could confuse a new user and lead them to conclude that much of the file has been deleted, rather than merely being outside of the displayed region.) That functionality for disabling specific key bindings until a user has opted in could then be used in other cases, but would still have the warning that calls it "confusing".
tomatoaway · 2022-02-14 06:36
`git config core.ignorecase` (to stash the non-case changing edits before you reset and pop)
kromobrn · 2022-02-14 07:11
If you're using a distributed vcs (which already doesn't account for all Emacs usage), it could be the case that the file you're working on could have already been modified by you and other people before you noticed the mistype was made.
The downcase-region in particular can be very annoying when called by mistake in long text files, because is not that easy to perceive that Title cases became lower cased.
Zambito1 · 2022-02-15 15:21
Something that no one else seems to have mentioned yet but makes a lot of sense to me: it's not that upcase-region itself is confusing, it's that the default binding for upcase-region (C-x C-u) is *extremely close* to one of the default bindings for undo (C-x u). I suspect people where having issues where they meant to undo something, but held Ctrl too long and made random regions uppercase without realizing.
ebriose · 2022-02-16 17:18
In my case, having already rebound `C-x C-u` a long time ago, when I ran `M-x upcase-region` I got that same message. Which was (ironically) particularly confusing.
Fantastic-Sweet-8539 · 2022-12-22 01:31
Good point. And imagine that you accidentally up-cased a region, and then you sagely went to invoke undo ... might even become comical.