Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlink for buffer throws an exception #29

Open
abcdw opened this issue Aug 6, 2024 · 0 comments
Open

Unlink for buffer throws an exception #29

abcdw opened this issue Aug 6, 2024 · 0 comments

Comments

@abcdw
Copy link

abcdw commented Aug 6, 2024

It seems the problem is that propertize doesn't handle non-string values.

Debugger entered--Lisp error: (wrong-type-argument stringp #<buffer tmp.scm<tmp>>)
  propertize(#<buffer tmp.scm<tmp>> face bold)
  sesman--format-link(((Arei . "guile-ares-rs:localhost:7888") buffer #<buffer tmp.scm<tmp>>))
  #f(compiled-function (link) #<bytecode 0x18e0c2b0d7d24b9c>)(((Arei . "guile-ares-rs:localhost:7888") buffer #<buffer tmp.scm<tmp>>))
  mapcar(#f(compiled-function (link) #<bytecode 0x18e0c2b0d7d24b9c>) (((Arei . "guile-ares-rs:localhost:7888") buffer #<buffer tmp.scm<tmp>>)))
  sesman--ask-for-link("Unlink: " (((Arei . "guile-ares-rs:localhost:7888") buffer #<buffer tmp.scm<tmp>>)) ask-all)
  sesman-unlink()
  funcall-interactively(sesman-unlink)
  command-execute(sesman-unlink record)
  execute-extended-command(nil "sesman-unlink" nil)
  funcall-interactively(execute-extended-command nil "sesman-unlink" nil)
  command-execute(execute-extended-command)

A temporary workaround:

(defun arei--sesman--format-link (link)
  "Like original `sesman--format-link', but wraps values into format
to ensure that they are string and propertize can handle them."
  (let* ((system (sesman--lnk-system-name link))
         (session (gethash (car link) sesman-sessions-hashmap)))
    (format "%s(%s) -> %s [%s]"
            (sesman--lnk-context-type link)
            (propertize
             (format "%s" (sesman--abbrev-path-maybe (sesman--lnk-value link)))
             'face 'bold)
            (propertize
             (format "%s" (sesman--lnk-session-name link))
             'face 'bold)
            (if session
                (sesman--format-session-objects system session)
              "invalid"))))

(advice-add 'sesman--format-link :override 'arei--sesman--format-link)
abcdw added a commit to abcdw/emacs-arei that referenced this issue Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant