Decoding UTF-8 encoded strings encoded as base64
* eat.el (eat--t-set-cwd): Decoding UTF-8 encoded strings encoded as base64. * eat.el (eat--t-manipulate-selection): Use 'ignore-errors' instead of '(ignore-error ...)', since both macro expand to the same code. * eat.el (eat--t-set-cmd): Decoding UTF-8 encoded strings encoded as base64. Use 'when-let*' instead of 'when' nested in 'let'.
This commit is contained in:
parent
61695d9671
commit
59fe724b27
1 changed files with 11 additions and 6 deletions
17
eat.el
17
eat.el
|
@ -2357,8 +2357,12 @@ the format \"file://HOST/CWD/\"; HOST can be empty."
|
||||||
('base64
|
('base64
|
||||||
(let ((dir (ignore-errors (expand-file-name
|
(let ((dir (ignore-errors (expand-file-name
|
||||||
(file-name-as-directory
|
(file-name-as-directory
|
||||||
(base64-decode-string path)))))
|
(decode-coding-string
|
||||||
(hostname (ignore-errors (base64-decode-string host))))
|
(base64-decode-string path)
|
||||||
|
locale-coding-system)))))
|
||||||
|
(hostname (ignore-errors (decode-coding-string
|
||||||
|
(base64-decode-string host)
|
||||||
|
locale-coding-system))))
|
||||||
(when (and dir hostname)
|
(when (and dir hostname)
|
||||||
;; Update working directory.
|
;; Update working directory.
|
||||||
(setf (eat--t-term-cwd eat--t-term) (cons hostname dir))
|
(setf (eat--t-term-cwd eat--t-term) (cons hostname dir))
|
||||||
|
@ -2474,7 +2478,7 @@ DATA is the selection data encoded in base64."
|
||||||
(base64-encode-string str))))
|
(base64-encode-string str))))
|
||||||
;; The client is requesting to set clipboard content, let's try to
|
;; The client is requesting to set clipboard content, let's try to
|
||||||
;; fulfill the request.
|
;; fulfill the request.
|
||||||
(let ((str (ignore-error error
|
(let ((str (ignore-errors
|
||||||
(decode-coding-string (base64-decode-string data)
|
(decode-coding-string (base64-decode-string data)
|
||||||
locale-coding-system))))
|
locale-coding-system))))
|
||||||
(seq-doseq (target targets)
|
(seq-doseq (target targets)
|
||||||
|
@ -2519,9 +2523,10 @@ DATA is the selection data encoded in base64."
|
||||||
|
|
||||||
(defun eat--t-set-cmd (cmd)
|
(defun eat--t-set-cmd (cmd)
|
||||||
"Set the command being executed to CMD."
|
"Set the command being executed to CMD."
|
||||||
(let ((c (ignore-errors (base64-decode-string cmd))))
|
(when-let* ((c (ignore-errors (decode-coding-string
|
||||||
(when c
|
(base64-decode-string cmd)
|
||||||
(funcall (eat--t-term-set-cmd-fn eat--t-term) eat--t-term c))))
|
locale-coding-system))))
|
||||||
|
(funcall (eat--t-term-set-cmd-fn eat--t-term) eat--t-term c)))
|
||||||
|
|
||||||
(defun eat--t-cmd-start ()
|
(defun eat--t-cmd-start ()
|
||||||
"Call shell command start hook."
|
"Call shell command start hook."
|
||||||
|
|
Loading…
Add table
Reference in a new issue