From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 29 13:43:44 2021 Received: (at submit) by debbugs.gnu.org; 29 Aug 2021 17:43:44 +0000 Received: from localhost ([127.0.0.1]:57316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKOqO-0004bg-G8 for submit@debbugs.gnu.org; Sun, 29 Aug 2021 13:43:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:36268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKOqN-0004bX-A5 for submit@debbugs.gnu.org; Sun, 29 Aug 2021 13:43:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKOqL-0005Pj-Ic for bug-gnu-emacs@gnu.org; Sun, 29 Aug 2021 13:43:43 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:48421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKOqD-0006Qk-Jc for bug-gnu-emacs@gnu.org; Sun, 29 Aug 2021 13:43:38 -0400 Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 4E6A4FF803 for ; Sun, 29 Aug 2021 17:43:29 +0000 (UTC) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: thing-at-mouse Organization: LINKOV.NET Date: Sun, 29 Aug 2021 20:21:01 +0300 Message-ID: <87sfys6ubm.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.199; envelope-from=juri@linkov.net; helo=relay9-d.mail.gandi.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Maybe I'm missing something, but thingatpt.el has the keywords ;; Keywords: extensions, matching, mouse that contain the keyword "mouse", and yet there is no such function as 'thing-at-mouse'. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 29 16:04:05 2021 Received: (at 50256) by debbugs.gnu.org; 29 Aug 2021 20:04:05 +0000 Received: from localhost ([127.0.0.1]:57462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKR2C-00065X-Pv for submit@debbugs.gnu.org; Sun, 29 Aug 2021 16:04:04 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKR2A-000653-PM for 50256@debbugs.gnu.org; Sun, 29 Aug 2021 16:04:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LcSdG+BaQmg8SwU20ZLxprEAWlaU5jgyVq2sC+s8ILQ=; b=qEVwCzvhWydBuU3cRgFtzIFS5X cuk5512jm/Wq47ieDSSm6/h5nqV4BBg4OGCyyKxGlhKpnzxfMBdHBqtuVhtrO2OaBLhXJr/tkpPKs 6bP9zueRdJSTw97WrBSq7h/i1oTGCOCrgVovyj3UDTVrU+7BqHW6xBfcGCXhV2lD6stU=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKR20-0003MF-FX; Sun, 29 Aug 2021 22:03:56 +0200 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> Date: Sun, 29 Aug 2021 22:03:51 +0200 In-Reply-To: <87sfys6ubm.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 29 Aug 2021 20:21:01 +0300") Message-ID: <87eeacdnmg.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: > Maybe I'm missing something, but thingatpt.el has the keywords > > ;; Keywords: extensions, matching, mouse > > that contain the keyword "mouse", and yet there is no such function as > 'thing-at-mou [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: > Maybe I'm missing something, but thingatpt.el has the keywords > > ;; Keywords: extensions, matching, mouse > > that contain the keyword "mouse", and yet there is no such function as > 'thing-at-mouse'. I'm not quite sure I understand how such a function would look like. `thing-at-point' has the signature (thing-at-point THING) Would the proposed new function have a signature (thing-at-mouse EVENT THING) ? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 30 03:41:31 2021 Received: (at 50256) by debbugs.gnu.org; 30 Aug 2021 07:41:31 +0000 Received: from localhost ([127.0.0.1]:58021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKbv9-0000S5-0o for submit@debbugs.gnu.org; Mon, 30 Aug 2021 03:41:31 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:56937) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKbv5-0000RY-1O for 50256@debbugs.gnu.org; Mon, 30 Aug 2021 03:41:27 -0400 Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id AEDCC1BF206; Mon, 30 Aug 2021 07:41:20 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> Date: Mon, 30 Aug 2021 10:20:05 +0300 In-Reply-To: <87eeacdnmg.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 29 Aug 2021 22:03:51 +0200") Message-ID: <87h7f7z8ui.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain > I'm not quite sure I understand how such a function would look like. > `thing-at-point' has the signature > > (thing-at-point THING) > > Would the proposed new function have a signature > > (thing-at-mouse EVENT THING) > > ? This looks like the right signature. Then the implementation and an example of usage could look like this: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=thing-at-mouse.patch diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index ab17748df5..536eef5406 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -151,6 +151,15 @@ bounds-of-thing-at-point (if (and (<= real-beg orig) (<= orig end) (< real-beg end)) (cons real-beg end)))))))))) +;;;###autoload +(defun thing-at-mouse (event thing &optional no-properties) + "Return the THING at mouse click. +Like `thing-at-point', but reacts to the event +where the mouse button is clicked." + (save-excursion + (mouse-set-point last-input-event) + (thing-at-point thing no-properties))) + ;;;###autoload (defun thing-at-point (thing &optional no-properties) "Return the THING at point. diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index f33cbaf112..c9b2bdeaf1 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -1368,5 +1367,14 @@ global-dictionary-tooltip-mode (if on #'dictionary-tooltip-track-mouse #'ignore)) on)) +(defun context-menu-dictionary (menu) + "Dictionary context menu." + (when (thing-at-mouse last-input-event 'word) + (define-key menu [dictionary-separator] menu-bar-separator) + (define-key menu [dictionary-search-word-at-mouse] + '(menu-item "Dictionary Search" dictionary-search-word-at-mouse + :help "Search the word at mouse click in dictionary"))) + menu) + (provide 'dictionary) ;;; dictionary.el ends here --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 30 20:04:55 2021 Received: (at 50256) by debbugs.gnu.org; 31 Aug 2021 00:04:55 +0000 Received: from localhost ([127.0.0.1]:60622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKrGk-0006L2-Mo for submit@debbugs.gnu.org; Mon, 30 Aug 2021 20:04:55 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKrGe-0006Ke-Cl for 50256@debbugs.gnu.org; Mon, 30 Aug 2021 20:04:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=59KYC7GkRkIjWAnZJdl1urRLQefcnf4Dl50/HqWyeSI=; b=bJt3DFlvzDGBhhH/HIkdll0WI/ JFfvPUZaMWaBmPA3gj7pxu06s4Eva69PHTO9RCqnt+T5gJWQMcI8023AYCk1J8BhiMImuc3XdyDPp Pne4LzTrhqArEA7K7WvdDVM1Vkouv+uGiYcnWxbLLQ5MrbDyC2/vWM87xz6IXEVsVmJE=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKrGU-0004Mw-0O; Tue, 31 Aug 2021 02:04:38 +0200 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> Date: Tue, 31 Aug 2021 02:04:33 +0200 In-Reply-To: <87h7f7z8ui.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 30 Aug 2021 10:20:05 +0300") Message-ID: <871r6a8ooe.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: > This looks like the right signature. Then the implementation > and an example of usage could look like this: [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: > This looks like the right signature. Then the implementation > and an example of usage could look like this: [...] > +(defun context-menu-dictionary (menu) > + "Dictionary context menu." > + (when (thing-at-mouse last-input-event 'word) > + (define-key menu [dictionary-separator] menu-bar-separator) > + (define-key menu [dictionary-search-word-at-mouse] > + '(menu-item "Dictionary Search" dictionary-search-word-at-mouse > + :help "Search the word at mouse click in dictionary"))) > + menu) Ah, I see. Yes, that makes perfect sense to me -- go ahead and push (perhaps with some documentation). -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 03:11:08 2021 Received: (at 50256) by debbugs.gnu.org; 31 Aug 2021 07:11:08 +0000 Received: from localhost ([127.0.0.1]:32783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKxvH-0004pL-VR for submit@debbugs.gnu.org; Tue, 31 Aug 2021 03:11:08 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:53749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKxvC-0004oT-7O for 50256@debbugs.gnu.org; Tue, 31 Aug 2021 03:11:03 -0400 Received: (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 476DDC000C; Tue, 31 Aug 2021 07:10:54 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> Date: Tue, 31 Aug 2021 09:49:29 +0300 In-Reply-To: <871r6a8ooe.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 31 Aug 2021 02:04:33 +0200") Message-ID: <87y28i85xi.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> This looks like the right signature. Then the implementation >> and an example of usage could look like this: > > [...] > >> +(defun context-menu-dictionary (menu) >> + "Dictionary context menu." >> + (when (thing-at-mouse last-input-event 'word) >> + (define-key menu [dictionary-separator] menu-bar-separator) >> + (define-key menu [dictionary-search-word-at-mouse] >> + '(menu-item "Dictionary Search" dictionary-search-word-at-mouse >> + :help "Search the word at mouse click in dictionary"))) >> + menu) > > Ah, I see. Yes, that makes perfect sense to me -- go ahead and push > (perhaps with some documentation). In bug#50067 you suggested to add a new arg with the click event to all context menu functions. This will make code more readable: (defun context-menu-dictionary (menu click) (when (thing-at-mouse click 'word) so I will change the call to provide the arg from last-input-event, and maybe later it will be possible to acquire the same event more directly, not from last-input-event, and all callers will get it. Now the problem found in bug#9923: 1. 'C-h m' temporarily switches from the original *info* buffer to the *Help* buffer; 2. thing-at-mouse (called from context-menu-dictionary) uses (save-excursion (mouse-set-point event)) 3. mouse-set-point calls (posn-set-point (event-end event)) 4. in posn-set-point: 4.1. (select-window (posn-window position)) switches back to the original *info* buffer that was selected in the window; 4.2. (goto-char (posn-point position)) goes to the position that event-end got from the *Help* buffer, so in the *info* buffer moves to the position from the *Help* buffer. So maybe need to add the same condition that I already added to 2 places: (eq (window-buffer (posn-window (event-start event))) (current-buffer)) but I have no idea at what level to add it: in mouse-set-point? Or deeper in posn-set-point? Both are quite low-level, and I don't know if this might break something. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 14:05:47 2021 Received: (at 50256) by debbugs.gnu.org; 31 Aug 2021 18:05:47 +0000 Received: from localhost ([127.0.0.1]:35354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL88o-0001Db-SS for submit@debbugs.gnu.org; Tue, 31 Aug 2021 14:05:47 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:55967) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL88h-0001D0-Kn for 50256@debbugs.gnu.org; Tue, 31 Aug 2021 14:05:40 -0400 Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id A2B6B1C0002; Tue, 31 Aug 2021 18:05:32 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> Date: Tue, 31 Aug 2021 20:52:43 +0300 In-Reply-To: <87y28i85xi.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 31 Aug 2021 09:49:29 +0300") Message-ID: <87k0k1o5ks.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > 3. mouse-set-point calls (posn-set-point (event-end event)) > > 4. in posn-set-point: > 4.1. (select-window (posn-window position)) > switches back to the original *info* buffer > that was selected in the window; > > 4.2. (goto-char (posn-point position)) > goes to the position that event-end got from the *Help* buffer, > so in the *info* buffer moves to the position from the *Help* buffer. > > So maybe need to add the same condition that I already added to 2 places: > > (eq (window-buffer (posn-window (event-start event))) > (current-buffer)) > > but I have no idea at what level to add it: in mouse-set-point? > Or deeper in posn-set-point? Both are quite low-level, > and I don't know if this might break something. There are more context-menu-functions that use mouse-set-point that fails with 'C-h m', e.g.: (defun context-menu-ffap (menu) "File at point menu." (save-excursion (mouse-set-point last-input-event) (when (ffap-guess-file-name-at-point) So maybe the check for current-buffer above should be added to mouse-set-point. Or maybe it's not backward-compatible, I'm not sure. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 03:25:55 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 07:25:55 +0000 Received: from localhost ([127.0.0.1]:36061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLKd9-0002wA-0t for submit@debbugs.gnu.org; Wed, 01 Sep 2021 03:25:55 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:40761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLKd7-0002vm-Fc for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 03:25:54 -0400 Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 38831240008; Wed, 1 Sep 2021 07:25:45 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> Date: Wed, 01 Sep 2021 10:17:56 +0300 In-Reply-To: <87k0k1o5ks.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 31 Aug 2021 20:52:43 +0300") Message-ID: <87ilzk6bsr.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > So maybe the check for current-buffer above should be added > to mouse-set-point. Now I found the real root of the problems. All reported problems can be solved by this short patch: diff --git a/lisp/subr.el b/lisp/subr.el index 0a31ef2b29..0b3b8d0e0f 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1510,8 +1510,8 @@ event-start For more information, see Info node `(elisp)Click Events'." (if (consp event) (nth 1 event) - (or (posn-at-point) - (list (selected-window) (point) '(0 . 0) 0)))) + (or (posn-at-point (window-point)) + (list (selected-window) (window-point) '(0 . 0) 0)))) (defun event-end (event) "Return the ending position of EVENT. @@ -1519,8 +1519,8 @@ event-end See `event-start' for a description of the value returned." (if (consp event) (nth (if (consp (nth 2 event)) 2 1) event) - (or (posn-at-point) - (list (selected-window) (point) '(0 . 0) 0)))) + (or (posn-at-point (window-point)) + (list (selected-window) (window-point) '(0 . 0) 0)))) Both 'event-start' and 'event-end' created an event with the window equal to the selected window, but point from some random buffer, not from selected window's buffer. One question still remains: maybe this fix should be implemented at a deeper level in posn-at-point when its arg POS is nil? But actually, posn-at-point just uses this line: tem = Fpos_visible_in_window_p (pos, window, Qt); So maybe this fix should be implemented in Fpos_visible_in_window_p, i.e. at the end of this code if (EQ (pos, Qt)) posint = -1; else if (!NILP (pos)) posint = fix_position (pos); else if (w == XWINDOW (selected_window)) posint = PT; else posint = marker_position (w->pointm); it should get position from the selected window's buffer? From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 03:44:07 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 07:44:07 +0000 Received: from localhost ([127.0.0.1]:36103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLKul-0003P7-Id for submit@debbugs.gnu.org; Wed, 01 Sep 2021 03:44:07 -0400 Received: from quimby.gnus.org ([95.216.78.240]:56864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLKuh-0003OU-6P for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 03:44:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pfBuBytszlmm2p/lSTD2VGwNL586Fdrh1iKjPSeFKC0=; b=uPSvyknkSrAz1MYrE4UV2JwdML qqFn+BXK8NJrNdV0nI3HpkcaZBSu8u0aB9rMw8MxMnnoY2UHcZGqG882uUFOOgIa6gcROibgkFXcH kQ3pdjQgRF1CrMo8skje/79KPjSC0dhp5Dbfiz0yO5qcYtmFH/83wzmCuMXJDy812dT8=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLKuW-0006TI-Iw; Wed, 01 Sep 2021 09:43:56 +0200 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> Date: Wed, 01 Sep 2021 09:43:50 +0200 In-Reply-To: <87ilzk6bsr.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 01 Sep 2021 10:17:56 +0300") Message-ID: <87mtowivux.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: > So maybe this fix should be implemented in Fpos_visible_in_window_p, > i.e. at the end of this code > > if (EQ (pos, Qt)) > posint = -1; > else if (!NILP (pos)) > posint = fix_position (pos); > else [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: > So maybe this fix should be implemented in Fpos_visible_in_window_p, > i.e. at the end of this code > > if (EQ (pos, Qt)) > posint = -1; > else if (!NILP (pos)) > posint = fix_position (pos); > else if (w == XWINDOW (selected_window)) > posint = PT; > else > posint = marker_position (w->pointm); > > it should get position from the selected window's buffer? I've tried to follow the logic here, and I think you're right, but it's difficult to really get a handle on what the repercussions here might be in various scenarios. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 05:18:22 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 09:18:22 +0000 Received: from localhost ([127.0.0.1]:36310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLMNy-0001sB-EN for submit@debbugs.gnu.org; Wed, 01 Sep 2021 05:18:22 -0400 Received: from mout.gmx.net ([212.227.15.15]:53201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLMNk-0001rh-Kw for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 05:18:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630487882; bh=9R682R1HRG/Xf11QP+l8dPeEN2JMTAys8bbcFSNLnmk=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=N4fWUvd012N0mtHy1QeP+YRtzizlDJV0yMUccaXIhPxMABXK9u7zVhINAo4Iml/2J J/y9DU/CqdrE0wtmvUiPcSfx4gUmnL36tR7JmbTYpv5c38U1n4m1PR2fXv6jUdn/ca 1tyytEZy/B/qGhIGlLPoPnZz0AiB+252jJOUGXFc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([213.142.96.44]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mirna-1my0ac0grM-00etS0; Wed, 01 Sep 2021 11:18:02 +0200 Subject: Re: bug#50256: thing-at-mouse To: Juri Linkov , Lars Ingebrigtsen References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> From: martin rudalics Message-ID: <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> Date: Wed, 1 Sep 2021 11:18:01 +0200 MIME-Version: 1.0 In-Reply-To: <87ilzk6bsr.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:FtCbz2FyZDaL7tJENMNsWcl+eEcypOcxua3qGAQgYLdUSjGCL++ 9gxK7dzyYiuSYqSC9BDaEYALQ/niojsmV2hhYDWWff1ORYH7qWrZu46p+oHJUBFZeCAmDyv mzzdLpXR7hx9rg1Sj3xp9bsMlIWKyHPq0cPNhmikHRN3O+eyQnXj0JUwTeEv8fDvhLixnWF f9kHj0lMs/ptCmVEBkBWA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:9HMCC63Pqvo=:Fj/jMlBpbz6P2qbf2r0Pny 4jYbnJjyYlY4K4ryVOQGRnkLHWtD4i5kUlBo05NuWJop341VP6zs4ZhDozPYZttaugOCwsggQ wn2VbGh/dZgNesYKaiSudF44r2VxstkdhpW5wHXik/b9PIDg35A6PZcLG6195UOSZtTNoUlq8 096Oe5FCpqTo13SBeVOJQ1n9IqkrDn0aDql5JxFqy0jS4bN3GptZp0k5hUT+riuvn0nGMvdD7 PLx+2XFJ3W6oC1KeLwqEq7QQ4WqhQmV+EiiP+nznfa7uVdondbxkSA181N9aCzAElUeQaqd6w zZjvj2XJ5kHSLSoTzcGazpHTQ690PZq+JWf5ZEfE1K8+sAGMc+4sJS5nf3ocGbBLwsEmu1A+r 5U7m6PXlfBqGJFar6OS+3gqs5wgXlmE3Vc6YzHVB7DyeVFCbCOXPFWg1kaoJZLOruPeeMze4w ZxeLdiTFzL34fZcQWbqn6GUp4+NKayrS+u45pSykqXw4eBj/odIkmyCkPIqL4ax8iLtu7HeS5 yVuz/O4uFagaFqGLWq3Qw+PkxUuKO46H55X1EtCiQ+wcDyCrkbH4tVFsIJhIZK27puPswvdnO KHaqrx5lx0xHkmt1Y3FsYhWsjuF3diXjR2PwHbNZWyYrlJu44TZMGL+n7wsKIbglAIyMnBfGF PHT1qqD+qZcDpteP+hYntfWdSD1URvTd5X+Ufdt6S/gBDPtbbPuxDUPl2hcrxOOaxXN4ANSt4 3u6B0233eKK1CpWqOgordI5vgp0eGHjuNuBqTmCftg7hcyA0jzfyqmYFZ/NTvQlrAyIsaf7d6 CAnXn+AS1tAVh2h0acV6wr0Tvj+r3EVG3/vL+ydL8fjByHGxUhqO8jl4OB6BjfKcby88cANUn BxFGDCvyL1NTqDXYpuHCU2baIuVoBKyTBcMpJVYLiQZLfW81bJpLwexymhvADy9yKqZ993QPW f+y380D/1Uiy7nVeHCCx1ETGLU//+gku3CvMOU4tQ839B/Rz9r7qcRT/fu5G98yKRv4NcBLIe UHqx5Kyz2G2IL1FtKBJBSEkQFV65j5aaSB2b3YlKEhIa76POZ1Ghj6rKpycArSjeNiIZbAOQ3 Z6RZzwlbu9CSMO0aNCvmSs7dsb2AWkuzKAroin/8Xe/bizolznWUOfkmw== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > So maybe this fix should be implemented in Fpos_visible_in_window_p, > i.e. at the end of this code > > if (EQ (pos, Qt)) > posint = -1; > else if (!NILP (pos)) > posint = fix_position (pos); > else if (w == XWINDOW (selected_window)) > posint = PT; > else > posint = marker_position (w->pointm); Using the position of point of the current buffer when WINDOW is specified doesn't make any sense. Moreover the Elisp manual says that "The argument POSITION defaults to the current position of point in WINDOW" which doesn't make sense if point is taken from a buffer not shown in WINDOW. So the fix should be implemented in Fpos_visible_in_window_p. > it should get position from the selected window's buffer? I don't understand this last sentence though. martin From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 08:02:31 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 12:02:32 +0000 Received: from localhost ([127.0.0.1]:36531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLOwl-000299-Sw for submit@debbugs.gnu.org; Wed, 01 Sep 2021 08:02:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLOwf-00028m-S7 for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 08:02:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44900) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLOwU-0000Ud-Gj; Wed, 01 Sep 2021 08:02:12 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4557 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLOwS-0001gn-Ez; Wed, 01 Sep 2021 08:02:10 -0400 Date: Wed, 01 Sep 2021 15:02:04 +0300 Message-Id: <83sfyoqzb7.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <87ilzk6bsr.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 01 Sep 2021 10:17:56 +0300) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Date: Wed, 01 Sep 2021 10:17:56 +0300 > Cc: 50256@debbugs.gnu.org > > > So maybe the check for current-buffer above should be added > > to mouse-set-point. > > Now I found the real root of the problems. All reported problems > can be solved by this short patch: > > diff --git a/lisp/subr.el b/lisp/subr.el > index 0a31ef2b29..0b3b8d0e0f 100644 > --- a/lisp/subr.el > +++ b/lisp/subr.el > @@ -1510,8 +1510,8 @@ event-start > > For more information, see Info node `(elisp)Click Events'." > (if (consp event) (nth 1 event) > - (or (posn-at-point) > - (list (selected-window) (point) '(0 . 0) 0)))) > + (or (posn-at-point (window-point)) > + (list (selected-window) (window-point) '(0 . 0) 0)))) I don't understand this: are you saying that in a selected window you see point different from window-point? How does that happen? > Both 'event-start' and 'event-end' created an event > with the window equal to the selected window, > but point from some random buffer, > not from selected window's buffer. Can you show the recipe that produces this strange result? (I looked at bug#9923, which you say is where this was reported, but couldn't find a recipe there for which you described the sequence of calls.) > One question still remains: maybe this fix should be implemented > at a deeper level in posn-at-point when its arg POS is nil? > > But actually, posn-at-point just uses this line: > > tem = Fpos_visible_in_window_p (pos, window, Qt); > > So maybe this fix should be implemented in Fpos_visible_in_window_p, > i.e. at the end of this code > > if (EQ (pos, Qt)) > posint = -1; > else if (!NILP (pos)) > posint = fix_position (pos); > else if (w == XWINDOW (selected_window)) > posint = PT; > else > posint = marker_position (w->pointm); > > it should get position from the selected window's buffer? Once again, in a selected window, point (a.k.a. "PT" in C) should be identical to the window-point of that window. So I don't think I understand why this would need any change. Please tell more. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 08:16:49 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 12:16:49 +0000 Received: from localhost ([127.0.0.1]:36567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLPAb-0002cj-00 for submit@debbugs.gnu.org; Wed, 01 Sep 2021 08:16:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLPAV-0002cK-NI for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 08:16:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45648) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLPAP-00084j-Kh; Wed, 01 Sep 2021 08:16:33 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1464 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLPAO-0003tM-DG; Wed, 01 Sep 2021 08:16:32 -0400 Date: Wed, 01 Sep 2021 15:16:26 +0300 Message-Id: <83lf4gqyn9.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> (message from martin rudalics on Wed, 1 Sep 2021 11:18:01 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: martin rudalics > Date: Wed, 1 Sep 2021 11:18:01 +0200 > Cc: 50256@debbugs.gnu.org > > Using the position of point of the current buffer when WINDOW is > specified doesn't make any sense. Moreover the Elisp manual says that > > "The argument POSITION defaults to the current position of point in > WINDOW" > > which doesn't make sense if point is taken from a buffer not shown in > WINDOW. That function works only with positions shown in some window, so why do you say the above makes no sense? The implementation emulates display, so it must have a window to make layout decisions. > So the fix should be implemented in Fpos_visible_in_window_p. The snippet cited in the original message _was_ from Fpos_visible_in_window_p. But I don't understand what kind of fix did you have in mind, perhaps because I don't understand how the original problem reported by Juri happened in the first place. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 10:25:31 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 14:25:31 +0000 Received: from localhost ([127.0.0.1]:38763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLRBD-0004Z0-5u for submit@debbugs.gnu.org; Wed, 01 Sep 2021 10:25:31 -0400 Received: from mout.gmx.net ([212.227.17.22]:33369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLRBB-0004Yn-Cx for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 10:25:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630506322; bh=i+dq5EaMOpWDxZTSH981aXYgak8XrcIH8UihFZRmu6A=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=P6ekjs8wPt+cvehj0IpDYE8qRaWg9w6pf6eA2PFTv+r0QVUWa10Ty1nG7UNHJ+KOi iq7R4IS90A5VRoyJ2oGPDuygSTFsY0z/ZzW8CMSYHPbpWQNqUamvqW8965eaSyhKpw iqRsDe6aMU4rs8GTRU2VdiGk1Q8w9/LCpo3pDjoA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([213.142.96.44]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MDQeU-1mB1KG1mtS-00AYiK; Wed, 01 Sep 2021 16:25:22 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> From: martin rudalics Message-ID: <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> Date: Wed, 1 Sep 2021 16:25:20 +0200 MIME-Version: 1.0 In-Reply-To: <83lf4gqyn9.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:jObOwG/WCnAygTGkJ0E22bMUEl/cfx1uYcfl1hX1HSlvkxFyy01 7kqzyOYJN/qsYHIjqpNB6ib+jLulKOMbAdEempvZAP2xOgIC+vK/pkGI6/zJoYG3u1c9iYh 8OobtBzupzwlm/yYzqEKR/+Bifo1xdy3Pl8ataWBdBiV0t6G7q1hs4KUikW95Kyt7nHDxg0 R/DykWfd8++OSxQnZQ4DQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:7FNSdXV/tls=:8sqcNCu5cp+C+ga4CDorv2 hqvmADoHXIkpbkstMNNJ7A/HcWsoqQqsIwyF/e7SISOHg/47Bh75s7ozKziLJgUqyTVSFM5Sk LYEYbfKRFGICICzQ9aiPYCYas8RngnroxLRuBrqWFv7ThGHbV5KlU2HgEzunuylWch+96NTUA nlGOrqG+JDhyU9XeuH1IWmULhgae5qhMFs1HaKausVTE6LSmL7c87MDHPKCKw7WR268sGspLt cs9ZSE/YmElGEsNTytTVwP7cfva1CPZUahteDJFc0+vFoN74iJYe+RUiEjzwPDUiL8tYilz+h oP7VLvdrJVv5n3l4gkJjF6IZ8xtZ5LwJt7yWIlm7k8YB8TpTDjr3R/HwR/05KfVQhrZH8OLxF 1mRTo9Uj50Ds1pAibnWE4fFJ76mRKSMSRQ/B7kG7m8Z5ec3K4+ZSFV7AgS+cBULl+MTnQREID 7w4xjaTkKRngKBLd7wnolZyd5L9NPeZ3BHED8f35pxLYyI2m2dDhLLcgCn2sQnXpiOG3TgR5u odKwMSmf1mj26yR8FnRu2KRjg0o6qXhFBR3CWcNZFtt60i/EnGCBhz4ygAVelrdu/xF87wGkn Rn/d5p/odxy+fosgKGJ5KJZicvb6ZJruKvG3yM0JSxEtNKucXD212Ne2pv2OP2CPvWHZ+h3b7 amCP4TS09ocms2AwDG0uG34Iy8EZisy1pZG3I1LAnCzP0HqroWzRpGRk+56Lh6bLiLOWIEXa6 BjXifQg8PMpc6yQMBa2mxG/orDpSEamDb4a8nGfTjI8d5/n8nmBGhxbfsdIksIlHRzsX7EpJ4 9gr0wLIE0B9JVEbfECux9KxOUg5QLNBe31yKsvo8FKexQlgNJT5FINT9mM3Jr6aUDn/IQcVRN 9j+20gJlMoOo+uwLQCvovnF4eU8t13zugGOAugb7J8Ua5mwCMIq7tREO4KbhIzIOnTUOqr1xO BKOqDsrbdJDGR9kKKRXHDyr+5g2U3311TsMiZMbCMPoFpq4zvE54DWkFIJ5CD2f/8EvcuqyY9 UGz4L1cwbL+9tL5glpY9UmfDHcp1OmBlq2xvvHU46Bdeeu0wGMtUHLrTliPQauEz4DItMUYB/ v7i4uGLUzhia26Jamyh1JM+EYW6wa0WqBVcwGR7+hU214l1r65XN/meMg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > That function works only with positions shown in some window, so why > do you say the above makes no sense? The implementation emulates > display, so it must have a window to make layout decisions. > >> So the fix should be implemented in Fpos_visible_in_window_p. > > The snippet cited in the original message _was_ from > Fpos_visible_in_window_p. But I don't understand what kind of fix did > you have in mind, perhaps because I don't understand how the original > problem reported by Juri happened in the first place. With emacs -Q put into *scratch* and evaluate via C-x c-e (progn (with-current-buffer "*Messages*" (goto-char (point-min))) (pop-to-buffer "*Messages*") (with-current-buffer "*scratch*" (pos-visible-in-window-p nil nil t))) This reports visibility for the position of point in *scratch* and not that of the window point of the selected *Messages* window. martin From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 11:46:00 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 15:46:00 +0000 Received: from localhost ([127.0.0.1]:38872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLSR6-0006nZ-16 for submit@debbugs.gnu.org; Wed, 01 Sep 2021 11:46:00 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:57087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLSR4-0006n6-Bo for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 11:45:58 -0400 Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id BB2C1240004; Wed, 1 Sep 2021 15:45:50 +0000 (UTC) From: Juri Linkov To: martin rudalics Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> Date: Wed, 01 Sep 2021 18:42:35 +0300 In-Reply-To: <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> (martin rudalics's message of "Wed, 1 Sep 2021 11:18:01 +0200") Message-ID: <87eea848fk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, Lars Ingebrigtsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> So maybe this fix should be implemented in Fpos_visible_in_window_p, >> i.e. at the end of this code >> >> if (EQ (pos, Qt)) >> posint = -1; >> else if (!NILP (pos)) >> posint = fix_position (pos); >> else if (w == XWINDOW (selected_window)) >> posint = PT; >> else >> posint = marker_position (w->pointm); > > Using the position of point of the current buffer when WINDOW is > specified doesn't make any sense. Moreover the Elisp manual says that > > "The argument POSITION defaults to the current position of point in > WINDOW" > > which doesn't make sense if point is taken from a buffer not shown in > WINDOW. So the fix should be implemented in Fpos_visible_in_window_p. Actually, WINDOW is not specified, but defaults to the selected window. But still you point is valid: using the position of point of the current buffer for the selected window doesn't make sense. >> it should get position from the selected window's buffer? > > I don't understand this last sentence though. I meant to set posint to (window-point), but written in C. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 11:46:03 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 15:46:03 +0000 Received: from localhost ([127.0.0.1]:38877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLSR9-0006oY-7k for submit@debbugs.gnu.org; Wed, 01 Sep 2021 11:46:03 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:23375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLSR8-0006nN-1p for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 11:46:02 -0400 Received: (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id EDE4524000D; Wed, 1 Sep 2021 15:45:54 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <83sfyoqzb7.fsf@gnu.org> Date: Wed, 01 Sep 2021 18:44:49 +0300 In-Reply-To: <83sfyoqzb7.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 01 Sep 2021 15:02:04 +0300") Message-ID: <87v93k2tkq.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I don't understand this: are you saying that in a selected window you > see point different from window-point? How does that happen? > >> Both 'event-start' and 'event-end' created an event >> with the window equal to the selected window, >> but point from some random buffer, >> not from selected window's buffer. > > Can you show the recipe that produces this strange result? (I looked > at bug#9923, which you say is where this was reported, but couldn't > find a recipe there for which you described the sequence of calls.) Martin sent a test case for pos-visible-in-window-p, and here is the test case for mouse-set-point that uses pos-visible-in-window-p. In emacs -Q evaluate: (with-current-buffer "*Messages*" (mouse-set-point last-input-event)) and it moves point in *scratch* to the position of point of the *Messages* buffer. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 11:59:52 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 15:59:52 +0000 Received: from localhost ([127.0.0.1]:38893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLSeO-0007Bz-N6 for submit@debbugs.gnu.org; Wed, 01 Sep 2021 11:59:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLSeF-0007BX-If for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 11:59:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54828) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLSe9-00042E-I6; Wed, 01 Sep 2021 11:59:29 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3562 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLSe7-0003m0-Sy; Wed, 01 Sep 2021 11:59:29 -0400 Date: Wed, 01 Sep 2021 18:59:25 +0300 Message-Id: <8335qoqobm.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> (message from martin rudalics on Wed, 1 Sep 2021 16:25:20 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: juri@linkov.net, larsi@gnus.org, 50256@debbugs.gnu.org > From: martin rudalics > Date: Wed, 1 Sep 2021 16:25:20 +0200 > > (progn > (with-current-buffer "*Messages*" > (goto-char (point-min))) > (pop-to-buffer "*Messages*") > (with-current-buffer "*scratch*" > (pos-visible-in-window-p nil nil t))) > > This reports visibility for the position of point in *scratch* and not > that of the window point of the selected *Messages* window. But you've switched to *scratch* in the selected window, so why is that a problem? From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 12:13:01 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 16:13:01 +0000 Received: from localhost ([127.0.0.1]:38918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLSrF-0007aW-8g for submit@debbugs.gnu.org; Wed, 01 Sep 2021 12:13:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLSrD-0007aH-1W for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 12:12:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55800) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLSr7-0006ZI-99; Wed, 01 Sep 2021 12:12:53 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4392 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLSr6-0004hf-9F; Wed, 01 Sep 2021 12:12:52 -0400 Date: Wed, 01 Sep 2021 19:12:50 +0300 Message-Id: <83v93kp94t.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <87v93k2tkq.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 01 Sep 2021 18:44:49 +0300) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <83sfyoqzb7.fsf@gnu.org> <87v93k2tkq.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: larsi@gnus.org, 50256@debbugs.gnu.org > Date: Wed, 01 Sep 2021 18:44:49 +0300 > > In emacs -Q evaluate: > > (with-current-buffer "*Messages*" > (mouse-set-point last-input-event)) > > and it moves point in *scratch* to the position of point of > the *Messages* buffer. I don't follow: what do you expect to be in last-input-event in this case, and how is that relevant to mouse clicks, when the mouse is not even involved in this scenario? I fear I'm missing something very important here. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 12:21:11 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 16:21:11 +0000 Received: from localhost ([127.0.0.1]:38923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLSz9-0007n2-3y for submit@debbugs.gnu.org; Wed, 01 Sep 2021 12:21:11 -0400 Received: from mout.gmx.net ([212.227.17.20]:37631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLSz7-0007mn-VW for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 12:21:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630513263; bh=9TF5yuryDm5F6WLIdTyiUNHn+xbUP86f/3ti92T4K3Q=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=iG4WaF/RJCn4ZAzIQfUiRu1vkUgBe8M331sEpMsiTKyTrpM6mdkOv6RUrUHu+7wtT /d6Gr9OYZ6hOlyxAPuM1bSWmr65Bdqb8MWZM7DGWb1gUUcfNd5LrA8yW97F7E8gh// KqhiJ5C1ydS5E0xsfMKcxQZMIpMdioYPKZlk2Iwc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([213.142.96.44]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mn2WF-1mjmAb3oOd-00k6WY; Wed, 01 Sep 2021 18:21:03 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> From: martin rudalics Message-ID: <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> Date: Wed, 1 Sep 2021 18:21:00 +0200 MIME-Version: 1.0 In-Reply-To: <8335qoqobm.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:dCQi2ATJ4miPbMW0OKc95ZsQhOHtg8G1pMhTAbf4iScgkguqKQ5 hzQsaA24WhQdjTqXyEKkD6pUDp82oRaFzIHqO2R1oNkB/pljWmtQIP3sIfCsO58qnX1XyCT qt58Nebfb44Tvqr2R2H6RsJx1R+gacEtw+4tLFUQcvt7v7qdZl6ZKGlLwhck6zepomEpcDW R82C5yxYa9rgV6gV2ecDQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:O986BRwshqA=:KO7o4alC5dgwss6WFvAoAc sY9St5hRlnKjP/WI/Wo6FbWLnlZu8UHHnEETfY6EzXgu/4wwP1dKT/LMsnZFdr+bkTTqw04dH w9SyYqL1+natKh/yCepXk6DrodNcSAk+2wjvopShNla29i9SDcc8pWKnjxoiV3QFRw28EmSnU rfe/DTV5mlt3l1dg1ifmQfVjGbLku5rALHa8Fx9BJBxByhwJKbz0EYbRWms4FvdSHA0ITCOXd Ubcvy1KjgTMUkKyruFzSrv0PkeqEZNYLk4d0id3uVNeXqlfhAbjXVWqw0Cv1FVbm8TZw/x+lV FEtBuj3jw0lboiBTHWQiRqTtgy54Mb3tZSlti80PtsXqHB+d1SblFANVWN6/orujFWQ5YOiVx y2EswMkS86RXtJNoUQgIwtHCeqVfkJCGyg+nl2vyLyRw1mF91hyEIXJgSM4yIWO+kj6RBGGSH o4NzIbQF6cHHI2P7CP2XjcH5tvjmKakE3kNpl242r2uug2P/IRPCqkxX7AGuQ6dcwJW5Z5UFl oXTWndp2aZVLymNOK7HFeqZjrBplL2ymCtcf5Z/bdwtGTZhpJtNZLtHW1E7+P9AzPfTuUcm/0 Dz4ER5Z/5YNIqM9yOhQCoIqq4e4JtiqLfXJUsw4Ld89lqiFXpOU5RwqalJAeoyq8IOKek5fdZ +A1waqWLqfTPr1OMqdQlmlX2gyFRLCasy8dcrXP2EoOwCszzqlub4nm6drORsybeBKI8xapwe McZLDa9uyhPEXRkcHERFSDJipwR4U7DokOYqkxbAYm74wg/ZYmipzioRKwAtBDOOVWzF/C/Cf 8+yg756lEGz9XVCr2KGAr17x2kmBWdcFWm8iLJH8Hw3pcstvxuW9Kawwx2t7AvOnomWBHuaQq RrIAasgAN3tMs11txu103KlxzgRI8m9Wut6oa9KAjz57lufq2k2hXZiDqYSzB1Qj/YM2tEFaJ 47UMUMBA1zegPIhpX+zSp4Fb2RWAF8M+k3YbmIBPMzs2rPSr3bP0jogMfGxS2pL/c9UnFehGt k6QMxV38LVT4eCgO+l0yCxm4ca5CUB6u/wVbM9ILP2X5ST8WcnuZYHbsY9hYN15A98ojqjaUo LO4Ekp4rnZ3EhAX2mkmWrQM0f65BRGA4iQv9j+jWp/9zvrYFFbsyPcznA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> (progn >> (with-current-buffer "*Messages*" >> (goto-char (point-min))) >> (pop-to-buffer "*Messages*") >> (with-current-buffer "*scratch*" >> (pos-visible-in-window-p nil nil t))) >> >> This reports visibility for the position of point in *scratch* and not >> that of the window point of the selected *Messages* window. > > But you've switched to *scratch* in the selected window, so why is > that a problem? I have only run `with-current-buffer'. The selected window shows *Messages*. (pos-visible-in-window-p nil nil t) should never return nil as it does in the above recipe. martin From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 12:27:36 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 16:27:36 +0000 Received: from localhost ([127.0.0.1]:38931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLT5L-0007w7-Q1 for submit@debbugs.gnu.org; Wed, 01 Sep 2021 12:27:35 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:54655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLT5K-0007vu-Bc for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 12:27:34 -0400 Received: (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 212A6C0006; Wed, 1 Sep 2021 16:27:26 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <83sfyoqzb7.fsf@gnu.org> <87v93k2tkq.fsf@mail.linkov.net> <83v93kp94t.fsf@gnu.org> Date: Wed, 01 Sep 2021 19:25:15 +0300 In-Reply-To: <83v93kp94t.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 01 Sep 2021 19:12:50 +0300") Message-ID: <877dg02rh0.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> (with-current-buffer "*Messages*" >> (mouse-set-point last-input-event)) >> >> and it moves point in *scratch* to the position of point of >> the *Messages* buffer. > > I don't follow: what do you expect to be in last-input-event in this > case, and how is that relevant to mouse clicks, when the mouse is not > even involved in this scenario? Normally, last-input-event should be a mouse click event. But sometimes it gets a non-mouse event (e.g. a number). Then in mouse-set-point, event-end produces a fake mouse event using posn-at-point. But such constructed event contains position from a random buffer (that was current at the time of invocation). It should contain the position of point in the buffer displayed in the selected window. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 13:54:18 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 17:54:18 +0000 Received: from localhost ([127.0.0.1]:38974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLURF-0006L5-Sy for submit@debbugs.gnu.org; Wed, 01 Sep 2021 13:54:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLURE-0006Kn-4q for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 13:54:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59790) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLUR7-00073l-VD; Wed, 01 Sep 2021 13:54:09 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2733 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLUR7-0008Nn-IG; Wed, 01 Sep 2021 13:54:09 -0400 Date: Wed, 01 Sep 2021 20:54:06 +0300 Message-Id: <83pmtsp4g1.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> (message from martin rudalics on Wed, 1 Sep 2021 18:21:00 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: juri@linkov.net, larsi@gnus.org, 50256@debbugs.gnu.org > From: martin rudalics > Date: Wed, 1 Sep 2021 18:21:00 +0200 > > >> (progn > >> (with-current-buffer "*Messages*" > >> (goto-char (point-min))) > >> (pop-to-buffer "*Messages*") > >> (with-current-buffer "*scratch*" > >> (pos-visible-in-window-p nil nil t))) > >> > >> This reports visibility for the position of point in *scratch* and not > >> that of the window point of the selected *Messages* window. > > > > But you've switched to *scratch* in the selected window, so why is > > that a problem? > > I have only run `with-current-buffer'. The selected window shows > *Messages*. Then what is the semantics of the code snippet above, and why did you call with-current-buffer the second time? What did you want to accomplish, except make a point? IOW, what kind of real-life situation needs such a code? > (pos-visible-in-window-p nil nil t) should never return nil as it > does in the above recipe. Why not? From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 14:00:30 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 18:00:30 +0000 Received: from localhost ([127.0.0.1]:38978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLUXG-0006XA-Jj for submit@debbugs.gnu.org; Wed, 01 Sep 2021 14:00:30 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:43229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLUXD-0006Wu-SF for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 14:00:28 -0400 Received: (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 720D6100004; Wed, 1 Sep 2021 18:00:18 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> Date: Wed, 01 Sep 2021 20:59:59 +0300 In-Reply-To: <83pmtsp4g1.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 01 Sep 2021 20:54:06 +0300") Message-ID: <875yvknpls.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: martin rudalics , larsi@gnus.org, 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> I have only run `with-current-buffer'. The selected window shows >> *Messages*. > > Then what is the semantics of the code snippet above, and why did you > call with-current-buffer the second time? What did you want to > accomplish, except make a point? > > IOW, what kind of real-life situation needs such a code? In bug#9923 'C-h m' switched to another buffer before calling mouse-set-point. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 15:23:58 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 19:23:58 +0000 Received: from localhost ([127.0.0.1]:39041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLVq2-0000Dz-9T for submit@debbugs.gnu.org; Wed, 01 Sep 2021 15:23:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLVq0-0000Dn-Ns for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 15:23:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34208) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLVpu-0006Ro-L5; Wed, 01 Sep 2021 15:23:50 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4268 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLVpu-0008QW-81; Wed, 01 Sep 2021 15:23:50 -0400 Date: Wed, 01 Sep 2021 22:23:45 +0300 Message-Id: <83k0k0p0am.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <875yvknpls.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 01 Sep 2021 20:59:59 +0300) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <875yvknpls.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: rudalics@gmx.at, larsi@gnus.org, 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: martin rudalics , larsi@gnus.org, 50256@debbugs.gnu.org > Date: Wed, 01 Sep 2021 20:59:59 +0300 > > >> I have only run `with-current-buffer'. The selected window shows > >> *Messages*. > > > > Then what is the semantics of the code snippet above, and why did you > > call with-current-buffer the second time? What did you want to > > accomplish, except make a point? > > > > IOW, what kind of real-life situation needs such a code? > > In bug#9923 'C-h m' switched to another buffer before calling > mouse-set-point. Then it's a bug in that command, I'd say. You assume something about last-input and what mouse-set-point and posn-set-point will do when last-input is not a click event. And that assumption turns out to be false. So instead of making that assumption, why not give the code a valid event to work with instead? posn-at-point cannot work correctly when current buffer and the selected window's buffer are not the same, because they use display code which is based on that contract. If you break the contract by the likes of with-current-buffer, you will be lucky not to crash, let alone cause errors. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 15:26:52 2021 Received: (at 50256) by debbugs.gnu.org; 1 Sep 2021 19:26:52 +0000 Received: from localhost ([127.0.0.1]:39057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLVsq-0000JP-AK for submit@debbugs.gnu.org; Wed, 01 Sep 2021 15:26:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLVso-0000JD-Nd for 50256@debbugs.gnu.org; Wed, 01 Sep 2021 15:26:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34410) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLVsj-0000bl-Co; Wed, 01 Sep 2021 15:26:45 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4456 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLVsi-0000iX-U1; Wed, 01 Sep 2021 15:26:45 -0400 Date: Wed, 01 Sep 2021 22:26:42 +0300 Message-Id: <83ilzkp05p.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <87eea848fk.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 01 Sep 2021 18:42:35 +0300) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <87eea848fk.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: rudalics@gmx.at, larsi@gnus.org, 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Date: Wed, 01 Sep 2021 18:42:35 +0300 > Cc: 50256@debbugs.gnu.org, Lars Ingebrigtsen > > >> if (EQ (pos, Qt)) > >> posint = -1; > >> else if (!NILP (pos)) > >> posint = fix_position (pos); > >> else if (w == XWINDOW (selected_window)) > >> posint = PT; > >> else > >> posint = marker_position (w->pointm); > > > > Using the position of point of the current buffer when WINDOW is > > specified doesn't make any sense. Moreover the Elisp manual says that > > > > "The argument POSITION defaults to the current position of point in > > WINDOW" > > > > which doesn't make sense if point is taken from a buffer not shown in > > WINDOW. So the fix should be implemented in Fpos_visible_in_window_p. > > Actually, WINDOW is not specified, but defaults to the selected window. > But still you point is valid: using the position of point of the current buffer > for the selected window doesn't make sense. It makes perfect sense, because this code cannot work if the current buffer and the selected window's buffer are different. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 02:17:30 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 06:17:30 +0000 Received: from localhost ([127.0.0.1]:39437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLg2U-0007oB-DR for submit@debbugs.gnu.org; Thu, 02 Sep 2021 02:17:30 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:53781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLg2S-0007nv-V7 for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 02:17:29 -0400 Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 1E9E6FF80B; Thu, 2 Sep 2021 06:17:20 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <875yvknpls.fsf@mail.linkov.net> <83k0k0p0am.fsf@gnu.org> Date: Thu, 02 Sep 2021 09:16:03 +0300 In-Reply-To: <83k0k0p0am.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 01 Sep 2021 22:23:45 +0300") Message-ID: <87ilzjijto.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: rudalics@gmx.at, larsi@gnus.org, 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> In bug#9923 'C-h m' switched to another buffer before calling >> mouse-set-point. > > Then it's a bug in that command, I'd say. You assume something about > last-input and what mouse-set-point and posn-set-point will do when > last-input is not a click event. And that assumption turns out to be > false. So instead of making that assumption, why not give the code a > valid event to work with instead? Currently event-start and event-end that use mouse-set-point and posn-set-point create an invalid event when some code inadvertently switches the buffer. > posn-at-point cannot work correctly when current buffer and the > selected window's buffer are not the same, because they use display > code which is based on that contract. If you break the contract by > the likes of with-current-buffer, you will be lucky not to crash, let > alone cause errors. So the conclusion is following? There is a bug in the low-level function, but we ask users to be careful and to take precautions against stumbling on this bug. Then the problem is that such warning should be documented somewhere. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 02:48:25 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 06:48:26 +0000 Received: from localhost ([127.0.0.1]:39493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLgWP-0002QB-OJ for submit@debbugs.gnu.org; Thu, 02 Sep 2021 02:48:25 -0400 Received: from mout.gmx.net ([212.227.15.15]:33939) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLgWN-0002Pu-22 for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 02:48:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630565296; bh=4I4RE9EUs4VrRy1sEPfVaLpYc56TBQmjobRiwj2kilM=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=On4mlGvV7r74Jfdr+1PDVYMO1O9Fe9BN8e6O4bfB22Z1s1EXdlwExn4rzMlWzM9vq gFXUlKExsFJCDykA0JdAkZjMemQjT5ahh9jhyJdLWhes2FUqd+4shaU70ue9W1Xljn wooT/7M+/wTdA2MmCWjWrCykxX2/rfqSiYEs4YsE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.36]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MVNAr-1mWJ6t0ZOB-00SReS; Thu, 02 Sep 2021 08:48:16 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> From: martin rudalics Message-ID: Date: Thu, 2 Sep 2021 08:48:15 +0200 MIME-Version: 1.0 In-Reply-To: <83pmtsp4g1.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:QPA5n5sOWLgctQyCga1lsKCKD90z6sDpPt1gH4eT1egXJsGC6VN OZtI0PUTB6kvUkuXo1u8rAMwSFGgL3Y35HlgrCNwTrPmDEYnW1q3O4Mt8T++2MFhroXkMzu AvMrZF/okScG3RRmlPHvCz0anNUAdxm8fg3+13Tvjyu7F02KD0RCsT63a8u9RgaLV9JmHhV cRGAqzd+SsVvre2IgnSkw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:LzAEE65BHxc=:ZqIEk3eUcdl3xTuQf9qCZJ mfj2N9LNEAKkzLuHgSFBPyOAEwmb8rp4q3UXbTZbu6TDL2ovrwQMlpsz8ZoUmXN71fTZQtWwe 3eaKAWyAnwJHl+Xh8bC2bstMyza7jGKAhunb9iem3B1nFxXSBf8Z/KTVumIZWkM7oT2sR28fO Oz7hA5A+jFxxp8fdAVT/We36YZ6yPrVYwdriBNZpdP3wyjP9BwIMCZPh7bqKUAUVA6gCq349S lt08bV195CMgZ4N4UfHaiuwKLKKmNjFA1EHn0+N3y2np3XPM7dzJtgutNV3jlXJz1ouBD8RMI cKPOFRblK9Zh7SioXG3XrzbpXFG9iBSV62/mxu+if3aE73Xvk+bgrSOqOT2hHmZzEGfBjocUr ObJfaKZibbWnvrHuLJvWw3E8+x+mGdv5udrZP7TovOvl+Hxqqx/rsDT0KbHYcVh1XNMZVZ3c3 OlQscjA2XY35+YTUMy8gCEecte9fv7GozIddo2U5cYR8228I8UUEJeIbNAn4PfHGmT3jV8gz2 0986APQn0Cp2mLBMLjjaxptYbm7oNzTa5wwXs0YcEtNb7RwinfE6yUmUpL/+snOG5V2fqmfrX eN108OdMq6s1l1gAJ9CUn65mjnWjV01wjGntaDcLYle1xz0STBfQ47Dl64wlUqZ7RvZEqd3b3 3FKnDUZPZi8iuJYAJdGDagTVSuGFKFUYv7d551DJw5FWwpXQL8EfGND+IvpJFmXhN2lTQVx/k 6rpUZB2rnEpzhMmz2e1Y+jO0bHkL0FTGXsgm6R9N3ElN+klckv3FmdzGCCG5e+DMDOEjGBPi2 tGVeaJWKL16+dX1HfiT8QyiMl5sXDsIGp+fBA8u5Y2F0/Rv5DFz8TrFNb6xr2ZcAmaiJ1h2dr 08jEV6qWuAdxQa8WDHpy50zHLzL4izT2xs2089AGTMpDkWzkMQYY8qsHdEDp2kItHX4eSXvMu bI2s03x8hYeZjRYyQo5IkWyTKaun6RFWaEQpiofcLSY3XMVScASyIERuQKu35OZFwClWamXS1 NaQPuTDdqk12siKid+MIoQ9bc5sRoj7TBDXe8CgTyVazU84lh++mKlOM9qCZE4BaLwuemTffo AzrRzIo+0XM7NIPF1hazrf4fB9Q579asb4jeubcj7IUvfB9j8AmjLGv6w== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Then what is the semantics of the code snippet above, and why did you > call with-current-buffer the second time? What did you want to > accomplish, except make a point? I tried to write a simple example with emacs -Q showing how code breaks a contract stated in a manual. > IOW, what kind of real-life situation needs such a code? Any call of `pos-visible-in-window-p' might happen within the context of `with-current-buffer'. Just check how often these forms are used in the Emacs code base. >> (pos-visible-in-window-p nil nil t) should never return nil as it >> does in the above recipe. > > Why not? Because in the manual we say that "The argument POSITION defaults to the current position of point in WINDOW; WINDOW defaults to the selected window." If the current buffer is not shown in WINDOW, the first part of this sentence is wrong. martin From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 03:22:08 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 07:22:08 +0000 Received: from localhost ([127.0.0.1]:39530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLh31-0005Pg-Qy for submit@debbugs.gnu.org; Thu, 02 Sep 2021 03:22:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLh30-0005PD-OX for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 03:22:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51564) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLh2u-0000IZ-P6; Thu, 02 Sep 2021 03:22:00 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4572 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLh2u-0008FW-CJ; Thu, 02 Sep 2021 03:22:00 -0400 Date: Thu, 02 Sep 2021 10:21:55 +0300 Message-Id: <834kb3phm4.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <87ilzjijto.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 02 Sep 2021 09:16:03 +0300) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <875yvknpls.fsf@mail.linkov.net> <83k0k0p0am.fsf@gnu.org> <87ilzjijto.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: rudalics@gmx.at, larsi@gnus.org, 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: rudalics@gmx.at, larsi@gnus.org, 50256@debbugs.gnu.org > Date: Thu, 02 Sep 2021 09:16:03 +0300 > > >> In bug#9923 'C-h m' switched to another buffer before calling > >> mouse-set-point. > > > > Then it's a bug in that command, I'd say. You assume something about > > last-input and what mouse-set-point and posn-set-point will do when > > last-input is not a click event. And that assumption turns out to be > > false. So instead of making that assumption, why not give the code a > > valid event to work with instead? > > Currently event-start and event-end that use mouse-set-point and posn-set-point > create an invalid event when some code inadvertently switches the buffer. Yes. Then either mouse-set-point should be fixed to avoid that when it runs inside with-current-buffer, or, when the event is not a click event, we should concoct the data corresponding to event-start/end differently, in a way that is tolerant to this situation. And I'm not yet clear what would be the desired result in this case: > (progn > (with-current-buffer "*Messages*" > (goto-char (point-min))) > (pop-to-buffer "*Messages*") > (with-current-buffer "*scratch*" > (pos-visible-in-window-p nil nil t))) What position would you like this to report on? Would you like it to report on the value of point in the selected window, or should it report on the value of point in the current buffer? Since these two are different, it is no longer a trivial question to answer. > > posn-at-point cannot work correctly when current buffer and the > > selected window's buffer are not the same, because they use display > > code which is based on that contract. If you break the contract by > > the likes of with-current-buffer, you will be lucky not to crash, let > > alone cause errors. > > So the conclusion is following? There is a bug in the low-level > function, but we ask users to be careful and to take precautions > against stumbling on this bug. Then the problem is that such warning > should be documented somewhere. It's fine with me to document that restriction, yes. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 03:24:09 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 07:24:09 +0000 Received: from localhost ([127.0.0.1]:39538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLh4z-0005T6-Je for submit@debbugs.gnu.org; Thu, 02 Sep 2021 03:24:09 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLh4w-0005Sd-O2 for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 03:24:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=B8DvSu4Mh3Oqgl5djYwx5yKOAe4irlfgSpSPRkOdkyU=; b=bC+/mu7z72olxELrmIOvSKPjkO svx1Zm2xNWH9h0V0RA7suUdX0OWUVgONxFETbAHpyLP23aFPMJmRdq08iNP/TQOax11uUnKMOZ0Ev NTFpTbT9OBMdigL2SoQn7lNx66m8hP3SR5Z1fXzCa8bz0y0lMUAxKN8os9+UfZKRfKZo=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLh4m-0002w7-2i; Thu, 02 Sep 2021 09:24:00 +0200 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <875yvknpls.fsf@mail.linkov.net> <83k0k0p0am.fsf@gnu.org> <87ilzjijto.fsf@mail.linkov.net> Date: Thu, 02 Sep 2021 09:23:54 +0200 In-Reply-To: <87ilzjijto.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 02 Sep 2021 09:16:03 +0300") Message-ID: <87y28fbfud.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: > So the conclusion is following? There is a bug in the low-level > function, but we ask users to be careful and to take precautions > against stumbling on this bug. Then the problem is that such warn [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: rudalics@gmx.at, Eli Zaretskii , 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: > So the conclusion is following? There is a bug in the low-level > function, but we ask users to be careful and to take precautions > against stumbling on this bug. Then the problem is that such warning > should be documented somewhere. I think we should fix the low-level function, myself. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 03:30:46 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 07:30:46 +0000 Received: from localhost ([127.0.0.1]:39546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLhBO-0005ex-GQ for submit@debbugs.gnu.org; Thu, 02 Sep 2021 03:30:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLhBL-0005ej-UF for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 03:30:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51788) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLhBF-0007SB-VW; Thu, 02 Sep 2021 03:30:37 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1105 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLhAq-0000SN-MQ; Thu, 02 Sep 2021 03:30:28 -0400 Date: Thu, 02 Sep 2021 10:30:10 +0300 Message-Id: <831r67ph8d.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: (message from martin rudalics on Thu, 2 Sep 2021 08:48:15 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: juri@linkov.net, larsi@gnus.org, 50256@debbugs.gnu.org > From: martin rudalics > Date: Thu, 2 Sep 2021 08:48:15 +0200 > > >> (pos-visible-in-window-p nil nil t) should never return nil as it > >> does in the above recipe. > > > > Why not? > > Because in the manual we say that > > "The argument POSITION defaults to the current position > of point in WINDOW; WINDOW defaults to the selected window." > > If the current buffer is not shown in WINDOW, the first part of this > sentence is wrong. So the only problem is that of inaccurate documentation? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 03:33:09 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 07:33:09 +0000 Received: from localhost ([127.0.0.1]:39550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLhDg-0005iW-UT for submit@debbugs.gnu.org; Thu, 02 Sep 2021 03:33:09 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLhDf-0005iK-Io for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 03:33:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jt7Ud33Y1nODaiTtSttKHRNtUI5b5x5iibnjvtMSWUw=; b=gzWKGXJbaFowEeUiLtNuUKqVGV sQ7hst3tGG+PPw3Ydp6sksXczKE5yCzYZBs0SzvEVyTVzkuOXmEjBiCkM0egjgeO8RBafgndPdltY 8+F0oqRW/nXspkBx2Ce/NoH/ZtSt//7bwaVkJQWQpVTgk9pVZBBqKNyuxmXQrH3UueqA=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLhDU-0003oy-To; Thu, 02 Sep 2021 09:33:01 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> Date: Thu, 02 Sep 2021 09:32:56 +0200 In-Reply-To: <831r67ph8d.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 02 Sep 2021 10:30:10 +0300") Message-ID: <87tuj3bffb.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: >> Because in the manual we say that >> >> "The argument POSITION defaults to the current position >> of point in WINDOW; WINDOW defaults to the selected window." >> >> If the current buffer is not sh [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: martin rudalics , 50256@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> Because in the manual we say that >> >> "The argument POSITION defaults to the current position >> of point in WINDOW; WINDOW defaults to the selected window." >> >> If the current buffer is not shown in WINDOW, the first part of this >> sentence is wrong. > > So the only problem is that of inaccurate documentation? The doc string makes sense to me (that is, if it did what it said, it'd be good). That it doesn't do this is a bug, in my opinion. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 03:34:19 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 07:34:19 +0000 Received: from localhost ([127.0.0.1]:39554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLhEp-0005kG-8F for submit@debbugs.gnu.org; Thu, 02 Sep 2021 03:34:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLhEo-0005k4-6u for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 03:34:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51870) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLhEi-00022z-Vj; Thu, 02 Sep 2021 03:34:12 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1352 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLhEi-0004VW-07; Thu, 02 Sep 2021 03:34:12 -0400 Date: Thu, 02 Sep 2021 10:34:10 +0300 Message-Id: <83zgsvo2h9.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <87y28fbfud.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu, 02 Sep 2021 09:23:54 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <875yvknpls.fsf@mail.linkov.net> <83k0k0p0am.fsf@gnu.org> <87ilzjijto.fsf@mail.linkov.net> <87y28fbfud.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: rudalics@gmx.at, 50256@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: Eli Zaretskii , rudalics@gmx.at, 50256@debbugs.gnu.org > Date: Thu, 02 Sep 2021 09:23:54 +0200 > > Juri Linkov writes: > > > So the conclusion is following? There is a bug in the low-level > > function, but we ask users to be careful and to take precautions > > against stumbling on this bug. Then the problem is that such warning > > should be documented somewhere. > > I think we should fix the low-level function, myself. Which low-level function you'd like to fix? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 03:46:20 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 07:46:20 +0000 Received: from localhost ([127.0.0.1]:39594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLhQR-0007Es-Pn for submit@debbugs.gnu.org; Thu, 02 Sep 2021 03:46:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLhQN-00076q-54 for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 03:46:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52066) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLhQG-000426-NR; Thu, 02 Sep 2021 03:46:08 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2108 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLhQG-0008Ix-Ab; Thu, 02 Sep 2021 03:46:08 -0400 Date: Thu, 02 Sep 2021 10:46:04 +0300 Message-Id: <83y28fo1xf.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <87tuj3bffb.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu, 02 Sep 2021 09:32:56 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: rudalics@gmx.at, 50256@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: martin rudalics , juri@linkov.net, 50256@debbugs.gnu.org > Date: Thu, 02 Sep 2021 09:32:56 +0200 > > Eli Zaretskii writes: > > >> "The argument POSITION defaults to the current position > >> of point in WINDOW; WINDOW defaults to the selected window." > >> > >> If the current buffer is not shown in WINDOW, the first part of this > >> sentence is wrong. > > > > So the only problem is that of inaccurate documentation? > > The doc string makes sense to me (that is, if it did what it said, it'd > be good). That it doesn't do this is a bug, in my opinion. Our doc strings didn't descend on us from Mt Sinai, and aren't carved in stone. They were written by people, and may include hidden assumptions those people had in mind that could make other people interpret them incorrectly. So to decide that the code is wrong and the documentation is right, we need more evidence than just what the current documentation literally says. If we want to support the current documentation to the letter, the only way of doing that I know of is to force WINDOW to display the current buffer, at least internally, i.e. to switch to the WINDOW's buffer for the duration of pos-visible-in-window-p. If that leaves everyone happy, it could be done relatively easily, but then I wonder why does the code in question with-current-buffer, and what would break when pos-visible-in-window-p internally switches back to the buffer shown in WINDOW? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 04:54:55 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 08:54:55 +0000 Received: from localhost ([127.0.0.1]:39756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLiUo-00084l-V0 for submit@debbugs.gnu.org; Thu, 02 Sep 2021 04:54:55 -0400 Received: from mout.gmx.net ([212.227.15.18]:34761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLiUn-00084W-DN for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 04:54:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630572886; bh=V421WuWiJag0fQLxljjzagpMIcVArxfMxeQjWMzbCYc=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=a+njOLulVzErBVolUPJjYv2n3xR344c0g2YrqUNvSR9gLxBN35O11R84oA7voq3gn ez7T+fH9c+omDiOatnHzRZTPvZHFh70t6k7xjN7MpPj0XGPVZQGHO9kP/O9Ds5Xc30 qdrCQ9E40zgPBb1T3Mo/d+SiYiu/2+7oWAIncVyc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.24]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MTiPv-1mYCoS3kFh-00U3B2; Thu, 02 Sep 2021 10:54:46 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii , Lars Ingebrigtsen References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> From: martin rudalics Message-ID: <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> Date: Thu, 2 Sep 2021 10:54:44 +0200 MIME-Version: 1.0 In-Reply-To: <83y28fo1xf.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:15X+5bBX2gT2TtBTFEPaySEyEvF3H//MSLPs/ebOrFqPsy7KXXb 2xru+yFfFAFVGX1/9ojj0JC3j/ud91mUG4t9/L0U2xggTEO/G/sg9PAKJSwsMrqrZkbGSt8 40f2Q4Sc49TEcohVvnYKprAVZmD65J8CemCEjoFrh1niHpMbq38aP5IUHCoHp9ifpOUpi4K VO+Ag3E+W5fIGCg1WD4jw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:P1uwGkZBOOI=:AU/xGbWoTYib/AHySodoOE PxMxMMdCiy30xcFTO9oI8qvZXLyykWEYuCGbbKWUirbo0TaiMQUsrk3g3tHwnodvfiFdWaqvH woGR6nTFAbyinBM5apus5WIpgJRqCAkhgd3ECFFEyOHUNmNP2e2Gklr3odPMpEbcfoLD5WqDv LLUjfR3xsXLXcfit4v4EE3TfUR7/3TZgnqJskVm+MlqVDYzT2Xk28zb6VXSCOkj28X+B7XXIr y9E3GuXKoXcqWQKTaaWRGzCkyI8O4dBDAYHaunmzAp06HhAFfdCsOYwGePtQ2+Giz1sGLkZ36 RySH2ngzPD7bWjyNMDeBxTh0/Plo7mcTixpSE8P9430NPlR6WPXXmHK2qVI05F+5z/Et95tB3 ufM1ZYmsW/LtjEGT02O1gBbViaokGlZKzfUL8/M8pea8IairVn5TsivVSsDvo08wyOpRh7Wjy OPe2Kcbucd5+rrEXqpQqrBqdjdU0hpA0KshEtAuOnAR6GBdHyffiSbN/7lV/SX1g17kR/nveH z3vjd5z26e43o9JQKKde0v6qLmbbPnFoelN68regG7iXyNY0ciS1x+d6Mgwi11Ds59OkXmk/a uhDheZUtRkBKEkxHohLnWsnM6OxZsa8gJhs3FHHnZab267JsHXqzIIW+alvYrToPaVGDfmwcN bguNKrfJ7NGwKecek6kPvM27x1YVwJGm7s9tf358GALOWPpKo+g7wGiGjTuR3geh95CFUpdHd zWrWLNh6PCHFppQqv+3iakgS3SibrEI+OMkoLMlTNTOAnQP9OU39CjVMWsOGpLKgMpMcqR5/1 XLvgUc6XGi7E6tGpnxj1i7zWUJ56HAqiQ7vbiSnHeDj9CrB1zwmPKJbUt+sF2OE24swHuUKlw 7RubkjxNCAFqPj6UlEMR2FNKl+xWGSWHSKrF50GyCwQdbbXNAKgmzSmCSENYW7SbRsnnppfud intl7Y+WHmAFbLHSGcOfUBeo4DmdA3yUxDNU9vtw8TAUtzFqnM0V/dtqv/nflV2vuoSrMCXES UYokYK6locgqXwrOmtCccMtty1R7X0RXuIHDRZML/H26ptZPJ53gged0Ksu7GV3IeeqEy+DIH PrYq+2hB1ZG/osaehVEMALQx4jtF+A8SR4Q97RtnMLpXAApwu0wmhuM+g== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > If we want to support the current documentation to the letter, the > only way of doing that I know of is to force WINDOW to display the > current buffer, at least internally, i.e. to switch to the WINDOW's > buffer for the duration of pos-visible-in-window-p. If that leaves > everyone happy, it could be done relatively easily, but then I wonder > why does the code in question with-current-buffer, and what would > break when pos-visible-in-window-p internally switches back to the > buffer shown in WINDOW? pos_visible_p already does if (XBUFFER (w->contents) != current_buffer) { old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (w->contents)); } martin From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 05:03:00 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 09:03:01 +0000 Received: from localhost ([127.0.0.1]:39788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLice-00021U-O7 for submit@debbugs.gnu.org; Thu, 02 Sep 2021 05:03:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLicc-00021H-PH for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 05:02:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53992) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLicW-0001ak-Li; Thu, 02 Sep 2021 05:02:52 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3090 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLicW-0004yA-8v; Thu, 02 Sep 2021 05:02:52 -0400 Date: Thu, 02 Sep 2021 12:02:50 +0300 Message-Id: <83pmtrnydh.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> (message from martin rudalics on Thu, 2 Sep 2021 10:54:44 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: juri@linkov.net, 50256@debbugs.gnu.org > From: martin rudalics > Date: Thu, 2 Sep 2021 10:54:44 +0200 > > > If we want to support the current documentation to the letter, the > > only way of doing that I know of is to force WINDOW to display the > > current buffer, at least internally, i.e. to switch to the WINDOW's > > buffer for the duration of pos-visible-in-window-p. If that leaves > > everyone happy, it could be done relatively easily, but then I wonder > > why does the code in question with-current-buffer, and what would > > break when pos-visible-in-window-p internally switches back to the > > buffer shown in WINDOW? > > pos_visible_p already does > > if (XBUFFER (w->contents) != current_buffer) > { > old_buffer = current_buffer; > set_buffer_internal_1 (XBUFFER (w->contents)); > } I'm asking if this is the desired behavior, when Lisp runs this inside with-current-buffer? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 08:42:28 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 12:42:28 +0000 Received: from localhost ([127.0.0.1]:39986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLm2z-0001Dr-9G for submit@debbugs.gnu.org; Thu, 02 Sep 2021 08:42:28 -0400 Received: from mout.gmx.net ([212.227.15.19]:52309) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLm2x-0001Dc-5u for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 08:42:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630586536; bh=FQ/4rJYPuzcaIdla9AMuDp9YnvjtQyEZHJVEHAN+ujQ=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=cGqTcgWkX5w5SagN+BBsa90BX0estm3aii84vIw10OegK6GOZsU1iXAnZdh08hWw3 3UhEsSAnm7lsvwbpaUzaPwylIpt4aiqQgmZ0OMPEFw45Gy1Yrj1QfojunIG+lT1+C+ 2gTk+mioLVtirnqOoynTexgoQ1Q/u92s6rttDEBc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.24]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MyKHm-1nBHls1SQe-00ydgG; Thu, 02 Sep 2021 14:42:16 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> From: martin rudalics Message-ID: <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> Date: Thu, 2 Sep 2021 14:42:15 +0200 MIME-Version: 1.0 In-Reply-To: <83pmtrnydh.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:urXl6xNf1H0H6gEPsVePnMuUKk/HB4L+Uscw6/T+xdCwbPRPkQK OOv5OStDv8+vHEizHxlc8uIRy59HBhfcBaQMLZSMNCNG1AetPqDfuyHb5ptzGzSJqSv/7AU JZR37e36osJkdK+dVp/AmDvqfGYlvee2tjz3bZRBfWmpmEzxuk1MZOQA7Muz31U7teIvwvc fJNqh6ZLXQZwbR9KoOJgQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:4DtW2nb1O8I=:gCoNPDGV5D4kqAByDVKmy2 OGQva4SmfwvvqByyr8WfQ/mV/7mCFJHqKj+rqF938yWZrr3WOkrtxogPsTbL/pX12SlN8RkoD tf3H269zaa+VwE3XEf1qoe3Xm23FJM98pGJGCA95bELSEe3KYOcLde5iw0NCz7gY/BBqizW6O E64W+S8aUaaeIn18i8f/ifiOVEiIymsgLvXtqACDijv58Rm5oR3V2iO6MDSVoMvW7ErJ//ccw 25AFbqDGwQNS7wiql/NdoK6m2NubwwHBQFkrJdvFzJZ2VOUQpCz308CzMm5mO2+70PprQM060 UO2FIwOePffd1n+hj0PKiyWPcjsJu/npDfGN+YgSBsglnbTyQovhbgpZVePO/we6GvYOQm8C/ P7cuzXbR1NYJKm/YOhLihKxYIUfL7Ne4NJhaCVUnxAt1G5ZxLUZBP9kugsnjFph1H0f4hb4w5 1AlUK8b0R5wdVTkj+GtORfw17YU1g0muPQ27d25DahBxaE/iU7giG7qvQyCWgocwAErN0gd/N LaubpnwCHDbh6+5KUwKYn/lOp+Qza3Sxf4fGiiBVU1tkMk8ggrO5u/QtSi5MsXEOBXMFJ7m66 +75rt/VHqDT2TZQZvexzytpgItKt4H+7nRkziMRPNQtJoh/D4Bg/1ChhGjmBGa5JymNstAfH6 Q3GtdGaJOslJZF4mAc1P+x+oq1domcUuF4qbXqt206DBttZLm/k/CSJyxQ0gRejBnTT+6cP+L /o53TxblHvluJkvtPH7ksFyMa5eUXwoUkdLT7CYsv0e91ztKMtykQRNz4aoP9HOQ4igaWymjF /qoO/a32wN57xKyoCRbRsuRU13jjGSLZz0NZHfRbhKHaNVvSxBXUKqqoTGNGIfh0l62bqFi0v 7DCxw9hily44aAtH4LNWq2xj4125PYWwxKR3UBLmRkX5ragVlF3XgFrkTqNFAC7oLgDt1p+9v 7h8lifZa8+yvKwmoudSmVq1kIR1NBJ4t1q/R+Xi7Vdrm61gNU/nMir1Na+qHHfr6a8vUbbtdm JQ9hICzI+YhQx98LOj1kkhYukDeXymp6swxBYTUNx2Vkf4kItYCh8nBgYUZj+m+LFTbwG+Cgx KINx3YLvjkL7VmU5ME01M6GH2Ce8qpi1R9JrGCF37eci4ZfnzWnBWePCQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> pos_visible_p already does >> >> if (XBUFFER (w->contents) != current_buffer) >> { >> old_buffer = current_buffer; >> set_buffer_internal_1 (XBUFFER (w->contents)); >> } > > I'm asking if this is the desired behavior, when Lisp runs this inside > with-current-buffer? It is the _necessary_ behavior when WINDOW is not the selected window and its buffer is not current. Regardless of whether it happens inside `with-current-buffer' or not. martin From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 09:13:31 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 13:13:31 +0000 Received: from localhost ([127.0.0.1]:40007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLmX4-0001yc-MP for submit@debbugs.gnu.org; Thu, 02 Sep 2021 09:13:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLmX2-0001yO-D4 for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 09:13:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60602) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLmWw-0005Jt-Nk; Thu, 02 Sep 2021 09:13:22 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2748 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLmWw-0002fw-4Q; Thu, 02 Sep 2021 09:13:22 -0400 Date: Thu, 02 Sep 2021 16:13:17 +0300 Message-Id: <83k0jznms2.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> (message from martin rudalics on Thu, 2 Sep 2021 14:42:15 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: larsi@gnus.org, juri@linkov.net, 50256@debbugs.gnu.org > From: martin rudalics > Date: Thu, 2 Sep 2021 14:42:15 +0200 > > >> pos_visible_p already does > >> > >> if (XBUFFER (w->contents) != current_buffer) > >> { > >> old_buffer = current_buffer; > >> set_buffer_internal_1 (XBUFFER (w->contents)); > >> } > > > > I'm asking if this is the desired behavior, when Lisp runs this inside > > with-current-buffer? > > It is the _necessary_ behavior when WINDOW is not the selected window > and its buffer is not current. But in the case in point, WINDOWS _was_ the selected window. That's why pos-visible-in-window-p used PT. Which is what you said was the bug. Or am I missing something? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 10:43:15 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 14:43:15 +0000 Received: from localhost ([127.0.0.1]:41714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLnvv-0004cJ-Ks for submit@debbugs.gnu.org; Thu, 02 Sep 2021 10:43:15 -0400 Received: from mout.gmx.net ([212.227.15.15]:58173) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLnvr-0004bw-Hm for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 10:43:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630593784; bh=6VhtAJW+6pv4VIb/npwB857XffHvMS9gXmUTLWWZSmA=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=VI18W1EsYww8B0YujhmdwSbkPGxlpKNjPFhbYiyNcs3f5IGURLqeVfmuIW9wyNFjW a8oeUJbKmy3j58VC0Le1PhMPPnXo2Smm/XHqFyoNSwSRurNe9AdsHAQ5yCISffgzuz ILJroFTvORMJ0OKlOL+4onuluEIbNBim1A578Uxg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.24]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mel3n-1mwFDB1ej7-00anm2; Thu, 02 Sep 2021 16:43:04 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> From: martin rudalics Message-ID: Date: Thu, 2 Sep 2021 16:43:02 +0200 MIME-Version: 1.0 In-Reply-To: <83k0jznms2.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:CcC6qyjsRcygGxQ7E42nC4va5yoIfFadZGUwXA9sh8bbke4GegM ZR51jvr+djfS+bhMYpVBaw4tOuqfAMqm19sTKPP4nk9DHWbbB/tTFfvzKqtJgB5f/z14tbW tvZhI7RNp16xiAiCAVZbPzLEJO9IHXbqMwyTPLwD2xSQLqpnmauUW9Vt9GKeuGw71GdMoqm CF6POI8UieHn+s0r1OnSQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:TR8Nxln9CmY=:Clr1uKa5MpMQOdz/KIRah6 mobt7E4RnHEcPJdX2uvXzXzjQzcBXrLP6hVmSiDPyaI5wxfW1lqnUzP82IqxRCVQi53lzQi/2 KwWPFyN/HxRFXuKucwHmP479qofT1cgF1tCy0jrnA/wqpa7v05gRfXp1Kx4VHE2j9cO8Z1rTt YFDcoFjpymY0ITp0s2GV84CijNZLVgITrAdCMux4dnGsEg9KYNamPQAs3ku0C2fd/4FWKDGnC poiGhjSdLqtOTDqQIj1lGH3GLHCuO3eFj9Tx3yWmHwfsEIIZk9DgNTBiOq0xBWWi244wRCAG9 wGwGClnqijC/JzratrQVv2tbKxBxg6zbeP0N55E+rOdBeXjJkF+gzLZ1gcfkS3g1mdoS1tYAC 0HzIaw8u1hyS2J6ZtCjOKX2lr7Eg7+WOk1TF8j2QXF+gV7yWvcUIrdngIR7Pdca/nVFrzE5mW p7djJhSDdpZ1r8jDHQ8UzF9F+HvEJ+INVGCy++fZReIC7o3x65WvXykw539KAkE0v3k64zoD9 symAq0bOVz0E8bVp6Y+SM2kJqwlopq5XvUAHJS23QiaoZlz2EoxOR7YJPhhvW1abAQ5hzbWpG sVc6UUkKP0GRNyaqbn/GTYF1FGgfJklWNaDCr6EspR2AA7Un3gtGD9nkxEmWBxZThH6iByCm4 YaRFNag7TXZCLGm22N6qgJ5HXBSEOlhAVO0f/RklPLn1xLYYtC/S7hYQxBbVgJQ1tBHKIrI9s QGCgGZuuR/bstXxNfT5DTH+yHgJ8rYR43K/fcP6BK8ReqOK/t9uGftHVmIlf1kbc5I6b5o4B1 pSL2Mmj0WTHFcp+TPAi5JYvwPjNO0KEqHyUYuY581v/OZ5sxtJt3+C80ZD1IJS78UPSYSooJG xJPRUAIzcxXNTXrlZPeAtzs42PBuf1Esm1izA9O9h5PqK8WWBG5FfMRIVXLcyOU0AfVsVk+bU W+1XPlOJCggY9R2L0oiLvvkvn9XPcx8pVD4PvlbIqHziVXHClNJFG6utQhDroRAbyPBSLFZVq hGWiTda1xED0jxPwSl7qJgIGnCI3oTPFyMuy1g0stsbb4njlbq6YkMJqWrNAMcaVNuFsm3rAl W5I8plM2P3XcyyW47ki01PnWXBPiD9r+meflbCJDV46f4NtCu4t1gVgEA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> >> pos_visible_p already does >> >> >> >> if (XBUFFER (w->contents) != current_buffer) >> >> { >> >> old_buffer = current_buffer; >> >> set_buffer_internal_1 (XBUFFER (w->contents)); >> >> } >> > >> > I'm asking if this is the desired behavior, when Lisp runs this inside >> > with-current-buffer? >> >> It is the _necessary_ behavior when WINDOW is not the selected window >> and its buffer is not current. > > But in the case in point, WINDOWS _was_ the selected window. That's > why pos-visible-in-window-p used PT. Which is what you said was the > bug. Or am I missing something? No. The above was meant in response to your earlier: If we want to support the current documentation to the letter, the only way of doing that I know of is to force WINDOW to display the current buffer, at least internally, i.e. to switch to the WINDOW's buffer for the duration of pos-visible-in-window-p. I mean that we needn't do that because pos_visible_p already does it. So I'd just propose to do the trivial (line numbers are not trunk's); diff --git a/src/window.c b/src/window.c index cb8fe5fcdb..bfbed01749 100644 --- a/src/window.c +++ b/src/window.c @@ -2199,8 +2199,6 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, posint = -1; else if (!NILP (pos)) posint = fix_position (pos); - else if (w == XWINDOW (selected_window)) - posint = PT; else posint = marker_position (w->pointm); martin From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 11:59:13 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 15:59:13 +0000 Received: from localhost ([127.0.0.1]:41826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLp7R-0000CG-DG for submit@debbugs.gnu.org; Thu, 02 Sep 2021 11:59:13 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:59801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLp7P-0000C4-Hm for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 11:59:12 -0400 Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 9529F1C0008; Thu, 2 Sep 2021 15:59:01 +0000 (UTC) From: Juri Linkov To: martin rudalics Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> Date: Thu, 02 Sep 2021 18:58:40 +0300 In-Reply-To: (martin rudalics's message of "Thu, 2 Sep 2021 16:43:02 +0200") Message-ID: <87v93j9dfz.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, Eli Zaretskii , larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I mean that we needn't do that because pos_visible_p already does it. > So I'd just propose to do the trivial (line numbers are not trunk's); > > diff --git a/src/window.c b/src/window.c > index cb8fe5fcdb..bfbed01749 100644 > --- a/src/window.c > +++ b/src/window.c > @@ -2199,8 +2199,6 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, > posint = -1; > else if (!NILP (pos)) > posint = fix_position (pos); > - else if (w == XWINDOW (selected_window)) > - posint = PT; > else > posint = marker_position (w->pointm); I confirm this fixes the reported issues. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 11:59:35 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 15:59:36 +0000 Received: from localhost ([127.0.0.1]:41829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLp7n-0000Cr-L3 for submit@debbugs.gnu.org; Thu, 02 Sep 2021 11:59:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLp7m-0000Ce-08 for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 11:59:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38320) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLp7g-0003CR-EQ; Thu, 02 Sep 2021 11:59:28 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1108 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLp7g-0002r4-1w; Thu, 02 Sep 2021 11:59:28 -0400 Date: Thu, 02 Sep 2021 18:59:24 +0300 Message-Id: <83o89bynmr.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: (message from martin rudalics on Thu, 2 Sep 2021 16:43:02 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: larsi@gnus.org, juri@linkov.net, 50256@debbugs.gnu.org > From: martin rudalics > Date: Thu, 2 Sep 2021 16:43:02 +0200 > > >> >> pos_visible_p already does > >> >> > >> >> if (XBUFFER (w->contents) != current_buffer) > >> >> { > >> >> old_buffer = current_buffer; > >> >> set_buffer_internal_1 (XBUFFER (w->contents)); > >> >> } > >> > > >> > I'm asking if this is the desired behavior, when Lisp runs this inside > >> > with-current-buffer? > >> > >> It is the _necessary_ behavior when WINDOW is not the selected window > >> and its buffer is not current. > > > > But in the case in point, WINDOWS _was_ the selected window. That's > > why pos-visible-in-window-p used PT. Which is what you said was the > > bug. Or am I missing something? > > No. The above was meant in response to your earlier: > > If we want to support the current documentation to the letter, the > only way of doing that I know of is to force WINDOW to display the > current buffer, at least internally, i.e. to switch to the WINDOW's > buffer for the duration of pos-visible-in-window-p. > > I mean that we needn't do that because pos_visible_p already does it. > So I'd just propose to do the trivial (line numbers are not trunk's); Yes, but I'd prefer that we first established what is the desired behavior in this case: > (pop-to-buffer "*Messages*") > (with-current-buffer "*scratch*" > (pos-visible-in-window-p nil nil t))) IOW, what to do when WINDOW is the selected window, but the current buffer is not the buffer shown in WINDOW? Would you please humor me with an answer to my question? I'd also like to hear from Lars and Juri about this. Without the agreement about the behavior in that use case, I don't see how we can reason about the fix. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 14:29:27 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 18:29:27 +0000 Received: from localhost ([127.0.0.1]:42028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLrSo-0001xN-Q9 for submit@debbugs.gnu.org; Thu, 02 Sep 2021 14:29:26 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:39981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLrSk-0001x7-Pg for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 14:29:25 -0400 Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id A49FCFF807; Thu, 2 Sep 2021 18:29:14 +0000 (UTC) From: Juri Linkov To: martin rudalics Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> Date: Thu, 02 Sep 2021 21:28:32 +0300 In-Reply-To: <87v93j9dfz.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 02 Sep 2021 18:58:40 +0300") Message-ID: <87y28e4ysv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> I mean that we needn't do that because pos_visible_p already does it. >> So I'd just propose to do the trivial (line numbers are not trunk's); >> >> diff --git a/src/window.c b/src/window.c >> index cb8fe5fcdb..bfbed01749 100644 >> --- a/src/window.c >> +++ b/src/window.c >> @@ -2199,8 +2199,6 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, >> posint = -1; >> else if (!NILP (pos)) >> posint = fix_position (pos); >> - else if (w == XWINDOW (selected_window)) >> - posint = PT; >> else >> posint = marker_position (w->pointm); > > I confirm this fixes the reported issues. Actually, whereas it fixes the reported issue, it breaks everything else: moving point up and down always jumps to the fixed column like goal-column, selecting a completion from the Completions buffer always says "No completion here", 'C-c C-c' in diff-mode jumps to the wrong hunk, etc. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 14:41:23 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 18:41:23 +0000 Received: from localhost ([127.0.0.1]:42038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLreN-0002Fd-0V for submit@debbugs.gnu.org; Thu, 02 Sep 2021 14:41:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLreI-0002FN-8c for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 14:41:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45054) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLreB-0002cm-VY; Thu, 02 Sep 2021 14:41:11 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3308 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLreB-0004px-Im; Thu, 02 Sep 2021 14:41:11 -0400 Date: Thu, 02 Sep 2021 21:41:06 +0300 Message-Id: <83czpqzupp.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <87y28e4ysv.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 02 Sep 2021 21:28:32 +0300) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: rudalics@gmx.at, larsi@gnus.org, 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Date: Thu, 02 Sep 2021 21:28:32 +0300 > Cc: 50256@debbugs.gnu.org, larsi@gnus.org > > >> --- a/src/window.c > >> +++ b/src/window.c > >> @@ -2199,8 +2199,6 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, > >> posint = -1; > >> else if (!NILP (pos)) > >> posint = fix_position (pos); > >> - else if (w == XWINDOW (selected_window)) > >> - posint = PT; > >> else > >> posint = marker_position (w->pointm); > > > > I confirm this fixes the reported issues. > > Actually, whereas it fixes the reported issue, > it breaks everything else: moving point up and down > always jumps to the fixed column like goal-column, > selecting a completion from the Completions buffer > always says "No completion here", 'C-c C-c' in diff-mode > jumps to the wrong hunk, etc. Figures out, because the window's point didn't get updated yet (AFAIR, it is updated by redisplay), whereas pos-visible-in-window-p is expected to work before that. I think we need to special-case the case of the current buffer. But I'd still like to talk about the semantics of calling pos-visible-in-window-p when WINDOWS is the selected window, but the WINDOW's buffer is not the current one. Who "wins" in that case, for the purpose of the default value of position: the window or the buffer? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 14:47:08 2021 Received: (at 50256) by debbugs.gnu.org; 2 Sep 2021 18:47:08 +0000 Received: from localhost ([127.0.0.1]:42055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLrjw-0002PL-6N for submit@debbugs.gnu.org; Thu, 02 Sep 2021 14:47:08 -0400 Received: from mout.gmx.net ([212.227.17.21]:36611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLrjt-0002OR-4p for 50256@debbugs.gnu.org; Thu, 02 Sep 2021 14:47:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630608418; bh=SI4Iwj4UIWx65uSkeBZu2AmzfF5gj7O6a/eNrZNU1gU=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=j33DHWsgL1KkTiOuVfp+Jv5gdb0vXpwLK3IJlgn9gw8dLsnsftdQ0f3zdv+CnTUk1 fn23iACngqcHrwjEzwLwTP/EuKljVXBQt6oc+n1EJOL8Flkr8ZmUKQ/tqv/Ruw6DmP g5RShPPvIEnB2AKm7Xo/FX4CgkZuCfoUVEclxuD0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([46.125.249.53]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M1Hdq-1mObpQ0gDy-002sdl; Thu, 02 Sep 2021 20:46:58 +0200 Subject: Re: bug#50256: thing-at-mouse To: Juri Linkov References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> From: martin rudalics Message-ID: <918d18ad-2def-1012-06bc-69351b560574@gmx.at> Date: Thu, 2 Sep 2021 20:46:57 +0200 MIME-Version: 1.0 In-Reply-To: <87y28e4ysv.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:tRImbMuyUmKMxJwmtNsBI1rvecpGzPisJ8iqBu+l+RJ5Hb+vKMx guEchLaeJoJb3sRTyKsLxKx3rTjHMwq/N98JFQB8yrJBBG9rqgDeziELw0/18mQ73pslIXa BNVCWyJV6B1svl2p3aRgAygHsQQ6+hRa6dU8oA7ijqZrfqhufxjQ0mJBT5YT1hlVILATl6p MvQ+3CXsQCgWYvR32wT0Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:c0CPKmXod7A=:jysB3+1PD50B2++ZepMlNo WZpyKU+8D3gleb1WG8Osf6PlLtWxa5gNpipfwmDGqGN0fcK9Wb1Bi3F3BZUNCOb+ESFPRUC1z X/KV84VBFNKszu6e7p/1+soSlOpOBYFB3Wogl0/+3SLMaJkeIaEL6pL+9HRkKz/2wu/CduhuD 6jftKjSTphYu564VTq+besdBP7JBiIH4oa7hgqiVrf39RTERt7CKdPi3Lgzju1/0DBJtFQreV 1vumqelORqcA2JMZpbdK8IGqx8uaH68K3z+A2p79ADladTup0cc2EjIRNzZg2HKT2pWuuA7cC 0Z6hsr787PU9alqDvbKwt+o3vuorkur8RJLhYzYeIoAOwggJprHujLRkjq8kqbSZ4O03JOnt2 lt0+TvRJJRYgcogYuykRxc5mi7yPuSFTZ/w2DzDer9WrrrZLkJwzRh8UNaRQnTypYjDG7nOUS 0VmvG0ooICNQtrsz3930mlF15Majja7r/wrxz+JvMXZCOyi00OKVNjr4yes15t4o3Xg3RLeVV 01IYsbujDy35N07bBx0J5oANk9ca9qdlg6oQPs/kFU+YlwwDU9Kz46jh2Yzo0EHm9SAOayPnU 9DKQ8TznCRZoG3NXw1tYfuz41coSvht0YeJFweb7KGJZOzV7vbgu+Xo1GLHEO6xTskIQJhuFw nvEj02g+2sb+8QNqeA3v/4+2CRhjzWTsBIB+5jYNHsU7Og5OqWyWuP9hYaNPiV585cenrpYkP lGwYGWfJp/5X9o+5er3cE/uoHDTvSe1IdIMxaeasPuwelGtSQ9ahyk7lITVJtjMHWQoKVq6Hc 8RJ+ljwJYOMktzmKMApg1T5kuKBZk9JnCik4e5JJ90aGIw05jhb/CmKDZej5seVCVTQiKdMZR 9lUfFfE9t8p/c1sO2SuBAnEXUzhXMSJXLTJidKWby6dbFAg2VLHlAY9RXd8As9veBAuXDmhNS 5oUq7fTLUYzIryLyUtPOIO+amglIf4Szmbki8UaQmp34tsFRfIg0+qNhwNMpeFcOJPP1B4WlF /c400neyjjd9+LYFSG4wMk5uiNzonT+kKYU5yTu7vZ2v9/M1FYPd7p+doofLPVBzyks8EGgYK NtqOohF7K6iMmJed3KnOGTsV3vR6nz9kinWAAqsyxcNphQmdq28IvQ61w== X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Actually, whereas it fixes the reported issue, > it breaks everything else: moving point up and down > always jumps to the fixed column like goal-column, > selecting a completion from the Completio [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [46.125.249.53 listed in dnsbl.sorbs.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rudalics[at]gmx.at) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [212.227.17.21 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) > Actually, whereas it fixes the reported issue, > it breaks everything else: moving point up and down > always jumps to the fixed column like goal-column, > selecting a completion from the Completions buffer > always says "No completion here", 'C-c C-c' in diff-mode > jumps to the wrong hunk, etc. Is the below better? diff --git a/src/window.c b/src/window.c index cb8fe5fcdb..e86f50e600 100644 --- a/src/window.c +++ b/src/window.c @@ -2199,7 +2199,8 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, posint = -1; else if (!NILP (pos)) posint = fix_position (pos); - else if (w == XWINDOW (selected_window)) + else if (w == XWINDOW (selected_window) + && XBUFFER (w->contents) == current_buffer) posint = PT; else posint = marker_position (w->pointm); martin From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 03 03:40:47 2021 Received: (at 50256) by debbugs.gnu.org; 3 Sep 2021 07:40:48 +0000 Received: from localhost ([127.0.0.1]:42729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mM3od-0002dm-LH for submit@debbugs.gnu.org; Fri, 03 Sep 2021 03:40:47 -0400 Received: from mout.gmx.net ([212.227.17.21]:47313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mM3oa-0002dG-CB for 50256@debbugs.gnu.org; Fri, 03 Sep 2021 03:40:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630654838; bh=BQjFqnpMf5OJNNW8fQw5cjSrobt9jT5eOR/pN9Sj1f8=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=bt6XZ48Oebqe7tdr94tSxMVdrNk7xBTv2F6fLzfCaze29k1EJeur83BqaoxoR4AZX DB2RwQGewu+2IS7hu995Pt5ZwtZsA+31Lz/UhTuy++h/KWtJ8TbPgKzmrsPfGBX1yk MTGiQ/yy2O8e1i4aYVqC0VVOqcmw+LYfgW8DtFnA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.4]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MeCtj-1mwV9t0127-00bKhM; Fri, 03 Sep 2021 09:40:38 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii , Juri Linkov References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> From: martin rudalics Message-ID: Date: Fri, 3 Sep 2021 09:40:36 +0200 MIME-Version: 1.0 In-Reply-To: <83czpqzupp.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:0PnVrtbAZXTUDbiaYbqFBc09pPWol3+2kuHR2a7xOsXi6OdmoLF G8uED1RvkZ8XyLxfJEpPcg0PUlP4U/rxbQqqHDty1dpReNDwLM2efOqql66lHRYLk0FiiSZ F9XydNHjp5+rMmy53Nn7/vfSeZRVZwVmugLp1I7AfrV9UkB8QFoA6qnlDyYOdIB/9vY/o7x A/hnUJap1xEy/NX4jmMvQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:i48nien1S0E=:c/bMjVZT5L9822E3HMF5pL 3OgcDPVvqytlrogH4CYDiSj5wuWKNMNFvcRocLosqMNBNPeQm3aqDW/nfRtYmPF4fcWrL0jlQ Znh/lBZ2u/YlXtyhLbi8Xn0THPrt6Tj7kCw/P8pYGJIn8w9k8puCXppkKvvxfIGg0S8gVVjgd K4lQffl7SYePswI62mWJtNFF4a5Ji7DdELw5HzH3HfEaxZFfhVgF9NmIvKhI74nOmf4zQs7I7 32PJHUz5giUp5exvD+CrTv7h3heDU/gcjSK3xNI3Eegb/vL2/pqDI1aTspr8YhPfN2VUllPK9 NpQN7IfkzBeM/1EWfuVEiCANeysWPyBu6OMVcCOhcNgjKDJailpmL7ZDtej0Xtk2GKclCtolo ebX0Cs3CFzEwijlWWhnc/U/PzGWLwq8qwhPa7hdnE29+uctTJnIs5d0el/4FSCno0/FYvSoR9 0WG4MBMA0vo1T6XkiNU7BALmM9Q/ZMFqotO5zIXZjjbG61/tjaDql4Hwa/93oIQ+Z/9VCsTm/ V83bKwZHVpviuZ0ZSBA7xOtH5/fOVOy/5xFNKp2vGj3BboissZbd5eXGG4gphZ5OZ111Nvmdn k1yxb960mKgns07cE9p+s3rYKiUjoYZEbM5PT1ppyEGNGK9stBm5c/2rb3j6KILsCOBkStVS3 oJmAOm833xdMZc39LDF0fPoQYirx1md9WMEksaCnJ6tAmodanNgkl0QIVv/+HJrtlj+J+1fiK zRmDKsQtwIo1noqqxoNqWkjsnCze3tn6Sgzs/HF1rKL+YZ5Bsd3OK5Al7J6+ExBYDQo770TgY cc5ez8KPMs5zgsl0IT7swUDHwrA9bhaUx6tJOu8Wrslp9Bb4wmx81LhGzwGQ2dS3mLwgMCyuj GJcfI0u0KlP7EN0eTSU3gGwdUVFn8+KffsNhteQ6r9aDTheq7Ab/1yanECvnQ+IV6xYGSSlcg wxec2UXBMsyVe33hpmI99Cosf36Bvjg4DapiqUOMSQteRvbWqjtTlhf94xFdpXreryiGKo/24 hwHzwp067VeL2hOcCeMX+WdTkMY3WI5EqLXGqUtGtj4caJ7dFTmcjh9VbSHFoPA3Mee0+jHA8 dFBQdi1t+4UJgQ8zwuFY1IzP0H5on06ccQ4SeVnhHtw02Xlm5oT7CX0Ww== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I think we need to special-case the case of the current buffer. But > I'd still like to talk about the semantics of calling > pos-visible-in-window-p when WINDOWS is the selected window, but the > WINDOW's buffer is not the current one. Who "wins" in that case, for > the purpose of the default value of position: the window or the > buffer? If in the manual we say "The argument POSITION defaults to the current position of point in WINDOW", this means that the window should win. Whether that's reasonable is another question. Note that a similar disputable case already happens when we do (pos-visible-in-window-p nil (next-window) t) and the next window does not show the current buffer. We there silently override the "nil" with WINDOW's point. Maybe we should signal an error in either of these cases when WINDOW's buffer is not the current buffer. IIUC we use `pos-visible-in-window-p' mainly for three purposes: (1) Detect whether a buffer position that typically does _not_ equal window point is visible in window and, if it isn't, do something (scroll, enlarge the window) to make it visible. (2) Detect whether window point is only partially visible. (3) Get the coordinates of window point and move the mouse or pop up a menu there. In all these cases, callers simply don't care about which buffer is current when calling the function - the buffer in question is WINDOW's buffer. A different use were to check whether a position of an arbitrary BUFFER would be visible in a WINDOW if BUFFER were displayed there with the start of the window set to some valid BUFFER position. I don't know whether anyone ever used such a functionality. To make it work, a caller would have to set WINDOW's buffer and start position first, call `pos-visible-in-window-p' and restore the original state afterwards. Even in this hypothetical case, the caller wouldn't care about which buffer is current. martin From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 03 04:19:14 2021 Received: (at 50256) by debbugs.gnu.org; 3 Sep 2021 08:19:14 +0000 Received: from localhost ([127.0.0.1]:42854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mM4Pp-00086r-RP for submit@debbugs.gnu.org; Fri, 03 Sep 2021 04:19:13 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:42799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mM4Po-00086G-5Y for 50256@debbugs.gnu.org; Fri, 03 Sep 2021 04:19:12 -0400 Received: (Authenticated sender: juri@linkov.net) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 5FC912000A; Fri, 3 Sep 2021 08:19:03 +0000 (UTC) From: Juri Linkov To: martin rudalics Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <918d18ad-2def-1012-06bc-69351b560574@gmx.at> Date: Fri, 03 Sep 2021 11:10:15 +0300 In-Reply-To: <918d18ad-2def-1012-06bc-69351b560574@gmx.at> (martin rudalics's message of "Thu, 2 Sep 2021 20:46:57 +0200") Message-ID: <87v93i9ipg.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Actually, whereas it fixes the reported issue, >> it breaks everything else: moving point up and down >> always jumps to the fixed column like goal-column, >> selecting a completion from the Completions buffer >> always says "No completion here", 'C-c C-c' in diff-mode >> jumps to the wrong hunk, etc. > > Is the below better? > > @@ -2199,7 +2199,8 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, > - else if (w == XWINDOW (selected_window)) > + else if (w == XWINDOW (selected_window) > + && XBUFFER (w->contents) == current_buffer) Thanks, now it fixes the reported issue while not breaking other things. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 03 07:06:33 2021 Received: (at 50256) by debbugs.gnu.org; 3 Sep 2021 11:06:33 +0000 Received: from localhost ([127.0.0.1]:43132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mM71l-0004Ll-BN for submit@debbugs.gnu.org; Fri, 03 Sep 2021 07:06:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mM71k-0004LX-2u for 50256@debbugs.gnu.org; Fri, 03 Sep 2021 07:06:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54200) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mM71e-0007ZG-Fz; Fri, 03 Sep 2021 07:06:26 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4261 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mM71e-0003h7-35; Fri, 03 Sep 2021 07:06:26 -0400 Date: Fri, 03 Sep 2021 14:06:22 +0300 Message-Id: <83v93hyl3l.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: (message from martin rudalics on Fri, 3 Sep 2021 09:40:36 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 50256@debbugs.gnu.org, larsi@gnus.org > From: martin rudalics > Date: Fri, 3 Sep 2021 09:40:36 +0200 > > If in the manual we say "The argument POSITION defaults to the current > position of point in WINDOW", this means that the window should win. > Whether that's reasonable is another question. Note that a similar > disputable case already happens when we do > > (pos-visible-in-window-p nil (next-window) t) > > and the next window does not show the current buffer. We there silently > override the "nil" with WINDOW's point. Maybe we should signal an error > in either of these cases when WINDOW's buffer is not the current buffer. > > IIUC we use `pos-visible-in-window-p' mainly for three purposes: > > (1) Detect whether a buffer position that typically does _not_ equal > window point is visible in window and, if it isn't, do something > (scroll, enlarge the window) to make it visible. > > (2) Detect whether window point is only partially visible. > > (3) Get the coordinates of window point and move the mouse or pop up a > menu there. > > In all these cases, callers simply don't care about which buffer is > current when calling the function - the buffer in question is WINDOW's > buffer. > > A different use were to check whether a position of an arbitrary BUFFER > would be visible in a WINDOW if BUFFER were displayed there with the > start of the window set to some valid BUFFER position. I don't know > whether anyone ever used such a functionality. To make it work, a > caller would have to set WINDOW's buffer and start position first, call > `pos-visible-in-window-p' and restore the original state afterwards. > Even in this hypothetical case, the caller wouldn't care about which > buffer is current. Thanks. There's one more use case I can think of: when WINDOW is not a selected one, but its buffer is also displayed in the selected window, which could mean its point is different from WINDOW's point. Anyway, after thinking for some time about this, I concluded that the only sane way forward, especially since we are going to cut the emacs-28 branch soon, is to leave the default behavior of pos-visible-in-window-p and posn-at-point as it is today, and add one more optional argument to force the possible alternative behavior(s). The proposed change to event-start and event-end are new code, so they should have no trouble passing this new optional argument to posn-at-point. That means to add an argument to pos-visible-in-window-p that would cause it to select one of the following 3 alternatives: WINDOW's point, WINDOW's buffer's point, and (in case WINDOW is the selected window) the current buffer's point. The default should stay as it is today: when WINDOW is the selected window, use the current buffer's point. Anything else IMNSHO risks introducing many bugs into existing well-tested code that we will never be able to discover and fix in time for Emacs 28.1 release. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 03:34:28 2021 Received: (at 50256) by debbugs.gnu.org; 4 Sep 2021 07:34:28 +0000 Received: from localhost ([127.0.0.1]:46413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMQC4-00052a-1y for submit@debbugs.gnu.org; Sat, 04 Sep 2021 03:34:28 -0400 Received: from mout.gmx.net ([212.227.17.20]:35725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMQC1-00052J-Uc for 50256@debbugs.gnu.org; Sat, 04 Sep 2021 03:34:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630740859; bh=L6foTvRNUIupZawHyvC4OeG2X6FSrU0+pVPtHsf9mFQ=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=NLiMqm6o7IMmyMrBVXKKe0sfIHZvs2CoTj7lYOofvhfPcL/w4FFABQ98cEZN/cN63 uMPmUWC6s5DTyuaerSA4dUTsZUOedGbxaeAt81N0fQy7Xn7lf25rYpob2WACpq2L6s rNQbfEdgyiVr18RAiaP9Hp+hTeVNlat8MOTwHnUk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([212.95.5.122]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MS3mt-1mWdhg00IF-00TW1N; Sat, 04 Sep 2021 09:34:19 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> From: martin rudalics Message-ID: Date: Sat, 4 Sep 2021 09:34:17 +0200 MIME-Version: 1.0 In-Reply-To: <83v93hyl3l.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:83HESnNOdTymWz/aEEjelEezb9Ax6UBDZDzvtr3RgtNPBiozL8p WKdrVnRV6wsw327OBagM4zp7oqZJARY1dZLJHcPXXZPdG3Ajg7foigjaOV3o7lt4EN5YsEt vW+2NbmXWbl/fjlBtADjzva0IaJ/Ad4iDQ7WSnxqRyLHWWPwoVlJchr2AKT92qIztOFcLRg Pn3ALcta9s9BWfIzJELlQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:p83s9kRPfUU=:5WI8nVsXbPXWqs3W9SZhvT ApDv5K+zWYISQ7l4khF1X0LR4PwCOte6k7oei6ercGr6yzVX4JQO4ed5+L3gs/1rZvWT/t9OL G57hRQ2QQBxru2+fR15bBPFleZ8XZRudMyCFMxbpGdRflkpCkjRgV2oRyYamhkRD/GZlgM4I0 Gu5nR6cR0pAU+M8XZAnUMliQSsY8gp9ozWF//izr0ApBPuknJRsbgo+DstIFJKgWC7H0cn8k4 LKntUoDnbZ5eRvauwC1GFTAhUeMB0BA4yVN2H0ygxs3Jn8NkQE5iA6IiAz1HQGqBpwfD7UZM2 Q9q5UQsBWnRYBWOhkpcive83iUevIoeDa0ab1/AgdzV39AXaw9t3mTg5zwq8i1e2zezNSU7ii yj4srbS+86y8EBxszCOTDqm6CvdE83tDQzd1jwLw+h3ElokO1yx5dgZYwHfuys+UvpjaL530D TCAl2W9NTFx0XMGjdTRMvsEMXgGsdTicGq4/JUriDINT5j6uKW5Ph/IdXQh6VKPB/N8Upxu6w Y+GEPsyrSyj8Ox5rax2U/HdG+4tkJjJN7g04RbGr/SdPGCbMNHZZf/xnbkb8x0lNHSvD+p2Fl hVbip35W8vIuEpvr2/jTuzw2U5dltMqaR+sj3VSdUK6ou54v4eDsCf539/piph+ZiHYfmyZd6 XNR+uelra5mAUTGP5tSOsV5pUhyr0isklAuOhiGRObIrCCVzsLw0N6LFRbPnNbCkvSaqb0b78 63XowppKhHLY0MXO57brUZm4WK1BnZunqwoirz1yLhrS5/j8HLUoUt3/muCGmC4d32YrD0R6n y68qAK0YrrSDcUhCVb1DXTBx7J8T+MMBCDkbrH1kNt9zGyNG1Pxrihe+BhLfkCUZvhjMy2hgo FCpX9ylK3wJbLKCSacB8KxSBRanSbmv0n7i294cM3AU1flusO/q6nM9VN36OP7ywoX8DTD3mE bcEGgBIqSuUWdEJkq7eDIsyysh0NfvGTMD2xsOIEp7ofR7CHo3y+BHPZh8Sks9nnd0u99KvUi dbpm1Bpu/txmml+DBxMUSy7lIhiuoxcoYB4nxEzEsZCMT4Q1MAwl8FdzOX/41ZVk54pv6DXyG /ayvO/3znY35JzUcdcVP1ZLdcTGZuBmAxbqs9oYQa3S82UewQKQ0PTTtg== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Thanks. There's one more use case I can think of: when WINDOW is not > a selected one, but its buffer is also displayed in the selected > window, which could mean its point is different from WINDOW's point. You mean this would constitute a reasonable and legitimate scenario where we should use the current buffer's point via a nil argument as we do with the present code. It can be easily accommodated via diff --git a/src/window.c b/src/window.c index cb8fe5fcdb..9296b12499 100644 --- a/src/window.c +++ b/src/window.c @@ -2199,7 +2199,7 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, posint = -1; else if (!NILP (pos)) posint = fix_position (pos); - else if (w == XWINDOW (selected_window)) + else if (XBUFFER (w->contents) == current_buffer) posint = PT; else posint = marker_position (w->pointm); > Anyway, after thinking for some time about this, I concluded that the > only sane way forward, especially since we are going to cut the > emacs-28 branch soon, is to leave the default behavior of > pos-visible-in-window-p and posn-at-point as it is today, and add one > more optional argument to force the possible alternative behavior(s). > The proposed change to event-start and event-end are new code, so they > should have no trouble passing this new optional argument to > posn-at-point. There's no need doing that - these function could just pass an explicit POS argument instead of using nil. > That means to add an argument to pos-visible-in-window-p that would > cause it to select one of the following 3 alternatives: WINDOW's > point, WINDOW's buffer's point, and (in case WINDOW is the selected > window) the current buffer's point. The default should stay as it is > today: when WINDOW is the selected window, use the current buffer's > point. > > Anything else IMNSHO risks introducing many bugs into existing > well-tested code that we will never be able to discover and fix in > time for Emacs 28.1 release. Agreed. But the solution you propose appears pure overkill to me. Instead of adding another argument (and trying to explain its meaning) we should rather tell that using nil for POS is ambiguous and should be avoided because at the time this function is called, the current buffer and WINDOW's buffer might not be the same. Also, your proposed solution will not catch bugs in existing but no-so-well-tested code. To catch those it might reasonable to do: diff --git a/src/window.c b/src/window.c index cb8fe5fcdb..18ada851fe 100644 --- a/src/window.c +++ b/src/window.c @@ -2199,10 +2199,16 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, posint = -1; else if (!NILP (pos)) posint = fix_position (pos); - else if (w == XWINDOW (selected_window)) - posint = PT; else - posint = marker_position (w->pointm); + { + if (XBUFFER (w->contents) != current_buffer) + message ("`pos-visible-in-window' called with POS nil but WINDOW's buffer is not current"); + + if (w == XWINDOW (selected_window)) + posint = PT; + else + posint = marker_position (w->pointm); + } /* If position is above window start or outside buffer boundaries, or if window start is out of range, position is not visible. */ martin From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 04:02:32 2021 Received: (at 50256) by debbugs.gnu.org; 4 Sep 2021 08:02:32 +0000 Received: from localhost ([127.0.0.1]:46536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMQdD-0001g7-EV for submit@debbugs.gnu.org; Sat, 04 Sep 2021 04:02:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMQdB-0001Zf-BE for 50256@debbugs.gnu.org; Sat, 04 Sep 2021 04:02:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53978) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMQd4-0007WG-LV; Sat, 04 Sep 2021 04:02:22 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1911 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMQd4-0005Bn-7L; Sat, 04 Sep 2021 04:02:22 -0400 Date: Sat, 04 Sep 2021 11:02:20 +0300 Message-Id: <83sfykwyyb.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: (message from martin rudalics on Sat, 4 Sep 2021 09:34:17 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: juri@linkov.net, 50256@debbugs.gnu.org, larsi@gnus.org > From: martin rudalics > Date: Sat, 4 Sep 2021 09:34:17 +0200 > > > Thanks. There's one more use case I can think of: when WINDOW is not > > a selected one, but its buffer is also displayed in the selected > > window, which could mean its point is different from WINDOW's point. > > You mean this would constitute a reasonable and legitimate scenario > where we should use the current buffer's point via a nil argument as we > do with the present code. I don't know what is reasonable in that case, all I know is that there could be 2 alternatives, each one not necessarily senseless. > > Anyway, after thinking for some time about this, I concluded that the > > only sane way forward, especially since we are going to cut the > > emacs-28 branch soon, is to leave the default behavior of > > pos-visible-in-window-p and posn-at-point as it is today, and add one > > more optional argument to force the possible alternative behavior(s). > > The proposed change to event-start and event-end are new code, so they > > should have no trouble passing this new optional argument to > > posn-at-point. > > There's no need doing that - these function could just pass an explicit > POS argument instead of using nil. They could, but (posn-at-point) is a very frequent usage, and the same with pos-visible-in-window-p. I want to avoid the need of auditing all of those (and there are a lot of them not in Emacs, so we practically can't) and adjusting them for the different semantics we want to introduce to handle what mouse-set-point does, or should do, for context menus. > > That means to add an argument to pos-visible-in-window-p that would > > cause it to select one of the following 3 alternatives: WINDOW's > > point, WINDOW's buffer's point, and (in case WINDOW is the selected > > window) the current buffer's point. The default should stay as it is > > today: when WINDOW is the selected window, use the current buffer's > > point. > > > > Anything else IMNSHO risks introducing many bugs into existing > > well-tested code that we will never be able to discover and fix in > > time for Emacs 28.1 release. > > Agreed. But the solution you propose appears pure overkill to me. It could be, but it is safe, and it does the job. The allegedly "buggy" code in pos-visible-in-window-p was there since long ago, so its behavior is now a de-facto standard, even though the doc string fails to describe the subtlety. I cannot see any sense in changing that behavior now, just because some new (and quite tricky) code made some assumption about that behavior that happens to be false. > Instead of adding another argument (and trying to explain its meaning) > we should rather tell that using nil for POS is ambiguous and should be > avoided because at the time this function is called, the current buffer > and WINDOW's buffer might not be the same. "We should rather tell" means documentation changes, right? That cannot fix the problems I'm worried about: if we break code out there, telling we documented that won't get us any points. We should avoid breaking the code in the first place. > Also, your proposed solution will not catch bugs in existing but > no-so-well-tested code. That doesn't make the situation worse, does it? "Don't do harm" is a great principle in these cases, IME. > To catch those it might reasonable to do: > > diff --git a/src/window.c b/src/window.c > index cb8fe5fcdb..18ada851fe 100644 > --- a/src/window.c > +++ b/src/window.c > @@ -2199,10 +2199,16 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, > posint = -1; > else if (!NILP (pos)) > posint = fix_position (pos); > - else if (w == XWINDOW (selected_window)) > - posint = PT; > else > - posint = marker_position (w->pointm); > + { > + if (XBUFFER (w->contents) != current_buffer) > + message ("`pos-visible-in-window' called with POS nil but WINDOW's buffer is not current"); > + > + if (w == XWINDOW (selected_window)) > + posint = PT; > + else > + posint = marker_position (w->pointm); > + } That's orthogonal. (And it seems to issue the warning in an unrelated case, handled by the 'else' clause?) We should first decide how to support the context menus with this stuff, and then we can talk how to find code out there which makes similar assumptions. (But if there is such code out there, how was it working till now?) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 07:10:54 2021 Received: (at 50256) by debbugs.gnu.org; 4 Sep 2021 11:10:54 +0000 Received: from localhost ([127.0.0.1]:46758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMTZV-0007SB-Ss for submit@debbugs.gnu.org; Sat, 04 Sep 2021 07:10:54 -0400 Received: from mout.gmx.net ([212.227.15.19]:43757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMTZU-0007Ry-Nf for 50256@debbugs.gnu.org; Sat, 04 Sep 2021 07:10:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630753845; bh=+A/D+Ozn7Vg7OyCgz1E3WU2MgBrVdVCYQtIvj3y3aX0=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=J2IK/Mttp31J7aMhF6UXwZ8jC7CpnIcvsPokkVRwCTTY+rMNlpjQ8UC63p/dsmRhk +6zsfsLlno53+Je4Xn5eCPFPLv82N7OLMDjDodFhy9nyG2S+DFpZonmTDGOF+qU/hA n5ilGRotDAoKaiLAqfnvKxlBGuTlm4gjKUDc62Rc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([212.95.5.122]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MBm1e-1mH0yv1fu0-00CEL9; Sat, 04 Sep 2021 13:10:45 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> From: martin rudalics Message-ID: <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> Date: Sat, 4 Sep 2021 13:10:43 +0200 MIME-Version: 1.0 In-Reply-To: <83sfykwyyb.fsf@gnu.org> Content-Type: multipart/mixed; boundary="------------BB4D7116E7F8A9E9415B3D4E" Content-Language: en-US X-Provags-ID: V03:K1:+xrVcd+frfgNb36bSpZFn/kbZYw6OOu4Tud26ypcRqDjq8QRnJu 4Ziidff+CopyVLKOpd6WPFMXiAqFo+tpGuNl574bSp/xoz8IQy5NZTb/knMMgcSPHhH1uJh lDlIJtwkyUsBxCCYq8xdmN4dYcFo+3G1RSKrEYnMCPI1KjeIgrIKN/G7KWEzsnG2iBN6YK0 o+K+st02AGmpGpIX4CfUg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:pvQkuuEO2Xs=:qAmBW/bKDpMvBFrlv2UiAt YeHsNC0MrNcGpGixVxh9U3PVK57fbvn0P773oeN8BK9zqsMycZsZFQ9DEhX6CoDMmcB+cfcIk rGXXqA3wHLDHOWkEFXe94agl1sCKf3c/lZ00EEpwRNN1+mO59xzwnLY7qDR/x/7hPRy86KxIT yxWNVARYVDoQ1TKpjEy/aUA6/izt/6ffJHJDYYxXBNlz7zOHDbiUYaJ1KYtjPcrRR8B78S52o oJwws15xr4OQ1sX/GtVYlTe3C6kSmLU+KcLKTV0q6revAqYiXkCaneG7k0p2EW8IY9Ab99smd EB4oJb5cmaqSvU1KLkKLm1TRgIU5aDo+EH//XGQPszd8UBQ/g3xYvUZ07qbHAgIrqBmoQ5rUT tXbRMI1a9g+CU/rhPZadzMaWdRW3qFVfYzFb9yaCbs/1zVcR1k/aww29ZRkuPn1mO8pR1wDds DCI60/pCyn3asMgYu70RkCv0sUelserO27IdRT0iel2JwewTezOTY/sZ8+l+yL4eSoBywSmYG sOSUOVm5ctXml0VlSlm+67HjMvmzR8IpaGrsts4oJeVfqeJKyFnAm9IWK6lOLYyphLZWyZAQo hiEfq2rYgnY2V6NCLKzHBE/L3xJhGVETvfM6laxpm//FBbN8xs7gTOINwPMen4GMVcyIUJqDb 92BWv5HsbseWb6VgWGJcnrX3LmWXIniVqPsIFiAsQonksILG1/cOMMCvTqFEYXIxvodZLdBpO f1FMG02cgrY2lY7HwYwRqjP7E9p6K0wAv3HVSBfPwZMUXZURAXPG13ZFfOY+dnKx26Se0TWE6 nd2hwKkMT2pZmE5pvckh/oEqus7nUovx6vMKJUzCXtbYZRMkeO0uL+un3hCrsNp1MqPOlssNW +/wt+aZ6aCWkb8HfSK6NuR64j3SLR0UARO8XY5r4laL8DoN/8fzVNnTByZZ4hNhyjY+i8SC/Z lSGqVzolzX5cXdhdhhcNE+fn/vTLFAj+dTn07d4e3yQZG7Ag4BnlUIC/NxKbi5n1sFy80/8TP 7u+9dY9yZ2BawSYJwvs8OSksDo+NgOpKjcXdAnlc46K6v4S1N04i+zYlWdg+hQEHX5T4T9XQP FBVbSg1TdGZX3l+ol5o7C0TZIWUBN1ddkHRYpJ8XC0i/YjfQCfAxktRcw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------BB4D7116E7F8A9E9415B3D4E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit > That's orthogonal. (And it seems to issue the warning in an unrelated > case, handled by the 'else' clause?) Which case? > We should first decide how to > support the context menus with this stuff, and then we can talk how to > find code out there which makes similar assumptions. (But if there is > such code out there, how was it working till now?) Maybe I have not been making myself clear. What I would apply is the attached (modulo any errors it contains): No change in behavior, just a warning in the doc-string and suspicious calls. martin --------------BB4D7116E7F8A9E9415B3D4E Content-Type: text/x-patch; name="pos-visible-in-window-p.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pos-visible-in-window-p.diff" diff --git a/src/window.c b/src/window.c index cb8fe5fcdb..a7ad4d5599 100644 =2D-- a/src/window.c +++ b/src/window.c @@ -2172,6 +2172,10 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_w= indow_p, first. POS defaults to point in WINDOW; WINDOW defaults to the selected window. +Do not pass nil as POS unless you are sure that WINDOW displays the +current buffer. This function will emit a warning when POS is neither a +marker, a number or t and WINDOW does not display the current buffer. + If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, the return value is a list of 2 or 6 elements (X Y [RTOP RBOT ROWH VPOS])= , where X and Y are the pixel coordinates relative to the top left corner @@ -2199,10 +2203,16 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_= window_p, posint =3D -1; else if (!NILP (pos)) posint =3D fix_position (pos); - else if (w =3D=3D XWINDOW (selected_window)) - posint =3D PT; else - posint =3D marker_position (w->pointm); + { + if (XBUFFER (w->contents) !=3D current_buffer) + message ("`pos-visible-in-window' called with POS nil but WINDOW's buffe= r is not current"); + + if (w =3D=3D XWINDOW (selected_window)) + posint =3D PT; + else + posint =3D marker_position (w->pointm); + } /* If position is above window start or outside buffer boundaries, or if window start is out of range, position is not visible. */ --------------BB4D7116E7F8A9E9415B3D4E-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 07:35:46 2021 Received: (at 50256) by debbugs.gnu.org; 4 Sep 2021 11:35:46 +0000 Received: from localhost ([127.0.0.1]:46767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMTxZ-0001oA-Uy for submit@debbugs.gnu.org; Sat, 04 Sep 2021 07:35:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMTxY-0001ny-5K for 50256@debbugs.gnu.org; Sat, 04 Sep 2021 07:35:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57504) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMTxR-0002K8-IK; Sat, 04 Sep 2021 07:35:38 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3347 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMTxQ-0001pd-Q2; Sat, 04 Sep 2021 07:35:37 -0400 Date: Sat, 04 Sep 2021 14:35:35 +0300 Message-Id: <83ilzgwp2w.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> (message from martin rudalics on Sat, 4 Sep 2021 13:10:43 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: juri@linkov.net, 50256@debbugs.gnu.org, larsi@gnus.org > From: martin rudalics > Date: Sat, 4 Sep 2021 13:10:43 +0200 > > > That's orthogonal. (And it seems to issue the warning in an unrelated > > case, handled by the 'else' clause?) > > Which case? This one: > + else > + posint = marker_position (w->pointm); > > We should first decide how to > > support the context menus with this stuff, and then we can talk how to > > find code out there which makes similar assumptions. (But if there is > > such code out there, how was it working till now?) > > Maybe I have not been making myself clear. What I would apply is the > attached (modulo any errors it contains): No change in behavior, just a > warning in the doc-string and suspicious calls. That doesn't fix the problem which started this thread, does it? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 15:10:43 2021 Received: (at 50256) by debbugs.gnu.org; 4 Sep 2021 19:10:43 +0000 Received: from localhost ([127.0.0.1]:48607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMb3r-00055P-G2 for submit@debbugs.gnu.org; Sat, 04 Sep 2021 15:10:43 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:48317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMb3q-000550-Bz for 50256@debbugs.gnu.org; Sat, 04 Sep 2021 15:10:42 -0400 Received: (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 28048100003; Sat, 4 Sep 2021 19:10:34 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> Date: Sat, 04 Sep 2021 21:58:47 +0300 In-Reply-To: <83ilzgwp2w.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 04 Sep 2021 14:35:35 +0300") Message-ID: <87mtosjgzk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: martin rudalics , larsi@gnus.org, 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Maybe I have not been making myself clear. What I would apply is the >> attached (modulo any errors it contains): No change in behavior, just a >> warning in the doc-string and suspicious calls. > > That doesn't fix the problem which started this thread, does it? Indeed, it displays a warning, but doesn't fix the problem. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 05 03:50:30 2021 Received: (at 50256) by debbugs.gnu.org; 5 Sep 2021 07:50:31 +0000 Received: from localhost ([127.0.0.1]:49087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMmv8-0006oC-Nq for submit@debbugs.gnu.org; Sun, 05 Sep 2021 03:50:30 -0400 Received: from mout.gmx.net ([212.227.17.22]:50815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMmv6-0006nu-74 for 50256@debbugs.gnu.org; Sun, 05 Sep 2021 03:50:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630828221; bh=vusW+SqqlQY8MemxJxZK3zNA7EvZzZl8Qb1rorSd/hU=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=BBl02i2zxYyfzbzZ3agVp9yo45Ukb/c0pdf1rSiVMWhPbsAqgRfRyPeo5CNi/JV7H Wi4qTUj2TdCXh3nBf+L4A+hFxqpbi5VbTjfrNShmbOaeInzB5jaUfODJB/JY5WRzMA xIvGVfXodYURFVurVD3A9dYWeE8yPdqEDGuvbPxE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([212.95.5.92]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N3siG-1n4oqj1DBA-00zkfK; Sun, 05 Sep 2021 09:50:21 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> From: martin rudalics Message-ID: <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> Date: Sun, 5 Sep 2021 09:50:14 +0200 MIME-Version: 1.0 In-Reply-To: <83ilzgwp2w.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:VSNwU3mYpN+5+mPMCZ+LkEl5WnFM+wAg3q+TlVgmZZdMlMeX1uF f6dz8OWqF8aYcDWLNTi876exYSYbnKCfpqhd/6AhMvyjarHNoqasdLapv7oULWuVYfLBoyz PGXz6hVwqjcXThJmr5nSGGn2PYMcQ2pvWpqT+rhhgfDjQvmFVlwhqyPTaNlgVvJrs1+OAxn fTY2X50GJu98wXb47vS1w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:rgrz1b2BDJ8=:VTEWXtyXbJZqh/sV8+zOuB /aFtJOf/1PyZVyZ0JNWNdMHz85LFRA+L52NQnRagWXIgob5VKNobWKU7UotGdCPFhLzbDkk2a R/vURJeKMWeL70fQzcY8UsF9nKYynf+Pxy/25VTp8UWD8aDE7oof0jv8ZjUHNkpKX4/aNnwtB a8AjqkQIrM+Doo3w3pn8ZIJcq7NjInynpXx+lTmlPnoEC9uIG4hUBh96elj0mNNJtIYwDMVGG K8SWH6m7hhDEXvXI5JSDUxW0h15nkSangFONGJZJdVhsyXgu4fsxDgZPTnx7cbaLQ0fsc8Tyw bKBVz5W0QCit19OzENelt8BeHODJlyaraM9rw1HV8yqDrjW+/AubySFf+7STjjEoG6IsPh7BH SPlVvfqZV9nBoou5BNV5SndtNETou6EuGGpalfymuMi1Iuo8M7B6V4Nlcn2WT0UoJf4ZgQr4m dr/ZOl7NSTUbSYEUk3zPneykC8tpg3PnnvnbbkD4JZj/I02pQGguoDHbIeMkAa3wb2SWJe8pC cS+33B7EAKWvxVuKO5vfkLHnNmp8/tijkH7lnDEUbglbGoqEK1i1JPDylza6I9eHIsBcKGrf2 zQM9i/VYbFodKa4ambrOps8VEH6NiPm5cLIuiigHDpc882qNHRBmD6Y5RRnKKVM2EXVf80Qm+ pQwhu27HhHTdcdCpT7BjAe232HyXXvVb7ordJGmR4TZBpvuZ4tsI9tporzWzzMWRMWIgx2ml+ bi/3QXCGfoWX89W06BszpBb/GgP//9pzQPcmFbpVFcrYZlKAs2MchaspfQJMDhebU6+WZBIw6 5UHRW4Xck5pl3bgvn/bpPAhkXBAulxy84NgLBYrs4gbgi98pCQ0VrU6tuCoNq0o4c/vL7zytY OaSKL+3LVpz6ht2eLfMPCY8yf4muzL7bOFZ5Thh5pDdiS28bPWFO7+iHO0Y24ZNq/ej++HPXY CGPSQTDVFA+vEC1pOHi9MCThfXusTWUb4/9a0nExUQbo+JvBeARft2P7tGn9OdyMqcHmcPxgM 6SwDjYNPQckBDWiKrOQLTIOR/OqrnayPULaPHRcoShIC5WDnTedMYnUZf/bu23EZ6Ywv6MLgL SPDgLQcXkVb+f1TE3HULCzIteGPiWl/t+tI5IinAe4jEf7etSPaf7IpxQ== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> > That's orthogonal. (And it seems to issue the warning in an unrelated >> > case, handled by the 'else' clause?) >> >> Which case? > > This one: > >> + else >> + posint = marker_position (w->pointm); You mean when the caller asks for using point in a non-selected window that does not show the current buffer. Why do you think this case is unrelated and/or should be handled differently? >> Maybe I have not been making myself clear. What I would apply is the >> attached (modulo any errors it contains): No change in behavior, just a >> warning in the doc-string and suspicious calls. > > That doesn't fix the problem which started this thread, does it? Right. We have two ways to fix that problem: (1) Fix it in a general way. You don't want to do that because it might harm calls of that function that silently worked until now. (2) Fix it by modifying the calls of `pos-visible-in-window-p'. In that case the warning should help us find the calls that should be fixed. martin From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 05 03:50:47 2021 Received: (at 50256) by debbugs.gnu.org; 5 Sep 2021 07:50:47 +0000 Received: from localhost ([127.0.0.1]:49090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMmvO-0006oj-Vq for submit@debbugs.gnu.org; Sun, 05 Sep 2021 03:50:47 -0400 Received: from mout.gmx.net ([212.227.17.21]:57323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMmvN-0006oS-82 for 50256@debbugs.gnu.org; Sun, 05 Sep 2021 03:50:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630828238; bh=31kyKR0VBPjPfZ7QSxp68SKIqylW/6a8Y0p7i5LGRfI=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=EUYSqKb8+JSPxCk1DcDp7h4VMSrNiFmp1vEz539nIfJ+60/xCRO5kSQqRaOGT7xtW uS4AtVo8Nz3Z+e/ACpjM0T1Srwx2Yth4J11a58SNwR6p0+fxpMpUPug7Bx73nXSpFw w3sYnoJnA9+ZAh56UTyNHRNG6ojvM4hTOJ1K8C+0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([212.95.5.92]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MQ5vc-1mZtvi2Cg4-00M3tq; Sun, 05 Sep 2021 09:50:38 +0200 Subject: Re: bug#50256: thing-at-mouse To: Juri Linkov , Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <87mtosjgzk.fsf@mail.linkov.net> From: martin rudalics Message-ID: <3938e118-c9be-a548-a35e-35d89a95430e@gmx.at> Date: Sun, 5 Sep 2021 09:50:37 +0200 MIME-Version: 1.0 In-Reply-To: <87mtosjgzk.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:0q9knCZi8y1fJd7HI/dAX3WgIn5S+bDvUbQHSfuAe+y7/13k0hf +rQm6/uHb4OmznNf0oyyntUsrBg3QZbeFDkgwfJnLyvroOGY0bQCdU2aWjoQAcAYypNY9bD XYImmD+vPAGaU276+Jd4C8VcRga+6zQK5DKyi3ci9ApfVlpNNeUEsyP7TjR5nBUPROvU7RI XNohrEke9sTUIoZk3sdGQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:NrrJ7GHL2wI=:w+HpyoJDPwbzxqet0NI37Q HF9hytsilbGA5wzmR61QFAHFmZXD11IZq4Ilk+XRNPN8ByXD+MWhAKSU96Iwx1Tj4jAxirF7s FU+YQxQDwuPBUN1Ds6TJEnsnPwQEr531uBCEqjPUrOnA5kmo0OJQI9XU5iqL56uYfIpibUylv +KvgpvXlnVJknrb+b0ewbN3EKv8cOR20W1Y5Soc3KQYtiIqdU4LZKWEZLsAdQca3yWVw6rLml BAjV0BErFsKaSzxt5bzR2U+z4x4QlWftf2Xc0rwShZSLF+dZLM89VA/gPV61FEZvJMiuklIj8 JKFnMELo8FhUt+r838vlyYGxeoKFAcl/3yRzszLsGBgSnQ/jCpI/irvrBA1oCq/ReV5e8bFCZ XYmg2grda+68psiv6UD2z9A/yMROdcLzEjH1NQVgKPgJ9uUcIPU52fg7QBg6GGre2cPaXMPKM F04+pGM4mQxP9ZjHMiWyRCAcDa+qiTqah1kLGnTgOXwNWueBSGzcEGR8bCXyydPrHkGZ3Tf5E y06JfL8scEWZFngnZeEF1z4l6D0zlJNxp6ijfTnizj+H9rgUgkrpga5NU2B0+X9WKe9S0am35 9ZH+lVu585ynKJ+VVI8bQqUI7enlS1IqG85XscVunOHFBUyzVsYgQ+0o5nrEx8TTLUAv8SkUz y1FvtbeG0fxDncr1AqKPoaJjWt1SsFOZdWTH2UWd0JoqxJiYDdyKOwP8pxlXgIiIK1yJjB82q sqhS6BNpkwVGrpVQf5xKM/4DHTxGXGRmBkedcty3Fn+SwdTj8cnpSBjoB1sLHJr++WE0Vk+YK iKppne2x2hsZLBZ7Ohm3+DUciefGBPnbhTh/4N6e5oVsY1TPmi6T5F7VGH5wbv1txuigZmwtO U8OoGhNM/h1D70053E1OqZdY+QBPAXHOd8Bfb9Bl7BGI0mzA4IbnatSvAQNtVavVQgK90kRsD iBF+BjD5udySqMpEUC/Ut/08GwEI+bJtjqYWmpqzrTgLNu24rvKEcxK0bcVOfFjqftXjuleIk jKnxwPVXRV3bBb/Yv4EuZZkRAzL5j5X0uk9qu+2CeLifF8xBsIHDZYzSmxskSvFI/0os4/xtW Z5mPLaEs4pDphnaLJs7x1L0KIwke7tRI/7vl72efBYVmLSpHdtMRjk5gA== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Indeed, it displays a warning, but doesn't fix the problem. But you now know that there is a problem and how to fix it. Right? martin From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 05 05:24:36 2021 Received: (at 50256) by debbugs.gnu.org; 5 Sep 2021 09:24:36 +0000 Received: from localhost ([127.0.0.1]:49205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMoOC-00039Y-87 for submit@debbugs.gnu.org; Sun, 05 Sep 2021 05:24:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMoOB-00039L-0j for 50256@debbugs.gnu.org; Sun, 05 Sep 2021 05:24:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58622) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMoO5-0004f3-0G; Sun, 05 Sep 2021 05:24:29 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4576 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMoO4-0006Zm-JL; Sun, 05 Sep 2021 05:24:28 -0400 Date: Sun, 05 Sep 2021 12:24:32 +0300 Message-Id: <831r63v0hb.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> (message from martin rudalics on Sun, 5 Sep 2021 09:50:14 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> <87k0k1o5ks.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: juri@linkov.net, 50256@debbugs.gnu.org, larsi@gnus.org > From: martin rudalics > Date: Sun, 5 Sep 2021 09:50:14 +0200 > > >> > That's orthogonal. (And it seems to issue the warning in an unrelated > >> > case, handled by the 'else' clause?) > >> > >> Which case? > > > > This one: > > > >> + else > >> + posint = marker_position (w->pointm); > > You mean when the caller asks for using point in a non-selected window > that does not show the current buffer. Why do you think this case is > unrelated and/or should be handled differently? I see no reason to display a warning in that case. It's completely legitimate; moreover, a non-selected window will almost always display a buffer that is not the current buffer, and annoying warnings in those cases will just ... annoy. > >> Maybe I have not been making myself clear. What I would apply is the > >> attached (modulo any errors it contains): No change in behavior, just a > >> warning in the doc-string and suspicious calls. > > > > That doesn't fix the problem which started this thread, does it? > > Right. We have two ways to fix that problem: > > (1) Fix it in a general way. You don't want to do that because it might > harm calls of that function that silently worked until now. > > (2) Fix it by modifying the calls of `pos-visible-in-window-p'. In that > case the warning should help us find the calls that should be fixed. Once again, the warning is an orthogonal issue. I'm not opposed to displaying a warning in cases where the caller might have intended something else. But let's please first fix the actual issue that started this thread, and that wasn't the lack of warning. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 05 05:39:16 2021 Received: (at 50256) by debbugs.gnu.org; 5 Sep 2021 09:39:16 +0000 Received: from localhost ([127.0.0.1]:49240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMocO-0003Xq-2q for submit@debbugs.gnu.org; Sun, 05 Sep 2021 05:39:16 -0400 Received: from mout.gmx.net ([212.227.15.15]:53739) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMocM-0003Xd-Jj for 50256@debbugs.gnu.org; Sun, 05 Sep 2021 05:39:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630834748; bh=8LjkNfWKUJUBGy5IqleEtbsXMfvvvPoEQvTfqPYDOO4=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=cNdgp+MerXnHrOqt98/Rc6tFvs/esNgB8lGBFkFdLxk7wMg6wCKg2VfcMl+u4CnkV l3IbpPqyYjWXKWng4ZdhUjHDr0Iz2IScvPrTDxaAFYQTlumxJB2JokZQTSUDPxBxms 9YFh9Is2eiagedMzsQmCcsAEqKnUJ7axqVXd4J6w= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.92]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1McYCl-1mxGUg3Q0z-00cwVq; Sun, 05 Sep 2021 11:39:07 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> <831r63v0hb.fsf@gnu.org> From: martin rudalics Message-ID: Date: Sun, 5 Sep 2021 11:39:06 +0200 MIME-Version: 1.0 In-Reply-To: <831r63v0hb.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:Sj0s2I0hs+TjAKcemlV3BtJ1McTLzlPfM30bLNeojjHV3n4gx4e ytNbOIDW8UqUW1p0f+bBAMwXu47NIPBAwIgzS2+QCMfM7aA+8g9SIofr88qL9VdarQWxkQ1 TxtO+XZaXtR7SQmGyMxyfubX5amo0y4MInzBs2IQ+W1axu+g5p6HI1nh9wqEzgowo8BfeWJ Gihuluhz8Y0PPaDxoIUbw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:U0Tzy6E7qGE=:ayjFNPzyKDXgSoFDImedvG +WRxAORdYWSr/3UgMV05X6jnBRiHT2hgj+FwJJ6fTPZ1uoK8/EFOM689Iig4UZrcte448GRLR a7dZlstp4Linof3U11C8EwvYcUyAb16eeZsLD9tZrtzQYnTDBoVlqvYf8hMKHAFO050QnPTqX l26l4ilDwYqGCN6s//W3DBsD3jjeUG35HS/JwmgGrtZD4W/9YKWVwpGtkcnOQbeQLwYv499c/ 4cIZIHHN2ToRz/3iJIUZWbWJuk9qI3dHm3NZsDd4JIAg6tTH4B7eM1fg/X0hZRkx3f0MiX58x +0PcqaGxlg8pRFlSdORo+G6j6qfuBd+xqTE2LO6zcxCjhrObinDdKV5863o6ic+/pdfnt+OLp 6eIbAZiBgdgQ7olOVz38sAq7KaJqKo8yqlLsjXpjYYIt7uHbjmHp+q+iT9GJ9vFkc2wTH29LM 9iLZyocFqQJcSHWKhU0uoHEZYe3MQWguzfGT0pjucn7Z1PaBQFkcyu4bRoyAJ5CWwJOhWGQe0 u9p8gmMyiOX/js9r0QJ2+PJb2O04zvsj40jwuCvq2CXbQjyVK0FJlZ9MLtRjkeTZhNne0VPCk zTLxGZsykKHf1GxjxhpfqiYj7OA+OMqi/ahQry/E13nKY5lhhhfBzv8vG4PAQjsP4iTTX//zw QQl5FbBAdD3pQ51/WoZiw8Es6FSA/nUfanLC3eBHx4zVRm4oLgzuhBOoBW+14K+XtMb7fQdCn nZSflGV2N6KTun4zU1ELWUYtbab6QUqbfIDjwTfrGi+2gowbcXHunPKQgcmbTTNRz3DH4K7CW Hm31yCDQ7oJObMtraqid7vtWXexqzQx4b4rFm/jjMDWh9z7HzN1ijKjdi3uWgY/hj7xaGenFo gS2mm+acFER72tb44lXRrGRgoGNsz1RPIBxlaJUiiC5JMqVTL16v+eLOe51Y14bEFoRSbylj+ J+LOaRP//PsPF1quY3A849oQyX582cIconwX0/ROpi5BcNKdXJgv8LtNaI7V4DY/Fs5QaEQw7 XzEPS6gmmTEg61NN6tZU827zR4f0vJUGYeOXqwQbD9GLgWEv7/hIe3AhzxaZ3fZgZZvqrjgP7 AbUnaGiKmgsb4qim8mmUq/JstNpBNCLVvJl+Q7cATZYbXdU5KESZI7xMg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > legitimate; moreover, a non-selected window will almost always display > a buffer that is not the current buffer, and annoying warnings in > those cases will just ... annoy. OK. > Once again, the warning is an orthogonal issue. I'm not opposed to > displaying a warning in cases where the caller might have intended > something else. But let's please first fix the actual issue that > started this thread, and that wasn't the lack of warning. I probably don't understand the actual issue then. martin From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 05 05:42:22 2021 Received: (at 50256) by debbugs.gnu.org; 5 Sep 2021 09:42:22 +0000 Received: from localhost ([127.0.0.1]:49248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMofN-0003cl-Pf for submit@debbugs.gnu.org; Sun, 05 Sep 2021 05:42:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMofM-0003cX-4b for 50256@debbugs.gnu.org; Sun, 05 Sep 2021 05:42:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59044) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMofG-0002zC-BD; Sun, 05 Sep 2021 05:42:14 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1705 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMofF-0007uf-UO; Sun, 05 Sep 2021 05:42:14 -0400 Date: Sun, 05 Sep 2021 12:42:18 +0300 Message-Id: <83tuiztl39.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: (message from martin rudalics on Sun, 5 Sep 2021 11:39:06 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <87ilzk6bsr.fsf@mail.linkov.net> <6dcf3191-dbb3-0c6c-2483-0fc05e9ff6e5@gmx.at> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> <831r63v0hb.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: juri@linkov.net, 50256@debbugs.gnu.org, larsi@gnus.org > From: martin rudalics > Date: Sun, 5 Sep 2021 11:39:06 +0200 > > > Once again, the warning is an orthogonal issue. I'm not opposed to > > displaying a warning in cases where the caller might have intended > > something else. But let's please first fix the actual issue that > > started this thread, and that wasn't the lack of warning. > > I probably don't understand the actual issue then. The actual issue is that pos-visible-in-window-p and posn-at-point produced unexpected results when the buffer shown in the selected window was momentarily changed by with-current-buffer. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 05 12:41:50 2021 Received: (at 50256) by debbugs.gnu.org; 5 Sep 2021 16:41:50 +0000 Received: from localhost ([127.0.0.1]:50874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMvDK-0008DR-Gq for submit@debbugs.gnu.org; Sun, 05 Sep 2021 12:41:50 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:58653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMvDI-0008Cz-BV for 50256@debbugs.gnu.org; Sun, 05 Sep 2021 12:41:48 -0400 Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 1CF4E240005; Sun, 5 Sep 2021 16:41:39 +0000 (UTC) From: Juri Linkov To: martin rudalics Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> Date: Sun, 05 Sep 2021 19:13:15 +0300 In-Reply-To: <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> (martin rudalics's message of "Sun, 5 Sep 2021 09:50:14 +0200") Message-ID: <874kazxm9o.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, Eli Zaretskii , larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > (1) Fix it in a general way. You don't want to do that because it might > harm calls of that function that silently worked until now. > > (2) Fix it by modifying the calls of `pos-visible-in-window-p'. In that > case the warning should help us find the calls that should be fixed. Since there is no way to fix (1), I sent a fix for (2): diff --git a/lisp/subr.el b/lisp/subr.el index 6ae6d242a4..bf0177a846 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1510,8 +1510,8 @@ event-start For more information, see Info node `(elisp)Click Events'." (if (consp event) (nth 1 event) - (or (posn-at-point) - (list (selected-window) (point) '(0 . 0) 0)))) + (or (posn-at-point (window-point)) + (list (selected-window) (window-point) '(0 . 0) 0)))) (defun event-end (event) "Return the ending position of EVENT. @@ -1519,8 +1519,8 @@ event-end See `event-start' for a description of the value returned." (if (consp event) (nth (if (consp (nth 2 event)) 2 1) event) - (or (posn-at-point) - (list (selected-window) (point) '(0 . 0) 0)))) + (or (posn-at-point (window-point)) + (list (selected-window) (window-point) '(0 . 0) 0)))) (defsubst event-click-count (event) "Return the multi-click count of EVENT, a click or drag event. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 05 12:47:55 2021 Received: (at 50256) by debbugs.gnu.org; 5 Sep 2021 16:47:55 +0000 Received: from localhost ([127.0.0.1]:50900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMvJD-0008O2-BG for submit@debbugs.gnu.org; Sun, 05 Sep 2021 12:47:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMvJB-0008Nq-P8 for 50256@debbugs.gnu.org; Sun, 05 Sep 2021 12:47:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40432) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMvJ5-0003QJ-PM; Sun, 05 Sep 2021 12:47:47 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4393 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMvJ5-00081n-DM; Sun, 05 Sep 2021 12:47:47 -0400 Date: Sun, 05 Sep 2021 19:47:49 +0300 Message-Id: <83fsujt1e2.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <874kazxm9o.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 05 Sep 2021 19:13:15 +0300) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> <874kazxm9o.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: rudalics@gmx.at, larsi@gnus.org, 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: Eli Zaretskii , 50256@debbugs.gnu.org, larsi@gnus.org > Date: Sun, 05 Sep 2021 19:13:15 +0300 > > > (1) Fix it in a general way. You don't want to do that because it might > > harm calls of that function that silently worked until now. > > > > (2) Fix it by modifying the calls of `pos-visible-in-window-p'. In that > > case the warning should help us find the calls that should be fixed. > > Since there is no way to fix (1), I sent a fix for (2): Thanks, but is that the best fix? It would mean any other Lisp program that needs to do something similar will have to use such kludges. But if I'm the only one who thinks this isn't clean enough, I won't object to this solution. Just be sure to add comments explaining why you do something as strange as that. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 06 04:31:13 2021 Received: (at 50256) by debbugs.gnu.org; 6 Sep 2021 08:31:13 +0000 Received: from localhost ([127.0.0.1]:51691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNA24-0002nz-Vi for submit@debbugs.gnu.org; Mon, 06 Sep 2021 04:31:13 -0400 Received: from mout.gmx.net ([212.227.15.18]:42183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNA21-0002ni-Qe for 50256@debbugs.gnu.org; Mon, 06 Sep 2021 04:31:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630917063; bh=Wc9blmdg/0yKpc6TiXWKW5zoYZpx/BW++kItcT/mzks=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=VRm5M3nw+N9f+MaSFhFYVQq+omOeOlvxy/eoc1+G27lseYeWXlKaYa35qQIzEEdTf s15WvOcG25UZ+JISjww7a25umrIFnbq14vFg3Kf4HKF9HdIGOUsT/3FS3/K6caRU+M l3Y8kUi0PgLwb9dgXB372amzx/Z9LmImsYthLj0o= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([213.142.97.9]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N17UW-1n7kJZ1yGY-012cFd; Mon, 06 Sep 2021 10:31:03 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <83lf4gqyn9.fsf@gnu.org> <1a65f234-c1ee-ae95-aa05-2e3d9d1e1002@gmx.at> <8335qoqobm.fsf@gnu.org> <7c9cb0a1-b222-cb06-7e7c-7f17231faca3@gmx.at> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> <831r63v0hb.fsf@gnu.org> <83tuiztl39.fsf@gnu.org> From: martin rudalics Message-ID: <85beb5ec-ee4c-5308-503e-7664828b3e45@gmx.at> Date: Mon, 6 Sep 2021 10:31:01 +0200 MIME-Version: 1.0 In-Reply-To: <83tuiztl39.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:M/EqVajYAMdb6QrN7uRsIR6qYMhAJZolISAX5OJgzuM1qX0Dy4X 2k3ETlkuAYd9UK6CW9QnqrSa9mTtfrXkuGwnklvomZhYep3w6ik+hl8YVGuc3QVdnnTk339 nDTM5KWC01qYL9iKx5A/RQZtCep2PUot3R+DBfuujI+sKxNmz/dQDt7vQdRlsHefP3gK+w+ /DHWJ1NR0Z866dWddJUHQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:4cNyUsf7NDY=:5Fb/IRFtVWfoMSig7nBFGA 7ogi8W4bJrmiacT85vxwMhw91jO2aNWK30W8CTnj5U3RSg9wl+k6ZV7BAdfg2iTA0TWrFrDoI 60tlUopUZxuxDJrIbrDPY0+1ZoEW6DnXvn300R64GdnLnIzXs18kWre5N3SNQo2LeiPiTx2us letqCDCA4FXh1wFndmAelWYWb/CWc9jIJR+VthxUGrwyBJWNGkhvH4a4AZJqp4VZ3aD2LgbRa o5Es7ZlfYYplGwJ2zmImmr2KiuMbPrx9HnSCvRvP2xyGEoEkZkIaJHcJ2BI5RK2F9+wm+bl51 JZbXnMbiOJo8758D54DjFff3sGLi1JwOIZXomPl+jVWqXraKDSUYqcIOefPhrY2iFs8L/PkTf hNahw7bSEkW4JEw5Jiha9w1+j87X88ZyBP2rjgqz6ABquhkCu2+1FeWoYypuueB6cP3QoqKHL VsK3OVQQ2k311uDtM9DNAsEKrkIUqqqiDaStXeQz8eH+DPgBDGNraacu8Eeb5EwIZyhQNBXrz HfR7TvQlcrCfeVz0T1RY0tyFQsL4SFv3AFMVhSCZQ/LWYaCaZNcSMrviT3ViR0sGc3BN5JssO D32zTTUEBGDVbzfEQs/ZxwfCjMlffRC0h6Qg0TKXojuSDd4eMlBUoww1Iq49aOlLP59aJ/nC7 6Rfvb6UyIa2GTyGLk/8/9TwmrICn2Jn4Ube1C/zuq1uxRM/uy8NQRMe+uHa89N+bmyB5/X1l/ R7pokyh8+6OTEP0iCCmG++xXYEFsohPi2+238TtVLAgQHB3dFkZDmKHGi7lRufSxbsGfLaSCS welXtvlYkzASyzMgLDTsCO4bhfNrYgQVvXNKXyXW4mzEMD1iCHABVfwJIr+0teQa9NEewh1cY J5r8wxP+gNJWEptfTjXX6FEZXVum9Xt3i8/FD3DzVrOGe9qhFsh9KrEP9+Ib2mnp/Lm7X1R3I McZFDqH0t+QyWNbjt866p4XCDZBSCah1zcme2NIfzQJnuWKBB/0n7GI4mkRLtLximotQCpZVt FJ5u+8wUYX87zubXuoZVb5h9mj5fUwsU+r2KXTFKcA0Sz3rLTy50xvzDAQnUVxgENZ4Ux+z1S 9EqSZrcVBxDfBWTDCgl0sTTtwqCEmmh81yaCZcgy0GiNNhEcMXs16WPMw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > The actual issue is that pos-visible-in-window-p and posn-at-point > produced unexpected results when the buffer shown in the selected > window was momentarily changed by with-current-buffer. Whatever `with-current-buffer' does, it does not "momentarily change the buffer shown in the selected window". I've re-read this thread and now think too that we should not change the code of neither `posn-at-point' nor `pos-visible-in-window-p'. Given that a function that calls any of these can have used `with-current-buffer', `set-window-point' and `goto-char', it's easy to see that when passing nil as POS argument DTRT never works out. Suppose I have two windows, the selected one showing *scratch*, the other one showing *Messages*, and I managed to make position 0 in the *Messages* window vertically scrolled out of view. If I now do (let ((window (next-window))) (set-window-point window 0) (pos-visible-in-window-p nil window)) I get nil as response although in the resulting configuration position 0 is clearly visible. If OTOH I do (with-current-buffer (window-buffer (next-window)) (goto-char 0) (pos-visible-in-window-p nil (next-window))) I get t although in the resulting configuration position 0 is clearly out of view. We may call both pilot errors but I see no evidence that the coder did anything wrong wrt our docs of `pos-visible-in-window-p'. If I do instead (let ((window (next-window))) (set-window-point window 0) (pos-visible-in-window-p (window-point) window)) and (with-current-buffer (window-buffer (next-window)) (goto-char 0) (pos-visible-in-window-p (point) (next-window))) I get the results I would have expected. So I would, in general, recommend against using nil as POS argument for `pos-visible-in-window-p'. Given how fairly rare in our code base the use of nil is, such recommendation seems feasible to me. For Emacs 29 it should be then even possible to warn whenever it's used. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 06 04:31:20 2021 Received: (at 50256) by debbugs.gnu.org; 6 Sep 2021 08:31:20 +0000 Received: from localhost ([127.0.0.1]:51694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNA2C-0002oK-8N for submit@debbugs.gnu.org; Mon, 06 Sep 2021 04:31:20 -0400 Received: from mout.gmx.net ([212.227.15.18]:57539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNA29-0002nx-W0 for 50256@debbugs.gnu.org; Mon, 06 Sep 2021 04:31:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630917072; bh=VFw+psBAMdkJ+LZPtXLKphPKfhR6DOWMyC6XlZi6dJM=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=imQDiUIYs7QJcunb/Dyr0chXGp5pKR+iiV09WN6J9/49ViJEYixYsLwnxIovwAIdU 0ARAyQ/bhapcV5R4Jw5rcv6ArLd/8oQFHPAXpmNbt9mKynmPlupeC194FURo74EpEF Oy3FwYrLE+8vvzQolXxkZtZ70GYK7fW5jyRejRSk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([213.142.97.9]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MRCOE-1mZB6p3SCK-00N69i; Mon, 06 Sep 2021 10:31:11 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii , Juri Linkov References: <87sfys6ubm.fsf@mail.linkov.net> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> <874kazxm9o.fsf@mail.linkov.net> <83fsujt1e2.fsf@gnu.org> From: martin rudalics Message-ID: <9f8a5ba5-b22d-a226-a25c-8a99ba91ebe0@gmx.at> Date: Mon, 6 Sep 2021 10:31:10 +0200 MIME-Version: 1.0 In-Reply-To: <83fsujt1e2.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:8kty9kyCJ5wkzIMiLH2Xwu912hVfpm9haY5F5cFuAkEI2JxQjpy u2teDLhYOTPNYJd5V7pGFkFZ1aoL5i10DhlY+CHYKtRy5+xZlOHCLyMFkp9sNF9OpSiv6rN v3HcJ9xZCG+E6AhP3N00wDL6Hz/rdIMuIF2HsfhgI8nT+kZ9lI/CpibT7u21qt3qF5pJ0Dd aJEZQbiV0Az49DCOeRbAA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:p9t4CN78MfA=:34ScbahUkVmDYKB1Ed0bA8 vvz0wo2+FiisELRMIJi7lmo85ug2K+1L/2XSm2pE/CKGG5FIrTsLfzcHqHCRciCe/6c+5aiqd qtyHdBseiRJmSgImroqtKCZKf62R9ScNf4yaxX2Z8Brm9p1NwKy38ZmhI1BSmfL0WNcwVzNmx ksBaNhiMASi72AB6dE+AS7UjTB93Wkn26VyS43KslylrnBlIStl43NUceK8d6tIIwF9Mmc+7m L515B9WA0nwGN7nHQkYkPnqefcW0LWrSt23qUYFMyiQUD3h06/iVPIhByTAHDqTfeJcBV2Dvk NciBFwCA5079oIxOxJn2M5aOMKLhF517OZzgWSQPvASpuQcUg0vgVrWeWxUzoPqZLTeuDhFQu Td8PHWmoGEFg/vVaLypBsW5jCgMS7grnTocalTLwYnKtJZLopZMfOFlT0wdVGUoNEvbYWo/0n uMo5TZ/i8f3XknOcdqMgZUBEivKISmjGuAWeaBhTsOJulI8VFkDxdes9m9/C9chO8wC3QeIzU Ka9jM8OP16k2Sg09DQIOVSdAhOnaYfnbcOOEHu9WbXt64RmrX5F0pmR3WnGuw/0elMLcYVYwT 8uSeGen5AFA5j4GzhC2NsH2dUyPBV9e6WoVPcs/diLb6cTTInF2k0AEBFbTumJcQHfqI7eFTX +9Uc3BJ48yt8wHWlOKQxeQxzcr1X4cp8w5iq2SWn1GKanvVKkkzRs2+lrmH6rPC234ou3eU96 MZnAvL5DnOuFEcZUEAY6peTqnTSxQK07dr/WyyvocgNLWIiLRiX9h9dqTluHt2QImVCzPAsYl RXwFftE4RQoQIaMKrQyztL5bAe9IeE6IJPTFBPVWDMchdiEioOa5a4kg1tyLKJDxlykbQXG3N Rv+CYhs/ypbWDDBXa9JgL6GpRNhlOYuVb56JWginAMxw1IQPMf8Jo0Vfzl5tnNAsRgEAPPRuP GnqQhIGcRYdHQL54VyQrarhWnJ3z2ARxa5g8yuzaEafTB14VNK5B9G1Kz+F6UrgC7gp7a0Tmi bpKjfhf1/Dckz0mNJYKgBVhlPXEH5OoQ991zNqWRh4lGXOYR8q1Mm2/fA2nCSoBqL7t2LmQAt jlPfZTI3vZd7onfqNN7bltUrmiGq9vrXpmwG9NEwUE35qOIPdJWwvgYHw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Thanks, but is that the best fix? It would mean any other Lisp > program that needs to do something similar will have to use such > kludges. > > But if I'm the only one who thinks this isn't clean enough, I won't > object to this solution. Just be sure to add comments explaining why > you do something as strange as that. Please explain why you think Juri's solution is a kludge and why it is not clean. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 06 06:57:21 2021 Received: (at 50256) by debbugs.gnu.org; 6 Sep 2021 10:57:21 +0000 Received: from localhost ([127.0.0.1]:52106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNCJK-0005Qr-MI for submit@debbugs.gnu.org; Mon, 06 Sep 2021 06:57:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNCJI-0005QV-O8 for 50256@debbugs.gnu.org; Mon, 06 Sep 2021 06:57:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35462) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNCJC-0000Hn-Sz; Mon, 06 Sep 2021 06:57:02 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3827 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNCJC-0000Eh-GB; Mon, 06 Sep 2021 06:57:02 -0400 Date: Mon, 06 Sep 2021 13:57:09 +0300 Message-Id: <83czpmrmyi.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: <9f8a5ba5-b22d-a226-a25c-8a99ba91ebe0@gmx.at> (message from martin rudalics on Mon, 6 Sep 2021 10:31:10 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> <874kazxm9o.fsf@mail.linkov.net> <83fsujt1e2.fsf@gnu.org> <9f8a5ba5-b22d-a226-a25c-8a99ba91ebe0@gmx.at> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Cc: 50256@debbugs.gnu.org, larsi@gnus.org > From: martin rudalics > Date: Mon, 6 Sep 2021 10:31:10 +0200 > > > Thanks, but is that the best fix? It would mean any other Lisp > > program that needs to do something similar will have to use such > > kludges. > > > > But if I'm the only one who thinks this isn't clean enough, I won't > > object to this solution. Just be sure to add comments explaining why > > you do something as strange as that. > > Please explain why you think Juri's solution is a kludge and why it is > not clean. Because it extremely non-obvious why the code does something strange like that. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 06 10:08:57 2021 Received: (at 50256) by debbugs.gnu.org; 6 Sep 2021 14:08:57 +0000 Received: from localhost ([127.0.0.1]:54181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNFIv-0004pq-D8 for submit@debbugs.gnu.org; Mon, 06 Sep 2021 10:08:57 -0400 Received: from mout.gmx.net ([212.227.15.18]:60877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNFIt-0004pe-SE for 50256@debbugs.gnu.org; Mon, 06 Sep 2021 10:08:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630937329; bh=IR+KyY2OUtA+ypHWDra+i67a55w50kAKMx36v9uB3tI=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=QaXWra6sHzgE0XkWeDyErUKpxeFclqsZ3QNqO0CS0kLnNX+lU83E9guNkqynbCbrY N+54sJs7mjA1JKZK0KmOwjX37p5NShH9na94FbR7AYmqao4tfb2nbOgdwT9GatxCSA elHGZ7D9ECbvycvCU1ldPJpvFsHyOEzxiKjkNw8M= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([213.142.97.9]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N6bfw-1n1b2N2yXW-0186M7; Mon, 06 Sep 2021 16:08:49 +0200 Subject: Re: bug#50256: thing-at-mouse To: Eli Zaretskii References: <87sfys6ubm.fsf@mail.linkov.net> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> <874kazxm9o.fsf@mail.linkov.net> <83fsujt1e2.fsf@gnu.org> <9f8a5ba5-b22d-a226-a25c-8a99ba91ebe0@gmx.at> <83czpmrmyi.fsf@gnu.org> From: martin rudalics Message-ID: Date: Mon, 6 Sep 2021 16:08:47 +0200 MIME-Version: 1.0 In-Reply-To: <83czpmrmyi.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:9mcfOTDmnH8tBg5S1M6EqErvtrM37MiO/E0/lCuZykAIelxMrS6 TIbnzpO3/hKgGlIxjAl7cHnJ0ikO3QtyQgIt8+Xp7V9IDC6QHN0fx1wvQIkO2YPd18RHglQ hB6ZbuIvJbUvbRJ2xWUly25kGS8OLJVx7NgjubekgtOsjB5q4vxxMkRbIieJzSQvArqJaXt Zh99nqr3guIlnFMySRGOQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:+o1Ekf0wlZw=:CGAw5+0GMDlTFd3p5OjRI4 +hRsA7bYdP8S97NkNKueyDxWNwToL+/ZZBJqgmySKQiJuF6vgysy5kcADpZELp8ILnBnR2ZRc LQ/wYYBe2K9eooiYPwP7GxVDRJFnsNMpmjwlwkC4PWTyI+p2rA5UAqwcZrkB6zVHI6X/RXObi Rf/kCzBULWiG58/SW1e6xSUQv8RmrhyZUzvRVnWDeVKOE1LYFAzRYR8Psi3IWWh64TwRExwJ7 cz2m2xAg4yCa45dDJXteMlTqaCUPcwEZk6J4ETrR2BCrfhDpDPW6jYSL/578rJhtapI4u5uG8 6FQubBM4F+qCMakdhifY0OLJyV2tKLyknNhvPTR55Su8xO4BXo1E7EGmtWYIdAKDZE0ZaTDK2 4DzepIHmm5yiptwlaRbZiHW8lvE7HK1OAW0Sbq3aqUPfj+VUvTG3y3S6G7mVU/6si7vN7wQ88 EwoLQVR5VSJK2uH4cBhvtpg9wa1Qlpzo+Phim2rq4f/KWCa5J0fjDIzVp+KaHLe0RPmMwy1Lu BncuaESSMj5DUT1KQJkpsn21ntL4WYoTjEsHBbKLUG/pVua0jivUp/UVuJxFDSXCl2W3aHhW2 FBbiehioIhSGg23M531gHOHjyxFTqGS3xZqQ9eOtZcTPNJhEJu3W6MLHVyhCmfH+3WkT4sCID av3w/3N83LFJrLAR+yQ9E5UV8Bx8DAWufYROeWmrrgyuPfTp+ftSbSWL+NFtmJ/sYaXaAjrGm QJ0aCVLCoNdbDIhid4aIw39VYgZtp4Spdhq217i20JYg963O8Ee60DmL6V6qvKQ32NQgN9Wtk WI2UH3S6++2jWHjJovWCdb8iokE4Wb4i9XXyrC/zarldcEDD9ajr8gM91Hb9gMNZWSxI+WAvj kglzuVjkamQ1D67e49DA2vFFD/2RfUPsTOpvBIKu4zhXPe9Dbsx4V6RkL3kUTqc0eqnJyji3c PA4U95OBWdBPeCRweAVhofkDV5Vx8fpuk5XpWIu8FUVPFi4qnOzkOA2H8t/cC+qXOCtAVKvui deHeTn1tmrTv02GB9QqOs/77VUBwqYG1mihs6JYLhZliNhxywcJk6UEDq3y6FsVnkqq6BACMG iMLv6IkFkhV5eRTHBIv1TXR9rnlKkQGD2s5CiqX/kW4X+b6Sc4K01Gplw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Please explain why you think Juri's solution is a kludge and why it is >> not clean. > > Because it extremely non-obvious why the code does something strange > like that. If you intend the use of (posn-at-point (window-point)) instead of (posn-at-point) we strongly disagree. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 06 11:41:42 2021 Received: (at 50256) by debbugs.gnu.org; 6 Sep 2021 15:41:42 +0000 Received: from localhost ([127.0.0.1]:54258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGkg-0007BI-IP for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:41:42 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:57655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGke-0007An-QH for 50256@debbugs.gnu.org; Mon, 06 Sep 2021 11:41:41 -0400 Received: (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 957016000B; Mon, 6 Sep 2021 15:41:32 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> <874kazxm9o.fsf@mail.linkov.net> <83fsujt1e2.fsf@gnu.org> <9f8a5ba5-b22d-a226-a25c-8a99ba91ebe0@gmx.at> <83czpmrmyi.fsf@gnu.org> Date: Mon, 06 Sep 2021 18:10:52 +0300 In-Reply-To: <83czpmrmyi.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 06 Sep 2021 13:57:09 +0300") Message-ID: <87fsuhkipf.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: martin rudalics , larsi@gnus.org, 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> > Thanks, but is that the best fix? It would mean any other Lisp >> > program that needs to do something similar will have to use such >> > kludges. >> > >> > But if I'm the only one who thinks this isn't clean enough, I won't >> > object to this solution. Just be sure to add comments explaining why >> > you do something as strange as that. >> >> Please explain why you think Juri's solution is a kludge and why it is >> not clean. > > Because it extremely non-obvious why the code does something strange > like that. I see no other way to fix it. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 06 11:43:31 2021 Received: (at 50256) by debbugs.gnu.org; 6 Sep 2021 15:43:31 +0000 Received: from localhost ([127.0.0.1]:54280 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGmQ-0007Fl-PA for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:43:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGmO-0007FY-PR for 50256@debbugs.gnu.org; Mon, 06 Sep 2021 11:43:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43418) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNGmJ-0003Ch-DV; Mon, 06 Sep 2021 11:43:23 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2058 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNGmH-0003AU-S6; Mon, 06 Sep 2021 11:43:22 -0400 Date: Mon, 06 Sep 2021 18:43:26 +0300 Message-Id: <83y289r9pd.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-Reply-To: (message from martin rudalics on Mon, 6 Sep 2021 16:08:47 +0200) Subject: Re: bug#50256: thing-at-mouse References: <87sfys6ubm.fsf@mail.linkov.net> <83pmtsp4g1.fsf@gnu.org> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> <874kazxm9o.fsf@mail.linkov.net> <83fsujt1e2.fsf@gnu.org> <9f8a5ba5-b22d-a226-a25c-8a99ba91ebe0@gmx.at> <83czpmrmyi.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: juri@linkov.net, 50256@debbugs.gnu.org, larsi@gnus.org > From: martin rudalics > Date: Mon, 6 Sep 2021 16:08:47 +0200 > > >> Please explain why you think Juri's solution is a kludge and why it is > >> not clean. > > > > Because it extremely non-obvious why the code does something strange > > like that. > > If you intend the use of (posn-at-point (window-point)) instead of > (posn-at-point) we strongly disagree. Then we'll have to disagree. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 12 12:33:00 2021 Received: (at 50256) by debbugs.gnu.org; 12 Sep 2021 16:33:00 +0000 Received: from localhost ([127.0.0.1]:43499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPSPc-0007hD-27 for submit@debbugs.gnu.org; Sun, 12 Sep 2021 12:33:00 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:43971) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPSPY-0007gr-E4 for 50256@debbugs.gnu.org; Sun, 12 Sep 2021 12:32:58 -0400 Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id BC7A7240002; Sun, 12 Sep 2021 16:32:48 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <831r67ph8d.fsf@gnu.org> <87tuj3bffb.fsf@gnus.org> <83y28fo1xf.fsf@gnu.org> <191e9cc6-7370-5b7d-7777-716b61e0155d@gmx.at> <83pmtrnydh.fsf@gnu.org> <158a8854-f56a-9aaa-3a14-d108e086a24c@gmx.at> <83k0jznms2.fsf@gnu.org> <87v93j9dfz.fsf@mail.linkov.net> <87y28e4ysv.fsf@mail.linkov.net> <83czpqzupp.fsf@gnu.org> <83v93hyl3l.fsf@gnu.org> <83sfykwyyb.fsf@gnu.org> <087851c3-b3b1-5130-f4b1-50cd42ef83a8@gmx.at> <83ilzgwp2w.fsf@gnu.org> <361bb63a-5e29-9785-0785-6c46f6621223@gmx.at> <874kazxm9o.fsf@mail.linkov.net> <83fsujt1e2.fsf@gnu.org> Date: Sun, 12 Sep 2021 19:32:20 +0300 In-Reply-To: <83fsujt1e2.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 Sep 2021 19:47:49 +0300") Message-ID: <87tuipg3fv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: rudalics@gmx.at, larsi@gnus.org, 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > But if I'm the only one who thinks this isn't clean enough, I won't > object to this solution. Just be sure to add comments explaining why > you do something as strange as that. So I added comments explaining why such an arg is needed, and pushed. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 12 13:13:00 2021 Received: (at 50256) by debbugs.gnu.org; 12 Sep 2021 17:13:00 +0000 Received: from localhost ([127.0.0.1]:43516 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPT2K-0000m1-CW for submit@debbugs.gnu.org; Sun, 12 Sep 2021 13:13:00 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:41587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPT2G-0000lf-9X for 50256@debbugs.gnu.org; Sun, 12 Sep 2021 13:12:58 -0400 Received: (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id D0C84100006; Sun, 12 Sep 2021 17:12:48 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> <87y28i85xi.fsf@mail.linkov.net> Date: Sun, 12 Sep 2021 20:12:21 +0300 In-Reply-To: <87y28i85xi.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 31 Aug 2021 09:49:29 +0300") Message-ID: <87k0jlg1l6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > In bug#50067 you suggested to add a new arg with the click event > to all context menu functions. This will make code more readable: > > (defun context-menu-dictionary (menu click) > (when (thing-at-mouse click 'word) > > so I will change the call to provide the arg from last-input-event, > and maybe later it will be possible to acquire the same event > more directly, not from last-input-event, and all callers will get it. So now a new arg 'click' was added to all context-menu-functions. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 12 13:33:20 2021 Received: (at 50256) by debbugs.gnu.org; 12 Sep 2021 17:33:20 +0000 Received: from localhost ([127.0.0.1]:43522 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPTM0-0001UL-1y for submit@debbugs.gnu.org; Sun, 12 Sep 2021 13:33:20 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:57325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPTLv-0001Ts-ID; Sun, 12 Sep 2021 13:33:18 -0400 Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 8A3151C0003; Sun, 12 Sep 2021 17:33:06 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#50256: thing-at-mouse Organization: LINKOV.NET References: <87sfys6ubm.fsf@mail.linkov.net> <87eeacdnmg.fsf@gnus.org> <87h7f7z8ui.fsf@mail.linkov.net> <871r6a8ooe.fsf@gnus.org> Date: Sun, 12 Sep 2021 20:32:40 +0300 In-Reply-To: <871r6a8ooe.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 31 Aug 2021 02:04:33 +0200") Message-ID: <878s01g0nb.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50256 Cc: 50256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 50256 fixed close 50256 28.0.50 quit >> +(defun context-menu-dictionary (menu) >> + "Dictionary context menu." >> + (when (thing-at-mouse last-input-event 'word) >> + (define-key menu [dictionary-separator] menu-bar-separator) >> + (define-key menu [dictionary-search-word-at-mouse] >> + '(menu-item "Dictionary Search" dictionary-search-word-at-mouse >> + :help "Search the word at mouse click in dictionary"))) >> + menu) > > Ah, I see. Yes, that makes perfect sense to me -- go ahead and push > (perhaps with some documentation). Now pushed with NEWS. I don't know if it needs to be mentioned in Info manual. From unknown Thu Aug 21 14:54:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 11 Oct 2021 11:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator