From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aMz6EVfmAl9XfwAA0tVLHw (envelope-from ) for ; Mon, 06 Jul 2020 08:52:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yGbNDVfmAl+4dAAA1q6Kng (envelope-from ) for ; Mon, 06 Jul 2020 08:52:39 +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 D9464940539 for ; Mon, 6 Jul 2020 08:52:38 +0000 (UTC) Received: from localhost ([::1]:34180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsMrd-0000DA-AZ for larch@yhetil.org; Mon, 06 Jul 2020 04:52:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsMr8-0000Cl-LS for emacs-orgmode@gnu.org; Mon, 06 Jul 2020 04:52:06 -0400 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:33306) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsMr7-0001gU-03 for emacs-orgmode@gnu.org; Mon, 06 Jul 2020 04:52:06 -0400 Received: by mail-io1-xd35.google.com with SMTP id i25so38614531iog.0 for ; Mon, 06 Jul 2020 01:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=L02V1+1o4lMQY44lOdtAOgO/fJnEBqEyPcBujHlRu80=; b=W8OzfsxJOyJEnlR7ejC2ohR6SCXrSvCdB4vVuI7zV93aXLBkQYqJci23AnAtjJ2jCD +JeyrDfbCJPn709Su/rhQtlZ7D4Kvy7ww6jJwHD/PHmoeIteNCKZ3kiqKgY+wauikcp0 gCT9xXMgzyR9iQTIv3yhesQQ57wV56+aW4Vu9/izc9KruKsZCclWzuiH8EjXjftoQe54 wlJE8a/7S6kcm95jy9VLTQ6n6PqZUlkRBx0amCMVbDm96epGoxSGwcEWmT/7hjSFfBz7 S8rFq5KW/ZwDvhdpVjj2UMX1wQ//JiZ89s9eVoS/Y63sZw6uVgRnMwoKtwIykiDMBlH0 rgAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=L02V1+1o4lMQY44lOdtAOgO/fJnEBqEyPcBujHlRu80=; b=dCzonHDjTPWEMgkKb6iq2nzZ5Zm4IdSZXSSqVVTZkmvp0FAgptcEPSqIk2kA2JUSD9 2r8YpO1GdRGMN0jHSQpu/M657U8lEeMBd703OwOv5RkTIwJ90XzGVJ0iFvk8d5QhOOQx mO5GLVknZJgwcCxrPLd0J4qLgKrCu3G/XnmZV3oM4I3KrHCTX9XDhzhuCplGU3NI5HB6 RcqZ8FnCLtATAAy6YOqk4y51XCPfPPvOeKkXSvNAZ9vi8v2N2bx9zgkKoplbdKf+C5dF 1kxjaI/Sh6hp90LAEGisPC7iLk2ufK4tqzwoqPrO+BBfcM7lmw0XUTjlhcOvIL6yGZuJ BYNQ== X-Gm-Message-State: AOAM5320KIYAJrtCXolErnpkWvCU3MhNzVAM3cCEXSLP/75WXXtdMYNN tf/rzjhISnVDGyg2tEbbFNGcOH+BDKqjEEpgApPLwj00 X-Google-Smtp-Source: ABdhPJxxSw0z32ud9h+VjmQ4qRgY27996E05cakqqGULVk8lmES31Ho9P1oSYLFYJXq++igQs9NKa3FZlAg9v3M2DdM= X-Received: by 2002:a02:2401:: with SMTP id f1mr50943735jaa.66.1594025523309; Mon, 06 Jul 2020 01:52:03 -0700 (PDT) MIME-Version: 1.0 From: Duianto - Date: Mon, 6 Jul 2020 10:51:54 +0200 Message-ID: Subject: org-insert-item, indent causes a soft freeze or error message To: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::d35; envelope-from=otnaiud@gmail.com; helo=mail-io1-xd35.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=W8OzfsxJ; 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-Spam-Score: -1.71 X-TUID: KfDtA+Z4DvK6 Hello Depending on the indentation amount on the line following a list item, when (org-insert-item) is evaluated. Causes Emacs to soft freeze (can be canceled by pressing: C-g) or an error message is shown: (args-out-of-range 0 1) Reproduction Steps: Copy the following lines: 1. a b 2. c (the second line is indented by 3 spaces) Open a new buffer: C-x b test.org RET Switch to org mode: M-x org-mode RET Paste the copied lines: C-y Move the cursor to the end of the first line, after the: a (if the cursor is before the a, then the list item is added on a new line above probably as expected) Evaluate the following command: S-M-; (org-insert-item) RET Observed: The only visible change is that the cursor moves to the beginning of the "Eval:" prompt in the minibuffer. The Emacs cpu usage spikes (an infinite loop?) The soft freeze can be canceled by pressing: C-g The buffer now shows: 1. a 1. b 2. c The initial example above had three spaces before the: b The same soft freeze is observed if more spaces are added before the: b (I only tested it, up to five spaces, but I there might not be an upper limit) Indented by one or two spaces: If the initial second line is indented with one or two spaces, then Emacs shows an error message instead of freezing. A Backtrace buffer opens with the message: Debugger entered--Lisp error: (args-out-of-range 0 1) replace-match("1. " nil nil nil 1) #f(compiled-function (struct old-struct item) #)(((1 0 "1. " nil nil nil 6) (6 0 "2. " nil nil nil 13) (16 0 "1. " nil nil nil 20)) ((1 0 "1. " nil nil nil 6) (6 0 "1. " nil nil nil 13) (16 0 "2. " nil nil nil 20)) 16) org-list-struct-apply-struct(((1 0 "1. " nil nil nil 6) (6 0 "2. " nil nil nil 13) (16 0 "1. " nil nil nil 20)) ((1 0 "1. " nil nil nil 6) (6 0 "1. " nil nil nil 13) (16 0 "2. " nil nil nil 20))) org-list-write-struct(((1 0 "1. " nil nil nil 6) (6 0 "2. " nil nil nil 13) (16 0 "1. " nil nil nil 20)) ((1) (6) (16))) org-insert-item() eval((org-insert-item) nil) eval-expression((org-insert-item) nil nil 127) funcall-interactively(eval-expression (org-insert-item) nil nil 127) call-interactively(eval-expression nil nil) command-execute(eval-expression) No indentation: If the indentation is removed from the second line: 1. a b 2. c Then it might be working as expected: 1. a 2. b 2. c a correctly numbered list item is inserted. The fourth lines list number: 2. c didn't change, but it might be expected since there was no indentation before the: b therefore it might be assumed that the list ended there. At least Emacs didn't freeze or show any errors. System info: Org mode version 9.3.7 (9.3.7-4-gba6ca7-elpaplus @ c:/Users/username/.emacs.d/elpa/org-plus-contrib-20200622/) GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29 Windows 1903