Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thing-at-point 'sexp vs `symbol [WIP] #181

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jacktasia
Copy link
Owner

Experiments related to #179

I noticed that "things" sexp and symbol will behave differently with thing-at-point based on the current mode. Some example code below

(with-temp-buffer
  (funcall 'lisp-mode) ;; if removed or changed you can get different results for symbol vs sexp
  (let ((expected "#/something")) 
    (insert (concat "(" expected ")"))
    (goto-char (point-min))
    (forward-char 5)
    (let* ((cur (thing-at-point 'sexp)) ;; vs 'symbol
           (line (thing-at-point 'line))
           (matches (string= expected cur)))
           (message "thing: %s | matched: %s | line: %s" cur matches line))))

because of this I am considering adding two new options dumb-jump-default-thing and dumb-jump-language-thing. Where you can either define a "thing" per language or a default.

For anyone reading this please let me know if you have any feedback either way. Thanks!

@jacktasia jacktasia self-assigned this Dec 4, 2017
@coveralls
Copy link

coveralls commented Dec 4, 2017

Coverage Status

Coverage decreased (-0.5%) to 96.84% when pulling 411ec72 on thing-at-point-sexp into c4b3e4b on master.

@netromdk
Copy link
Contributor

netromdk commented Dec 5, 2017

I think that sounds reasonable. So you'll default both to 'symbol?

@jacktasia
Copy link
Owner Author

I think that sounds reasonable. So you'll default both to 'symbol?

Yeah, basically I was thinking that dumb-jump-default-thing would default to 'symbol and dumb-jump-language-thing would be an alist (I think?) and if the current language was not in there then it would fallback to the default. Any thoughts/concerns? Thanks!

@netromdk
Copy link
Contributor

netromdk commented Dec 5, 2017

Sounds fine to me. Would be interesting with some meaningful tests showing the different cases probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants