Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
store.el
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Qiantan Hong
store.el
Commits
950bef61
Commit
950bef61
authored
3 years ago
by
Qiantan Hong
Browse files
Options
Downloads
Patches
Plain Diff
print circle, and escape file names for `fs' backend
parent
2742e45e
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
store.el
+11
-3
11 additions, 3 deletions
store.el
with
11 additions
and
3 deletions
store.el
+
11
−
3
View file @
950bef61
...
...
@@ -51,6 +51,7 @@
(
require
'cl-lib
)
(
require
'cl-generic
)
(
require
'url
)
;;; Customs
(
defgroup
persistence
nil
"Persistence facility."
...
...
@@ -153,7 +154,9 @@ Return the new list with VALUE removed."
;;; General Utilities
(
defsubst
store--print
(
form
)
(
let
((
print-length
nil
)
(
print-level
nil
))
(
let
((
print-length
nil
)
(
print-level
nil
)
(
print-circle
t
))
(
prin1
form
(
current-buffer
)))
(
insert
"\n"
))
...
...
@@ -318,9 +321,14 @@ Arrange for compacting if log count exceeds (compact-ratio * size-of-table)."
;; We normalize PATH right away, saving future hassles.
(
store-fs--make
:path
(
file-name-as-directory
path
)))
;;We allow some more chars that is usually safe, and makes printed Lisp objects more readable
(
defvar
store-fs--path-allowed-chars
(
cl-list*
?\ ?\(
?\)
?\[
?\]
?\#
url-unreserved-chars
))
(
defsubst
store-fs--key-to-path
(
key
store
)
;; TODO: escape illegal characters
(
concat
(
store-fs--path
store
)
(
prin1-to-string
key
)))
(
concat
(
store-fs--path
store
)
(
let
((
print-length
nil
)
(
print-level
nil
))
(
url-hexify-string
(
prin1-to-string
key
)
store-fs--path-allowed-chars
))))
(
cl-defmethod
store-put
(
key
value
(
store
store-fs
))
(
with-temp-buffer
(
store--print
value
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment