;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/list-quoted-functions.el ;; ;; required: ;; https://dataswamp.org/~incal/emacs-init/search-regexp-in-files.el ;; ;; test: ;; evaluate (list-quoted-functions) ;; ;; and se if it catches this `custom-comment-hide', as quoted: ;; ;; (put 'custom-comment-hide 'disabled nil) ;; ;; but not this, as unquoted and not a function: ;; ;; (custom-comment-hide 'oh-not-a-function) (require 'cl-lib) (require 'search-regexp-in-files) (require 'seq) (defun get-regexp-vars (re) (let ((vars)) (mapatoms (lambda (a) (when (and (boundp a) (string-match-p re (symbol-name a))) (push a vars) ))) vars) ) ;; (length (get-regexp-vars "gnus-.*")) ; 1129 ;; (length (get-regexp-vars "w3m-.*")) ; 427 (defun get-all-functions (&optional delim) (let ((funs)) (if delim (mapatoms (lambda (f) (when (fboundp f) (push (format "%s%s" f delim) funs) ))) (mapatoms (lambda (f) (when (fboundp f) (push f funs) )))) funs) ) (defun list-quoted-functions () (let*((funs (get-all-functions "\\|")) (num-funs (length funs)) (num-funs-each-time 1000)) (cl-loop for i from 0 to num-funs by num-funs-each-time do (let*((funs-part (cl-subseq funs i (min num-funs (+ i num-funs-each-time)))) (funs-part-str (apply `(seq-concatenate string ,@funs-part))) (funs-sub-str (substring funs-part-str 0 (- (length funs-part-str) 2) )) (funs-part-regexp (seq-concatenate 'string "'\\(" funs-sub-str "\\)[^-/]\\b") )) ;; TODO: bug below. Invalid regexp: "Unmatched ( or \\(" (search-regexp-in-files "~/.emacs.d/emacs-init/list-quoted-functions.el" funs-part-regexp) )))) ;; (list-quoted-functions) (provide 'list-quoted-functions)