GNU bug report logs - #63438
30.0.50; abbrev mode wrongly capitalizes with mixed capitalized words

Previous Next

Package: emacs;

Reported by: Daniel Fleischer <danflscr <at> gmail.com>

Date: Thu, 11 May 2023 07:11:01 UTC

Severity: wishlist

Found in version 30.0.50

Full log


Message #10 received at control <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Fleischer <danflscr <at> gmail.com>
Cc: 63438 <at> debbugs.gnu.org
Subject: Re: bug#63438: 30.0.50;
 abbrev mode wrongly capitalizes with mixed capitalized words
Date: Thu, 11 May 2023 11:29:59 +0300
severity 63438 wishlist
thanks

> From: Daniel Fleischer <danflscr <at> gmail.com>
> Date: Thu, 11 May 2023 10:10:40 +0300
> 
> Recipe for recreating:
> 
> - Add some abbrev definition with mixed capitalization, e.g. "abc"
> should expand to "aBC".
> - Enable abbrev-mode. 
> - Write "aBC".
> - Upon pressing space, abbrev-mode converts it into "ABC". 
> 
> There is a code section in `abbrev-insert' that explicitly capitalizes
> the first letter; I'm sure it's there for a reason but I think the
> behavior I showed is unexpected. As for the example "aBC", there are
> real use cases, just to mention one "iPhone".

What you see is the documented behavior: by default, if the abbrev was
triggered by a word that has some upper-case letters in it, Emacs
capitalizes the first letter of every word in the expansion (you can
optionally set abbrev-all-caps non-nil to up-case all the letters in
the expansion).  In your case, capitalizing the first letter of "aBC"
yields "ABC", and that's what you see.

What did you expect to happen instead?




This bug report was last modified 2 years and 39 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.