Giter VIP home page Giter VIP logo

Comments (8)

magnars avatar magnars commented on June 30, 2024

(s-lower-camel-case "foo_bar") produces "fooBar" on my machine.

Could you try running the tests?

They contain this one, for instance:

 (defexamples s-lower-camel-case
    (s-lower-camel-case "some words") => "someWords"
    (s-lower-camel-case "dashed-words") => "dashedWords"
    (s-lower-camel-case "under_scored_words") => "underScoredWords")

from s.el.

squid-lee avatar squid-lee commented on June 30, 2024

The tests ran fine. So I poked around a bit & it seems to be scala-mode2's scala-mode that causes it to not work.
I can take (s-lower-camel-case "foo_bar_") and it works differently in python-mode & scala-mode.

With a bit of 'emacs -q' and '(require 's)', it seems that this is the case even in vanilla emacs + s.el

from s.el.

magnars avatar magnars commented on June 30, 2024

Ah, you're right. It's based on the current syntax definition.

That explains it. Not sure how to solve it, tho.

from s.el.

squid-lee avatar squid-lee commented on June 30, 2024

Well I hacked it, and added '(replace-regexp-in-string "_" " " s)' instead of s in 's-split-words', but I imagine this might break in other places.

Where does the syntax definition factor in to things? I can't tell from looking in s.el or in the docs for split-string

from s.el.

magnars avatar magnars commented on June 30, 2024

It's in s-split-words, using [:word:], [:lower:] and [:upper:] in
regexp to support all sorts of i18n issues. I guess _ is a word-character
in Scala.

On Mon, Jan 27, 2014 at 3:31 PM, MrBones118 [email protected]:

Well I hacked it, and added '(replace-regexp-in-string "_" " " s)' instead
of s in 's-split-words', but I imagine this might break in other places.

Where does the syntax definition factor in to things? I can't tell from
looking in s.el or in the docs for split-string


Reply to this email directly or view it on GitHubhttps://github.com//issues/53#issuecomment-33371800
.

from s.el.

squid-lee avatar squid-lee commented on June 30, 2024

Very well. I'll close it as an upstream problem. Thanks for the help

from s.el.

magnars avatar magnars commented on June 30, 2024

Sorry about the lack of a solution.

from s.el.

jaroslawr avatar jaroslawr commented on June 30, 2024

I ran into the same problem, and found a possible solution, there is (make-syntax-table) and a (with-syntax-table) macro, s.el could have its own syntax table derived from Emacs main syntax table, and wrap its functions with the with-syntax-table macro, making the results independent of the current syntax table:

https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Table-Functions.html

from s.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.