GNU bug report logs - #69236
29.1; Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode Line

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Gabriele Nicolardi <gabriele@HIDDEN>; dated Sun, 18 Feb 2024 18:25:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 69236 <at> debbugs.gnu.org:


Received: (at 69236) by debbugs.gnu.org; 18 Feb 2024 20:04:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 18 15:04:03 2024
Received: from localhost ([127.0.0.1]:38401 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rbnOM-000413-Kz
	for submit <at> debbugs.gnu.org; Sun, 18 Feb 2024 15:04:02 -0500
Received: from smtp06.cbsolt.net ([185.97.217.45]:60196)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gabriele@HIDDEN>) id 1rbnOJ-00040S-Fg
 for 69236 <at> debbugs.gnu.org; Sun, 18 Feb 2024 15:04:01 -0500
Received: from [10.0.2.15] (host-79-51-252-152.retail.telecomitalia.it
 [79.51.252.152])
 by smtp06.cbsolt.net (Postfix) with ESMTPSA id 4TdGnb1nGZz3wZc;
 Sun, 18 Feb 2024 21:03:30 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net;
 s=201504-di4k2w; t=1708286612;
 bh=qCYlwXb7ERJjneiugZmMO5TZD9iolmFdS9DXem3DEqA=;
 h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
 b=TVdZ0sH1pFpqw0svQ9v/W8Eq4aKdJHboFq9QreKuZRKNAlMdw8hYEIS5BzDmJgrY3
 3K0qfJXMN/LEX7OhLlckfTaMk+J7eCS9OeL4jl0+25V3zZxdfZv8ZdS4FHxisBPwfm
 UO7KwMDYQqZMTgGKDUoQ/nWazx1zY5Kn+dlchMws=
Content-Type: multipart/alternative;
 boundary="------------Rh2YlnrjzRhvbHn2x3zQnsF2"
Message-ID: <44d02c85-131a-4dbe-a93c-824676997030@HIDDEN>
Date: Sun, 18 Feb 2024 21:03:28 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#69236: 29.1; Unwanted Focus Shift when Clicking Menu
 Functions in Emacs Mode Line
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>
References: <05e7cb08-1a09-41de-ac03-7146891d4353@HIDDEN>
 <86wmr1r43u.fsf@HIDDEN>
 <ca18560c-1168-42d0-8234-9c2fcb83ed42@HIDDEN>
 <86jzn1r2cm.fsf@HIDDEN>
From: Gabriele Nicolardi <gabriele@HIDDEN>
In-Reply-To: <86jzn1r2cm.fsf@HIDDEN>
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 69236
Cc: 69236 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.6 (---)

This is a multi-part message in MIME format.
--------------Rh2YlnrjzRhvbHn2x3zQnsF2
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

I think I found a workaround but not a fix. I need to create a modified 
version of the functions I call by the menu to avoid the problem.

I'm also aware that this may depend on the graphical server and/or the 
operating system.

Thanks

Il 18/02/24 20:36, Eli Zaretskii ha scritto:
> So the problem is fixed, and we can close this bug?  Or is there still
> something left to investigate and/or fix?
--------------Rh2YlnrjzRhvbHn2x3zQnsF2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>I think I found a workaround but not a fix. I need to create a
      modified version of the functions I call by the menu to avoid the
      problem.</p>
    <p>I'm also aware that this may depend on the graphical server
      and/or the operating system.</p>
    <p>Thanks<br>
    </p>
    <div class="moz-cite-prefix">Il 18/02/24 20:36, Eli Zaretskii ha
      scritto:<br>
    </div>
    <blockquote type="cite" cite="mid:86jzn1r2cm.fsf@HIDDEN">
      <pre>So the problem is fixed, and we can close this bug?  Or is there still
something left to investigate and/or fix?</pre>
    </blockquote>
  </body>
</html>

--------------Rh2YlnrjzRhvbHn2x3zQnsF2--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#69236; Package emacs. Full text available.

Message received at 69236 <at> debbugs.gnu.org:


Received: (at 69236) by debbugs.gnu.org; 18 Feb 2024 19:37:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 18 14:37:32 2024
Received: from localhost ([127.0.0.1]:38363 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rbmyi-0003C2-Gh
	for submit <at> debbugs.gnu.org; Sun, 18 Feb 2024 14:37:32 -0500
Received: from eggs.gnu.org ([209.51.188.92]:57914)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rbmyf-0003Bp-Sw
 for 69236 <at> debbugs.gnu.org; Sun, 18 Feb 2024 14:37:30 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rbmyE-00082S-U4; Sun, 18 Feb 2024 14:37:02 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=cSIWWi4ff2hXGXL8VZkAh/WzOVcJNWpcfMo0dWlzui8=; b=coGM88CdqikT
 aFvsouGN6DgB773bjVVoIdbqPcy7Ri+qGJZfmZG6G/jQFj6HYP/DLwBTKpXyji7oOqLhSecsi9nKi
 BwTc3iWafHuPHs/OAH/6Auf8hE+6wYrtFbax8Tyll56rdqJwy011AITIce2x2Cfxv42v2pxUbWU22
 cdud6gAim0L7RMuovG16z3WwOCyrgRXJ3g/ayxOzmU4aBBjvGaBQdxVcyWaRZdHHyl8wgazv5wbHV
 4cghd2f67ANEh2Ke5UFaaS/QdLNNUhmzKbmFgG75KJ/3LTIY+POUMMqHEI54+8VRUpCagbRFxLcFc
 jb8/3QbVcELOu2cTfX4EgA==;
Date: Sun, 18 Feb 2024 21:36:57 +0200
Message-Id: <86jzn1r2cm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Gabriele Nicolardi <gabriele@HIDDEN>
In-Reply-To: <ca18560c-1168-42d0-8234-9c2fcb83ed42@HIDDEN> (message
 from Gabriele Nicolardi on Sun, 18 Feb 2024 20:25:50 +0100)
Subject: Re: bug#69236: 29.1; Unwanted Focus Shift when Clicking Menu
 Functions in Emacs Mode Line
References: <05e7cb08-1a09-41de-ac03-7146891d4353@HIDDEN>
 <86wmr1r43u.fsf@HIDDEN>
 <ca18560c-1168-42d0-8234-9c2fcb83ed42@HIDDEN>
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: 69236
Cc: 69236 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.2 (-----)

[Please use Reply All to reply, to have the bug tracker CC'ed.]

> Date: Sun, 18 Feb 2024 20:25:50 +0100
> From: Gabriele Nicolardi <gabriele@HIDDEN>
> 
> When things do work I get:
> 
>  <help-echo> <down-mouse-1> ;; mouse-minor-mode-menu
>  q <return>                 ;; exit-minibuffer
>  <help-echo> C-h l          ;; view-lossage
> 
> When things doesn't work I get:
> 
>  <help-echo> <down-mouse-1>           ;; mouse-minor-mode-menu
>  <mouse-1> <mouse-1>                  ;; mouse-select-window
>  <help-echo> C-x o                    ;; other-window
>  <return>                             ;; exit-minibuffer
>  C-h l                                ;; view-lossage
> 
> I see the <mouse-1> event but i click the mouse just one time. Other users reported the same issue so I
> presume it is not a hardware problem (the mouse...).
> 
> I also find that this code:
> 
> (defmacro with-ignore-mouse-events (&rest body)
>   "Macro to ignore mouse events before evaluating BODY."
>   `(progn
>      (when (input-pending-p)
>        (let ((event (read-event)))
>          (if (mouse-event-p event)
>              (let ((button (event-basic-type event)))
>                (if (eq button 'mouse-1)
>                    (ignore)
>                  (setq unread-command-events (list event))))
>            (setq unread-command-events (list event)))))
>      ,@body))
> 
> (defun mwe-function-1 ()
>   "MWE function 1"
>   (interactive)
>   (unwind-protect
>       (query-replace "foo" "bar" nil (point-min) (point-max))
>     ;; UNWINDFORMS
>     (read-string "function 1 executed")))
> 
> (defun mwe-function-1* ()
>   (interactive)
>   (with-ignore-mouse-events
>    (mwe-function-1)))
> 
> fixes the problem. (I need to use mwe-function-1* in the menu definition).

So the problem is fixed, and we can close this bug?  Or is there still
something left to investigate and/or fix?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#69236; Package emacs. Full text available.

Message received at 69236 <at> debbugs.gnu.org:


Received: (at 69236) by debbugs.gnu.org; 18 Feb 2024 18:59:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 18 13:59:33 2024
Received: from localhost ([127.0.0.1]:38285 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rbmNx-0007oG-BJ
	for submit <at> debbugs.gnu.org; Sun, 18 Feb 2024 13:59:33 -0500
Received: from eggs.gnu.org ([209.51.188.92]:37500)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rbmNv-0007o3-0f
 for 69236 <at> debbugs.gnu.org; Sun, 18 Feb 2024 13:59:32 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rbmNU-0001OX-Br; Sun, 18 Feb 2024 13:59:04 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=CgFfQiMNZwTqwVT2ssGUIGOvVYp1/v/7TbzLWILX1s0=; b=sPWNwIZMt56T
 iOc0p6UEj/7QQ3ztrQS1YLPfiBrwkup7SlqTrM8nXlTheMS0LqoFR+iIRU4FSPGYx3oPIIlaJMI5N
 2mRHa0gE+/pmOeTVjJoF8dKnmQt6/fK6XikLqII5jljxd+vx6c/mAyeVm7IEl79weoOdkYHvoKqtw
 L3N/pnPuDXNhSlTa1UpGLCuHjuLClyvkLnQfYxriJXuPsbjVV/RvZ1qnY+jXxbjJ+98b7bVabQ2aT
 ecplXjnSpyVNo+3y5DfmFDglBH5zeVaHJ44mkysag0SfBTvIRL8WbDdAOuDDlETggLga+LraaZYwl
 Ojs7QumYvFXZWDwcQk1kxw==;
Date: Sun, 18 Feb 2024 20:59:01 +0200
Message-Id: <86wmr1r43u.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Gabriele Nicolardi <gabriele@HIDDEN>
In-Reply-To: <05e7cb08-1a09-41de-ac03-7146891d4353@HIDDEN> (message
 from Gabriele Nicolardi on Thu, 15 Feb 2024 22:55:12 +0100)
Subject: Re: bug#69236: 29.1;
 Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode Line
References: <05e7cb08-1a09-41de-ac03-7146891d4353@HIDDEN>
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: 69236
Cc: 69236 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.2 (-----)

> Date: Thu, 15 Feb 2024 22:55:12 +0100
> From: Gabriele Nicolardi <gabriele@HIDDEN>
> 
> I have this MWE code:
> 
> (defun mwe-function-1 ()
>   "MWE function 1"
>   (interactive)
>   (unwind-protect
>       (query-replace "foo" "bar" nil (point-min) (point-max))
>     ;; UNWINDFORMS
>     (read-string "function 1 executed")))
> 
> (defun mwe-function-2 ()
>   "MWE function 2"
>   (interactive)
>   (unwind-protect
>       (query-replace "foo" "bar" nil (point-min) (point-max))
>     ;; UNWINDFORMS
>     (read-string "function 2 executed")))
> 
> (defun mwe-function-3 ()
>   "MWE function 3"
>   (interactive)
>   (unwind-protect
>       (query-replace "foo" "bar" nil (point-min) (point-max))
>     ;; UNWINDFORMS
>     (read-string "function 3 executed")))
> 
> (define-minor-mode mwe-mode
>   "MWE mode"
>   :init-value nil
>   :lighter (:eval (propertize " MWE "
>                               'face '(:foreground "RoyalBlue" :background "DarkGoldenrod1")))
> 
>   :keymap
>   `(
>     (,(kbd "<C-kp-1>") . mwe-function)
>     )
> 
>   (if mwe-mode
>       (easy-menu-define mwe-menu mwe-mode-map
>         "MWE"
>         '("MWE mode"
>           ;; I want the menu on mode-line only:
>           :visible (not (eq (framep (selected-frame)) 'x))
>           ["mwe-function-1" mwe-function-1
>            :help "mwe-function 1"]
>           ["mwe-function-2" mwe-function-2
>            :help "mwe-function 2"]
>           ["mwe-function-3" mwe-function-3
>            :help "mwe-function 3"]))
>     t))
> 
> that builds a minor mode where I have the mwe-menu on the mode line.
> 
> It happens, very randomly but quite often, that I am experiencing an
> issue in Emacs where clicking on a function name in a menu displayed on
> the mode line not only triggers the desired function but also has an
> unintended effect on the window or buffer below, interfering with the
> intended functionality.
> 
> When I click on the function mwe-function-* in the menu, it doesn't get
> executed because the mouse event interrupts `query-replace'. The issue
> doesn't occur consistently and is quite random.

Please show the output of "C-h l" in both cases, i.e. when things work
and when they don't.  This should give some ideas about what goes
wrong.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#69236; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Feb 2024 18:24:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 18 13:24:21 2024
Received: from localhost ([127.0.0.1]:37348 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rblpq-0003NJ-WF
	for submit <at> debbugs.gnu.org; Sun, 18 Feb 2024 13:24:21 -0500
Received: from lists.gnu.org ([209.51.188.17]:48948)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gabriele@HIDDEN>) id 1rblUA-0001wK-2J
 for submit <at> debbugs.gnu.org; Sun, 18 Feb 2024 13:01:56 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <gabriele@HIDDEN>)
 id 1rajhX-0008E8-HA
 for bug-gnu-emacs@HIDDEN; Thu, 15 Feb 2024 16:55:27 -0500
Received: from smtp04.cbsolt.net ([185.97.217.43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <gabriele@HIDDEN>)
 id 1rajhT-0007Ce-PH
 for bug-gnu-emacs@HIDDEN; Thu, 15 Feb 2024 16:55:27 -0500
Received: from [10.0.2.15] (host-79-51-252-152.retail.telecomitalia.it
 [79.51.252.152])
 by smtp04.cbsolt.net (Postfix) with ESMTPSA id 4TbTPt21jNz3wvr
 for <bug-gnu-emacs@HIDDEN>; Thu, 15 Feb 2024 22:55:14 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net;
 s=201504-di4k2w; t=1708034117;
 bh=03uFN+3qaTwg38k7Z5q2KfxHQndX9I0r/AEQqalIz/w=;
 h=Date:To:Subject:From:From;
 b=q7/cqD4iOedIF0YcPP0leGgfAlMfdaBablXL5txjAVRBO2Hn4uLyGd741prxkSZc7
 n+ArP5X9GUaYsoMgpd0fmN6hvijdPP1gYjduO19TIAkqcBdUzoO7vj9vCbLx4vzx52
 FNCf3P24KDVXBGWDGVklbMrKb53bm9R7tSsC0ZF0=
Content-Type: multipart/alternative;
 boundary="------------0VCc0YOVir5EP8fih0b7KBSf"
Message-ID: <05e7cb08-1a09-41de-ac03-7146891d4353@HIDDEN>
Date: Thu, 15 Feb 2024 22:55:12 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: bug-gnu-emacs@HIDDEN
Subject: 29.1; Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode
 Line
Content-Language: en-US
From: Gabriele Nicolardi <gabriele@HIDDEN>
Received-SPF: pass client-ip=185.97.217.43;
 envelope-from=gabriele@HIDDEN; helo=smtp04.cbsolt.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -3.5 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.5 (----)

This is a multi-part message in MIME format.
--------------0VCc0YOVir5EP8fih0b7KBSf
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

I have this MWE code:

(defun mwe-function-1 ()
   "MWE function 1"
   (interactive)
   (unwind-protect
       (query-replace "foo" "bar" nil (point-min) (point-max))
     ;; UNWINDFORMS
     (read-string "function 1 executed")))

(defun mwe-function-2 ()
   "MWE function 2"
   (interactive)
   (unwind-protect
       (query-replace "foo" "bar" nil (point-min) (point-max))
     ;; UNWINDFORMS
     (read-string "function 2 executed")))

(defun mwe-function-3 ()
   "MWE function 3"
   (interactive)
   (unwind-protect
       (query-replace "foo" "bar" nil (point-min) (point-max))
     ;; UNWINDFORMS
     (read-string "function 3 executed")))

(define-minor-mode mwe-mode
   "MWE mode"
   :init-value nil
   :lighter (:eval (propertize " MWE "
                               'face '(:foreground "RoyalBlue" 
:background "DarkGoldenrod1")))

   :keymap
   `(
     (,(kbd "<C-kp-1>") . mwe-function)
     )

   (if mwe-mode
       (easy-menu-define mwe-menu mwe-mode-map
         "MWE"
         '("MWE mode"
           ;; I want the menu on mode-line only:
           :visible (not (eq (framep (selected-frame)) 'x))
           ["mwe-function-1" mwe-function-1
            :help "mwe-function 1"]
           ["mwe-function-2" mwe-function-2
            :help "mwe-function 2"]
           ["mwe-function-3" mwe-function-3
            :help "mwe-function 3"]))
     t))

that builds a minor mode where I have the mwe-menu on the mode line.

It happens, very randomly but quite often, that I am experiencing an
issue in Emacs where clicking on a function name in a menu displayed on
the mode line not only triggers the desired function but also has an
unintended effect on the window or buffer below, interfering with the
intended functionality.

When I click on the function mwe-function-* in the menu, it doesn't get
executed because the mouse event interrupts `query-replace'. The issue
doesn't occur consistently and is quite random.

I opened an issue on StackExchange:
https://emacs.stackexchange.com/q/80153/15606

Here you will find a GIF that shows the problem I described.

This is big problem for me because I write code for a team that use
Emacs to edit LaTeX documents and I'm trying to create a user-friendly
environment. But many functions doesn't work when called from this kind
of menus.

Best regards,

Gabriele Nicolardi


In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
  cairo version 1.16.0) of 2023-12-10 built on lcy02-amd64-098
Repository revision: 28fb02492c2444c5976eb53fd6f9badfe54f4ea1
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.6 LTS

Configured using:
  'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
  --without-xaw3d --with-modules --with-cairo
  --with-native-compilation=aot --with-xinput2 --with-tree-sitter
  --with-json
  'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
  -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
  -isystem/build/emacs/stage/usr/include -O2'
  'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
  -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
  -isystem/build/emacs/stage/usr/include'
  'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
  -L/build/emacs/parts/emacs/install/usr/lib
  -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
  -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
  -L/build/emacs/stage/usr/lib''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM
GTK3 ZLIB

Important settings:
   value of $LANG: it_IT.UTF-8
   locale-coding-system: utf-8-unix

Major mode: LaTeX

Minor modes in effect:
   shell-dirtrack-mode: t
   mwe-mode: t
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   line-number-mode: t
   transient-mark-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils byte-opt time-date cl-loaddefs comp
comp-cstr warnings icons rx cl-seq cl-macs gv cl-extra help-mode
bytecomp byte-compile cl-lib tex-mode compile text-property-search shell
subr-x pcomplete comint ansi-osc ansi-color ring display-line-numbers
easy-mmode rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 102650 4917)
  (symbols 48 8309 0)
  (strings 32 24629 2279)
  (string-bytes 1 807125)
  (vectors 16 18896)
  (vector-slots 8 370470 13534)
  (floats 8 42 323)
  (intervals 56 899 453)
  (buffers 984 15))



I have this MWE code:

(defun mwe-function-1 ()
"MWE function 1"
(interactive)
(unwind-protect
(query-replace "foo" "bar" nil (point-min) (point-max))
;; UNWINDFORMS
(read-string "function 1 executed")))

(defun mwe-function-2 ()
"MWE function 2"
(interactive)
(unwind-protect
(query-replace "foo" "bar" nil (point-min) (point-max))
;; UNWINDFORMS
(read-string "function 2 executed")))

(defun mwe-function-3 ()
"MWE function 3"
(interactive)
(unwind-protect
(query-replace "foo" "bar" nil (point-min) (point-max))
;; UNWINDFORMS
(read-string "function 3 executed")))

(define-minor-mode mwe-mode
"MWE mode"
:init-value nil
:lighter (:eval (propertize " MWE "
'face '(:foreground "RoyalBlue" :background "DarkGoldenrod1")))

:keymap
`(
(,(kbd "") . mwe-function)
)

(if mwe-mode
(easy-menu-define mwe-menu mwe-mode-map
"MWE"
'("MWE mode"
;; I want the menu on mode-line only:
:visible (not (eq (framep (selected-frame)) 'x))
["mwe-function-1" mwe-function-1
:help "mwe-function 1"]
["mwe-function-2" mwe-function-2
:help "mwe-function 2"]
["mwe-function-3" mwe-function-3
:help "mwe-function 3"]))
t))

that builds a minor mode where I have the mwe-menu on the mode line.

It happens, very randomly, that I am experiencing an issue in Emacs
where clicking on a function name in a menu displayed on the mode line
not only triggers the desired function but also has an unintended effect
on the window or buffer below, interfering with the intended
functionality.





In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
cairo version 1.16.0) of 2023-12-10 built on lcy02-amd64-098
Repository revision: 28fb02492c2444c5976eb53fd6f9badfe54f4ea1
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.6 LTS

Configured using:
'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
--without-xaw3d --with-modules --with-cairo
--with-native-compilation=aot --with-xinput2 --with-tree-sitter
--with-json
'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
-isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
-isystem/build/emacs/stage/usr/include -O2'
'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
-isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
-isystem/build/emacs/stage/usr/include'
'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
-L/build/emacs/parts/emacs/install/usr/lib
-L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
-L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
-L/build/emacs/stage/usr/lib''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM
GTK3 ZLIB

Important settings:
value of $LANG: it_IT.UTF-8
locale-coding-system: utf-8-unix

Major mode: LaTeX

Minor modes in effect:
shell-dirtrack-mode: t
mwe-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
line-number-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils byte-opt time-date cl-loaddefs comp
comp-cstr warnings icons rx cl-seq cl-macs gv cl-extra help-mode
bytecomp byte-compile cl-lib tex-mode compile text-property-search shell
subr-x pcomplete comint ansi-osc ansi-color ring display-line-numbers
easy-mmode rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 102650 4917)
(symbols 48 8309 0)
(strings 32 24629 2279)
(string-bytes 1 807125)
(vectors 16 18896)
(vector-slots 8 370470 13534)
(floats 8 42 323)
(intervals 56 899 453)
(buffers 984 15))
--------------0VCc0YOVir5EP8fih0b7KBSf
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,<br>
    </p>
    <p>I have this MWE code:<br>
      <br>
      (defun mwe-function-1 ()<br>
        "MWE function 1"<br>
        (interactive)<br>
        (unwind-protect<br>
            (query-replace "foo" "bar" nil (point-min) (point-max))<br>
          ;; UNWINDFORMS<br>
          (read-string "function 1 executed")))<br>
      <br>
      (defun mwe-function-2 ()<br>
        "MWE function 2"<br>
        (interactive)<br>
        (unwind-protect<br>
            (query-replace "foo" "bar" nil (point-min) (point-max))<br>
          ;; UNWINDFORMS<br>
          (read-string "function 2 executed")))<br>
      <br>
      (defun mwe-function-3 ()<br>
        "MWE function 3"<br>
        (interactive)<br>
        (unwind-protect<br>
            (query-replace "foo" "bar" nil (point-min) (point-max))<br>
          ;; UNWINDFORMS<br>
          (read-string "function 3 executed")))<br>
      <br>
      (define-minor-mode mwe-mode<br>
        "MWE mode"<br>
        :init-value nil<br>
        :lighter (:eval (propertize " MWE "<br>
                                    'face '(:foreground "RoyalBlue"
      :background "DarkGoldenrod1")))<br>
      <br>
        :keymap<br>
        `(<br>
          (,(kbd "&lt;C-kp-1&gt;") . mwe-function)<br>
          )<br>
      <br>
        (if mwe-mode<br>
            (easy-menu-define mwe-menu mwe-mode-map<br>
              "MWE"<br>
              '("MWE mode"<br>
                ;; I want the menu on mode-line only:<br>
                :visible (not (eq (framep (selected-frame)) 'x))<br>
                ["mwe-function-1" mwe-function-1<br>
                 :help "mwe-function 1"]<br>
                ["mwe-function-2" mwe-function-2<br>
                 :help "mwe-function 2"]<br>
                ["mwe-function-3" mwe-function-3<br>
                 :help "mwe-function 3"]))<br>
          t))<br>
      <br>
      that builds a minor mode where I have the mwe-menu on the mode
      line.<br>
      <br>
      It happens, very randomly but quite often, that I am experiencing
      an<br>
      issue in Emacs where clicking on a function name in a menu
      displayed on<br>
      the mode line not only triggers the desired function but also has
      an<br>
      unintended effect on the window or buffer below, interfering with
      the<br>
      intended functionality.<br>
      <br>
      When I click on the function mwe-function-* in the menu, it
      doesn't get<br>
      executed because the mouse event interrupts `query-replace'. The
      issue<br>
      doesn't occur consistently and is quite random.<br>
      <br>
      I opened an issue on StackExchange:<br>
      <a class="moz-txt-link-freetext" href="https://emacs.stackexchange.com/q/80153/15606">https://emacs.stackexchange.com/q/80153/15606</a><br>
      <br>
      Here you will find a GIF that shows the problem I described.<br>
      <br>
      This is big problem for me because I write code for a team that
      use<br>
      Emacs to edit LaTeX documents and I'm trying to create a
      user-friendly<br>
      environment. But many functions doesn't work when called from this
      kind<br>
      of menus.<br>
      <br>
      Best regards,<br>
      <br>
      Gabriele Nicolardi<br>
      <br>
      <br>
      In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version
      3.24.20,<br>
       cairo version 1.16.0) of 2023-12-10 built on lcy02-amd64-098<br>
      Repository revision: 28fb02492c2444c5976eb53fd6f9badfe54f4ea1<br>
      Repository branch: master<br>
      Windowing system distributor 'The X.Org Foundation', version
      11.0.12013000<br>
      System Description: Ubuntu 20.04.6 LTS<br>
      <br>
      Configured using:<br>
       'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3<br>
       --without-xaw3d --with-modules --with-cairo<br>
       --with-native-compilation=aot --with-xinput2 --with-tree-sitter<br>
       --with-json<br>
       'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include<br>
 -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu<br>
       -isystem/build/emacs/stage/usr/include -O2'<br>
       'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include<br>
 -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu<br>
       -isystem/build/emacs/stage/usr/include'<br>
       'LDFLAGS=-L/build/emacs/parts/emacs/install/lib<br>
       -L/build/emacs/parts/emacs/install/usr/lib<br>
       -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu<br>
       -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu<br>
       -L/build/emacs/stage/usr/lib''<br>
      <br>
      Configured features:<br>
      ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
      JPEG<br>
      JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES<br>
      NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3<br>
      THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2
      XPM<br>
      GTK3 ZLIB<br>
      <br>
      Important settings:<br>
        value of $LANG: it_IT.UTF-8<br>
        locale-coding-system: utf-8-unix<br>
      <br>
      Major mode: LaTeX<br>
      <br>
      Minor modes in effect:<br>
        shell-dirtrack-mode: t<br>
        mwe-mode: t<br>
        tooltip-mode: t<br>
        global-eldoc-mode: t<br>
        show-paren-mode: t<br>
        electric-indent-mode: t<br>
        mouse-wheel-mode: t<br>
        tool-bar-mode: t<br>
        menu-bar-mode: t<br>
        file-name-shadow-mode: t<br>
        global-font-lock-mode: t<br>
        font-lock-mode: t<br>
        blink-cursor-mode: t<br>
        line-number-mode: t<br>
        transient-mark-mode: t<br>
        auto-composition-mode: t<br>
        auto-encryption-mode: t<br>
        auto-compression-mode: t<br>
      <br>
      Load-path shadows:<br>
      None found.<br>
      <br>
      Features:<br>
      (shadow sort mail-extr emacsbug message mailcap yank-media puny
      dired<br>
      dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
      rfc6068<br>
      epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse
      rfc2231<br>
      mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
      ietf-drums<br>
      mm-util mail-prsvr mail-utils byte-opt time-date cl-loaddefs comp<br>
      comp-cstr warnings icons rx cl-seq cl-macs gv cl-extra help-mode<br>
      bytecomp byte-compile cl-lib tex-mode compile text-property-search
      shell<br>
      subr-x pcomplete comint ansi-osc ansi-color ring
      display-line-numbers<br>
      easy-mmode rmc iso-transl tooltip cconv eldoc paren electric
      uniquify<br>
      ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win
      x-win<br>
      term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe<br>
      tabulated-list replace newcomment text-mode lisp-mode prog-mode
      register<br>
      page tab-bar menu-bar rfn-eshadow isearch easymenu timer select<br>
      scroll-bar mouse jit-lock font-lock syntax font-core
      term/tty-colors<br>
      frame minibuffer nadvice seq simple cl-generic indonesian
      philippine<br>
      cham georgian utf-8-lang misc-lang vietnamese tibetan thai
      tai-viet lao<br>
      korean japanese eucjp-ms cp51932 hebrew greek romanian slovak
      czech<br>
      european ethiopic indian cyrillic chinese composite emoji-zwj
      charscript<br>
      charprop case-table epa-hook jka-cmpr-hook help abbrev obarray
      oclosure<br>
      cl-preloaded button loaddefs theme-loaddefs faces cus-face
      macroexp<br>
      files window text-properties overlay sha1 md5 base64 format env<br>
      code-pages mule custom widget keymap hashtable-print-readable
      backquote<br>
      threads dbusbind inotify lcms2 dynamic-setting system-font-setting<br>
      font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x
      multi-tty<br>
      make-network-process native-compile emacs)<br>
      <br>
      Memory information:<br>
      ((conses 16 102650 4917)<br>
       (symbols 48 8309 0)<br>
       (strings 32 24629 2279)<br>
       (string-bytes 1 807125)<br>
       (vectors 16 18896)<br>
       (vector-slots 8 370470 13534)<br>
       (floats 8 42 323)<br>
       (intervals 56 899 453)<br>
       (buffers 984 15))<br>
      <br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    I have this MWE code:
    <br>
    <br>
    (defun mwe-function-1 ()
    <br>
    "MWE function 1"
    <br>
    (interactive)
    <br>
    (unwind-protect
    <br>
    (query-replace "foo" "bar" nil (point-min) (point-max))
    <br>
    ;; UNWINDFORMS
    <br>
    (read-string "function 1 executed")))
    <br>
    <br>
    (defun mwe-function-2 ()
    <br>
    "MWE function 2"
    <br>
    (interactive)
    <br>
    (unwind-protect
    <br>
    (query-replace "foo" "bar" nil (point-min) (point-max))
    <br>
    ;; UNWINDFORMS
    <br>
    (read-string "function 2 executed")))
    <br>
    <br>
    (defun mwe-function-3 ()
    <br>
    "MWE function 3"
    <br>
    (interactive)
    <br>
    (unwind-protect
    <br>
    (query-replace "foo" "bar" nil (point-min) (point-max))
    <br>
    ;; UNWINDFORMS
    <br>
    (read-string "function 3 executed")))
    <br>
    <br>
    (define-minor-mode mwe-mode
    <br>
    "MWE mode"
    <br>
    :init-value nil
    <br>
    :lighter (:eval (propertize " MWE "
    <br>
    'face '(:foreground "RoyalBlue" :background "DarkGoldenrod1")))
    <br>
    <br>
    :keymap
    <br>
    `(
    <br>
    (,(kbd "<c-kp-1>") . mwe-function)
      <br>
      )
      <br>
      <br>
      (if mwe-mode
      <br>
      (easy-menu-define mwe-menu mwe-mode-map
      <br>
      "MWE"
      <br>
      '("MWE mode"
      <br>
      ;; I want the menu on mode-line only:
      <br>
      :visible (not (eq (framep (selected-frame)) 'x))
      <br>
      ["mwe-function-1" mwe-function-1
      <br>
      :help "mwe-function 1"]
      <br>
      ["mwe-function-2" mwe-function-2
      <br>
      :help "mwe-function 2"]
      <br>
      ["mwe-function-3" mwe-function-3
      <br>
      :help "mwe-function 3"]))
      <br>
      t))
      <br>
      <br>
      that builds a minor mode where I have the mwe-menu on the mode
      line.
      <br>
      <br>
      It happens, very randomly, that I am experiencing an issue in
      Emacs
      <br>
      where clicking on a function name in a menu displayed on the mode
      line
      <br>
      not only triggers the desired function but also has an unintended
      effect
      <br>
      on the window or buffer below, interfering with the intended
      <br>
      functionality.
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version
      3.24.20,
      <br>
      cairo version 1.16.0) of 2023-12-10 built on lcy02-amd64-098
      <br>
      Repository revision: 28fb02492c2444c5976eb53fd6f9badfe54f4ea1
      <br>
      Repository branch: master
      <br>
      Windowing system distributor 'The X.Org Foundation', version
      11.0.12013000
      <br>
      System Description: Ubuntu 20.04.6 LTS
      <br>
      <br>
      Configured using:
      <br>
      'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
      <br>
      --without-xaw3d --with-modules --with-cairo
      <br>
      --with-native-compilation=aot --with-xinput2 --with-tree-sitter
      <br>
      --with-json
      <br>
      'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
      <br>
-isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
      <br>
      -isystem/build/emacs/stage/usr/include -O2'
      <br>
      'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
      <br>
-isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
      <br>
      -isystem/build/emacs/stage/usr/include'
      <br>
      'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
      <br>
      -L/build/emacs/parts/emacs/install/usr/lib
      <br>
      -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
      <br>
      -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
      <br>
      -L/build/emacs/stage/usr/lib''
      <br>
      <br>
      Configured features:
      <br>
      ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
      JPEG
      <br>
      JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
      <br>
      NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
      <br>
      THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2
      XPM
      <br>
      GTK3 ZLIB
      <br>
      <br>
      Important settings:
      <br>
      value of $LANG: it_IT.UTF-8
      <br>
      locale-coding-system: utf-8-unix
      <br>
      <br>
      Major mode: LaTeX
      <br>
      <br>
      Minor modes in effect:
      <br>
      shell-dirtrack-mode: t
      <br>
      mwe-mode: t
      <br>
      tooltip-mode: t
      <br>
      global-eldoc-mode: t
      <br>
      show-paren-mode: t
      <br>
      electric-indent-mode: t
      <br>
      mouse-wheel-mode: t
      <br>
      tool-bar-mode: t
      <br>
      menu-bar-mode: t
      <br>
      file-name-shadow-mode: t
      <br>
      global-font-lock-mode: t
      <br>
      font-lock-mode: t
      <br>
      blink-cursor-mode: t
      <br>
      line-number-mode: t
      <br>
      transient-mark-mode: t
      <br>
      auto-composition-mode: t
      <br>
      auto-encryption-mode: t
      <br>
      auto-compression-mode: t
      <br>
      <br>
      Load-path shadows:
      <br>
      None found.
      <br>
      <br>
      Features:
      <br>
      (shadow sort mail-extr emacsbug message mailcap yank-media puny
      dired
      <br>
      dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
      rfc6068
      <br>
      epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse
      rfc2231
      <br>
      mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
      ietf-drums
      <br>
      mm-util mail-prsvr mail-utils byte-opt time-date cl-loaddefs comp
      <br>
      comp-cstr warnings icons rx cl-seq cl-macs gv cl-extra help-mode
      <br>
      bytecomp byte-compile cl-lib tex-mode compile text-property-search
      shell
      <br>
      subr-x pcomplete comint ansi-osc ansi-color ring
      display-line-numbers
      <br>
      easy-mmode rmc iso-transl tooltip cconv eldoc paren electric
      uniquify
      <br>
      ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win
      x-win
      <br>
      term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
      <br>
      tabulated-list replace newcomment text-mode lisp-mode prog-mode
      register
      <br>
      page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
      <br>
      scroll-bar mouse jit-lock font-lock syntax font-core
      term/tty-colors
      <br>
      frame minibuffer nadvice seq simple cl-generic indonesian
      philippine
      <br>
      cham georgian utf-8-lang misc-lang vietnamese tibetan thai
      tai-viet lao
      <br>
      korean japanese eucjp-ms cp51932 hebrew greek romanian slovak
      czech
      <br>
      european ethiopic indian cyrillic chinese composite emoji-zwj
      charscript
      <br>
      charprop case-table epa-hook jka-cmpr-hook help abbrev obarray
      oclosure
      <br>
      cl-preloaded button loaddefs theme-loaddefs faces cus-face
      macroexp
      <br>
      files window text-properties overlay sha1 md5 base64 format env
      <br>
      code-pages mule custom widget keymap hashtable-print-readable
      backquote
      <br>
      threads dbusbind inotify lcms2 dynamic-setting system-font-setting
      <br>
      font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x
      multi-tty
      <br>
      make-network-process native-compile emacs)
      <br>
      <br>
      Memory information:
      <br>
      ((conses 16 102650 4917)
      <br>
      (symbols 48 8309 0)
      <br>
      (strings 32 24629 2279)
      <br>
      (string-bytes 1 807125)
      <br>
      (vectors 16 18896)
      <br>
      (vector-slots 8 370470 13534)
      <br>
      (floats 8 42 323)
      <br>
      (intervals 56 899 453)
      <br>
      (buffers 984 15))</c-kp-1>
  </body>
</html>

--------------0VCc0YOVir5EP8fih0b7KBSf--




Acknowledgement sent to Gabriele Nicolardi <gabriele@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#69236; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 18 Feb 2024 20:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.