The Lambda Lab
/
projects
/
elpher.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
88f19dc
)
Cleaning up.
author
plugd
<plugd@thelambdalab.xyz>
Wed, 4 Aug 2021 14:37:28 +0000
(16:37 +0200)
committer
plugd
<plugd@thelambdalab.xyz>
Wed, 4 Aug 2021 14:37:28 +0000
(16:37 +0200)
elpher.el
patch
|
blob
|
history
diff --git
a/elpher.el
b/elpher.el
index
bd9cbb5
..
11ca3c1
100644
(file)
--- a/
elpher.el
+++ b/
elpher.el
@@
-1432,6
+1432,7
@@
Returns the url portion in the event that the display-string portion is empty."
"Collapse dot sequences in the (absolute) FILENAME.
For instance, the filename \"/a/b/../c/./d\" will reduce to \"/a/c/d\""
(let* ((path (split-string filename "/" t))
"Collapse dot sequences in the (absolute) FILENAME.
For instance, the filename \"/a/b/../c/./d\" will reduce to \"/a/c/d\""
(let* ((path (split-string filename "/" t))
+ (is-directory (string-match-p (rx (: (or "." ".." "/") line-end)) filename))
(path-reversed-normalized
(seq-reduce (lambda (a b)
(cond ((equal b "..") (cdr a))
(path-reversed-normalized
(seq-reduce (lambda (a b)
(cond ((equal b "..") (cdr a))
@@
-1440,10
+1441,7
@@
For instance, the filename \"/a/b/../c/./d\" will reduce to \"/a/c/d\""
path nil))
(path-normalized (reverse path-reversed-normalized)))
(if path-normalized
path nil))
(path-normalized (reverse path-reversed-normalized)))
(if path-normalized
- (concat
- "/"
- (string-join (reverse path-reversed-normalized) "/")
- (if (string-match-p (rx (: (or "." ".." "/") line-end)) filename) "/") "")
+ (concat "/" (string-join path-normalized "/") (and is-directory "/"))
"/")))
(defun elpher-address-from-gemini-url (url)
"/")))
(defun elpher-address-from-gemini-url (url)