From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.devel Subject: Re: Suggestion to add before and after hooks to posn-set-point. Date: Mon, 18 Sep 2017 23:07:11 -0400 Message-ID: References: Reply-To: rswgnu@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114fe7349086870559822961" X-Trace: blaine.gmane.org 1505790527 29091 195.159.176.226 (19 Sep 2017 03:08:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2017 03:08:47 +0000 (UTC) Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 19 05:08:39 2017 Return-path: Envelope-to: ged-emacs-devel@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 1du8tr-0007FA-GJ for ged-emacs-devel@m.gmane.org; Tue, 19 Sep 2017 05:08:39 +0200 Original-Received: from localhost ([::1]:39839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du8ty-0006xe-I4 for ged-emacs-devel@m.gmane.org; Mon, 18 Sep 2017 23:08:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du8sz-0006xB-Dy for emacs-devel@gnu.org; Mon, 18 Sep 2017 23:07:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1du8sw-0001DV-9A for emacs-devel@gnu.org; Mon, 18 Sep 2017 23:07:45 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du8sw-0001DK-6t for emacs-devel@gnu.org; Mon, 18 Sep 2017 23:07:42 -0400 Original-Received: from mail-qk0-f169.google.com ([209.85.220.169]:55155) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1du8sv-0005S4-Um for emacs-devel@gnu.org; Mon, 18 Sep 2017 23:07:42 -0400 Original-Received: by mail-qk0-f169.google.com with SMTP id d70so2417407qkc.11 for ; Mon, 18 Sep 2017 20:07:41 -0700 (PDT) X-Gm-Message-State: AHPjjUiwQ4BjQ3TiYFznQUtCZpsU79LQj9LRtApJFWxNUyniSC9qU+XW elE0AMcxAw7HzbDUwKUCkPA9Hp6P92gosXSo2+o= X-Google-Smtp-Source: AOwi7QABMm/orNmvn/ZiheSRWQMFRgQwkuLn4pn4iz4PQ3vVEpM0NBE0NyHMpFXcll/+LDH7hgHFQw6UG1Os9vtkYEA= X-Received: by 10.55.116.134 with SMTP id p128mr23421666qkc.50.1505790461509; Mon, 18 Sep 2017 20:07:41 -0700 (PDT) Original-Received: by 10.200.28.3 with HTTP; Mon, 18 Sep 2017 20:07:11 -0700 (PDT) In-Reply-To: X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218503 Archived-At: --001a114fe7349086870559822961 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Sep 18, 2017 at 10:21 PM, Stefan Monnier wrote: > > It seems as of Emacs 25, there are no hooks in posn-set-point to do > > something custom before or after point has been set/moved. > > There are various ways to do things very similar to what posn-set-point > does, so a hook on this function seems rather odd to me: it will only > catch some window selections and some point movements. =E2=80=8B=E2=80=8B > =E2=80=8B=E2=80=8B > IOW I find it difficult to characterize when these hooks will be run =E2=80=8B=E2=80=8B > (except with the trivial characterization that they're run when > =E2=80=8B=E2=80=8B > posn-set-point is run, which is not very meaningful since no command is > =E2=80=8B=E2=80=8B > documented to use this function). > =E2=80=8BFYI, the initial desire for these hooks came from wanting to do so= mething whenever the mouse set point. Then I thought it would be more useful if it covered any interactive setting of point, which led to posn-set-point (called by mouse-set-point). If there are better ways to do this, let's discuss them. Bob=E2=80=8B=E2=80=8B --001a114fe7349086870559822961 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Sep 18, 2= 017 at 10:21 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>= ; It seems as of Emacs 25, there are no hooks in posn-set-point to do
> something custom before or after point has been set/moved.

There are various ways to do things very similar to what posn-set-po= int
does, so a hook on this function seems rather odd to me: it will only
catch some window selections and some point movements.
=E2=80=8B=E2=80=8B
=C2=A0
=
=E2=80=8B=E2=80=8B
IOW I find it difficult to characterize = when these hooks will be run
=E2=80=8B=E2=80=8B
(except with the trivial characterizatio= n that they're run when
=E2=80=8B=E2=80=8B
posn-set-point is run, which is not very= meaningful since no command is
=E2=80=8B=E2=80=8B
documented to use this function).

=E2=80=8BFYI, the initial desire for these hooks came = from wanting to do something whenever the mouse set point.
Then I thought= it would be more useful if it covered any interactive setting of point, wh= ich led to posn-set-point
(called by mouse-set-point).=C2=A0 If there are = better ways to do this, let's discuss them.

Bob=E2=80=8B=E2=80= =8B
--001a114fe7349086870559822961--