fix(src-lines): use intern instead of make-symbol for thing-at-point#305
Open
gggion wants to merge 1 commit intonobiot:mainfrom
Open
fix(src-lines): use intern instead of make-symbol for thing-at-point#305gggion wants to merge 1 commit intonobiot:mainfrom
gggion wants to merge 1 commit intonobiot:mainfrom
Conversation
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make-symbolwithintern. The:thing-at-pointkeyword failed for thing types that dispatch via symbol properties (e.g.,defun) becausemake-symbolcreates an uninterned symbol. Thethingatpt.elmachinery stores properties on interned symbols, so(get thingend-op)` found nothing on the uninterned symbol.Things like
sexpworked because they have a literalforward-sexpfunction as fallback. Things likedefunfailed because noforward-defunfunction exists;defunrelies on theforward-opproperty pointing toend-of-defun.Fixes #304