Hi APEL developers, Forwarding a bug report from Debian.org:
Bug#557922: apel: inv-19.el:(invisible-p) overrides built-in invisible-p http://bugs.debian.org/557922 | From: Kan-Ru Chen | Date: Wed, 25 Nov 2009 17:25:54 +0800 | | invisible-p defined in inv-19.el overrides the default invisible-p in | GNU Emacs. The built-in one is available since 2007-08-25 and now is | implemented in C. | | The built-in one can accept POS-OR-PROP as it's first argument, but the | one in APEL can only accept mark or pos. | | Since the built-in is more powerful, I think APEL should not override | it. | From: David Maus | Date: Sat, 13 Feb 2010 14:23:46 +0100 | | Attached patch adds a new file "inv-23.el" that is just a copy of | "inv-19.el" with the offending (re)definition of `invisible-p' | removed, makes "invisible.el" and "EMU-ELS" aware of this file for | Emacs >= 23. | | 0001-Prevent-overriding-the-primitiv-invisible-p-in-Emacs.patch Thanks, -- Tatsuya Kinoshita
>From cccd6e702c09f45a385e39ad556eb00462235ef4 Mon Sep 17 00:00:00 2001 From: David Maus <maus.da...@gmail.com> Date: Sat, 13 Feb 2010 13:09:56 +0100 Subject: [PATCH] Prevent overriding the primitiv `invisible-p' in Emacs23. Check for Emacs version >= 23 in invisible.el and load new file inv-23.el accordingly. inv-23.el is a simple copy of inv-19.el with the function definition of `invisible-p' removed and version information replaced. Made the build file (EMU-ELS) aware of the invisible module for Emacs >= 23 as well. --- EMU-ELS | 3 +++ inv-23.el | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ invisible.el | 2 ++ 3 files changed, 63 insertions(+), 0 deletions(-) create mode 100644 inv-23.el diff --git a/EMU-ELS b/EMU-ELS index e8575a4..f0b14aa 100644 --- a/EMU-ELS +++ b/EMU-ELS @@ -180,6 +180,9 @@ ((featurep 'xemacs) ;; XEmacs. '(inv-xemacs invisible)) + ((>= emacs-major-version 23) + ;; Emacs 23 and later + '(inv-23 invisible)) ((>= emacs-major-version 19) ;; Emacs 19 and later. '(inv-19 invisible)) diff --git a/inv-23.el b/inv-23.el new file mode 100644 index 0000000..e4da829 --- /dev/null +++ b/inv-23.el @@ -0,0 +1,58 @@ +;;; inv-23.el --- invisible feature implementation for Emacs 23 or later + +;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <mori...@jaist.ac.jp> +;; Keywords: invisible, text-property, region, Emacs 23 + +;; 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., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poe) + +(defun enable-invisible ()) +(defun disable-invisible ()) +(defalias 'end-of-invisible 'disable-invisible) +(make-obsolete 'end-of-invisible 'disable-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 next-visible-point (pos) + (if (setq pos (next-single-property-change pos 'invisible)) + (if (eq ?\n (char-after pos)) + (1+ pos) + pos) + (point-max))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'inv-23) (require 'apel-ver)) + +;;; inv-23.el ends here diff --git a/invisible.el b/invisible.el index c210ebc..a8c7548 100644 --- a/invisible.el +++ b/invisible.el @@ -27,6 +27,8 @@ (cond ((featurep 'xemacs) (require 'inv-xemacs)) + ((>= emacs-major-version 23) + (require 'inv-23)) ((>= emacs-major-version 19) (require 'inv-19)) (t -- 1.6.6.1