|
From: | Karl Fogel |
Subject: | Re: [emacs-humanities] How can I `upcase-word` for ALL words in the buffer without typing the word twice? |
Date: | Tue, 04 Apr 2023 16:30:27 -0400 |
User-agent: | Gnus/5.13 (Gnus v5.13) |
On 04 Apr 2023, David Hedlund wrote:
I'm constantly running into this situation because when I'm copying code, pylint is giving me the message: Constant name "parser" doesn'tconform to UPPER_CASE naming style (python-pylint)In the sample code section below, I'm trying to replace "parser", and"args", with "PARSER", and "ARGS", respectively. Normally I'd use. M-x RET replace-string RET parser RET PARSER M-x RET replace-string RET args RET ARGSHowever, I don't like the idea of typing the word twice (lowercase,then uppercase), because * it's time-consuming * here's a risk that I make a typo.
When prompted for the second word, you can use M-p to insert the word you just typed, and then use M-u to upcase it before hitting RET for the final time.
In general, input history (with M-p, M-n, M-r, and M-s) is active and available in many situations in the minibuffer -- it's always worth trying it to see if it's there. The node "Minibuffer History" in the Emacs manual has more details.
Best regards, -Karl
[Prev in Thread] | Current Thread | [Next in Thread] |