-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
wrong-type-argument integer-or-marker-p nil #1074
Comments
I started getting this issue yesterday, too. Happens on both gccemacs and master. I'm using Nix too. I'm not using |
can you share a minimally reproducible Org file? |
This does it for me:
When I remove the final |
Since that |
So, it happened in two files for me: Neither had a |
With the following file contents:
|
This is probably caused by the leading whitespaces (and Reproduction
Run Why
(let ((origin (point)))
(end-of-line)
(skip-chars-backward " \r\t\n")
(cond
;; Within blank lines at the beginning of buffer, return nil.
((bobp) nil)
;; ... then SolutionAn extra |
Should be fixed with the recent changes. |
🤔 started to get this error yesterday after update to the latest version. Don't have leading newlines in the linked files. I've run I tried to debug it and it seems that it fails here: (content (or (org-element-property :raw-value element)
(buffer-substring-no-properties
begin
(or (org-element-property :content-end element)
(org-element-property :end element))))) I saw that my element is missing (defun org-roam--extract-links (&optional file-path)
"Extracts all link items within the current buffer.
Link items are of the form:
[from to type properties]
This is the format that emacsql expects when inserting into the database.
FILE-FROM is typically the buffer file path, but this may not exist, for example
in temp buffers. In cases where this occurs, we do know the file path, and pass
it as FILE-PATH."
(require 'org-ref nil t)
(setq file-path (or file-path
org-roam-file-name
(buffer-file-name)))
(save-excursion
(let (links)
(org-element-map (org-element-parse-buffer) 'link
(lambda (link)
(goto-char (org-element-property :begin link))
(when-let* ((type (org-roam--collate-types (org-element-property :type link)))
(path (org-element-property :path link))
(element (org-element-at-point))
(begin (or (org-element-property :content-begin element)
(org-element-property :contents-begin element)
(org-element-property :begin element)))
(content (or (org-element-property :raw-value element)
(buffer-substring-no-properties
begin
(or (org-element-property :content-end element)
(org-element-property :contents-end element)
(org-element-property :end element)))))
(content (string-trim content))
(properties (list :outline (org-roam--get-outline-path)
:content content
:point begin))
(names (pcase type
("id"
(list (car (org-roam-id-find path))))
("cite" (list path))
("website" (list path))
("fuzzy" (list path))
("roam" (list path))
(_ (if (or (file-remote-p path)
(org-roam--url-p path))
(list path)
(let ((file-maybe (expand-file-name path (file-name-directory file-path))))
(if (f-exists? file-maybe)
(list file-maybe)
(list path))))))))
(dolist (name names)
(when name
(push (vector file-path name type properties) links))))))
links))) And now it seems to be working. Please notice that I also changed |
🤔 according to Elements API, the name for this property is |
Description
One weird thing is that I only seems to have this error when using
envrc
.Steps to Reproduce
Not sure yet. I'll try to get a minimal example if it's not a trivial fix.
Backtrace
Expected Results
Actual Results
Environment
The text was updated successfully, but these errors were encountered: