;; This file: ;; ;; http://user.it.uu.se/~embe8573/conf/emacs-init/list-quoted-functions.el ;; ;; Required: ;; ;; http://user.it.uu.se/~embe8573/conf/emacs-init/search-regexp-in-files.el ;; ;; Test it on this very file! ;; ;; catch me, as quoted: ;; ;; (put 'custom-comment-hide 'disabled nil) ;; ;; don't catch me: ;; ;; (custom-comment-hide 'oh-oh-oh) (require 'cl-lib) (require 'search-regexp-in-files) (defun get-regexp-vars (regexp) (let ((vars '())) (mapatoms (lambda (a) (when (and (boundp a) (string-match regexp (symbol-name a)) ) (push a vars) ))) vars)) ;; some testing ;; (length (get-regexp-vars "gnus-.*")) ; 1109 ;; (length (get-regexp-vars "w3m-.*")) ; 445 (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 get-number-of-functions () (length (get-all-functions)) ) (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 (+ i num-funs-each-time))) (funs-part-str (apply `(cl-concatenate string ,@funs-part))) (funs-part-regexp (cl-concatenate 'string "'\\(" (substring funs-part-str 0 (- (length funs-part-str) 2)) "\\)\\b" ))) (search-regexp-in-files "~/.emacs.d/emacs-init/**/*.el" funs-part-regexp) )))) ;; (list-quoted-functions)