From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4Kn4Mag4WGHRtAAAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 12:47:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SN+qLag4WGEHNgAAB5/wlQ (envelope-from ) for ; Sat, 02 Oct 2021 10:47:04 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1DA172BA37 for ; Sat, 2 Oct 2021 12:47:04 +0200 (CEST) Received: from localhost ([::1]:46222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWcXl-0001G7-FF for larch@yhetil.org; Sat, 02 Oct 2021 06:47:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWcX8-0001Fk-6G for emacs-orgmode@gnu.org; Sat, 02 Oct 2021 06:46:23 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:35587) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWcX6-0001AT-0q for emacs-orgmode@gnu.org; Sat, 02 Oct 2021 06:46:21 -0400 Received: by mail-pl1-x62d.google.com with SMTP id bb10so531488plb.2 for ; Sat, 02 Oct 2021 03:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=jZG61PjGkOTOEkt/IXyHFDF66fkf3dVWOtg9ERZ96S8=; b=KmIyXaBGxz+uP3zoxkNUMrtO+FsZJewd1tY2ZWyE1bCxHKc/NBuskhz7TrWXnnyY2R Nb7plDbLbbTWevJAoZHgTtUYANfEwEZogqUYk33znGi8UJTA+L9eQSFUOXiX+0215QIE IRdPR/UAacEmDVoKujLTvPq3GXGGEeNA1rRUDqFglOsTS3fHu3PwNBqKuvx3MxS4V4be l5oYYHQV4RppMSHVkGNixx9byfvmMesBZOGig4wS22XfGOEsPA4K4MzUgb8u46BqePKP 85if/sDO9tOEumR/ppJPdW7WjPUBEPDdfC15pv0XrFIlF4P4cMy4wJw/zHfMcEZYj6Uj wVKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=jZG61PjGkOTOEkt/IXyHFDF66fkf3dVWOtg9ERZ96S8=; b=Oq72Ru1dWAem77O3wRQyIilfOVArwOuEIYWYn1UQVIRZeR8SDqMBtWLFdteLgaBfhm YnKrs/q5HlIk7RHpNRBW7p2PtFO2XqxiTuo9am4Opvp7zHb6eNtcbwNnKBgYR26UFI5o tVc3apgOk6pj/BukUBvcX3SFE38OTx/U5vzEguIguCuc3VuE+xUHEGwX7nurDK0yjWhM 9d5SJK4dMTxSELl2rxHarCeibZBq8Zt0B1GlNNdX9EOE9YKrrLXR+SK84h3Knm1U1rh1 +PlHRU3aWMli+pP7/89Pg2sVxrH0lCzBcM5TYeG7wOfkYf5EyKLxknsoP04GeP+H7Qbk 5WZA== X-Gm-Message-State: AOAM53320v+P+5psFhf/1N7dJhLOYkWCGocTtZSBfLZkzq0tIF0drqRD YRm0gmESX+yPwrEAE0Slxok= X-Google-Smtp-Source: ABdhPJxz89XimkbsxnFYUEgorz1xbz+YyPwvEOFK0uBJvVhw9WIst8en6vCONvACz4mqoICeIFd7KQ== X-Received: by 2002:a17:90a:311:: with SMTP id 17mr25377978pje.121.1633171578188; Sat, 02 Oct 2021 03:46:18 -0700 (PDT) Received: from localhost (211-22-147-226.hinet-ip.hinet.net. [211.22.147.226]) by smtp.gmail.com with ESMTPSA id n19sm8280423pff.37.2021.10.02.03.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 03:46:17 -0700 (PDT) From: Ihor Radchenko To: Bodertz Subject: [PATCH] Bug: Indenting empty description list item leaves point at beginning of line [9.4.4] In-Reply-To: <87o88hlkvv.fsf@gmail.com> References: <87o88hlkvv.fsf@gmail.com> X-Woof-Patch: t Date: Sat, 02 Oct 2021 18:47:35 +0800 Message-ID: <87y27bwvnc.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62d.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633171624; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=jZG61PjGkOTOEkt/IXyHFDF66fkf3dVWOtg9ERZ96S8=; b=NLXBm9S7dhzKDBb90LeqKqVejXRT8Hxe7FrB5yjD9NvicQLuWwxT0GLtJhT5Uklm/qINwa KhGYMxe2eDvVcKGjj7SvhAG9tg0ZodW4tvdzfoT0UylFPJrRz0BaaKpmef6UAQepO3ekW8 3yr162/4DbISf6OrtYYEK1njHDaQUGVfqSkONRQa1W4xrlR2efpBzSCvN9gXmHCV+2xwd7 QJGSWgMqvS1M7zAvacNexEHf9ZgoEouy4oqqONI/hnKnkbvaocRvBtnzW1j0Lrt9OLLU0r vLMy/DOJhbh9atV9hBO3IgvAqbRzr3gvGB+uTTUzq9ysLtRNq8yMbB9ob/rUrg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633171624; a=rsa-sha256; cv=none; b=pLO65kWIWQgQlzw3QPnQEjKY/UfUA05HoRCo7fefUZWgMjY/laa4+6PWMBRqLgOheL1A5q IWoxqho4R1VDwzgvsF6z6oQ6kl8SgAeh4sA8/P25XFU82Ub1X0TfYE7Ai3D7ZM6kZrxu/h WKoreqWmJs/tdB9cRvok8pD5h8FoOL1oM/FuZeBpT1xQOs+JjaXFkp1wObrsiwx4ZnjYAi BcRtPaqMAgjvnmTQzHXWWYYJXtVnTQtySgFNEqD9tC7+zZowSvVw7alX25eAK2aF2vM9xr tHfiaWKWYHzZa/KI0RpNtZk5xFfYSmZJXP6wC6w6+uZe88Qg/6dR8k4ahjXq4w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=KmIyXaBG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=KmIyXaBG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 1DA172BA37 X-Spam-Score: -1.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: yJOkyfN9wFCd --=-=-= Content-Type: text/plain Bodertz writes: > As you can see, point is at the beginning of the line. I think it > should be after the dash, as is the case when indenting plain list > items. The fix is attached. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-list-Do-not-move-point-when-promoting-demoting-i.patch >From 63870bec28e59732cbbdf8b2534f6ece96e2d5d8 Mon Sep 17 00:00:00 2001 Message-Id: <63870bec28e59732cbbdf8b2534f6ece96e2d5d8.1633171544.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sat, 2 Oct 2021 18:32:34 +0800 Subject: [PATCH] org-list: Do not move point when promoting/demoting items * lisp/org-list.el (org-list-struct-apply-struct): Make sure the origin marker is not moved to bol when promoting/demoting item in special case: - item - :: * testing/lisp/test-org-list.el (test-org-list/indent-item): Add test Fixes https://orgmode.org/list/87o88hlkvv.fsf@gmail.com --- lisp/org-list.el | 5 ++++- testing/lisp/test-org-list.el | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lisp/org-list.el b/lisp/org-list.el index 2bd9dc4d9..b6ab14f84 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -1866,7 +1866,10 @@ (defun org-list-struct-apply-struct (struct old-struct) (looking-at org-list-full-item-re) ;; a. Replace bullet (unless (equal old-bul new-bul) - (replace-match new-bul nil nil nil 1)) + (save-excursion + (replace-match "" nil nil nil 1) + (goto-char (match-end 1)) + (insert-before-markers new-bul))) ;; b. Replace checkbox. (cond ((equal (match-string 3) new-box)) diff --git a/testing/lisp/test-org-list.el b/testing/lisp/test-org-list.el index 3689a172f..e3d904b1e 100644 --- a/testing/lisp/test-org-list.el +++ b/testing/lisp/test-org-list.el @@ -298,7 +298,15 @@ (ert-deftest test-org-list/indent-item () (push-mark (point) t t) (goto-char (point-max)) (let (org-list-demote-modify-bullet) (org-indent-item)) - (buffer-string))))) + (buffer-string)))) + ;; When point is right after empty item, do not move point. + (should + (= 13 + (org-test-with-temp-text " +- item +- ::" + (org-indent-item) + (point))))) (ert-deftest test-org-list/indent-item-tree () "Test `org-indent-item-tree' specifications." -- 2.32.0 --=-=-=--