diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-14 22:22:36 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-14 22:22:36 -0200 |
commit | 42f302ab616264348a22107d6fb4d41632ec52a2 (patch) | |
tree | dbfc22d523c6954c553f5773d3bb17929d2d3726 /sx.el | |
parent | 22f86c35499f994f0eb7532b8eb27b0d990d889d (diff) |
Move sx-question-mode--goto-property-change to sx.el
Diffstat (limited to 'sx.el')
-rw-r--r-- | sx.el | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -259,6 +259,21 @@ whenever BODY evaluates to nil." :filter (lambda (&optional _) (when (progn ,@body) ,def))))) +(defun sx--goto-property-change (prop &optional direction) + "Move forward to the next change of text-property PROP. +Return the new value of PROP at point. + +If DIRECTION is negative, move backwards instead." + (let ((func (if (and (numberp direction) + (< direction 0)) + #'previous-single-property-change + #'next-single-property-change)) + (limit (if (and (numberp direction) + (< direction 0)) + (point-min) (point-max)))) + (goto-char (funcall func (point) prop nil limit)) + (get-text-property (point) prop))) + ;;; Printing request data (defvar sx--overlays nil |