Comments (8)
(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.
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.
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.
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.
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.
Very well. I'll close it as an upstream problem. Thanks for the help
from s.el.
Sorry about the lack of a solution.
from s.el.
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)
- Will s.el drop the support of Emacs 23? HOT 8
- Time for a new melpa-stable release? HOT 7
- Inclusion in Emacs HOT 12
- s-replace-all case-issue HOT 3
- Marmalade is dead, and the document should be updated correspondingly. HOT 1
- [feature request] function to split string into cons cell HOT 5
- Cosmetic change to `s-trim-right`
- Wildcard match? HOT 1
- Is it dead... HOT 10
- Functions which use `save-match-data` `with-temp-buffer` - side-effect-free? HOT 4
- (s-unindent s &optional bol-char) HOT 4
- 🐣 [REQUEST] - s-url-encode / s-url-decode HOT 10
- 🪲 [BUG] - Under CI 26.{1..3} fail due to no marker in buffer HOT 2
- 🪲 [BUG] - create-docs.sh failing HOT 2
- 🪲 [BUG] - Emacs 24.4 & 24.5 fail tests on CI. HOT 3
- 🐣 [REQUEST] - add s-truncate-width HOT 3
- Use ETD as a development dependency for example/tests/docs
- RFC : Dropping support for Emacs versions below 26. HOT 4
- 🐣 [REQUEST] - Add a way to check the style of given string HOT 1
- 🪲 [BUG] - s-split-words splits properly capitalized words like SPARCstation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s.el.