GNU bug report logs - #12692
24.1; thing-at-point in temp buffer

Previous Next

Package: emacs;

Reported by: Jerome Truong <jerometruong <at> gmail.com>

Date: Sat, 20 Oct 2012 18:26:01 UTC

Severity: minor

Tags: notabug

Found in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 12692 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jerome Truong <jerometruong <at> gmail.com>
Cc: 12692 <at> debbugs.gnu.org
Subject: Re: bug#12692: 24.1; thing-at-point in temp buffer
Date: Sat, 20 Oct 2012 22:05:13 -0400
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?




This bug report was last modified 12 years and 212 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.