Skip to content

Commit

Permalink
update.
Browse files Browse the repository at this point in the history
  • Loading branch information
morioka committed Oct 25, 1998
1 parent 8ebbc43 commit 3bd4cec
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 8 deletions.
48 changes: 48 additions & 0 deletions ChangeLog
@@ -1,3 +1,51 @@
1998-10-25 MORIOKA Tomohiko <morioka@jaist.ac.jp>

* poe.el (rassoc): New function.

1998-10-25 MORIOKA Tomohiko <morioka@jaist.ac.jp>

* poem-e20_3.el (characterp): New alias.

* poe-xemacs.el (eval-after-load): New function.

* poem.el (characterp): New alias.
(char-octet): New function.

* poe.el (make-local-hook): New macro.
(add-local-hook): New macro.
(remove-local-hook): New macro.

1998-10-25 MORIOKA Tomohiko <morioka@jaist.ac.jp>

* poem.el, poem-20.el, poem-e20_3.el, poem-e20.el, poem-xm.el: Add
setting of byte-compile-dynamic.

* poem-xm.el (string-to-int-list): Use `defun-maybe'.

* poem.el (string-as-unibyte): Use `defsubst-maybe' instead of
`defmacro-maybe'.
(string-as-multibyte): Likewise.
(char-int): Use `defalias-maybe'.
(int-char): Likewise.
(char-or-char-int-p): Likewise.

1998-10-25 MORIOKA Tomohiko <morioka@jaist.ac.jp>

* poe.el, poe-xemacs.el: Add setting of byte-compile-dynamic.

1998-10-25 MORIOKA Tomohiko <morioka@jaist.ac.jp>

* poe-18.el (data-directory): Use `defvar-maybe'.
(buffer-undo-list): Likewise.

* poe-xemacs.el (face-list): Use `defalias-maybe'.
(line-beginning-position): Likewise.
(line-end-position): Likewise.

* poe.el (defalias-maybe): New macro.

* poe-xemacs.el (dired-other-frame): Use `defun-maybe'.

1998-10-24 MORIOKA Tomohiko <morioka@jaist.ac.jp>

* poe.el (defvar-maybe): New macro.
Expand Down
36 changes: 35 additions & 1 deletion poe-xemacs.el
Expand Up @@ -83,7 +83,41 @@
(concat ancestor (substring filename (match-end 0)))))
)



;;; @ for anything older than XEmacs 20.2
;;;

;; eval-after-load is not defined in XEmacs but after-load-alist is
;; usable. See subr.el in XEmacs.

(defun-maybe eval-after-load (file form)
"Arrange that, if FILE is ever loaded, FORM will be run at that time.
This makes or adds to an entry on `after-load-alist'.
If FILE is already loaded, evaluate FORM right now.
It does nothing if FORM is already on the list for FILE.
FILE should be the name of a library, with no directory name."
;; Make sure there is an element for FILE.
(or (assoc file after-load-alist)
(setq after-load-alist (cons (list file) after-load-alist)))
;; Add FORM to the element if it isn't there.
(let ((elt (assoc file after-load-alist)))
(or (member form (cdr elt))
(progn
(nconc elt (list form))
;; If the file has been loaded already, run FORM right away.
(and (assoc file load-history)
(eval form)))))
form)

;; (defun-maybe eval-after-load (file form)
;; (or (assoc file after-load-alist)
;; (setq after-load-alist (cons (list file) after-load-alist)))
;; (let ((elt (assoc file after-load-alist)))
;; (or (member form (cdr elt))
;; (nconc elt (list form))))
;; form)


;;; @ Emacs 20.3 emulation
;;;

Expand Down
31 changes: 29 additions & 2 deletions poe.el
Expand Up @@ -143,7 +143,7 @@
;;; @ Emacs 19.29 emulation
;;;

(defvar path-separator ":"
(defvar-maybe path-separator ":"
"Character used to separate concatenated paths.")

(defun-maybe buffer-substring-no-properties (start end)
Expand Down Expand Up @@ -177,11 +177,38 @@ STRING should be given if the last search was by `string-match' on 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]
The third arg HISTORY, is dummy for compatibility.
See `read-from-minibuffer' for details of HISTORY argument."
(si:read-string prompt initial-input))
))

(defun-maybe rassoc (key list)
"Return non-nil if KEY is `equal' to the cdr of an element of LIST.
The value is actually the element of LIST whose cdr equals KEY."
(catch 'found
(while list
(if (equal (cdr (car list)) key)
(throw 'found (car list))
)
(setq list (cdr list)))
))

(defmacro-maybe make-local-hook (hook))

;; They are not Emacs features

(defmacro-maybe add-local-hook (hook function &optional append)
(if (fboundp 'make-local-hook)
(list 'add-hook hook function append 'local)
(list 'add-hook hook function append)
))

(defmacro remove-local-hook (hook function)
(if (fboundp 'make-local-hook)
(list 'remove-hook hook function 'local)
(list 'remove-hook hook function)
))


;;; @ Emacs 19.30 emulation
;;;
Expand Down
3 changes: 2 additions & 1 deletion poem-20.el
@@ -1,4 +1,5 @@
;;; poem-20.el --- poem implementation for Emacs 20 and XEmacs-mule
;;; -*-byte-compile-dynamic: t;-*-
;;; poem-20.el --- poem submodule for Emacs 20 and XEmacs-mule

;; Copyright (C) 1997,1998 Free Software Foundation, Inc.

Expand Down
2 changes: 1 addition & 1 deletion poem-e20.el
@@ -1,4 +1,4 @@
;;; poem-e20.el --- poem implementation for XEmacs-mule
;;; poem-e20.el --- poem submodule for Emacs 20; -*-byte-compile-dynamic: t;-*-

;; Copyright (C) 1998 Free Software Foundation, Inc.

Expand Down
5 changes: 4 additions & 1 deletion poem-e20_3.el
@@ -1,4 +1,5 @@
;;; poem-e20_3.el --- poem implementation for Emacs 20.3.
;;; -*-byte-compile-dynamic: t;-*-
;;; poem-e20_3.el --- poem submodule for Emacs 20.3

;; Copyright (C) 1998 Free Software Foundation, Inc.

Expand Down Expand Up @@ -39,6 +40,8 @@
"Return index of character succeeding CHAR whose index is INDEX."
`(1+ ,index))

(defalias-maybe 'characterp 'char-valid-p)


;;; @ string
;;;
Expand Down
4 changes: 2 additions & 2 deletions poem-xm.el
@@ -1,4 +1,4 @@
;;; poem-xm.el --- poem implementation for XEmacs-mule
;;; poem-xm.el --- poem module for XEmacs-mule; -*-byte-compile-dynamic: t;-*-

;; Copyright (C) 1998 Free Software Foundation, Inc.

Expand Down Expand Up @@ -163,7 +163,7 @@ but the contents viewed as characters do change.
;;; @ string
;;;

(defun string-to-int-list (str)
(defun-maybe string-to-int-list (str)
(mapcar #'char-int str))

(defalias 'looking-at-as-unibyte 'looking-at)
Expand Down
11 changes: 11 additions & 0 deletions poem.el
Expand Up @@ -70,8 +70,19 @@ If STRING is multibyte, the result is STRING itself.

(defalias-maybe 'int-char 'identity)

(defalias-maybe 'characterp 'integerp)

(defalias-maybe 'char-or-char-int-p 'integerp)

(defun-maybe char-octet (ch &optional n)
"Return the octet numbered N (should be 0 or 1) of char CH.
N defaults to 0 if omitted. [XEmacs-mule emulating function]"
(or (nth (if n
(1+ n)
1)
(split-char ch))
0))


;;; @ end
;;;
Expand Down

0 comments on commit 3bd4cec

Please sign in to comment.