Skip to content

fix(src-lines): use intern instead of make-symbol for thing-at-point#305

Open
gggion wants to merge 1 commit intonobiot:mainfrom
gggion:fix/thing-at-point-intern
Open

fix(src-lines): use intern instead of make-symbol for thing-at-point#305
gggion wants to merge 1 commit intonobiot:mainfrom
gggion:fix/thing-at-point-intern

Conversation

@gggion
Copy link
Copy Markdown
Contributor

@gggion gggion commented Mar 13, 2026

  • org-transclusion-src-lines.el (org-transclusion-content-range-of-lines): Replace make-symbol with intern. The :thing-at-point keyword failed for thing types that dispatch via symbol properties (e.g., defun) because make-symbol creates an uninterned symbol. The thingatpt.el machinery stores properties on interned symbols, so (get thing end-op)` found nothing on the uninterned symbol.

Things like sexp worked because they have a literal forward-sexp function as fallback. Things like defun failed because no forward-defun function exists; defun relies on the forward-op property pointing to end-of-defun.

Fixes #304

* org-transclusion-src-lines.el (org-transclusion-content-range-of-lines):
Replace `make-symbol' with `intern'.  The `:thing-at-point' keyword
failed for thing types that dispatch via symbol properties (e.g.,
`defun') because `make-symbol' creates an uninterned symbol.  The
`thingatpt.el' machinery stores properties on interned symbols, so
`(get thing 'end-op)' found nothing on the uninterned symbol.

Things like `sexp' worked because they have a literal `forward-sexp'
function as fallback.  Things like `defun' failed because no
`forward-defun' function exists; `defun' relies on the `forward-op'
property pointing to `end-of-defun'.

* test/things-at-point.org: Replace with tests covering covering `sexp',
`list', `defun', `word', `sentence', `paragraph', and `line' thing
types.

* test/things-at-point-dir/baz.el: Add more functions

* test/things-at-point-dir/functions.el: New file with five named
definitions for Elisp thing extraction tests.

* test/things-at-point-dir/story.txt: Replace with five paragraphs of
varying sentence structure for prose thing extraction tests.

Fixes nobiot#304
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

:thing-at-point defun extracts entire rest of file instead of single defun

1 participant