From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#33664: 26.1; Document vars and functions in `cursor-sensor.el' Date: Sun, 09 Dec 2018 09:01:02 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1544364010 27102 195.159.176.226 (9 Dec 2018 14:00:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2018 14:00:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 33664@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 09 15:00:06 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVzcq-0006tI-2A for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Dec 2018 15:00:04 +0100 Original-Received: from localhost ([::1]:55575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVzew-00021F-Hh for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Dec 2018 09:02:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVzeo-00020z-St for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 09:02:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVzej-00080j-Td for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 09:02:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35091) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gVzej-00080f-Py for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 09:02:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gVzej-0007yq-LH for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 09:02:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Dec 2018 14:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33664 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33664-submit@debbugs.gnu.org id=B33664.154436406930603 (code B ref 33664); Sun, 09 Dec 2018 14:02:01 +0000 Original-Received: (at 33664) by debbugs.gnu.org; 9 Dec 2018 14:01:09 +0000 Original-Received: from localhost ([127.0.0.1]:39349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVzdt-0007xV-Bc for submit@debbugs.gnu.org; Sun, 09 Dec 2018 09:01:09 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:50345) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVzdp-0007xJ-Sw for 33664@debbugs.gnu.org; Sun, 09 Dec 2018 09:01:07 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wB9E13Dw009353; Sun, 9 Dec 2018 09:01:04 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id A338F6A438; Sun, 9 Dec 2018 09:01:02 -0500 (EST) In-Reply-To: (Drew Adams's message of "Fri, 7 Dec 2018 15:15:37 +0000 (UTC)") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6435=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6435> : inlines <6979> : streams <1806630> : uri <2762389> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153258 Archived-At: I installed the patch below. Stefan diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 14cc4fba45..78d51c6dbb 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -3398,6 +3398,9 @@ Special Properties is moved away from any position that has a non-@code{nil} @code{cursor-intangible} property, just before redisplay happens. +When the variable @code{cursor-sensor-inhibit} is non-@code{nil}, the +@code{cursor-intangible} property is ignored. + @item field @kindex field @r{(text property)} Consecutive characters with the same @code{field} property constitute a @@ -3579,6 +3582,9 @@ Special Properties property or leaving it. The functions are called only when the minor mode @code{cursor-sensor-mode} is turned on. +When the variable @code{cursor-sensor-inhibit} is non-@code{nil}, the +@code{cursor-sensor-functions} property is ignored. + @item composition @kindex composition @r{(text property)} This text property is used to display a sequence of characters as a diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el index 7e3088dd91..21c48f830f 100644 --- a/lisp/emacs-lisp/cursor-sensor.el +++ b/lisp/emacs-lisp/cursor-sensor.el @@ -22,17 +22,29 @@ ;;; Commentary: -;; This package implements the `cursor-intangible' property, which is -;; meant to replace the old `intangible' property. To use it, just enable the -;; `cursor-intangible-mode', after which this package will move point away from -;; any position that has a non-nil `cursor-intangible' property. This is only -;; done just before redisplay happens, contrary to the old `intangible' -;; property which was done at a much lower level. +;; This package implements the `cursor-intangible' and +;; `cursor-sensor-functions' properties, which are meant to replace +;; the old `intangible', `point-entered', and `point-left' properties. + +;; To use `cursor-intangible', just enable the +;; `cursor-intangible-mode' minor mode, after which this package will +;; move point away from any position that has a non-nil +;; `cursor-intangible' property. This is only done just before +;; redisplay happens, contrary to the old `intangible' property which +;; was done at a much lower level. + +;; To use `cursor-sensor-functions', enable the `cursor-sensor-mode' +;; minor mode, after which the `cursor-sensor-functions' will be +;; called just before redisplay happens, according to the movement of +;; the cursor since the last redisplay. ;;; Code: ;;;###autoload -(defvar cursor-sensor-inhibit nil) +(defvar cursor-sensor-inhibit nil + "When non-nil, suspend `cursor-sensor-mode' and `cursor-intangible-mode'. +By convention, this is a list of symbols where each symbol stands for the +\"cause\" of the suspension.") (defun cursor-sensor--intangible-p (pos) (let ((p (get-pos-property pos 'cursor-intangible)))