Troubleshooting mapatoms returning nil despite interactive functions

Heime <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <m7Zd1ZYQ422itKZW_v5gi_mcljiBwSSE-tkvhn9f2aUNd9M7SruTRkaiP3j0AbAgrbz3PcJPH5a_YkNMd9UVOJCH87YVHb-sFrXyOzMVu_U=@protonmail.com>
I want to make a function that returns interactive functions defined in a given 
file.

Studying mapatoms, I understand it applies a function to each symbol in obarray 
but doesn't collect results - you must accumulate them yourself.  Unlike mapcar, 
it returns nothing.

Have selected a file, but the output is still nil, even though there are
interactive functions loaded.

(defun mazella-smbp (smb file)
  "Filter symbol SYM defined in a specific file that are currently loaded."
  (when (and (fboundp smb)
             (eq 'autoload (car-safe (symbol-function smb)))
             (string= (symbol-file smb) file)
             (commandp smb))
    smb))

(defun mazella-agfun (file)
  "List all interactive functions defined in FILE."
  
  (interactive "fFile: ")

  (let (smbs)
    (when (find-file-noselect file)
      (mapatoms (lambda (smb)
                  (when (mazella-smbp smb file)
                    (push smb smbs))))

      (message "Interactive functions: %s"
	(seq-filter #'commandp smbs))
      (seq-filter #'commandp smbs))))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.