home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.emacs.help
- Path: sparky!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!mit.edu!acevedo
- From: acevedo@mit.edu (Raul Acevedo)
- Subject: Re: How to locate a function?
- In-Reply-To: bcho@ISI.EDU's message of 27 Jul 92 23:50:48 GMT
- Message-ID: <ACEVEDO.92Jul28094522@hippocrene.mit.edu>
- Sender: news@athena.mit.edu (News system)
- Nntp-Posting-Host: hippocrene.mit.edu
- Organization: Massachusetts Institute of Technology
- References: <22053@venera.isi.edu>
- Distribution: gnu
- Date: Tue, 28 Jul 1992 13:44:06 GMT
- Lines: 37
-
- In article <22053@venera.isi.edu> bcho@ISI.EDU (Bonghan Cho) writes:
-
- How can I know the directory where a given function resides?
- Since the load path has many paths, otherwise, it is very diffcult to
- locate functions in order to modify the function definitions.
-
- I have the following code that searches `load-path' for where an elisp
- *package* (i.e. a file like `rmail.el' or `gnus.el', not a function)
- resides:
-
- (defun where-is-library (file arg)
-
- "Find where the Emacs Lisp library FILE is in the current `load-path'.
-
- By default, appends \".el\" to the filename given, unless FILE already
- ends in \".el\" or \".elc\". If a prefix argument is given, then no
- \".el\" prefix is given."
-
- (interactive "sWhere is library: \nP")
- (let ((path load-path)
- (file (if (or arg (string-match ".elc?\\'" file))
- file
- (concat file ".el"))))
- (while (and path (not (file-exists-p (concat (car path) "/" file))))
- (setq path (cdr path)))
- (if path
- (message "File %s is in %s." file (car path))
- (message "File %s not found." file))))
-
- If you want to know about a particular *function*, you have to use tags.
- --
- Raul J. Acevedo
- acevedo@MIT.EDU
-
- Life is a mystery and it's an unsolvable one. You simply live it through, and,
- as you draw your last breath you say "What was that all about?"
- --- Marlon Brando
-