Fix newlines in filenames in emacs-bookmark.zsh

This commit is contained in:
Alexander Rosenberg 2024-03-10 18:11:29 -07:00
parent 8459b7e1ac
commit c94d82c571
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -26,14 +26,18 @@ function __bm_update_bookmark_list {
local quoted_output local quoted_output
case "${BM_MODE}" in case "${BM_MODE}" in
'daemon') 'daemon')
quoted_output=(${(z)${"$(command emacsclient --eval \ quoted_output=(${(z)${"$(command emacs -Q --batch --eval \
"(let ((out)) "(prin1
(dolist (entry bookmark-alist out) (progn
(let ((path (alist-get 'filename (cdr entry) "")) (require 'server)
(pos (alist-get 'position (cdr entry) 1))) (server-eval-at \"server\"
(setq out (append (list (car entry) path '(let ((out))
(expand-file-name path) pos) (dolist (entry bookmark-alist out)
out)))))")":1:-1}}) (let ((path (alist-get 'filename (cdr entry) ""))
(pos (alist-get 'position (cdr entry) 1)))
(setq out (append (list (car entry) path
(expand-file-name path) pos)
out))))))))")":1:-1}})
;; ;;
''|'emacs') ''|'emacs')
if ! [[ -v BM_BOOKMARK_PATH ]]; then if ! [[ -v BM_BOOKMARK_PATH ]]; then