GNU bug report logs -
#21501
new Emacs functions for capitalizing text intelligently
Previous Next
Reported by: Zachary Kanfer <zkanfer <at> gmail.com>
Date: Thu, 17 Sep 2015 04:33:02 UTC
Severity: wishlist
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#21501: new Emacs functions for capitalizing text intelligently
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 21501 <at> debbugs.gnu.org.
--
21501: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21501
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> From: Zachary Kanfer <zkanfer <at> gmail.com>
> Date: Mon, 21 Sep 2015 14:52:01 -0400
> Cc: 21501 <at> debbugs.gnu.org
>
> Here's an updated patch with Eli's comments addressed. Now, these new commands
> seem to have all the functionality of the existing *-region and *-word
> commands.
Thanks, I pushed them.
Note that with this contribution you've exhausted your limit of code
submissions that can be accepted without legal paperwork, so if you'd
like to continue your contribution (we hope you do), you will have to
do that paperwork.
Also, please in the future always include with your patches a log
message in the format described in CONTRIBUTE.
Thanks.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
I'm submitting some additional -dwim functions to that change the
capitalization of text the way the user probably wants.
These work similarly to comment-dwim, or count-words: they act on the
region if and only if it's active (more specifically, if (use-region-p) is
true), and otherwise act on the word starting at point. Either way, they
use existing functions in Emacs: e.g. #'upcase-dwim delegates either to
#'upcase-region or #'upcase-word.
There are three functions: one for each of capitalizing text, upcasing
text, and lowercasing text. The docstrings are based on the docstring for
comment-dwim.
In my init file, I've changed the default mappings of M-u, M-l, and M-c to
these new functions, and would support changing Emacs's defaults to them.
However, I am led to believe that changing defaults isn't preferred, so
this patch doesn't contain any of that. Even without changing defaults, I
believe these functions are worth adding to Emacs.
The capitalization-related functions I'm using are all defined in C, so I
can't put these new functions alongside them. I put the changes in
simple.el, as that file's described as "A grab-bag of basic Emacs commands
not specifically related to some major mode or to file-handling.". I'm
happy to move the functions and create a new diff if there's a more
appropriate file for them to live in.
Changelog entry:
* simple.el: Add functions for capitalizing text intelligently.
(capitalize-dwim): New function.
(upcase-dwim): New function.
(downcase-dwim): New function.
The diff is attached.
-Zachary Kanfer
[Message part 5 (text/html, inline)]
[0001-Add-functions-for-capitalizing-text-intelligently.patch (text/x-patch, attachment)]
This bug report was last modified 9 years and 319 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.