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

mapcar: Wrong type argument: sequencep, 108 #84

Open
Igor1257 opened this issue Dec 12, 2023 · 11 comments
Open

mapcar: Wrong type argument: sequencep, 108 #84

Igor1257 opened this issue Dec 12, 2023 · 11 comments

Comments

@Igor1257
Copy link

Igor1257 commented Dec 12, 2023

obsidian-update and obsidian-jump return "mapcar: Wrong type argument: sequencep, 108"

obsidian.el
Version: 20231211.1857
Commit: 56f6861
Summary: Obsidian Notes interface

GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-07-30

PS: Previous version obsidian.el worked fine

Update: On note opening returning "File mode specification error: (wrong-type-argument sequencep 108)"

@LA-Toth
Copy link
Contributor

LA-Toth commented Dec 12, 2023

Can you tell which was the previous version you used?

There is at least one additional error for obsidian-jump, if the "selected" or typed file name is invalid, it fails with
find-file-noselect: Wrong type of argument: stringp, nil

@Igor1257
Copy link
Author

Can you tell which was the previous version you used?

There is at least one additional error for obsidian-jump, if the "selected" or typed file name is invalid, it fails with find-file-noselect: Wrong type of argument: stringp, nil

I'm sorry. I'm not sure. I think it was the version created in November 2023.

@jouyouyun
Copy link

jouyouyun commented Dec 18, 2023

I have the same error after updated to 56f6861.

After I rolled back to version 1.4.1, this bug disappeared and was probably introduced in version 1.4.2.

@licht1stein
Copy link
Owner

Let me know please if something else is not working after the fix

@jouyouyun
Copy link

Unfortunately, using the latest version, there are still errors, the information is as follows:

Wrong type argument: sequencep, 2023

@Igor1257
Copy link
Author

Igor1257 commented Dec 19, 2023

@licht1stein Hello )

Have got "mapcar: Wrong type argument: sequencep, 108" after upgrade obsidian.el and restart emacs

Please suggest me. Which variables or settings will be useful for debugging the issue

Part of my .emacs

(obsidian-specify-path "~/Vault/export testing")
;; If you want a different directory of `obsidian-capture':
(setq obsidian-inbox-directory "Inbox")

;; Define obsidian-mode bindings
(add-hook
  'obsidian-mode-hook
  (lambda ()
   ;; Replace standard command with Obsidian.el's in obsidian vault:
  (local-set-key (kbd "C-c C-o") 'obsidian-follow-link-at-point)

   ;; Use either `obsidian-insert-wikilink' or `obsidian-insert-link':
  (local-set-key (kbd "C-c C-l") 'obsidian-insert-wikilink)

   ;; Following backlinks
  (local-set-key (kbd "C-c C-b") 'obsidian-backlink-jump)))

;; Optionally you can also bind `obsidian-jump' and `obsidian-capture'
;; replace "YOUR_BINDING" with the key of your choice:
;;(global-set-key (kbd "YOUR_BINDING") 'obsidian-jump)
;;(global-set-key (kbd "YOUR_BINDING") 'obsidian-capture)

;; Activate detection of Obsidian vault
(global-obsidian-mode t)

image

@licht1stein
Copy link
Owner

How can I replicate?

@licht1stein
Copy link
Owner

Please do M-x toggle-debug-on-error RET and attach the stack trace.

@licht1stein licht1stein reopened this Dec 20, 2023
@pingdynasty
Copy link

I found that a problematic YAML front matter was causing this error for me:

---
tags: obsidian
---

Backtrace from M-x obsidian-update:

Debugger entered--Lisp error: (wrong-type-argument sequencep 111)
  #f(compiled-function (tag) #<bytecode 0x14117eb975123385>)(111)
  mapcar(#f(compiled-function (tag) #<bytecode 0x14117eb975123385>) "obsidian")
  obsidian-find-tags("---\ntags: obsidian\n---\n\...")
  obsidian-find-tags-in-file("/home/xyz/Documents/xyz/.#Notes.md")
  mapcar(obsidian-find-tags-in-file ("/home/xyz/Documents/xyz/.#Notes.md" "/home/xyz/Documents/..."))
  obsidian-list-all-tags()
  obsidian-update-tags-list()
  obsidian-update()
  funcall-interactively(obsidian-update)
  call-interactively(obsidian-update record nil)
  command-execute(obsidian-update record)
  execute-extended-command(nil "obsidian-update" nil)
  funcall-interactively(execute-extended-command nil "obsidian-update" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

After changing the front matter it worked fine:

---
tags: 
 - obsidian
---

@jouyouyun
Copy link

Debugger entered--Lisp error: (wrong-type-argument sequencep 2023)
  concat("#" 2023)
  (closure (t) (tag) (concat "#" tag))(2023)
  mapcar((closure (t) (tag) (concat "#" tag)) [2023 "daily"])
  (and front-matter (mapcar add-tag (gethash 'tags front-matter)))
  (append (and front-matter (mapcar add-tag (gethash 'tags front-matter))) (s-match-strings-all obsidian--tag-regex s))
  (-flatten (append (and front-matter (mapcar add-tag (gethash 'tags front-matter))) (s-match-strings-all obsidian--tag-regex s)))
  (let ((front-matter (obsidian-find-yaml-front-matter s)) (add-tag #'(lambda (tag) (concat "#" tag)))) (-flatten (append (and front-matter (mapcar add-tag (gethash 'tags front-matter))) (s-match-strings-all obsidian--tag-regex s))))
  obsidian-find-tags("---\naliases:\n  - 2023 Daily\ntags:\n  - 2023\n  - dai...")
  (-distinct (obsidian-find-tags (obsidian-read-file-or-buffer file)))
  obsidian-find-tags-in-file("/daily-sync-repo/daily-in-obsid...")
  mapcar(obsidian-find-tags-in-file ("/daily-sync-repo/daily-in-obsid..."  ...))
  (-flatten (mapcar #'obsidian-find-tags-in-file (obsidian-list-all-files)))
  (-distinct (-flatten (mapcar #'obsidian-find-tags-in-file (obsidian-list-all-files))))
  obsidian-list-all-tags()
  (setq obsidian--tags-list (obsidian-list-all-tags))
  obsidian-update-tags-list()
  obsidian-update()
  funcall-interactively(obsidian-update)
  command-execute(obsidian-update)

The file front matter:

---
aliases:
  - 2023 Daily
tags:
  - 2023
  - daily
time: 2023-09-11 13:56:33
---

@Igor1257
Copy link
Author

I found that a problematic YAML front matter was causing this error for me:

---
tags: obsidian
---

Me too. Thanks!!!

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

5 participants