1 ;;; egg-util.el --- Utilities with Egg
3 ;; Copyright (C) 2000 ElectroTechinical Laboratory, Japan
4 ;; Copyright (C) 2000 TOMURA Satoru <tomura@etl.go.jp>
6 ;; Author: TOMURA Satoru <tomura@etl.go.jp>
8 ;; Maintainer: TOMURA Satoru <tomura@etl.go.jp>
10 ;; Keywords: mule, multilingual, input method
12 ;; This file is part of EGG.
14 ;; EGG is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation; either version 2, or (at your option)
19 ;; EGG is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;; GNU General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27 ;; Boston, MA 02111-1307, USA.
35 (defun add-directory-to-load-path (dir)
36 (let ((dir (expand-file-name dir)))
37 (add-to-list 'load-path dir)
38 (let ((default-directory dir))
39 (normal-top-level-add-subdirs-to-load-path))))
41 (defun locate-libraries (library &optional nosuffix path interactive-call)
42 (let ((lpath (or path load-path))
45 (let ((path (locate-library library nosuffix lpath interactive-call)))
49 (member (directory-file-name (file-name-directory path))
51 result (cons path result)))
54 result (reverse result))))))
57 (defun load-libraries (library &optional path)
58 (let ((files (locate-libraries library nil (or path load-path) nil)))
60 (load-file (car files))
61 (setq files (cdr files)))))