It's a simple thing. My cursor is over a word and I want to get the word so that I can do something with it. I see a few different ways to do this but want to avoid reinvention and use a standard method.

  • 1
    The question is unclear. Do something with it where? In a program (code)? Interactively? Both? What kind of something?
    – Drew
    Commented Nov 3, 2016 at 16:07
  • "Read" in Emacs and Emacs Lisp generally means read interactively or read (load) Lisp code. I've edited the question to say "get" the word instead of "read" it.
    – Drew
    Commented Nov 3, 2016 at 16:14
  • What does "get the word" mean? Do you want a Lisp expression whose value is a string contianing the word? Do you want to mark the word? Do you want to put the word in the kill ring?
    – Omar
    Commented Nov 4, 2016 at 4:59

2 Answers 2


You can use the function thing-at-point and tell it to return the word at point and not return any text properties (unless you need them). Example buffer contents (| is the cursor):

Hello wor|ld

Calling (thing-at-point 'word 'no-properties) returns "world".

(current-word &optional STRICT REALLY-WORD)

Return the word at or near point, as a string. The return value includes no text properties.

  • For my case with subword-mode enabled (current-word) handles camelCaseWords properly contrary to (thing-at-point). Commented Feb 24, 2021 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.