| 1 | ;;; inv-xemacs.el --- invisible feature implementation for XEmacs |
|---|
| 2 | |
|---|
| 3 | ;; Copyright (C) 1995 Free Software Foundation, Inc. |
|---|
| 4 | ;; Copyright (C) 1995,1996,1997 MORIOKA Tomohiko |
|---|
| 5 | |
|---|
| 6 | ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> |
|---|
| 7 | ;; Keywords: invisible, text-property, region, XEmacs |
|---|
| 8 | |
|---|
| 9 | ;; This file is part of APEL (A Portable Emacs Library). |
|---|
| 10 | |
|---|
| 11 | ;; This program is free software; you can redistribute it and/or |
|---|
| 12 | ;; modify it under the terms of the GNU General Public License as |
|---|
| 13 | ;; published by the Free Software Foundation; either version 2, or (at |
|---|
| 14 | ;; your option) any later version. |
|---|
| 15 | |
|---|
| 16 | ;; This program is distributed in the hope that it will be useful, but |
|---|
| 17 | ;; WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 19 | ;; General Public License for more details. |
|---|
| 20 | |
|---|
| 21 | ;; You should have received a copy of the GNU General Public License |
|---|
| 22 | ;; along with XEmacs; see the file COPYING. If not, write to the Free |
|---|
| 23 | ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
|---|
| 24 | ;; 02111-1307, USA. |
|---|
| 25 | |
|---|
| 26 | ;;; Code: |
|---|
| 27 | |
|---|
| 28 | (require 'poe) |
|---|
| 29 | |
|---|
| 30 | (defun enable-invisible ()) |
|---|
| 31 | (defun disable-invisible ()) |
|---|
| 32 | (defalias 'end-of-invisible 'disable-invisible) |
|---|
| 33 | (make-obsolete 'end-of-invisible 'disable-invisible) |
|---|
| 34 | |
|---|
| 35 | (defun invisible-region (start end) |
|---|
| 36 | (if (save-excursion |
|---|
| 37 | (goto-char start) |
|---|
| 38 | (eq (following-char) ?\n)) |
|---|
| 39 | (setq start (1+ start))) |
|---|
| 40 | (put-text-property start end 'invisible t)) |
|---|
| 41 | |
|---|
| 42 | (defun visible-region (start end) |
|---|
| 43 | (put-text-property start end 'invisible nil)) |
|---|
| 44 | |
|---|
| 45 | (defun invisible-p (pos) |
|---|
| 46 | (if (save-excursion |
|---|
| 47 | (goto-char pos) |
|---|
| 48 | (eq (following-char) ?\n)) |
|---|
| 49 | (setq pos (1+ pos))) |
|---|
| 50 | (get-text-property pos 'invisible)) |
|---|
| 51 | |
|---|
| 52 | (defun next-visible-point (pos) |
|---|
| 53 | (save-excursion |
|---|
| 54 | (if (save-excursion |
|---|
| 55 | (goto-char pos) |
|---|
| 56 | (eq (following-char) ?\n)) |
|---|
| 57 | (setq pos (1+ pos))) |
|---|
| 58 | (or (next-single-property-change pos 'invisible) |
|---|
| 59 | (point-max)))) |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | ;;; @ end |
|---|
| 63 | ;;; |
|---|
| 64 | |
|---|
| 65 | (require 'product) |
|---|
| 66 | (product-provide (provide 'inv-xemacs) (require 'apel-ver)) |
|---|
| 67 | |
|---|
| 68 | ;;; inv-xemacs.el ends here |
|---|