emacs-humanities
[Top][All Lists]
Advanced

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

Re: [emacs-humanities] How can I `upcase-word` for ALL words in the buff


From: David Hedlund
Subject: Re: [emacs-humanities] How can I `upcase-word` for ALL words in the buffer without typing the word twice?
Date: Mon, 10 Apr 2023 07:06:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1


On 2023-04-04 22:30, Karl Fogel wrote:
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't
conform 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 ARGS

However, 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

This worked fine too! Thanks, I'll try to remember that this is mentioned in https://www.gnu.org/software/emacs/refcards/pdf/refcard.pdf



reply via email to

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