Comments (3)
@syohex any ideas on this one? (Error tested and reproduced.)
from s.el.
Sorry I don't remember anything about this. How about using CASE-FOLD
argument of assoc-string
as below ?
diff --git a/s.el b/s.el
index ba6c1ed..f1dfe9c 100644
--- a/s.el
+++ b/s.el
@@ -400,7 +400,7 @@ This is a simple wrapper around the built-in `string-match-p'."
(defun s--aget (alist key)
(declare (pure t) (side-effect-free t))
- (cdr (assoc-string key alist)))
+ (cdr (assoc-string key alist case-fold-search)))
(defun s-replace-all (replacements s)
"REPLACEMENTS is a list of cons-cells. Each `car` is replaced with `cdr` in S."
from s.el.
@syohex @magnars turns out it's a silly error, if the replacement lamba comes up with nil
it's going to send that back to replace-regexp-in-string
So I've added a condition to avert the problem...
(defun s-replace-all (replacements s)
"REPLACEMENTS is a list of cons-cells. Each `car` is replaced with `cdr` in S."
(declare (pure t) (side-effect-free t))
(replace-regexp-in-string
(regexp-opt (mapcar 'car replacements))
(lambda (it)
(let ((replacement (s--aget replacements it)))
(if (null replacement)
it
replacement)))
s t t))
I'll push a PR tomorrow. Comments welcome.
from s.el.
Related Issues (20)
- Speed Counting Matches: Unexpected Results
- 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
- 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
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.