1 ;;; inv-18.el --- invisible feature implementation for Emacs 18
3 ;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: invisible, text-property, region, Emacs 18
8 ;; This file is part of APEL (A Portable Emacs Library).
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.
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.
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.
29 (defun enable-invisible ()
30 (make-local-variable 'original-selective-display)
31 (setq original-selective-display selective-display)
32 (setq selective-display t))
34 (defun disable-invisible ()
35 (setq selective-display
36 (and (boundp 'original-selective-display)
37 original-selective-display)))
38 (defalias 'end-of-invisible 'disable-invisible)
39 (make-obsolete 'end-of-invisible 'disable-invisible)
41 (defun invisible-region (start end)
42 (let ((buffer-read-only nil)
43 (modp (buffer-modified-p)))
46 (eq (following-char) ?\n))
49 (subst-char-in-region start end ?\n ?\r t)
50 (set-buffer-modified-p modp))))
52 (defun visible-region (start end)
53 (let ((buffer-read-only nil)
54 (modp (buffer-modified-p)))
56 (subst-char-in-region start end ?\r ?\n t)
57 (set-buffer-modified-p modp))))
59 (defun invisible-p (pos)
62 (eq (following-char) ?\r)))
64 (defun next-visible-point (pos)
68 (if (eq (following-char) ?\n)
77 (product-provide (provide 'inv-18) (require 'apel-ver))
79 ;;; inv-18.el ends here