From d956e9aa2ebb1d241354eb224cb23c383bfee2c9 Mon Sep 17 00:00:00 2001 From: morioka Date: Mon, 9 Mar 1998 20:04:03 +0000 Subject: [PATCH] tm 7.79. --- ChangeLog | 222 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ emu-18.el | 52 +++++++------ emu-e19.el | 66 ++++++++++------- emu-mule.el | 73 ++++++++++--------- emu-nemacs.el | 60 ++++++++------- emu.el | 76 +++++++++---------- file-detect.el | 140 +++++++++++++++++++++++++++++++++++ install.el | 128 ++++++++++++++++++++++++++++++++ 8 files changed, 666 insertions(+), 151 deletions(-) create mode 100644 file-detect.el create mode 100644 install.el diff --git a/ChangeLog b/ChangeLog index df6d007..3fc1789 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,225 @@ +Fri Aug 23 07:28:37 1996 MORIOKA Tomohiko + + * tl: Version 7.48 was released. + +Thu Aug 22 16:21:21 1996 MORIOKA Tomohiko + + * emu-mule.el (set-process-input-coding-system): New alias. + +Wed Aug 21 12:08:41 1996 MORIOKA Tomohiko + + * install.el (install-elisp-module, install-elisp-modules): New + function. + + * file-detect.el (module-installed-p): New function. + +Mon Aug 19 17:38:23 1996 MORIOKA Tomohiko + + * install.el (install-files): New argument `overwrite'. + + * install.el (install-overwritten-file-modes): New variable. + + (install-file): Use variable `install-overwritten-file-modes'. + + * install.el (install-file, install-files): New function. + + * emu-mule.el (charsets-mime-charset-alist): add iso-2022-int-1 as + the largest MIME charset. + +Sun Aug 18 20:38:49 1996 MORIOKA Tomohiko + + * TL-ELS (tl-modules): Changed to list of symbols. + + * mk-tl (compile-tl): Use function `compile-elisp-modules'. + + * mk-tl: tl-els was renamed to TL-ELS. + + * install.el: Initial revision + + * emu-mule.el (charsets-mime-charset-alist): add lc-roman and + lc-jpold to iso-2022-jp, iso-2022-jp-2 and iso-2022-int-1. + + * emu-18.el (buffer-undo-list): define default variable as nil. + + * tl-list.el (put-alist): New implementation. + + * tl-list.el (put-alist): Use `setcdr' instead of `rplacd'. + +Sun Aug 18 08:10:43 1996 MORIOKA Tomohiko + + * tl-list.el (set-alist): New implementation. + + * tl-list.el (put-alist): DOC-string was modified. + +Sun Aug 18 07:30:38 1996 MORIOKA Tomohiko + + * emu.el: Alias `tl:read-string' was abolished. + +Sun Aug 18 07:29:06 1996 MORIOKA Tomohiko + + * mu-cite.el (mu-cite/get-prefix-register-verbose-method): Use + `read-string' instead of `tl:read-string'. + + * mu-cite.el (mu-cite/get-prefix-register-method): Use + `read-string' instead of `tl:read-string'. + + * mu-bbdb.el (mu-cite/get-bbdb-prefix-register-method): Use + `read-string' instead of `tl:read-string'. + + (mu-cite/get-bbdb-prefix-register-verbose-method): Use + `read-string' instead of `tl:read-string'. + + * emu.el: Redefine `read-string' for EMACS 19.28 or earlier. + +Sun Aug 18 06:39:40 1996 MORIOKA Tomohiko + + * emu-nemacs.el (decode-coding-string): New function. + +Sat Aug 17 03:25:51 1996 MORIOKA Tomohiko + + * emu-e19.el (mime-charset-to-coding-system): New function. + + * emu-e19.el (decode-coding-string): New function. + + * emu-mule.el: Function `character-decode-string' was renamed to + `decode-coding-string'. + +Fri Aug 16 06:06:40 1996 MORIOKA Tomohiko + + * tl-seq.el: comment was modified. + +Fri Aug 16 06:05:21 1996 MORIOKA Tomohiko + + * tl-seq.el: Don't autoload `position-if-not'. + + * tl-seq.el: Function `position-mismatched' was abolished. + + * tl-822.el (rfc822/analyze-comment): Use `string-match' instead + of `position-mismatched'. + + * tl-822.el (rfc822/analyze-domain-literal): New implementation. + + * tl-822.el (rfc822/analyze-atom): New implementation. + + * tl-822.el (rfc822/analyze-spaces): New implementation. + +Fri Aug 16 05:02:08 1996 MORIOKA Tomohiko + + * tl-seq.el: require file-detect. + +Fri Aug 16 04:59:13 1996 MORIOKA Tomohiko + + * genjis.el: Use function `find-if' instead of `some-element'. + + * tl-seq.el: Function `some-element' was abolished. + +Fri Aug 16 04:36:45 1996 MORIOKA Tomohiko + + * file-detect.el (add-path): moved from tl-misc.el. + + * tl-misc.el: Function `add-path' was moved to file-detect.el. + +Fri Aug 16 04:32:46 1996 MORIOKA Tomohiko + + * file-detect.el (get-latest-path): moved from tl-misc.el. + + * tl-misc.el: Function `get-latest-path' was moved to + file-detect.el. + +Fri Aug 16 04:27:54 1996 MORIOKA Tomohiko + + * tl-misc.el, tl-seq.el, tl-els, file-detect.el: module.el was + renamed to file-detect.el. + +Fri Aug 16 04:06:42 1996 MORIOKA Tomohiko + + * tl-seq.el, tl-misc.el, tl-els, module.el: install.el was renamed + to module.el. + +Fri Aug 16 03:27:50 1996 MORIOKA Tomohiko + + * tl-seq.el: Use `file-installed-p'. + +Fri Aug 16 03:09:15 1996 MORIOKA Tomohiko + + * tl-seq.el: Don't use cl.el if cl-seq.el is not found. + +Fri Aug 16 03:00:43 1996 MORIOKA Tomohiko + + * tl-els: Add install.el. + + * install.el: Initial revision + + * tl-misc.el: Function `file-installed-p' was moved to install.el. + +Fri Aug 16 02:04:24 1996 MORIOKA Tomohiko + + * tl-els: Add range.el. + +Fri Aug 16 02:02:55 1996 MORIOKA Tomohiko + + * range.el: New module. + + * tl-list.el: Range functions were moved to range.el. + + * tl-list.el: Don't use cl.el for EMACS 18. + +Wed Aug 14 23:11:07 1996 MORIOKA Tomohiko + + * tl-seq.el: Use cl.el; Don't define function `find' if it is + already exist. + +Wed Aug 14 02:32:13 1996 MORIOKA Tomohiko + + * tl-list.el: `(autoload 'last "cl")' instead of `(require 'cl)'. + +Wed Aug 14 02:15:12 1996 MORIOKA Tomohiko + + * tl-str.el (replace-space-with-underline): fixed problem in + XEmacs 20. + +Wed Aug 14 01:19:22 1996 MORIOKA Tomohiko + + * tl-list.el (map-union): Use `nreverse' instead of `reverse'. + + * tl-list.el (index): Use `nreverse' instead of `reverse'. + +Wed Aug 14 01:01:06 1996 MORIOKA Tomohiko + + * tl-list.el (permute): Use `nconc'. + +Wed Aug 14 00:53:35 1996 MORIOKA Tomohiko + + * tl-list.el (every-combination): Use `nreverse' instead of + `reverse'. + +Wed Aug 14 00:47:47 1996 MORIOKA Tomohiko + + * tl-list.el (except-nth): New implementation. + + * tl-list.el (nexcept-nth): New function. + +Wed Aug 14 00:24:14 1996 MORIOKA Tomohiko + + * tl-list.el (nnth-prev): New function. + (nth-prev): New implementation. + +Tue Aug 13 23:55:20 1996 MORIOKA Tomohiko + + * tl-list.el: Function `butlast' and `nbutlast' were abolished; + Use cl.el. + +Tue Aug 13 23:46:50 1996 MORIOKA Tomohiko + + * tl-list.el: Function `last' was abolished. + + * tl-list.el: Function `subsetp' was abolished. + + * tl-list.el: Function `cadr' was abolished. + + * tl-list.el: Function `caar' was abolished. + + Tue Aug 6 12:18:37 1996 MORIOKA Tomohiko * tl: Version 7.44 was released. diff --git a/emu-18.el b/emu-18.el index a0d286b..38d7f73 100644 --- a/emu-18.el +++ b/emu-18.el @@ -1,36 +1,34 @@ -;;; ;;; emu-18.el --- Emacs 19.* emulation module for Emacs 18.* -;;; -;;; Copyright (C) 1995 Free Software Foundation, Inc. -;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko -;;; -;;; Author: MORIOKA Tomohiko -;;; Version: -;;; $Id: emu-18.el,v 7.20 1996/07/26 12:08:55 morioka Exp $ -;;; Keywords: emulation, compatibility -;;; -;;; This file is part of tl (Tiny Library). -;;; -;;; This program is free software; you can redistribute it and/or -;;; modify it under the terms of the GNU General Public License as -;;; published by the Free Software Foundation; either version 2, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with This program. If not, write to the Free Software -;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;; + +;; Copyright (C) 1995,1996 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Version: $Id: emu-18.el,v 7.21 1996/08/18 17:17:27 morioka Exp $ +;; Keywords: emulation, compatibility + +;; This file is part of tl (Tiny Library). + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + ;;; Code: ;;; @ for EMACS 18.55 ;;; -(defvar buffer-undo-list) +(defvar buffer-undo-list nil) ;;; @ hook diff --git a/emu-e19.el b/emu-e19.el index 67519ee..7811db9 100644 --- a/emu-e19.el +++ b/emu-e19.el @@ -1,30 +1,29 @@ -;;; -;;; emu-e19.el --- Mule 2 emulation module for Emacs 19 and XEmacs 19 -;;; -;;; Copyright (C) 1995 Free Software Foundation, Inc. -;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko -;;; -;;; Author: MORIOKA Tomohiko -;;; Version: -;;; $Id: emu-e19.el,v 7.30 1996/07/15 08:26:24 morioka Exp $ -;;; Keywords: emulation, compatibility, Mule, Latin-1 -;;; -;;; This file is part of tl (Tiny Library). -;;; -;;; This program is free software; you can redistribute it and/or -;;; modify it under the terms of the GNU General Public License as -;;; published by the Free Software Foundation; either version 2, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with This program. If not, write to the Free Software -;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;; +;;; emu-e19.el --- emu module for Emacs 19 and XEmacs 19 + +;; Copyright (C) 1995,1996 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Version: +;; $Id: emu-e19.el,v 7.32 1996/08/17 03:25:51 morioka Exp $ +;; Keywords: emulation, compatibility, mule, Latin-1 + +;; This file is part of tl (Tiny Library). + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + ;;; Code: ;;; @ version and variant specific features @@ -111,6 +110,11 @@ to TARGET. On successful conversion returns t, else returns nil. [emu-e19.el; Mule emulating function]" t) +(defun decode-coding-string (string coding-system) + "Decode the STRING which is encoded in CODING-SYSTEM. +\[emu-e19.el]" + string) + (defun code-detect-region (beg end) "Detect coding-system of the text in the region between START and END. [emu-e19.el; Mule emulating function]" @@ -133,6 +137,14 @@ between START and END. [emu-e19.el; Mule emulating function]" (defvar default-mime-charset 'iso-8859-1) +(defun mime-charset-to-coding-system (charset) + (if (stringp charset) + (setq charset (intern (downcase charset))) + ) + (and (memq charset (list 'us-ascii default-mime-charset)) + charset) + ) + (defun detect-mime-charset-region (start end) "Return MIME charset for region between START and END. \[emu-e19.el]" diff --git a/emu-mule.el b/emu-mule.el index d19245a..73e639e 100644 --- a/emu-mule.el +++ b/emu-mule.el @@ -1,30 +1,29 @@ -;;; ;;; emu-mule.el --- Mule 2.* emulation module for Mule -;;; -;;; Copyright (C) 1995 Free Software Foundation, Inc. -;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko -;;; -;;; Author: MORIOKA Tomohiko -;;; Version: -;;; $Id: emu-mule.el,v 7.44 1996/08/05 15:15:18 morioka Exp $ -;;; Keywords: emulation, compatibility, Mule -;;; -;;; This file is part of tl (Tiny Library). -;;; -;;; This program is free software; you can redistribute it and/or -;;; modify it under the terms of the GNU General Public License as -;;; published by the Free Software Foundation; either version 2, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with This program. If not, write to the Free Software -;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;; + +;; Copyright (C) 1995,1996 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Version: +;; $Id: emu-mule.el,v 7.48 1996/08/22 16:21:21 morioka Exp $ +;; Keywords: emulation, compatibility, Mule + +;; This file is part of tl (Tiny Library). + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with This program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + ;;; Code: ;;; @ version specific features @@ -69,7 +68,7 @@ ;;; @ coding system ;;; -(defun character-decode-string (str coding-system) +(defun decode-coding-string (str coding-system) "Decode the string STR which is encoded in CODING-SYSTEM. \[emu-mule.el]" (let ((len (length str)) @@ -95,6 +94,8 @@ (,@ body) ))) +(defalias 'set-process-input-coding-system 'set-process-coding-system) + ;;; @ MIME charset ;;; @@ -112,13 +113,19 @@ (cons (list lc-ascii lc-grk) 'iso-8859-7) (cons (list lc-ascii lc-hbw) 'iso-8859-8) (cons (list lc-ascii lc-ltn5) 'iso-8859-9) - (cons (list lc-ascii lc-jp) 'iso-2022-jp) + (cons (list lc-ascii lc-roman lc-jpold lc-jp) 'iso-2022-jp) (cons (list lc-ascii lc-kr) 'euc-kr) (cons (list lc-ascii lc-big5-1 lc-big5-2) 'big5) - (cons (list lc-ascii lc-cn lc-jp lc-kr lc-jp2 - lc-ltn1 lc-grk) 'iso-2022-jp-2) - (cons (list lc-ascii lc-cn lc-jp lc-kr lc-jp2 - lc-cns1 lc-cns2 lc-ltn1 lc-grk) 'iso-2022-int-1) + (cons (list lc-ascii lc-roman lc-ltn1 lc-grk + lc-jpold lc-cn lc-jp lc-kr lc-jp2) 'iso-2022-jp-2) + (cons (list lc-ascii lc-roman lc-ltn1 lc-grk + lc-jpold lc-cn lc-jp lc-kr lc-jp2 + lc-cns1 lc-cns2) 'iso-2022-int-1) + (cons (list lc-ascii lc-roman + lc-ltn1 lc-ltn2 lc-crl lc-grk + lc-jpold lc-cn lc-jp lc-kr lc-jp2 + lc-cns1 lc-cns2 lc-cns3 lc-cns4 + lc-cns5 lc-cns6 lc-cns7) 'iso-2022-int-1) )) (defvar default-mime-charset 'x-ctext) @@ -176,7 +183,7 @@ "Decode the STRING which is encoded in MIME CHARSET. [emu-mule.el]" (let ((cs (mime-charset-to-coding-system charset))) (if cs - (character-decode-string string cs) + (decode-coding-string string cs) string))) diff --git a/emu-nemacs.el b/emu-nemacs.el index 385369f..c485326 100644 --- a/emu-nemacs.el +++ b/emu-nemacs.el @@ -1,31 +1,29 @@ -;;; ;;; emu-nemacs.el --- Mule 2 emulation module for NEmacs -;;; -;;; Copyright (C) 1995 Free Software Foundation, Inc. -;;; Copyright (C) 1993 .. 1996 MORIOKA Tomohiko -;;; -;;; Author: MORIOKA Tomohiko -;;; modified by KOBAYASHI Shuhei -;;; Version: -;;; $Id: emu-nemacs.el,v 7.39 1996/07/15 08:24:46 morioka Exp $ -;;; Keywords: emulation, compatibility, NEmacs, Mule -;;; -;;; This file is part of tl (Tiny Library). -;;; -;;; This program is free software; you can redistribute it and/or -;;; modify it under the terms of the GNU General Public License as -;;; published by the Free Software Foundation; either version 2, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with This program. If not, write to the Free Software -;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;; + +;; Copyright (C) 1995,1996 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Version: +;; $Id: emu-nemacs.el,v 7.40 1996/08/18 06:39:40 morioka Exp $ +;; Keywords: emulation, compatibility, NEmacs, mule + +;; This file is part of tl (Tiny Library). + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + ;;; Code: (require 'emu-18) @@ -129,6 +127,14 @@ else returns nil. [emu-nemacs.el; Mule emulating function]" (convert-region-kanji-code beg end ic oc) )))) +(defun decode-coding-string (string coding-system) + "Decode the STRING which is encoded in CODING-SYSTEM. +\[emu-nemacs.el]" + (if (eq coding-system 3) + string + (convert-string-kanji-code string coding-system 3) + )) + (defun code-detect-region (start end) "Detect coding-system of the text in the region between START and END. \[emu-nemacs.el; Mule emulating function]" diff --git a/emu.el b/emu.el index 83b205d..1d32f1e 100644 --- a/emu.el +++ b/emu.el @@ -1,31 +1,28 @@ -;;; ;;; emu.el --- Emulation module for each Emacs variants -;;; -;;; Copyright (C) 1995 Free Software Foundation, Inc. -;;; Copyright (C) 1995,1996 MORIOKA Tomohiko -;;; -;;; Author: MORIOKA Tomohiko -;;; modified by KOBAYASHI Shuhei -;;; Version: -;;; $Id: emu.el,v 7.20 1996/07/23 14:58:47 morioka Exp $ -;;; Keywords: emulation, compatibility, NEmacs, Mule, XEmacs -;;; -;;; This file is part of tl (Tiny Library). -;;; -;;; This program is free software; you can redistribute it and/or -;;; modify it under the terms of the GNU General Public License as -;;; published by the Free Software Foundation; either version 2, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with This program. If not, write to the Free Software -;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;; + +;; Copyright (C) 1995,1996 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Version: $Id: emu.el,v 7.22 1996/08/18 07:30:38 morioka Exp $ +;; Keywords: emulation, compatibility, NEmacs, Mule, XEmacs + +;; This file is part of tl (Tiny Library). + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + ;;; Code: (or (boundp 'emacs-major-version) @@ -111,16 +108,21 @@ and `default-mime-charset'. [emu.el]" string)) ) -(cond ((or running-emacs-19_29-or-later running-xemacs) - ;; for Emacs 19.29 or later and XEmacs - (defalias 'tl:read-string 'read-string) - ) - (t - ;; for Emacs 19.28 or earlier - (defun tl:read-string (prompt &optional initial-input history) - (read-string prompt initial-input) - ) - )) +(or running-emacs-19_29-or-later + running-xemacs + ;; for Emacs 19.28 or earlier + (fboundp 'si:read-string) + (progn + (fset 'si:read-string (symbol-function 'read-string)) + + (defun read-string (prompt &optional initial-input history) + "Read a string from the minibuffer, prompting with string PROMPT. +If non-nil, second arg INITIAL-INPUT is a string to insert before reading. +The third arg HISTORY, is dummy for compatibility. [emu.el] +See `read-from-minibuffer' for details of HISTORY argument." + (si:read-string prompt initial-input) + ) + )) (or (fboundp 'add-to-list) ;; This function was imported Emacs 19.30. diff --git a/file-detect.el b/file-detect.el new file mode 100644 index 0000000..d5b6bb9 --- /dev/null +++ b/file-detect.el @@ -0,0 +1,140 @@ +;;; file-detect.el --- Emacs Lisp file detection utility + +;; Copyright (C) 1996 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Version: +;; $Id: file-detect.el,v 1.6 1996/08/21 11:43:09 morioka Exp $ +;; Keywords: install, module + +;; This file is part of tl (Tiny Library). + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with This program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(defvar default-load-path load-path) + +(defun add-path (path &rest options) + "Add PATH to `load-path' if it exists under `default-load-path' +directories and it does not exist in `load-path'. + +You can use following PATH styles: + load-path relative: \"PATH/\" + (it is searched from `defaul-load-path') + home directory relative: \"~/PATH/\" \"~USER/PATH/\" + absolute path: \"/HOO/BAR/BAZ/\" + +You can specify following OPTIONS: + 'all-paths search from `load-path' + instead of `default-load-path' + 'append add PATH to the last of `load-path' + +\[file-detect.el]" + (let ((rest (if (memq 'all-paths options) + load-path + default-load-path)) + p) + (if (and (catch 'tag + (while rest + (setq p (expand-file-name path (car rest))) + (if (file-directory-p p) + (throw 'tag p) + ) + (setq rest (cdr rest)) + )) + (not (member p load-path)) + ) + (setq load-path + (if (memq 'append options) + (append load-path (list p)) + (cons p load-path) + )) + ))) + +(defun get-latest-path (pat &optional all-paths) + "Return latest directory in default-load-path +which is matched to regexp PAT. +If optional argument ALL-PATHS is specified, +it is searched from all of load-path instead of default-load-path. +\[file-detect.el]" + (catch 'tag + (let ((paths (if all-paths + load-path + default-load-path)) + dir) + (while (setq dir (car paths)) + (let ((files (sort (directory-files dir t pat t) + (function file-newer-than-file-p))) + file) + (while (setq file (car files)) + (if (file-directory-p file) + (throw 'tag file) + ) + (setq files (cdr files)) + )) + (setq paths (cdr paths)) + )))) + +(defun file-installed-p (file &optional paths) + "Return t if FILE exists in PATHS. +If PATHS is omitted, `load-path' is used. [file-detect.el]" + (if (null paths) + (setq paths load-path) + ) + (catch 'tag + (let (path) + (while paths + (setq path (expand-file-name file (car paths))) + (if (file-exists-p path) + (throw 'tag path) + ) + (setq paths (cdr paths)) + )))) + +(defun module-installed-p (module &optional paths) + "Return t if module is provided or exists in PATHS. +If PATHS is omitted, `load-path' is used. [file-detect.el]" + (or (featurep module) + (let ((name (symbol-name module))) + (if (null paths) + (setq paths load-path) + ) + (catch 'tag + (while paths + (let ((file (expand-file-name name (car paths)))) + (let ((elc-file (concat file ".elc"))) + (if (file-exists-p elc-file) + (throw 'tag elc-file) + )) + (let ((el-file (concat file ".el"))) + (if (file-exists-p el-file) + (throw 'tag el-file) + )) + (if (file-exists-p file) + (throw 'tag file) + ) + ) + (setq paths (cdr paths)) + ))))) + + +;;; @ end +;;; + +(provide 'file-detect) + +;;; file-detect.el ends here diff --git a/install.el b/install.el new file mode 100644 index 0000000..f934a69 --- /dev/null +++ b/install.el @@ -0,0 +1,128 @@ +;;; install.el --- Emacs Lisp package install utility + +;; Copyright (C) 1996 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Created: 1996/8/18 +;; Version: $Id: install.el,v 1.5 1996/08/21 12:08:41 morioka Exp $ +;; Keywords: install + +;; This file is part of tl (Tiny Library). + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(defun compile-elisp-module (module &optional path every-time) + (setq module (expand-file-name (symbol-name module) path)) + (let ((el-file (concat module ".el")) + (elc-file (concat module ".elc")) + ) + (if (or every-time + (file-newer-than-file-p el-file elc-file)) + (byte-compile-file el-file) + ) + )) + +(defun compile-elisp-modules (modules &optional path every-time) + (mapcar (function + (lambda (module) + (compile-elisp-module module path every-time) + )) + modules)) + + +(defvar install-overwritten-file-modes (+ (* 64 6)(* 8 4) 4)) + +(defun install-file (file src dest &optional move overwrite) + (let ((src-file (expand-file-name file src))) + (if (file-exists-p src-file) + (let ((full-path (expand-file-name file dest))) + (if (and (file-exists-p full-path) overwrite) + (set-file-modes full-path install-overwritten-file-modes) + ) + (copy-file src-file full-path t t) + (if move + (catch 'tag + (while (file-exists-p src-file) + (condition-case err + (progn + (delete-file src-file) + (throw 'tag nil) + ) + (error (princ (format "%s\n" (nth 1 err)))) + )))) + (princ (format "%s -> %s\n" file dest)) + )) + )) + +(defun install-files (files src dest &optional move overwrite) + (or (file-exists-p dest) + (make-directory dest t) + ) + (mapcar (function (lambda (file) + (install-file file src dest move overwrite) + )) + files)) + +(defun install-elisp-module (module src dest) + (let (el-file elc-file) + (let ((name (symbol-name module))) + (setq el-file (concat name ".el")) + (setq elc-file (concat name ".elc")) + ) + (let ((src-file (expand-file-name el-file src))) + (if (file-exists-p src-file) + (let ((full-path (expand-file-name el-file dest))) + (if (file-exists-p full-path) + (set-file-modes full-path install-overwritten-file-modes) + ) + (copy-file src-file full-path t t) + (princ (format "%s -> %s\n" el-file dest)) + )) + (setq src-file (expand-file-name elc-file src)) + (if (file-exists-p src-file) + (let ((full-path (expand-file-name elc-file dest))) + (copy-file src-file full-path t t) + (catch 'tag + (while (file-exists-p src-file) + (condition-case err + (progn + (delete-file src-file) + (throw 'tag nil) + ) + (error (princ (format "%s\n" (nth 1 err)))) + ))) + (princ (format "%s -> %s\n" elc-file dest)) + )) + ))) + +(defun install-elisp-modules (modules src dest) + (or (file-exists-p dest) + (make-directory dest t) + ) + (mapcar (function (lambda (module) + (install-elisp-module module src dest) + )) + modules)) + + +;;; @ end +;;; + +(provide 'install) + +;;; install.el ends here -- 1.7.10.4