I have written a helm-extension that at the end shows a list of entries where each entry is like this:
module_name function_name file-path line-number
I am now writing a persistent-action that will open the the file at a particular line number on each entry.
(defun decode-bt--open-file (line &optional persistent) (let ((file (match-string 3 line)) (line-number (string-to-number (match-string 4 line))) (text (match-string 2 line))) (find-file (if (file-name-absolute-p file) file (concat dir file))) (goto-line (line-number)) (if persistent (helm-highlight-current-line)))) (defun decode-backtrace-command () (interactive) (setq backtrace-alist nil) (helm :sources '(some-helm-source) :truncate-lines t :action (lambda (line) (decode-bt--open-file line)) :persistent-action (lambda (line) (decode-bt--open-file line t)) :buffer "*helm backtrace*"))
This fails with the following error,
Wrong type argument: stringp, nil
What am I doing wrong?