home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.004 / xemacs-1 / xemacs-19.13 / lisp / hyperbole / kotl / kprop-em19.el < prev    next >
Encoding:
Text File  |  1995-07-08  |  2.1 KB  |  66 lines

  1. ;;!emacs
  2. ;;
  3. ;; FILE:         kprop-em19.el
  4. ;; SUMMARY:      Koutline text property handling under Emacs 19.
  5. ;; USAGE:        GNU Emacs Lisp Library
  6. ;; KEYWORDS:     outlines, wp
  7. ;;
  8. ;; AUTHOR:       Bob Weiner
  9. ;;
  10. ;; ORIG-DATE:    7/27/93
  11. ;; LAST-MOD:      7-Jul-95 at 14:04:32 by Bob Weiner
  12. ;;
  13. ;; This file is part of Hyperbole.
  14. ;; Available for use and distribution under the same terms as GNU Emacs.
  15. ;;
  16. ;; Copyright (C) 1993-1995, Free Software Foundation, Inc.
  17. ;; Developed with support from Motorola Inc.
  18. ;;
  19. ;; DESCRIPTION:  
  20. ;; DESCRIP-END.
  21.  
  22. ;;; ************************************************************************
  23. ;;; Other required Elisp libraries
  24. ;;; ************************************************************************
  25.  
  26. (require 'hversion)
  27.  
  28. ;;; ************************************************************************
  29. ;;; Public functions
  30. ;;; ************************************************************************
  31.  
  32. (fset 'kproperty:get 'get-text-property)
  33.  
  34. (defun kproperty:map (function property value)
  35.   "Apply FUNCTION to each PROPERTY `eq' to VALUE in the current buffer."
  36.   (let ((result)
  37.     (start (point-min)))
  38.     (while (setq start
  39.          (text-property-any start (point-max) property value))
  40.       (setq result (cons (funcall function (text-properties-at start))
  41.              result)))
  42.     (nreverse result)))
  43.  
  44. (fset 'kproperty:next-single-change 'next-single-property-change)
  45.  
  46. (fset 'kproperty:previous-single-change 'previous-single-property-change)
  47.  
  48. (fset 'kproperty:properties 'text-properties-at)
  49.  
  50. (fset 'kproperty:put 'put-text-property)
  51. (defun kproperty:put (start end prop value &optional object)
  52.   "Set one property of the text from START to END.
  53. The third and fourth arguments PROP and VALUE specify the property to add.
  54. The optional fifth argument, OBJECT, is the string or buffer containing the
  55. text.
  56.  
  57. Text inserted before or after this region does not inherit PROP."
  58.   (add-text-properties
  59.    start end (list prop value 'rear-nonsticky (list prop)) object))
  60.  
  61. (fset 'kproperty:remove 'remove-text-properties)
  62.  
  63. (defun kproperty:set (property value)
  64.   "Set PROPERTY of character at point to VALUE."
  65.   (kproperty:put (point) (min (+ 2 (point)) (point-max)) property value))
  66.