all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Jerome Truong <jerometruong@gmail.com>
Cc: 12692@debbugs.gnu.org
Subject: bug#12692: 24.1; thing-at-point in temp buffer
Date: Sat, 20 Oct 2012 22:05:13 -0400	[thread overview]
Message-ID: <003918fuli.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <m26265m276.fsf@dhcp-09-43.bravo> (Jerome Truong's message of "Sat, 20 Oct 2012 13:24:29 -0500")

tags 12692 notabug
close 12692
stop

Jerome Truong wrote:

> Why does the following return the whole string "this.is.an.example":
>
> (thing-at-point 'symbol)this.is.an.example
>                         ^
>                         |
>                 eval at point here
>
> but using a temp buffer only returns "this":
>
> (let ((type 'symbol)
>       (string "this.is.an.example"))
>   (with-temp-buffer
>     (insert string)
>     (goto-char 1)
>     (let ((thing (thing-at-point type)))
>       (message "%s" thing))))

Depends on the syntax table in use. Replace your second example with

(let ((type 'symbol)
      (string "this.is.an.example"))
  (with-temp-buffer
    (insert string)
    (goto-char 1)
    (with-syntax-table emacs-lisp-mode-syntax-table
      (let ((thing (thing-at-point type)))
        (message "%s" thing)))))

HTH; maybe try help-gnu-emacs first next time?





      parent reply	other threads:[~2012-10-21  2:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-20 18:24 bug#12692: 24.1; thing-at-point in temp buffer Jerome Truong
2012-10-20 18:35 ` Drew Adams
2012-10-20 18:49 ` Jambunathan K
2012-10-21  2:05 ` Glenn Morris [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=003918fuli.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=12692@debbugs.gnu.org \
    --cc=jerometruong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.