help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

get all functions, again (lost message?)


From: Emanuel Berg
Subject: get all functions, again (lost message?)
Date: Thu, 20 Aug 2015 03:23:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

I just posted how to get all functions - that was some
hours ago, and I still don't see it, so maybe it is
lost in space. Anyway, I figured out how to do it -
now, the problem is rather how to *use* it, as the
regexp gets too big!

Keep it up!

;; 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 'search-regexp-in-files)
(require 'cl)

(defun get-all-functions (&optional delim)
  (let ((funs '()))
    (mapatoms (lambda (f)
                (when (fboundp f)
                  (push (if delim (format "%s%s" f delim) f) funs) )))
    (subseq funs 0 1000) )) ; too many functions for the regexp to hold them all
                            ; at once - here, get 1000 just to test, and
                            ; make pretty later

(defun list-quoted-functions ()
  (interactive)
  (let*((funs      (get-all-functions "\\|"))
        (funs-str  (apply `(concatenate string ,@funs)))
        (funs-regexp
         (concatenate 'string
            "[^#]'\\(" (substring funs-str 0 (- (length funs-str) 2))  "\\)\\b" 
)))
    (search-regexp-in-files
     "~/.emacs.d/emacs-init/**/*.el"
     funs-regexp) ))

;; (list-quoted-functions)

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]