Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6858017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:06:17+00:00 2026-05-27T02:06:17+00:00

Is there an analogue to inserting the word after point into the isearch query

  • 0

Is there an analogue to inserting the word after point into the isearch query by hitting C-w after C-s but for the replace string (and replace regexp) queries?

I also enjoy Sacha Chua’s modification of C-x inserting whole word around point into isearch:

http://sachachua.com/blog/2008/07/emacs-keyboard-shortcuts-for-navigating-code/

This too would be really useful in some cases if it could be used in replace string.

I’d be very thankful for any tips!
Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:06:18+00:00Added an answer on May 27, 2026 at 2:06 am

    This will do it, although it isn’t as fancy as C-w in isearch because you can’t keep hitting that key to extend the selection:

    (defun my-minibuffer-insert-word-at-point ()
      "Get word at point in original buffer and insert it to minibuffer."
      (interactive)
      (let (word beg)
        (with-current-buffer (window-buffer (minibuffer-selected-window))
          (save-excursion
            (skip-syntax-backward "w_")
            (setq beg (point))
            (skip-syntax-forward "w_")
            (setq word (buffer-substring-no-properties beg (point)))))
        (when word
          (insert word))))
    
    (defun my-minibuffer-setup-hook ()
      (local-set-key (kbd "C-w") 'my-minibuffer-insert-word-at-point))
    
    (add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)
    

    EDIT:
    Note that this is in the standard minibuffer, so you can use it use it anywhere you have a minibuffer prompt, for example in grep, occur, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any SWI's analogue for Turbo's save function, which saves into a file
Is there analogue of Django Messages Framework (or RoR flash messages) in Java? http://docs.djangoproject.com/en/dev/ref/contrib/messages/
Is there a git find analogue of git grep , i.e., something that will
can somebody tell me, is there an analogue of a Visual Studio #region feature
Is there an analogue of this tool (maybe python/ruby/etc) which runs under windows? It
I wonder whether there is an analogue of (//) in repa? It is needed
Is there an Elisp analogue for the SLIME macrostepper? Specifically, I'm looking for something
Is there an ORM-analogue for querying OLAP cubes / data-warehouses? I'm specifically interested in
Is there an analogue of Delphi TextRect in GDI? I looked at DrawText, DrawTextEx
Is there RSpec analogue for Groovy/Grails? I found a few blog posts mentioning GSpec

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.