[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
get all functions (was: Re: How to quote a list of functions?)
From: |
Emanuel Berg |
Subject: |
get all functions (was: Re: How to quote a list of functions?) |
Date: |
Thu, 20 Aug 2015 00:15:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
"Pascal J. Bourguignon" <pjb@informatimago.com>
writes:
> You should consider more closely my examples with
> cl-flet. Compare:
>
> (cl-flet ((w3m () (interactive) (message "doh!")))
> (call-interactively #'w3m))
>
> with:
>
> (cl-flet ((w3m () (interactive) (message "doh!")))
> (call-interactively 'w3m))
Yes, so #'w3m is correct.
Anyway, I have written something that will catch
quoted functions in source. That way they can be
considered very fast (because from the hit list, RET
will take you to that line in that file) - only one
problem, and that is the obarray doesn't seem to hold
all functions - one example is `w3m', but confusingly
many other w3m- functions are included!
If that detail can be sorted out (getting all
functions) this can be done very quickly for a large
amount of files and code lines!
;; 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 on this very file:
;;
;; catch me:
;; (put 'custom-comment-hide 'disabled nil)
;;
;; don't catch me:
;; (custom-comment-hide oh-oh-oh)
(require 'search-regexp-in-files)
(require 'cl)
(defun list-quoted-functions ()
(interactive)
(let*((funs (mapcar
(lambda (f) (format "%s\\|" f))
(cl-remove-if-not 'fboundp obarray)))
(funs-str (apply `(concatenate string ,@funs)))
(funs-regexp
(concatenate 'string
"'\\(" (substring funs-str 0 (- (length funs-str) 2)) "\\)" )))
(search-regexp-in-files
"~/.emacs.d/emacs-init/**/*.el"
funs-regexp) ))
;; (list-quoted-functions)
--
underground experts united
http://user.it.uu.se/~embe8573
- Re: How to quote a list of functions?, (continued)
- Message not available
- Re: How to quote a list of functions?, Pascal J. Bourguignon, 2015/08/16
- Re: How to quote a list of functions?, Emanuel Berg, 2015/08/17
- RE: How to quote a list of functions?, Drew Adams, 2015/08/18
- Re: How to quote a list of functions?, Emanuel Berg, 2015/08/18
- Re: How to quote a list of functions?, Emanuel Berg, 2015/08/18
- RE: How to quote a list of functions?, Drew Adams, 2015/08/18
- Re: How to quote a list of functions?, Emanuel Berg, 2015/08/20
- Message not available
- Re: How to quote a list of functions?, Pascal J. Bourguignon, 2015/08/18
- Re: How to quote a list of functions?, Stefan Monnier, 2015/08/18
- Re: How to quote a list of functions?, Pascal J. Bourguignon, 2015/08/19
- get all functions (was: Re: How to quote a list of functions?),
Emanuel Berg <=
- Message not available
- Re: How to quote a list of functions?, Rusi, 2015/08/18
- Message not available
- Re: How to quote a list of functions?, Pascal J. Bourguignon, 2015/08/18
- Message not available
- Re: How to quote a list of functions?, Pascal J. Bourguignon, 2015/08/17
- Re: How to quote a list of functions?, Emanuel Berg, 2015/08/18
- Message not available
- Re: How to quote a list of functions?, Pascal J. Bourguignon, 2015/08/16
- Re: How to quote a list of functions?, tomas, 2015/08/17
- Re: How to quote a list of functions?, Emanuel Berg, 2015/08/17
- Re: How to quote a list of functions?, Marcin Borkowski, 2015/08/18
- Re: How to quote a list of functions?, Emanuel Berg, 2015/08/18
- Re: How to quote a list of functions?, Marcin Borkowski, 2015/08/19