e4da829255caa62b80e0fabcb2e6a23195d47327
[elisp/apel.git] / inv-23.el
1 ;;; inv-23.el --- invisible feature implementation for Emacs 23 or later
2
3 ;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: invisible, text-property, region, Emacs 23
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., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
24
25 ;;; Code:
26
27 (require 'poe)
28
29 (defun enable-invisible ())
30 (defun disable-invisible ())
31 (defalias 'end-of-invisible 'disable-invisible)
32 (make-obsolete 'end-of-invisible 'disable-invisible)
33
34 (defun invisible-region (start end)
35   (if (save-excursion
36         (goto-char (1- end))
37         (eq (following-char) ?\n))
38       (setq end (1- end)))
39   (put-text-property start end 'invisible t))
40
41 (defun visible-region (start end)
42   (put-text-property start end 'invisible nil))
43
44 (defun next-visible-point (pos)
45   (if (setq pos (next-single-property-change pos 'invisible))
46       (if (eq ?\n (char-after pos))
47           (1+ pos)
48         pos)
49     (point-max)))
50
51
52 ;;; @ end
53 ;;;
54
55 (require 'product)
56 (product-provide (provide 'inv-23) (require 'apel-ver))
57
58 ;;; inv-23.el ends here