From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Newsgroups: gmane.emacs.help Subject: How to end text-insert undo segment after cursor jump (caused by =?UTF-8?Q?mouse=29=3F?= Date: Sat, 17 Oct 2020 20:44:26 +0200 Message-ID: <86c7c30ae2ae8088d0375b881995c551@mail.vmaly.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9225"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org, help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 17 20:44:50 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTrCD-0002GS-Fx for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 17 Oct 2020 20:44:49 +0200 Original-Received: from localhost ([::1]:51924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTrCC-0005ju-IV for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 17 Oct 2020 14:44:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTrBa-0005jl-El for help-gnu-emacs@gnu.org; Sat, 17 Oct 2020 14:44:10 -0400 Original-Received: from mta.vmaly.com ([94.242.65.182]:55589) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTrBY-0000nq-2w for help-gnu-emacs@gnu.org; Sat, 17 Oct 2020 14:44:09 -0400 Original-Received: from mail.vmaly.com (unknown [192.168.23.33]) by localhost.localdomain (Postfix) with ESMTP id 9DDDC41492; Sat, 17 Oct 2020 18:45:02 +0000 (GMT) X-Sender: emacs-newbie@hj.proberto.com Received-SPF: none client-ip=94.242.65.182; envelope-from=emacs-newbie@hj.proberto.com; helo=mta.vmaly.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/17 13:34:59 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] 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, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124530 Archived-At: Hello How to end text-insert undo segment after cursor jump (caused by mouse)? Coming from vim into (evil-mode) spacemacs, I sometimes get frustrated that undo segment is not ended when a mouse-caused cursor movement occurs. An example : While I am inserting text, touchpad gets often touched, causing the cursor to jump elsewhere. If I have entered five sentences just where I wanted them, without any jump, but sixth sentence gets by mistake entered all over the place because of multiple (three) touchpad touches in different places, when I notice this, I need to be able to execute (three times) "undo" so that the fives sentences stay intact, and the undo operation erase only the sixth sentence from all over the place. Right now when insert gets this way screwed up, the undo tree contains only one segment. When I press undo, all six sentences disappear. I have to choose all-or-nothing, neither of which is very useful!! Appending after "blabla" by entering insert mode and typing "This is first sentence. " /now mouse click occurs by mistake/ "This is second sentence." I get: blabla This is This is second sentence. first sentence. Pressing U for undo I need to get : blabla This is first sentence. , but I am instead getting: blabla Interestingly enough, when text is being replaced and not inserted, everything works as expected - undo segment ends when mouse moves the cursor, so replacing by mistake I can in sequence undo the previous changes made after mouse-caused jump. How can I fix this? Is it a bug, or some funny feature? Yours sincerely David PS: Please do not advise me to get "disable touch pad while typing" working.