1 ;;; poe-18.el --- poe API implementation for Emacs 18.*
3 ;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
4 ;; Copyright (C) 1999 Yuuichi Teranishi
6 ;; Author: MORIOKA Tomohiko <tomo@m17n.org>
7 ;; Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
8 ;; Yuuichi Teranishi <teranisi@gohome.org>
9 ;; Keywords: emulation, compatibility
11 ;; This file is part of APEL (A Portable Emacs Library).
13 ;; This program is free software; you can redistribute it and/or
14 ;; modify it under the terms of the GNU General Public License as
15 ;; published by the Free Software Foundation; either version 2, or (at
16 ;; your option) any later version.
18 ;; This program is distributed in the hope that it will be useful, but
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 ;; General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with this program; see the file COPYING. If not, write to the
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
30 ;; Note to APEL developers and APEL programmers:
32 ;; If old (v18) compiler is used, top-level macros are expanded at
33 ;; *load-time*, not compile-time. Therefore,
35 ;; (1) Definitions with `*-maybe' won't be compiled.
37 ;; (2) you cannot use macros defined with `defmacro-maybe' within function
38 ;; definitions in the same file.
39 ;; (`defmacro-maybe' is evaluated at load-time, therefore byte-compiler
40 ;; treats such use of macros as (unknown) functions and compiles them
41 ;; into function calls, which will cause errors at run-time.)
43 ;; (3) `eval-when-compile' and `eval-and-compile' are evaluated at
44 ;; load-time if used at top-level.
53 (fset 'defalias 'fset)
55 (defun byte-code-function-p (object)
56 "Return t if OBJECT is a byte-compiled function object."
57 (and (consp object) (consp (cdr object))
58 (let ((rest (cdr (cdr object)))
60 (if (stringp (car rest))
61 (setq rest (cdr rest)))
66 (eq (car elt) 'byte-code))
68 (setq rest (cdr rest)))))))
70 ;; (symbol-plist 'cyclic-function-indirection)
71 (put 'cyclic-function-indirection
73 '(cyclic-function-indirection error))
74 (put 'cyclic-function-indirection
76 "Symbol's chain of function indirections contains a loop")
78 ;; The following function definition is a direct translation of its
79 ;; C definition in emacs-20.4/src/data.c.
80 (defun indirect-function (object)
81 "Return the function at the end of OBJECT's function chain.
82 If OBJECT is a symbol, follow all function indirections and return the final
84 If OBJECT is not a symbol, just return it.
85 Signal a void-function error if the final symbol is unbound.
86 Signal a cyclic-function-indirection error if there is a loop in the
87 function chain of symbols."
92 (or (symbolp hare) (throw 'found hare))
93 (or (fboundp hare) (signal 'void-function (cons object nil)))
94 (setq hare (symbol-function hare))
95 (or (symbolp hare) (throw 'found hare))
96 (or (fboundp hare) (signal 'void-function (cons object nil)))
97 (setq hare (symbol-function hare))
99 (setq tortoise (symbol-function tortoise))
101 (if (eq hare tortoise)
102 (signal 'cyclic-function-indirection (cons object nil)))))
105 ;;; Emulate all functions and macros of emacs-20.3/lisp/byte-run.el.
106 ;;; (note: jwz's original compiler and XEmacs compiler have some more
107 ;;; macros; they are "nuked" by rms in FSF version.)
109 ;; Use `*-maybe' here because new byte-compiler may be installed.
110 (put 'inline 'lisp-indent-hook 0)
111 (defmacro-maybe inline (&rest body)
112 "Eval BODY forms sequentially and return value of last one.
114 This emulating macro does not support function inlining because old \(v18\)
115 compiler does not support inlining feature."
118 (put 'defsubst 'lisp-indent-hook 'defun)
119 (put 'defsubst 'edebug-form-spec 'defun)
120 (defmacro-maybe defsubst (name arglist &rest body)
121 "Define an inline function. The syntax is just like that of `defun'.
123 This emulating macro does not support function inlining because old \(v18\)
124 compiler does not support inlining feature."
125 (cons 'defun (cons name (cons arglist body))))
127 (defun-maybe make-obsolete (fn new)
128 "Make the byte-compiler warn that FUNCTION is obsolete.
129 The warning will say that NEW should be used instead.
130 If NEW is a string, that is the `use instead' message.
132 This emulating function does nothing because old \(v18\) compiler does not
133 support this feature."
134 (interactive "aMake function obsolete: \nxObsoletion replacement: ")
137 (defun-maybe make-obsolete-variable (var new)
138 "Make the byte-compiler warn that VARIABLE is obsolete,
139 and NEW should be used instead. If NEW is a string, then that is the
140 `use instead' message.
142 This emulating function does nothing because old \(v18\) compiler does not
143 support this feature."
144 (interactive "vMake variable obsolete: \nxObsoletion replacement: ")
147 (put 'dont-compile 'lisp-indent-hook 0)
148 (defmacro-maybe dont-compile (&rest body)
149 "Like `progn', but the body always runs interpreted \(not compiled\).
150 If you think you need this, you're probably making a mistake somewhere."
151 (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body)))))
153 (put 'eval-when-compile 'lisp-indent-hook 0)
154 (defmacro-maybe eval-when-compile (&rest body)
155 "Like progn, but evaluates the body at compile-time.
157 This emulating macro does not do compile-time evaluation at all because
158 of the limitation of old \(v18\) compiler."
161 (put 'eval-and-compile 'lisp-indent-hook 0)
162 (defmacro-maybe eval-and-compile (&rest body)
163 "Like progn, but evaluates the body at compile-time as well as at load-time.
165 This emulating macro does not do compile-time evaluation at all because
166 of the limitation of old \(v18\) compiler."
170 ;;; @ C primitives emulation.
173 (defun member (elt list)
174 "Return non-nil if ELT is an element of LIST. Comparison done with EQUAL.
175 The value is actually the tail of LIST whose car is ELT."
176 (while (and list (not (equal elt (car list))))
177 (setq list (cdr list)))
180 (defun delete (elt list)
181 "Delete by side effect any occurrences of ELT as a member of LIST.
182 The modified LIST is returned. Comparison is done with `equal'.
183 If the first member of LIST is ELT, deleting it is not a side effect;
184 it is simply using a different list.
185 Therefore, write `(setq foo (delete element foo))'
186 to be sure of changing the value of `foo'."
188 (if (equal elt (car list))
192 (while (and rrest (not (equal elt (car rrest))))
195 (setcdr rest (cdr rrest))
198 (defun default-boundp (symbol)
199 "Return t if SYMBOL has a non-void default value.
200 This is the value that is seen in buffers that do not have their own values
202 (condition-case error
204 (default-value symbol)
206 (void-variable nil)))
211 (defvar current-time-world-timezones
212 '(("PST" . -800)("PDT" . -700)("MST" . -700)
213 ("MDT" . -600)("CST" . -600)("CDT" . -500)
214 ("EST" . -500)("EDT" . -400)("AST" . -400)
215 ("NST" . -330)("UT" . +000)("GMT" . +000)
216 ("BST" . +100)("MET" . +100)("EET" . +200)
217 ("JST" . +900)("GMT+1" . +100)("GMT+2" . +200)
218 ("GMT+3" . +300)("GMT+4" . +400)("GMT+5" . +500)
219 ("GMT+6" . +600)("GMT+7" . +700)("GMT+8" . +800)
220 ("GMT+9" . +900)("GMT+10" . +1000)("GMT+11" . +1100)
221 ("GMT+12" . +1200)("GMT+13" . +1300)("GMT-1" . -100)
222 ("GMT-2" . -200)("GMT-3" . -300)("GMT-4" . -400)
223 ("GMT-5" . -500)("GMT-6" . -600)("GMT-7" . -700)
224 ("GMT-8" . -800)("GMT-9" . -900)("GMT-10" . -1000)
225 ("GMT-11" . -1100) ("GMT-12" . -1200))
226 "Time differentials of timezone from GMT in +-HHMM form.
227 Used in `current-time-zone' (Emacs 19 emulating function in poe-18.el).")
229 (defvar current-time-local-timezone nil
230 "*Local timezone name.
231 Used in `current-time-zone' (Emacs 19 emulating function in poe-18.el).")
233 (defun set-time-zone-rule (tz)
234 "Set the local time zone using TZ, a string specifying a time zone rule.
235 If TZ is nil, use implementation-defined default time zone information.
236 If TZ is t, use Universal Time."
239 (setq current-time-local-timezone tz))
241 (setq current-time-local-timezone "GMT"))
243 (setq current-time-local-timezone
245 ;; We use `date' command to get timezone information.
246 (call-process "date" nil (current-buffer) t)
247 (goto-char (point-min))
249 "^.*\\([A-Z][A-Z][A-Z]\\([^ \n\t]*\\)\\).*$")
250 (buffer-substring (match-beginning 1)
253 (defun current-time-zone (&optional specified-time)
254 "Return the offset and name for the local time zone.
255 This returns a list of the form (OFFSET NAME).
256 OFFSET is an integer number of seconds ahead of UTC (east of Greenwich).
257 A negative value means west of Greenwich.
258 NAME is a string giving the name of the time zone.
259 Optional argument SPECIFIED-TIME is ignored in this implementation.
260 Some operating systems cannot provide all this information to Emacs;
261 in this case, `current-time-zone' returns a list containing nil for
262 the data it can't find."
263 (let ((local-timezone (or current-time-local-timezone
265 (set-time-zone-rule nil)
266 current-time-local-timezone)))
267 timezone abszone seconds)
269 (or (cdr (assoc (upcase local-timezone)
270 current-time-world-timezones))
271 ;; "+900" style or nil.
274 (if (stringp timezone)
275 (setq timezone (string-to-int timezone)))
276 ;; Taking account of minute in timezone.
278 (setq abszone (abs timezone))
279 (setq seconds (* 60 (+ (* 60 (/ abszone 100)) (% abszone 100))))
280 (list (if (< timezone 0) (- seconds) seconds)
283 (or (fboundp 'si:current-time-string)
284 (fset 'si:current-time-string (symbol-function 'current-time-string)))
285 (defun current-time-string (&optional specified-time)
286 "Return the current time, as a human-readable string.
287 Programs can use this function to decode a time,
288 since the number of columns in each field is fixed.
289 The format is `Sun Sep 16 01:03:52 1973'.
290 If an argument SPECIFIED-TIME is given, it specifies a time to format
291 instead of the current time. The argument should have the form:
294 (HIGH LOW . IGNORED).
295 Thus, you can use times obtained from `current-time'
296 and from `file-attributes'."
297 (if (null specified-time)
298 (si:current-time-string)
299 (or (consp specified-time)
300 (error "Wrong type argument %s" specified-time))
301 (let ((high (car specified-time))
302 (low (cdr specified-time))
303 (offset (or (car (current-time-zone)) 0))
304 (mdays '(31 28 31 30 31 30 31 31 30 31 30 31))
305 (mnames '("Jan" "Feb" "Mar" "Apr" "May" "Jun"
306 "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"))
307 (wnames '("Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat"))
308 days dd yyyy lyear mm HH MM SS)
310 (setq low (car low)))
312 (error "Wrong type argument %s" high))
314 (error "Wrong type argument %s" low))
315 (setq low (+ low offset))
320 (while (or (> high 481)
327 (setq high (- high 481)
329 (if (and (zerop (% yyyy 4))
330 (or (not (zerop (% yyyy 100)))
331 (zerop (% yyyy 400))))
337 (setq high (- high 1)
339 (setq yyyy (1+ yyyy)))
341 (while (or (> high 1)
348 (setq high (- high 1)
353 (setq low (+ 65536 low)))
355 (setq lyear (and (zerop (% yyyy 4))
356 (or (not (zerop (% yyyy 100)))
357 (zerop (% yyyy 400)))))
358 (while (> (- dd (nth mm mdays)) 0)
359 (if (and (= mm 1) lyear)
361 (setq dd (- dd (nth mm mdays))))
363 (setq HH (/ low 3600)
367 (format "%s %s %2d %02d:%02d:%02d %4d"
369 (- (+ (* (1- yyyy) 365) (/ (1- yyyy) 400)
370 (/ (1- yyyy) 4)) (/ (1- yyyy) 100))) 7)
375 (defun current-time ()
376 "Return the current time, as the number of seconds since 1970-01-01 00:00:00.
377 The time is returned as a list of three integers. The first has the
378 most significant 16 bits of the seconds, while the second has the
379 least significant 16 bits. The third integer gives the microsecond
382 The microsecond count is zero on systems that do not provide
383 resolution finer than a second."
384 (let* ((str (current-time-string))
385 (yyyy (string-to-int (substring str 20 24)))
386 (mm (length (member (substring str 4 7)
387 '("Dec" "Nov" "Oct" "Sep" "Aug" "Jul"
388 "Jun" "May" "Apr" "Mar" "Feb" "Jan"))))
389 (dd (string-to-int (substring str 8 10)))
390 (HH (string-to-int (substring str 11 13)))
391 (MM (string-to-int (substring str 14 16)))
392 (SS (string-to-int (substring str 17 19)))
393 (offset (or (car (current-time-zone)) 0))
396 (setq ct1 0 ct2 0 i1 0 i2 0)
397 (setq year (- yyyy 1970))
405 (setq year (- yyyy 1))
406 (setq uru (- (+ (- (/ year 4) (/ year 100))
420 (setq dn (+ dd (* 31 (1- mm))))
422 (setq dn (+ (- dn (/ (+ 23 (* 4 mm)) 10))
423 (if (and (zerop (% yyyy 4))
424 (or (not (zerop (% yyyy 100)))
425 (zerop (% yyyy 400))))
437 (setq ct1 (+ (+ (+ ct1 i1) (/ ct2 65536))
438 (/ (+ (* HH 3600) (* MM 60) SS)
440 ct2 (+ (+ i2 (% ct2 65536))
441 (% (+ (* HH 3600) (* MM 60) SS)
443 (while (< (- ct2 offset) 0)
446 (setq ct2 (- ct2 offset))
452 ;;; @@ Floating point numbers.
455 (defalias 'numberp 'integerp)
458 "Return the absolute value of ARG."
459 (if (< arg 0) (- arg) arg))
461 (defun floor (arg &optional divisor)
462 "Return the largest integer no grater than ARG.
463 With optional DIVISOR, return the largest integer no greater than ARG/DIVISOR."
467 (- (/ (- divisor 1 arg) divisor))
470 ;;; @ Basic lisp subroutines.
473 (defmacro lambda (&rest cdr)
474 "Return a lambda expression.
475 A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is
476 self-quoting; the result of evaluating the lambda expression is the
477 expression itself. The lambda expression may then be treated as a
478 function, i.e., stored as the function value of a symbol, passed to
479 funcall or mapcar, etc.
481 ARGS should take the same form as an argument list for a `defun'.
482 DOCSTRING is an optional documentation string.
483 If present, it should describe how to call the function.
484 But documentation strings are usually not useful in nameless functions.
485 INTERACTIVE should be a call to the function `interactive', which see.
486 It may also be omitted.
487 BODY should be a list of lisp expressions."
488 ;; Note that this definition should not use backquotes; subr.el should not
489 ;; depend on backquote.el.
490 (list 'function (cons 'lambda cdr)))
492 (defun force-mode-line-update (&optional all)
493 "Force the mode-line of the current buffer to be redisplayed.
494 With optional non-nil ALL, force redisplay of all mode-lines."
495 (if all (save-excursion (set-buffer (other-buffer))))
496 (set-buffer-modified-p (buffer-modified-p)))
498 (defalias 'set-match-data 'store-match-data)
500 (defvar save-match-data-internal)
502 ;; We use save-match-data-internal as the local variable because
503 ;; that works ok in practice (people should not use that variable elsewhere).
504 (defmacro save-match-data (&rest body)
505 "Execute the BODY forms, restoring the global value of the match data."
506 (` (let ((save-match-data-internal (match-data)))
507 (unwind-protect (progn (,@ body))
508 (set-match-data save-match-data-internal)))))
511 ;;; @ Basic editing commands.
514 ;; 18.55 does not have these variables.
515 (defvar buffer-undo-list nil)
516 (defvar-maybe auto-fill-function nil)
517 (defvar-maybe unread-command-event nil)
518 (defvar-maybe unread-command-events nil)
520 (defalias 'buffer-disable-undo 'buffer-flush-undo)
521 (defalias 'insert-and-inherit 'insert)
522 (defalias 'insert-before-markers-and-inherit 'insert-before-markers)
523 (defalias 'number-to-string 'int-to-string)
525 (defun generate-new-buffer-name (name &optional ignore)
526 "Return a string that is the name of no existing buffer based on NAME.
527 If there is no live buffer named NAME, then return NAME.
528 Otherwise modify name by appending `<NUMBER>', incrementing NUMBER
529 until an unused name is found, and then return that name.
530 Optional second argument IGNORE specifies a name that is okay to use
531 \(if it is in the sequence to be tried\)
532 even if a buffer with that name exists."
533 (if (get-buffer name)
535 (while (get-buffer (setq new (format "%s<%d>" name n)))
540 (or (fboundp 'si:mark)
541 (fset 'si:mark (symbol-function 'mark)))
542 (defun mark (&optional force)
545 (defun-maybe window-minibuffer-p (&optional window)
546 "Return non-nil if WINDOW is a minibuffer window."
547 (eq (or window (selected-window)) (minibuffer-window)))
549 (defun-maybe window-live-p (obj)
550 "Returns t if OBJECT is a window which is currently visible."
552 (or (eq obj (minibuffer-window))
553 (eq obj (get-buffer-window (window-buffer obj))))))
555 ;; Add optinal argument `hist'
556 (or (fboundp 'si:read-from-minibuffer)
558 (fset 'si:read-from-minibuffer (symbol-function 'read-from-minibuffer))
559 (defun read-from-minibuffer (prompt &optional
560 initial-contents keymap read hist)
562 "Read a string from the minibuffer, prompting with string PROMPT.
563 If optional second arg INITIAL-CONTENTS is non-nil, it is a string
564 to be inserted into the minibuffer before reading input.
565 If INITIAL-CONTENTS is (STRING . POSITION), the initial input
566 is STRING, but point is placed at position POSITION in the minibuffer.
567 Third arg KEYMAP is a keymap to use whilst reading;
568 if omitted or nil, the default is `minibuffer-local-map'.
569 If fourth arg READ is non-nil, then interpret the result as a lisp object
570 and return that object:
571 in other words, do `(car (read-from-string INPUT-STRING))'
572 Fifth arg HIST is ignored in this implementatin."
573 (si:read-from-minibuffer prompt initial-contents keymap read))))
575 ;; Add optional argument `frame'.
576 (or (fboundp 'si:get-buffer-window)
578 (fset 'si:get-buffer-window (symbol-function 'get-buffer-window))
579 (defun get-buffer-window (buffer &optional frame)
580 "Return a window currently displaying BUFFER, or nil if none.
581 Optional argunemt FRAME is ignored in this implementation."
582 (si:get-buffer-window buffer))))
584 ;;; @@ Environment variables.
587 (autoload 'setenv "env"
588 "Set the value of the environment variable named VARIABLE to VALUE.
589 VARIABLE should be a string. VALUE is optional; if not provided or is
590 `nil', the environment variable VARIABLE will be removed.
591 This function works by modifying `process-environment'."
595 ;;; @ File input and output commands.
598 (defvar data-directory exec-directory)
600 ;; In 18.55, `call-process' does not return exit status.
601 (defun file-executable-p (filename)
602 "Return t if FILENAME can be executed by you.
603 For a directory, this means you can access files in that directory."
604 (if (file-exists-p filename)
605 (let ((process (start-process "test" nil "test" "-x" filename)))
606 (while (eq 'run (process-status process)))
607 (zerop (process-exit-status process)))))
609 (defun make-directory-internal (dirname)
610 "Create a directory. One argument, a file name string."
611 (let ((dir (expand-file-name dirname)))
612 (if (file-exists-p dir)
613 (error "Creating directory: %s is already exist" dir)
614 (call-process "mkdir" nil nil nil dir))))
616 (defun make-directory (dir &optional parents)
617 "Create the directory DIR and any nonexistent parent dirs.
618 The second (optional) argument PARENTS says whether
619 to create parent directories if they don't exist."
620 (let ((len (length dir))
623 (while (and (< p len) (string-match "[^/]*/?" dir p))
624 (setq p1 (match-end 0))
627 (setq path (substring dir 0 p1))
628 (if (not (file-directory-p path))
629 (cond ((file-exists-p path)
630 (error "Creating directory: %s is not directory" path))
632 (error "Creating directory: %s is not exist" path))
634 (make-directory-internal path))))
636 (make-directory-internal dir)))
638 (defun parse-colon-path (cd-path)
639 "Explode a colon-separated list of paths into a string list."
641 (let (cd-prefix cd-list (cd-start 0) cd-colon)
642 (setq cd-path (concat cd-path path-separator))
643 (while (setq cd-colon (string-match path-separator cd-path cd-start))
646 (list (if (= cd-start cd-colon)
648 (substitute-in-file-name
649 (file-name-as-directory
650 (substring cd-path cd-start cd-colon)))))))
651 (setq cd-start (+ cd-colon 1)))
654 (defun file-relative-name (filename &optional directory)
655 "Convert FILENAME to be relative to DIRECTORY (default: default-directory)."
656 (setq filename (expand-file-name filename)
657 directory (file-name-as-directory (expand-file-name
658 (or directory default-directory))))
660 (while (not (string-match (concat "^" (regexp-quote directory)) filename))
661 (setq directory (file-name-directory (substring directory 0 -1))
662 ancestor (concat "../" ancestor)))
663 (concat ancestor (substring filename (match-end 0)))))
665 (or (fboundp 'si:directory-files)
666 (fset 'si:directory-files (symbol-function 'directory-files)))
667 (defun directory-files (directory &optional full match nosort)
668 "Return a list of names of files in DIRECTORY.
669 There are three optional arguments:
670 If FULL is non-nil, return absolute file names. Otherwise return names
671 that are relative to the specified directory.
672 If MATCH is non-nil, mention only file names that match the regexp MATCH.
673 If NOSORT is dummy for compatibility."
674 (si:directory-files directory full match))
678 (or (fboundp 'si:accept-process-output)
680 (fset 'si:accept-process-output (symbol-function 'accept-process-output))
681 (defun accept-process-output (&optional process timeout timeout-msecs)
682 "Allow any pending output from subprocesses to be read by Emacs.
683 It is read into the process' buffers or given to their filter functions.
684 Non-nil arg PROCESS means do not return until some output has been received
685 from PROCESS. Nil arg PROCESS means do not return until some output has
686 been received from any process.
687 TIMEOUT and TIMEOUT-MSECS are ignored in this implementation."
688 (si:accept-process-output process))))
693 ;; In Emacs 20.4, these functions are defined in src/textprop.c.
694 (defun text-properties-at (position &optional object))
695 (defun get-text-property (position prop &optional object))
696 (defun get-char-property (position prop &optional object))
697 (defun next-property-change (position &optional object limit))
698 (defun next-single-property-change (position prop &optional object limit))
699 (defun previous-property-change (position &optional object limit))
700 (defun previous-single-property-change (position prop &optional object limit))
701 (defun add-text-properties (start end properties &optional object))
702 (defun put-text-property (start end property value &optional object))
703 (defun set-text-properties (start end properties &optional object))
704 (defun remove-text-properties (start end properties &optional object))
705 (defun text-property-any (start end property value &optional object))
706 (defun text-property-not-all (start end property value &optional object))
707 ;; the following two functions are new in v20.
708 (defun next-char-property-change (position &optional object))
709 (defun previous-char-property-change (position &optional object))
710 ;; the following two functions are obsolete.
711 ;; (defun erase-text-properties (start end &optional object)
712 ;; (defun copy-text-properties (start end src pos dest &optional prop)
720 (defvar emu:available-face-attribute-alist
722 ;;(bold . inversed-region)
723 (italic . underlined-region)
724 (underline . underlined-region)))
726 ;; by YAMATE Keiichirou 1994/10/28
727 (defun attribute-add-narrow-attribute (attr from to)
728 (or (consp (symbol-value attr))
730 (let* ((attr-value (symbol-value attr))
731 (len (car attr-value))
734 (while (and (< posfrom len)
735 (> from (nth posfrom attr-value)))
736 (setq posfrom (1+ posfrom)))
738 (while (and (< posto len)
739 (> to (nth posto attr-value)))
740 (setq posto (1+ posto)))
741 (if (= posto posfrom)
742 (if (= (% posto 2) 1)
744 (= to (nth posto attr-value)))
745 (set-marker (nth posto attr-value) from)
746 (setcdr (nthcdr (1- posfrom) attr-value)
747 (cons (set-marker-type (set-marker (make-marker)
750 (cons (set-marker-type
751 (set-marker (make-marker)
754 (nthcdr posto attr-value))))
755 (setcar attr-value (+ len 2))))
756 (if (= (% posfrom 2) 0)
757 (setq posfrom (1- posfrom))
758 (set-marker (nth posfrom attr-value) from))
759 (if (= (% posto 2) 0)
761 (setq posto (1- posto))
762 (set-marker (nth posto attr-value) to))
763 (setcdr (nthcdr posfrom attr-value)
764 (nthcdr posto attr-value)))))
766 (defalias 'make-overlay 'cons)
768 (defun overlay-put (overlay prop value)
769 (let ((ret (and (eq prop 'face)
770 (assq value emu:available-face-attribute-alist))))
772 (attribute-add-narrow-attribute (cdr ret)
773 (car overlay)(cdr overlay))))))
775 (defun make-overlay (beg end &optional buffer type))
776 (defun overlay-put (overlay prop value))))
778 (defun overlay-buffer (overlay))
785 (product-provide (provide 'poe-18) (require 'apel-ver))
787 ;;; poe-18.el ends here