update.
[elisp/apel.git] / poe-19.el
1 ;;; poe-19.el --- poe API implementation for Emacs 19.*
2
3 ;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: emulation, compatibility
7
8 ;; This file is part of APEL (A Portable Emacs Library).
9
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
14
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 ;; General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Code:
26
27 ;;; @ face
28 ;;;
29
30 (defun-maybe find-face (face)
31   (car (memq face (face-list)))
32   )
33
34
35 ;;; @ visible/invisible
36 ;;;
37
38 (defmacro enable-invisible ())
39
40 (defmacro end-of-invisible ())
41
42 (defun invisible-region (start end)
43   (if (save-excursion
44         (goto-char (1- end))
45         (eq (following-char) ?\n)
46         )
47       (setq end (1- end))
48     )
49   (put-text-property start end 'invisible t)
50   )
51
52 (defun visible-region (start end)
53   (put-text-property start end 'invisible nil)
54   )
55
56 (defun invisible-p (pos)
57   (get-text-property pos 'invisible)
58   )
59
60 (defun next-visible-point (pos)
61   (save-excursion
62     (goto-char (next-single-property-change pos 'invisible))
63     (if (eq (following-char) ?\n)
64         (forward-char)
65       )
66     (point)))
67
68
69 ;;; @ string
70 ;;;
71
72 (defmacro char-list-to-string (char-list)
73   "Convert list of character CHAR-LIST to string."
74   (` (mapconcat (function char-to-string)
75                 (, char-list)
76                 "")))
77
78
79 ;;; @ end
80 ;;;
81
82 (provide 'poe-19)
83
84 ;;; poe-19.el ends here