Asilata Bapat <asil...@gmail.com> writes: > When org-scan-tags runs in a batch mode invocation, the value of the variable > comment-start-skip is nil even while scanning an org file. The function > org-scan-tags calls (org-agenda-skip), which in turn calls (looking-at > comment-start-skip). Since the value of comment-start-skip is nil, it > triggers the error (wrong-type-argument stringp nil). > To fix this, the function org-agenda-skip should ensure that the variable > comment-start-skip is set to the appropriate value.
Could you please provide a detailed reproducer? > 2. The issue can indeed be fixed, e.g., by changing the source of > org-agenda-skip to invoke (org-mode) immediately before the let statement. > Doing this presumably sets the variable comment-start-skip to the expected > value, and the invocation succeeds. org-agenda-skip should be operating after org-agenda-prepare-buffers, which, in turn, should call org-mode. org-mode calls org-setup-comments-handling which must set comment-start-skip to non-nil. Best, Ihor