(let ((poe-modules '(poe))
(poem-modules '(poem))
(mcs-modules '(mcharset))
+ (invisible-modules '(invisible))
pccl-modules)
- (setq poe-modules (cons (cond ((featurep 'xemacs)
- 'poe-xemacs)
- ((>= emacs-major-version 19)
- 'poe-19)
- (t
- 'poe-18))
- poe-modules))
-
+ (cond ((featurep 'xemacs)
+ (setq poe-modules (cons 'poe-xemacs poe-modules)
+ invisible-modules (cons 'inv-xemacs invisible-modules))
+ )
+ ((>= emacs-major-version 19)
+ (setq poe-modules (cons 'poe-19 poe-modules)
+ invisible-modules (cons 'inv-19 invisible-modules))
+ )
+ (t
+ (setq poe-modules (cons 'poe-18 poe-modules)
+ invisible-modules (cons 'inv-18 invisible-modules))
+ ))
(cond ((featurep 'mule)
(cond ((featurep 'xemacs)
(setq poem-modules (cons 'poem-xm (cons 'poem-20
))
(setq emu-modules (append poe-modules poem-modules
- mcs-modules pccl-modules
+ mcs-modules invisible-modules
+ pccl-modules
emu-modules))
(setq emu-modules (cons 'broken emu-modules))
)
(require 'poem)
(require 'mcharset)
+(require 'invisible)
(defsubst char-list-to-string (char-list)
"Convert list of character CHAR-LIST to string."
--- /dev/null
+;;; inv-18.el --- invisible feature implementation for Emacs 18
+
+;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Keywords: invisible, text-property, region, Emacs 18
+
+;; This file is part of APEL (A Portable Emacs Library).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(defmacro enable-invisible ()
+ (`
+ (progn
+ (make-local-variable 'original-selective-display)
+ (setq original-selective-display selective-display)
+ (setq selective-display t)
+ )))
+
+(defmacro end-of-invisible ()
+ (` (setq selective-display
+ (if (boundp 'original-selective-display)
+ original-selective-display))
+ ))
+
+(defun invisible-region (start end)
+ (let ((buffer-read-only nil) ;Okay even if write protected.
+ (modp (buffer-modified-p)))
+ (if (save-excursion
+ (goto-char (1- end))
+ (eq (following-char) ?\n)
+ )
+ (setq end (1- end))
+ )
+ (unwind-protect
+ (subst-char-in-region start end ?\n ?\^M t)
+ (set-buffer-modified-p modp)
+ )))
+
+(defun visible-region (start end)
+ (let ((buffer-read-only nil) ;Okay even if write protected.
+ (modp (buffer-modified-p)))
+ (unwind-protect
+ (subst-char-in-region start end ?\^M ?\n t)
+ (set-buffer-modified-p modp)
+ )))
+
+(defun invisible-p (pos)
+ (save-excursion
+ (goto-char pos)
+ (eq (following-char) ?\^M)
+ ))
+
+(defun next-visible-point (pos)
+ (save-excursion
+ (goto-char pos)
+ (end-of-line)
+ (if (eq (following-char) ?\n)
+ (forward-char)
+ )
+ (point)
+ ))
+
+
+;;; @ end
+;;;
+
+(provide 'inv-18)
+
+;;; inv-18.el ends here
--- /dev/null
+;;; inv-19.el --- invisible feature implementation for Emacs 19 or later
+
+;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Keywords: invisible, text-property, region, Emacs 19
+
+;; This file is part of APEL (A Portable Emacs Library).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(defmacro enable-invisible ())
+
+(defmacro end-of-invisible ())
+
+(defun invisible-region (start end)
+ (if (save-excursion
+ (goto-char (1- end))
+ (eq (following-char) ?\n)
+ )
+ (setq end (1- end))
+ )
+ (put-text-property start end 'invisible t)
+ )
+
+(defun visible-region (start end)
+ (put-text-property start end 'invisible nil)
+ )
+
+(defun invisible-p (pos)
+ (get-text-property pos 'invisible)
+ )
+
+(defun next-visible-point (pos)
+ (save-excursion
+ (goto-char (next-single-property-change pos 'invisible))
+ (if (eq (following-char) ?\n)
+ (forward-char)
+ )
+ (point)))
+
+
+;;; @ end
+;;;
+
+(provide 'inv-19)
+
+;;; inv-19.el ends here
--- /dev/null
+;;; inv-xemacs.el --- invisible feature implementation for XEmacs
+
+;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997 MORIOKA Tomohiko
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Keywords: invisible, text-property, region, XEmacs
+
+;; This file is part of APEL (A Portable Emacs Library).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING. If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Code:
+
+(defmacro enable-invisible ())
+
+(defmacro end-of-invisible ())
+
+(defun invisible-region (start end)
+ (if (save-excursion
+ (goto-char start)
+ (eq (following-char) ?\n))
+ (setq start (1+ start))
+ )
+ (put-text-property start end 'invisible t)
+ )
+
+(defun visible-region (start end)
+ (put-text-property start end 'invisible nil)
+ )
+
+(defun invisible-p (pos)
+ (if (save-excursion
+ (goto-char pos)
+ (eq (following-char) ?\n))
+ (setq pos (1+ pos))
+ )
+ (get-text-property pos 'invisible)
+ )
+
+(defun next-visible-point (pos)
+ (save-excursion
+ (if (save-excursion
+ (goto-char pos)
+ (eq (following-char) ?\n))
+ (setq pos (1+ pos))
+ )
+ (or (next-single-property-change pos 'invisible)
+ (point-max))))
+
+
+;;; @ end
+;;;
+
+(provide 'inv-xemacs)
+
+;;; inv-xemacs.el ends here
--- /dev/null
+;;; invisible.el --- hide region
+
+;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Keywords: invisible, text-property, region
+
+;; This file is part of APEL (A Portable Emacs Library).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(require 'poe)
+
+(cond ((featurep 'xemacs)
+ (require 'inv-xemacs)
+ )
+ ((>= emacs-major-version 19)
+ (require 'inv-19)
+ )
+ (t
+ (require 'inv-18)
+ ))
+
+
+;;; @ end
+;;;
+
+(provide 'invisible)
+
+;;; invisible.el ends here
)
-;;; @ visible/invisible
-;;;
-
-(defmacro enable-invisible ())
-
-(defmacro end-of-invisible ())
-
-(defun invisible-region (start end)
- (if (save-excursion
- (goto-char (1- end))
- (eq (following-char) ?\n)
- )
- (setq end (1- end))
- )
- (put-text-property start end 'invisible t)
- )
-
-(defun visible-region (start end)
- (put-text-property start end 'invisible nil)
- )
-
-(defun invisible-p (pos)
- (get-text-property pos 'invisible)
- )
-
-(defun next-visible-point (pos)
- (save-excursion
- (goto-char (next-single-property-change pos 'invisible))
- (if (eq (following-char) ?\n)
- (forward-char)
- )
- (point)))
-
-
;;; @ end
;;;
))
-;;; @ visible/invisible
-;;;
-
-(defmacro enable-invisible ())
-
-(defmacro end-of-invisible ())
-
-(defun invisible-region (start end)
- (if (save-excursion
- (goto-char start)
- (eq (following-char) ?\n))
- (setq start (1+ start))
- )
- (put-text-property start end 'invisible t)
- )
-
-(defun visible-region (start end)
- (put-text-property start end 'invisible nil)
- )
-
-(defun invisible-p (pos)
- (if (save-excursion
- (goto-char pos)
- (eq (following-char) ?\n))
- (setq pos (1+ pos))
- )
- (get-text-property pos 'invisible)
- )
-
-(defun next-visible-point (pos)
- (save-excursion
- (if (save-excursion
- (goto-char pos)
- (eq (following-char) ?\n))
- (setq pos (1+ pos))
- )
- (or (next-single-property-change pos 'invisible)
- (point-max))))
-
-
;;; @ dired
;;;